From 654686293b6fa79070f4e900465ef6ede1a94da5 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Fri, 19 Jul 2013 16:51:48 -0400 Subject: [PATCH] Set to old xml defaults IFF no specified policy for problem nor course. --- common/lib/xmodule/xmodule/capa_module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index d76b62dc06..80e6adcd75 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -1152,10 +1152,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