From 74e6834cca71037669da531b4821e178e36d5e9f Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 31 Oct 2012 18:05:04 -0400 Subject: [PATCH] move rubric and problem to forms --- .../xmodule/xmodule/self_assessment_module.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index ad42090eea..854c2cf1f3 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -19,7 +19,12 @@ from xmodule.contentstore.content import XASSET_SRCREF_PREFIX, StaticContent log = logging.getLogger("mitx.courseware") +problem_form=('

') +rubric_form=('
Correct
' + '' + 'Incorrect
') def only_one(lst, default="", process=lambda x: x): """ @@ -53,15 +58,17 @@ class SelfAssessmentModule(XModule): instance_state, shared_state, **kwargs) dom2=etree.fromstring("" + self.definition['data'] + "") - rubric=''.join([etree.tostring(child) for child in only_one(dom2.xpath('rubric'))]) - problem=''.join([etree.tostring(child) for child in only_one(dom2.xpath('problem'))]) + self.rubric=''.join([etree.tostring(child) for child in only_one(dom2.xpath('rubric'))]) + self.problem=''.join([etree.tostring(child) for child in only_one(dom2.xpath('problem'))]) + + self.problem=''.join([self.problem,problem_form]) + + self.rubric=''.join([self.rubric,rubric_form]) #print(etree.tostring(rubric)) #print(etree.tostring(problem)) - self.html = etree.tostring(problem) - - #self.html=self.definition['data'] + self.html = self.problem