Commit 84f21379 by cahrens

Merge branch 'feature/alex/poll-merged' into feature/studio/advanced-settings-revamp

parents 7e8fcb85 a39d607a
......@@ -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)
......@@ -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
......
......@@ -80,7 +80,7 @@
<p class="date-description">
<%
# 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
%>
<input type="text" id="due_date" name="due_date" value="${due_date.strftime('%m/%d/%Y') if due_date is not None else ''}" placeholder="MM/DD/YYYY" class="date" size='15' autocomplete="off"/>
<input type="text" id="due_time" name="due_time" value="${due_date.strftime('%H:%M') if due_date is not None else ''}" placeholder="HH:MM" class="time" size='10' autocomplete="off"/>
......
......@@ -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:
......
......@@ -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": {
......
......@@ -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:
......
......@@ -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,
......
#! /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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment