From 7d4d5a0f3b4d4ffc1b6a976dd87e7850c2b24d03 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Thu, 1 Nov 2012 14:24:06 -0400 Subject: [PATCH] reformat code with spaces --- .../xmodule/xmodule/self_assessment_module.py | 130 +++++++++--------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/common/lib/xmodule/xmodule/self_assessment_module.py b/common/lib/xmodule/xmodule/self_assessment_module.py index d2175a4ed7..003d3bf36f 100644 --- a/common/lib/xmodule/xmodule/self_assessment_module.py +++ b/common/lib/xmodule/xmodule/self_assessment_module.py @@ -3,7 +3,6 @@ Add Self Assessment module so students can write essay, submit, then see a rubri Incredibly hacky solution to persist state and properly display information """ - import copy from fs.errors import ResourceNotFoundError import logging @@ -28,7 +27,7 @@ from xmodule.contentstore.content import XASSET_SRCREF_PREFIX, StaticContent log = logging.getLogger("mitx.courseware") #Set the default number of max attempts. Should be 1 for production -max_attempts=100 +max_attempts = 100 def only_one(lst, default="", process=lambda x: x): """ @@ -43,6 +42,7 @@ def only_one(lst, default="", process=lambda x: x): else: raise Exception('Malformed XML') + class ComplexEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, complex): @@ -87,48 +87,48 @@ class SelfAssessmentModule(XModule): """ #Parse definition file - dom2=etree.fromstring("" + self.definition['data'] + "") + 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]) + 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=('