diff --git a/cms/djangoapps/contentstore/module_info_model.py b/cms/djangoapps/contentstore/module_info_model.py index 2282333eb0..8ea6add88d 100644 --- a/cms/djangoapps/contentstore/module_info_model.py +++ b/cms/djangoapps/contentstore/module_info_model.py @@ -74,7 +74,7 @@ def set_module_info(store, location, post_data): # update existing metadata with submitted metadata (which can be partial) # IMPORTANT NOTE: if the client passed pack 'null' (None) for a piece of metadata that means 'remove it' - for metadata_key in posted_metadata.keys(): + for metadata_key, value in posted_metadata.items(): # let's strip out any metadata fields from the postback which have been identified as system metadata # and therefore should not be user-editable, so we should accept them back from the client @@ -90,4 +90,4 @@ def set_module_info(store, location, post_data): # commit to datastore # TODO (cpennington): This really shouldn't have to do this much reaching in to get the metadata - store.update_metadata(item_location, module._model_data._kvs._metadata) + store.update_metadata(location, module._model_data._kvs._metadata) diff --git a/cms/djangoapps/models/settings/course_grading.py b/cms/djangoapps/models/settings/course_grading.py index ca3a72c3db..36f5e4cb97 100644 --- a/cms/djangoapps/models/settings/course_grading.py +++ b/cms/djangoapps/models/settings/course_grading.py @@ -231,7 +231,7 @@ class CourseGradingModel(object): del descriptor.lms.format del descriptor.lms.graded - get_modulestore(location).update_metadata(location, descriptor._model_data._kvs._data) + get_modulestore(location).update_metadata(location, descriptor._model_data._kvs._metadata) @staticmethod diff --git a/cms/templates/edit_subsection.html b/cms/templates/edit_subsection.html index 6ad50e5598..68e9d2f8e4 100644 --- a/cms/templates/edit_subsection.html +++ b/cms/templates/edit_subsection.html @@ -80,7 +80,7 @@

<% # due date uses it own formatting for stringifying the date. As with capa_module.py, there's a utility module available for us to use - due_date = dateutil.parser.parse(subsection.lms.due) if subsection.lms.due is not None else None + due_date = dateutil.parser.parse(subsection.lms.due) if subsection.lms.due else None %> diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 9829555134..f457891525 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -168,6 +168,8 @@ class CapaModule(XModule): # add extra info and raise raise Exception(msg), None, sys.exc_info()[2] + self.set_state_from_lcp() + def new_lcp(self, state, text=None): if text is None: text = self.data @@ -734,6 +736,8 @@ class CapaModule(XModule): self.lcp.student_answers = answers + self.set_state_from_lcp() + self.system.track_function('save_problem_success', event_info) msg = "Your answers have been saved" if not self.max_attempts==0: diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index fd626b103a..55e041e8f6 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -256,27 +256,27 @@ class CourseDescriptor(SequenceDescriptor): "min_count": 12, "drop_count": 2, "short_label": "HW", - "weight": 0.15 + "weight": 15 }, { "type": "Lab", "min_count": 12, "drop_count": 2, - "weight": 0.15 + "weight": 15 }, { "type": "Midterm Exam", "short_label": "Midterm", "min_count": 1, "drop_count": 0, - "weight": 0.3 + "weight": 30 }, { "type": "Final Exam", "short_label": "Final", "min_count": 1, "drop_count": 0, - "weight": 0.4 + "weight": 40 } ], "GRADE_CUTOFFS": { diff --git a/common/lib/xmodule/xmodule/modulestore/inheritance.py b/common/lib/xmodule/xmodule/modulestore/inheritance.py index 947c6a2985..d819abe367 100644 --- a/common/lib/xmodule/xmodule/modulestore/inheritance.py +++ b/common/lib/xmodule/xmodule/modulestore/inheritance.py @@ -52,7 +52,7 @@ def own_metadata(module): if field.scope != Scope.settings: continue - if field.name in inherited_metadata and module._model_data[field.name] == inherited_metadata[field.name]: + if field.name in inherited_metadata and module._model_data.get(field.name) == inherited_metadata.get(field.name): continue if field.name not in module._model_data: diff --git a/common/lib/xmodule/xmodule/modulestore/mongo.py b/common/lib/xmodule/xmodule/modulestore/mongo.py index 00abad27ac..f1f4d43eb5 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo.py @@ -165,7 +165,7 @@ class CachingDescriptorSystem(MakoDescriptorSystem): inherit_metadata(module, metadata_to_inherit) return module except: - log.debug("Failed to load descriptor", exc_info=True) + log.warning("Failed to load descriptor", exc_info=True) return ErrorDescriptor.from_json( json_data, self, diff --git a/jenkins/quality.sh b/jenkins/quality.sh deleted file mode 100755 index 56217af874..0000000000 --- a/jenkins/quality.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/bash - -set -e -set -x - -git remote prune origin - -# Reset the submodule, in case it changed -git submodule foreach 'git reset --hard HEAD' - -# Set the IO encoding to UTF-8 so that askbot will start -export PYTHONIOENCODING=UTF-8 - -rake clobber -rake pep8 || echo "pep8 failed, continuing" -rake pylint || echo "pylint failed, continuing"