Commit 0ed06504 by Don Mitchell

Merge pull request #448 from edx/dhm/xml_default

Set to old xml defaults IFF no specified policy for problem nor course.
parents 9a61038c 65468629
......@@ -1161,10 +1161,11 @@ class CapaDescriptor(CapaFields, RawDescriptor):
Augment regular translation w/ setting the pre-Studio defaults.
"""
problem = super(CapaDescriptor, cls).from_xml(xml_data, system, org, course)
course_policy = system.policy.setdefault('course/{}'.format(system.url_name), {})
# pylint: disable=W0212
if 'showanswer' not in problem._model_data:
if 'showanswer' not in problem._model_data and 'showanswer' not in course_policy:
problem.showanswer = "closed"
if 'rerandomize' not in problem._model_data:
if 'rerandomize' not in problem._model_data and 'rerandomize' not in course_policy:
problem.rerandomize = "always"
return problem
......
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