diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py
index fdef2df54a..f5bb3c3d67 100644
--- a/common/lib/xmodule/xmodule/self_assessment_module.py
+++ b/common/lib/xmodule/xmodule/self_assessment_module.py
@@ -72,49 +72,18 @@ class SelfAssessmentModule(XModule):
Sample file:
-
- Insert problem text here.
-
-
- Insert grading rubric here.
-
-
- Thanks for submitting!
-
+
+ Insert problem text here.
+
+
+ Insert grading rubric here.
+
+
+ Thanks for submitting!
+
-
-
"""
- #Parse definition file
- dom2 = etree.fromstring("" + self.definition['data'] + "")
-
- #Extract problem, submission message and rubric from definition file
- 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.submit_message = etree.tostring(dom2.xpath('submitmessage')[0])
-
- #Forms to append to problem and rubric that capture student responses.
- #Do not change ids and names, as javascript (selfassessment/display.coffee) depends on them
- problem_form = ('
').format(system.ajax_url)
-
- rubric_form = ('
Please assess your performance given the above rubric:
'
- '
').format(system.ajax_url)
-
- #Combine problem, rubric, and the forms
- self.problem = ''.join([self.problem, problem_form])
- self.rubric = ''.join([self.rubric, rubric_form])
-
- #Display the problem to the student to begin with
- self.html = self.problem
-
#Initialize variables
self.answer = ""
self.score = 0
@@ -148,6 +117,40 @@ class SelfAssessmentModule(XModule):
self.score = instance_state['correct_map']['self_assess']['npoints']
self.correctness = instance_state['correct_map']['self_assess']['correctness']
+ #Parse definition file
+ dom2 = etree.fromstring("" + self.definition['data'] + "")
+
+ #Extract problem, submission message and rubric from definition file
+ 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.submit_message = etree.tostring(dom2.xpath('submitmessage')[0])
+
+ #Forms to append to problem and rubric that capture student responses.
+ #Do not change ids and names, as javascript (selfassessment/display.coffee) depends on them
+ problem_form = ('
').format(system.ajax_url)
+
+ rubric_form = ('
Please assess your performance given the above rubric:
'
+ '
').format(system.ajax_url)
+
+ #Combine problem, rubric, and the forms
+ if self.answer is not "" :
+ answer_html="
Previous Answer:
{0}
".format(self.answer)
+ self.problem = ''.join([self.problem, answer_html, problem_form])
+ else:
+ self.problem = ''.join([self.problem, problem_form])
+
+ self.rubric = ''.join([self.rubric, rubric_form])
+
+ #Display the problem to the student to begin with
+ self.html = self.problem
+
def get_score(self):
return {'score': self.score}