From e8cb3590b1af19e491f6ccbbdcf90cf1748f9fdd Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sat, 9 Feb 2013 09:06:14 -0500 Subject: [PATCH] Trim hint and submit messages out of self assessment --- .../xmodule/xmodule/self_assessment_module.py | 26 ++++--------------- lms/templates/self_assessment_hint.html | 2 +- lms/templates/self_assessment_prompt.html | 4 +-- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index 79eb635223..0d1092f96f 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -53,8 +53,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): @param descriptor: SelfAssessmentDescriptor @return: None """ - self.submit_message = definition['submitmessage'] - self.hint_prompt = definition['hintprompt'] self.prompt = stringify_children(self.prompt) self.rubric = stringify_children(self.rubric) @@ -76,8 +74,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): 'previous_answer': previous_answer, 'ajax_url': system.ajax_url, 'initial_rubric': self.get_rubric_html(system), - 'initial_hint': "", - 'initial_message': self.get_message_html(), 'state': self.state, 'allow_reset': self._allow_reset(), 'child_type': 'selfassessment', @@ -157,8 +153,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): else: hint = '' - context = {'hint_prompt': self.hint_prompt, - 'hint': hint} + context = {'hint': hint} if self.state == self.POST_ASSESSMENT: context['read_only'] = False @@ -169,15 +164,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): return system.render_template('self_assessment_hint.html', context) - def get_message_html(self): - """ - Return the appropriate version of the message view, based on state. - """ - if self.state != self.DONE: - return "" - - return """
{0}
""".format(self.submit_message) - def save_answer(self, get, system): """ @@ -274,7 +260,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild): self.change_state(self.DONE) return {'success': True, - 'message_html': self.get_message_html(), + 'message_html': '', 'allow_reset': self._allow_reset()} def latest_post_assessment(self, system): @@ -314,7 +300,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): 'hintprompt': 'some-html' } """ - expected_children = ['submitmessage', 'hintprompt'] + expected_children = [] for child in expected_children: if len(xml_object.xpath(child)) != 1: raise ValueError("Self assessment definition must include exactly one '{0}' tag".format(child)) @@ -323,9 +309,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): """Assumes that xml_object has child k""" return stringify_children(xml_object.xpath(k)[0]) - return {'submitmessage': parse('submitmessage'), - 'hintprompt': parse('hintprompt'), - } + return {} def definition_to_xml(self, resource_fs): '''Return an xml element representing this definition.''' @@ -336,7 +320,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor): child_node = etree.fromstring(child_str) elt.append(child_node) - for child in ['submitmessage', 'hintprompt']: + for child in []: add_child(child) return elt diff --git a/lms/templates/self_assessment_hint.html b/lms/templates/self_assessment_hint.html index 1adfc69e39..8c6eacba11 100644 --- a/lms/templates/self_assessment_hint.html +++ b/lms/templates/self_assessment_hint.html @@ -1,6 +1,6 @@
- ${hint_prompt} + Please enter a hint below:
diff --git a/lms/templates/self_assessment_prompt.html b/lms/templates/self_assessment_prompt.html index 564508cb7b..5347e23844 100644 --- a/lms/templates/self_assessment_prompt.html +++ b/lms/templates/self_assessment_prompt.html @@ -14,9 +14,9 @@
${initial_rubric}
-
${initial_hint}
+
-
${initial_message}
+