From ec0f8dacfe3ad4d75881fb2337070e3442360c3a Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 1 Nov 2012 17:45:58 -0400 Subject: [PATCH] clean up display code --- common/lib/xmodule/xmodule/html_module.py | 2 -- .../xmodule/js/src/selfassessment/display.coffee | 2 +- .../lib/xmodule/xmodule/self_assessment_module.py | 14 ++++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index 2023ac7017..6145a3b0ab 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -38,8 +38,6 @@ class HtmlModule(XModule): instance_state, shared_state, **kwargs) self.html = self.definition['data'] - - class HtmlDescriptor(XmlDescriptor, EditingDescriptor): """ Module for putting raw html in a course diff --git a/common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee b/common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee index a49d6feb66..d08050a94d 100644 --- a/common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee @@ -6,7 +6,7 @@ $(document).on('click', 'section.sa-wrapper input#show', ( -> if response.success $('section.sa-wrapper input#show').remove() $('section.sa-wrapper textarea#answer').remove() - $('section.sa-wrapper p#rubric').append(answer) + $('section.sa-wrapper p#rubric').append("Your answer: #{answer}") $('section.sa-wrapper p#rubric').append(response.rubric) else $('section.sa-wrapper p#rubric').append(response.message) diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index 6bf9820bdf..d274f593bb 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -121,7 +121,7 @@ class SelfAssessmentModule(XModule): 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.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]) @@ -133,8 +133,8 @@ class SelfAssessmentModule(XModule): '



').format(system.ajax_url) - rubric_form = ('

Please assess your performance given the above rubric:
' - '
' '
' '' @@ -142,14 +142,16 @@ class SelfAssessmentModule(XModule): 'id="ajax_url" name="ajax_url" url="{0}">' '


').format(system.ajax_url) + rubric_header=('

Rubric') + #Combine problem, rubric, and the forms if self.answer is not "" : - answer_html="

Previous Answer:
{0}

".format(self.answer) + 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]) + self.rubric = ''.join([rubric_header,self.rubric, rubric_form]) #Display the problem to the student to begin with self.html = self.problem @@ -284,7 +286,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): stores_state = True has_score = True - template_dir_name = "html" + template_dir_name = "selfassessment" js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]} js_module_name = "HTMLEditingDescriptor"