diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py
index b3bdf4554d..25f132ec4b 100644
--- a/cms/djangoapps/contentstore/tests/test_contentstore.py
+++ b/cms/djangoapps/contentstore/tests/test_contentstore.py
@@ -27,10 +27,12 @@ from xmodule.contentstore.django import contentstore
from xmodule.templates import update_templates
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.xml_importer import import_from_xml
+from xmodule.templates import update_templates
from xmodule.capa_module import CapaDescriptor
from xmodule.course_module import CourseDescriptor
from xmodule.seq_module import SequenceDescriptor
+from xmodule.modulestore.exceptions import ItemNotFoundError
TEST_DATA_MODULESTORE = copy.deepcopy(settings.MODULESTORE)
TEST_DATA_MODULESTORE['default']['OPTIONS']['fs_root'] = path('common/test/data')
@@ -212,12 +214,21 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
fs = OSFS(root_dir / 'test_export/policies/6.002_Spring_2012')
self.assertTrue(fs.exists('grading_policy.json'))
+ course = ms.get_item(location)
# compare what's on disk compared to what we have in our course
with fs.open('grading_policy.json','r') as grading_policy:
- on_disk = loads(grading_policy.read())
- course = ms.get_item(location)
+ on_disk = loads(grading_policy.read())
self.assertEqual(on_disk, course.definition['data']['grading_policy'])
+ #check for policy.json
+ self.assertTrue(fs.exists('policy.json'))
+
+ # compare what's on disk to what we have in the course module
+ with fs.open('policy.json','r') as course_policy:
+ on_disk = loads(course_policy.read())
+ self.assertIn('course/6.002_Spring_2012', on_disk)
+ self.assertEqual(on_disk['course/6.002_Spring_2012'], course.metadata)
+
# remove old course
delete_course(ms, cs, location)
@@ -409,3 +420,32 @@ class ContentStoreTest(ModuleStoreTestCase):
self.assertIn('markdown', context, "markdown is missing from context")
self.assertIn('markdown', problem.metadata, "markdown is missing from metadata")
self.assertNotIn('markdown', problem.editable_metadata_fields, "Markdown slipped into the editable metadata fields")
+
+
+class TemplateTestCase(ModuleStoreTestCase):
+
+ def test_template_cleanup(self):
+ ms = modulestore('direct')
+
+ # insert a bogus template in the store
+ bogus_template_location = Location('i4x', 'edx', 'templates', 'html', 'bogus')
+ source_template_location = Location('i4x', 'edx', 'templates', 'html', 'Empty')
+
+ ms.clone_item(source_template_location, bogus_template_location)
+
+ verify_create = ms.get_item(bogus_template_location)
+ self.assertIsNotNone(verify_create)
+
+ # now run cleanup
+ update_templates()
+
+ # now try to find dangling template, it should not be in DB any longer
+ asserted = False
+ try:
+ verify_create = ms.get_item(bogus_template_location)
+ except ItemNotFoundError:
+ asserted = True
+
+ self.assertTrue(asserted)
+
+
diff --git a/cms/djangoapps/contentstore/tests/test_course_settings.py b/cms/djangoapps/contentstore/tests/test_course_settings.py
index 05a86bf46b..86503d2136 100644
--- a/cms/djangoapps/contentstore/tests/test_course_settings.py
+++ b/cms/djangoapps/contentstore/tests/test_course_settings.py
@@ -245,7 +245,7 @@ class CourseGradingTest(CourseTestCase):
altered_grader = CourseGradingModel.update_from_json(test_grader.__dict__)
self.assertDictEqual(test_grader.__dict__, altered_grader.__dict__, "cutoff add D")
- test_grader.grace_period = {'hours' : '4'}
+ test_grader.grace_period = {'hours' : 4, 'minutes' : 5, 'seconds': 0}
altered_grader = CourseGradingModel.update_from_json(test_grader.__dict__)
self.assertDictEqual(test_grader.__dict__, altered_grader.__dict__, "4 hour grace period")
diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py
index d2f18f2e49..166982e35f 100644
--- a/cms/djangoapps/contentstore/tests/tests.py
+++ b/cms/djangoapps/contentstore/tests/tests.py
@@ -85,7 +85,6 @@ class ContentStoreTestCase(ModuleStoreTestCase):
# Now make sure that the user is now actually activated
self.assertTrue(user(email).is_active)
-
class AuthTestCase(ContentStoreTestCase):
"""Check that various permissions-related things work"""
diff --git a/cms/djangoapps/models/settings/course_grading.py b/cms/djangoapps/models/settings/course_grading.py
index f4c6fd3d7c..3d0b8f78af 100644
--- a/cms/djangoapps/models/settings/course_grading.py
+++ b/cms/djangoapps/models/settings/course_grading.py
@@ -155,7 +155,8 @@ class CourseGradingModel(object):
if 'grace_period' in graceperiodjson:
graceperiodjson = graceperiodjson['grace_period']
- grace_rep = " ".join(["%s %s" % (value, key) for (key, value) in graceperiodjson.iteritems()])
+ # lms requires these to be in a fixed order
+ grace_rep = "{0[hours]:d} hours {0[minutes]:d} minutes {0[seconds]:d} seconds".format(graceperiodjson)
descriptor = get_modulestore(course_location).get_item(course_location)
descriptor.metadata['graceperiod'] = grace_rep
@@ -234,10 +235,10 @@ class CourseGradingModel(object):
@staticmethod
def convert_set_grace_period(descriptor):
- # 5 hours 59 minutes 59 seconds => converted to iso format
+ # 5 hours 59 minutes 59 seconds => { hours: 5, minutes : 59, seconds : 59}
rawgrace = descriptor.metadata.get('graceperiod', None)
if rawgrace:
- parsedgrace = {str(key): val for (val, key) in re.findall('\s*(\d+)\s*(\w+)', rawgrace)}
+ parsedgrace = {str(key): int(val) for (val, key) in re.findall('\s*(\d+)\s*(\w+)', rawgrace)}
return parsedgrace
else: return None
diff --git a/cms/static/js/views/settings/main_settings_view.js b/cms/static/js/views/settings/main_settings_view.js
index 6f96ed574e..7a2ad914eb 100644
--- a/cms/static/js/views/settings/main_settings_view.js
+++ b/cms/static/js/views/settings/main_settings_view.js
@@ -97,7 +97,7 @@ CMS.Views.Settings.Details = CMS.Views.ValidatingView.extend({
}
var newVal = new Date(date.getTime() + time * 1000);
if (!cacheModel.has(fieldName) || cacheModel.get(fieldName).getTime() !== newVal.getTime()) {
- cacheModel.save(fieldName, newVal);
+ cacheModel.save(fieldName, newVal, { error: CMS.ServerError});
}
}
};
diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py
index ad084bdaf7..a1a4e6b65e 100644
--- a/common/lib/capa/capa/responsetypes.py
+++ b/common/lib/capa/capa/responsetypes.py
@@ -632,8 +632,14 @@ class MultipleChoiceResponse(LoncapaResponse):
# define correct choices (after calling secondary setup)
xml = self.xml
- cxml = xml.xpath('//*[@id=$id]//choice[@correct="true"]', id=xml.get('id'))
- self.correct_choices = [contextualize_text(choice.get('name'), self.context) for choice in cxml]
+ cxml = xml.xpath('//*[@id=$id]//choice', id=xml.get('id'))
+
+ # contextualize correct attribute and then select ones for which
+ # correct = "true"
+ self.correct_choices = [
+ contextualize_text(choice.get('name'), self.context)
+ for choice in cxml
+ if contextualize_text(choice.get('correct'), self.context) == "true"]
def mc_setup_response(self):
'''
diff --git a/common/lib/capa/capa/templates/codeinput.html b/common/lib/capa/capa/templates/codeinput.html
index 5c2ff2aca5..eb8cad0d70 100644
--- a/common/lib/capa/capa/templates/codeinput.html
+++ b/common/lib/capa/capa/templates/codeinput.html
@@ -50,6 +50,7 @@
},
smartIndent: false
});
+ $("#textbox_${id}").find('.CodeMirror-scroll').height(${int(13.5*eval(rows))});
});
diff --git a/common/lib/capa/capa/templates/designprotein2dinput.html b/common/lib/capa/capa/templates/designprotein2dinput.html
index ff845f8713..6733566ab9 100644
--- a/common/lib/capa/capa/templates/designprotein2dinput.html
+++ b/common/lib/capa/capa/templates/designprotein2dinput.html
@@ -1,5 +1,5 @@
cmd: %s
' % cmd - ret = os.popen(cmd).read() - msg += '%s' % ret.replace('<', '<') - msg += "
git update done!
" - - context = {'id': id, - 'msg': msg, - 'coursename': coursename, - 'csrf': csrf(request)['csrf_token'], - } - - result = render_to_response("gitupdate.html", context) - return result diff --git a/lms/static/sass/course/courseware/_courseware.scss b/lms/static/sass/course/courseware/_courseware.scss index 038903b756..ea987d8b2f 100644 --- a/lms/static/sass/course/courseware/_courseware.scss +++ b/lms/static/sass/course/courseware/_courseware.scss @@ -248,3 +248,17 @@ section.self-assessment { font-weight: bold; } } + +section.foldit { + table { + margin-top: 10px; + } + th { + text-align: center; + } + td { + padding-left: 5px; + padding-right: 5px; + + } +} \ No newline at end of file diff --git a/lms/static/sass/shared/_header.scss b/lms/static/sass/shared/_header.scss index 49c9ac250b..688ffbf57e 100644 --- a/lms/static/sass/shared/_header.scss +++ b/lms/static/sass/shared/_header.scss @@ -101,7 +101,7 @@ header.global { margin-right: 5px; > a { - @include background-image(linear-gradient(-90deg, #fff 0%, rgb(250,250,250) 50%, rgb(237,237,237) 50%, rgb(220,220,220) 100%)); + @include background-image(linear-gradient(#fff 0%, rgb(250,250,250) 50%, rgb(237,237,237) 50%, rgb(220,220,220) 100%)); border: 1px solid transparent; border-color: rgb(200,200,200); @include border-radius(3px); diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index fcbc83d815..33dc9562a7 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -32,7 +32,7 @@ % if timer_expiration_duration: - % endif diff --git a/lms/templates/dogfood.html b/lms/templates/dogfood.html deleted file mode 100644 index 8460454f81..0000000000 --- a/lms/templates/dogfood.html +++ /dev/null @@ -1,144 +0,0 @@ -<%namespace name='static' file='static_content.html'/> - - -## ----------------------------------------------------------------------------- -## Template for lib.dogfood.views.dj_capa_problem -## -## Used for viewing assesment problems in "dogfood" self-evaluation mode -## ----------------------------------------------------------------------------- - - -## -## - -% if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: -## <%static:css group='application'/> -% endif - -% if not settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: -## -% endif - - - - - -% if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: - <%static:js group='application'/> -% endif - -% if not settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: - % for jsfn in [ '/static/%s' % x.replace('.coffee','.js') for x in settings.PIPELINE_JS['application']['source_filenames'] ]: - - % endfor -% endif - -## codemirror - - - -## alternate codemirror -## -## -## - -## image input: for clicking on images (see imageinput.html) - - - -<%include file="mathjax_include.html" /> - - - - - - - - -## ----------------------------------------------------------------------------- -## information - -##Due: ${due} + +
+Status: +% if success: +You have successfully gotten to level ${goal_level}. +% else: +You have not yet gotten to level ${goal_level}. +% endif +
+ +| Level | +Submitted | +
|---|---|
| ${'{0}-{1}'.format(puzzle['set'], puzzle['subset'])} | +${puzzle['created'].strftime('%Y-%m-%d %H:%M')} | +
-Do you REALLY want to overwrite all the course.xml + problems + html -files with version from the main git repository? -
- - -% endif - - - - diff --git a/lms/templates/quickedit.html b/lms/templates/quickedit.html deleted file mode 100644 index bc8e74eb65..0000000000 --- a/lms/templates/quickedit.html +++ /dev/null @@ -1,180 +0,0 @@ -<%namespace name='static' file='static_content.html'/> - - -## ----------------------------------------------------------------------------- -## Template for courseware.views.quickedit -## -## Used for quick-edit link present when viewing capa-format assesment problems. -## ----------------------------------------------------------------------------- - - -## -## - -% if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: - <%static:css group='application'/> -% endif - -% if not settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: -## -% endif - - - - - -% if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: - <%static:js group='application'/> -% endif - -% if not settings.MITX_FEATURES['USE_DJANGO_PIPELINE']: - % for jsfn in [ '/static/%s' % x.replace('.coffee','.js') for x in settings.PIPELINE_JS['application']['source_filenames'] ]: - - % endfor -% endif - -## codemirror - - - -## alternate codemirror -## -## -## - -## image input: for clicking on images (see imageinput.html) - - -## - - - -<%block name="headextra"/> - - - <%include file="mathjax_include.html" /> - - - - - - - -## ----------------------------------------------------------------------------- -## information and i4x PSL code - -Download video here.
+Download subtitles here.
+