Commit 5125d8b0 by Vik Paruchuri

Reformat code

parent d82ac2b7
...@@ -106,10 +106,10 @@ class CombinedOpenEndedModule(CombinedOpenEndedFields, XModule): ...@@ -106,10 +106,10 @@ class CombinedOpenEndedModule(CombinedOpenEndedFields, XModule):
icon_class = 'problem' icon_class = 'problem'
js = {'coffee': js = {'coffee':
[resource_string(__name__, 'js/src/combinedopenended/display.coffee'), [resource_string(__name__, 'js/src/combinedopenended/display.coffee'),
resource_string(__name__, 'js/src/collapsible.coffee'), resource_string(__name__, 'js/src/collapsible.coffee'),
resource_string(__name__, 'js/src/javascript_loader.coffee'), resource_string(__name__, 'js/src/javascript_loader.coffee'),
]} ]}
js_module_name = "CombinedOpenEnded" js_module_name = "CombinedOpenEnded"
css = {'scss': [resource_string(__name__, 'css/combinedopenended/display.scss')]} css = {'scss': [resource_string(__name__, 'css/combinedopenended/display.scss')]}
......
...@@ -461,7 +461,7 @@ class CombinedOpenEndedV1Module(): ...@@ -461,7 +461,7 @@ class CombinedOpenEndedV1Module():
last_response_dict = { last_response_dict = {
'response': last_response, 'response': last_response,
'score': last_score, 'score': last_score,
'all_scores' : all_scores, 'all_scores': all_scores,
'post_assessment': last_post_assessment, 'post_assessment': last_post_assessment,
'type': task_type, 'type': task_type,
'max_score': max_score, 'max_score': max_score,
...@@ -750,7 +750,7 @@ class CombinedOpenEndedV1Module(): ...@@ -750,7 +750,7 @@ class CombinedOpenEndedV1Module():
score = last_response.get('all_scores', None) score = last_response.get('all_scores', None)
if score is not None: if score is not None:
#Convert none scores and weight scores properly #Convert none scores and weight scores properly
for z in xrange(0,len(score)): for z in xrange(0, len(score)):
if score[z] is None: if score[z] is None:
score[z] = 0 score[z] = 0
score[z] *= float(self.weight) score[z] *= float(self.weight)
......
...@@ -72,7 +72,8 @@ class OpenEndedChild(object): ...@@ -72,7 +72,8 @@ class OpenEndedChild(object):
try: try:
instance_state = json.loads(instance_state) instance_state = json.loads(instance_state)
except: except:
log.error("Could not load instance state for open ended. Setting it to nothing.: {0}".format(instance_state)) log.error(
"Could not load instance state for open ended. Setting it to nothing.: {0}".format(instance_state))
else: else:
instance_state = {} instance_state = {}
...@@ -81,8 +82,8 @@ class OpenEndedChild(object): ...@@ -81,8 +82,8 @@ class OpenEndedChild(object):
# element. # element.
# Scores are on scale from 0 to max_score # Scores are on scale from 0 to max_score
self.child_history=instance_state.get('child_history',[]) self.child_history = instance_state.get('child_history', [])
self.child_state=instance_state.get('child_state', self.INITIAL) self.child_state = instance_state.get('child_state', self.INITIAL)
self.child_created = instance_state.get('child_created', False) self.child_created = instance_state.get('child_created', False)
self.child_attempts = instance_state.get('child_attempts', 0) self.child_attempts = instance_state.get('child_attempts', 0)
...@@ -166,7 +167,7 @@ class OpenEndedChild(object): ...@@ -166,7 +167,7 @@ class OpenEndedChild(object):
"""None if not available""" """None if not available"""
if not self.child_history: if not self.child_history:
return None return None
return [self.child_history[i].get('score') for i in xrange(0,len(self.child_history))] return [self.child_history[i].get('score') for i in xrange(0, len(self.child_history))]
def latest_post_assessment(self, system): def latest_post_assessment(self, system):
"""Empty string if not available""" """Empty string if not available"""
......
...@@ -291,7 +291,7 @@ class SelfAssessmentDescriptor(): ...@@ -291,7 +291,7 @@ class SelfAssessmentDescriptor():
template_dir_name = "selfassessment" template_dir_name = "selfassessment"
def __init__(self, system): def __init__(self, system):
self.system =system self.system = system
@classmethod @classmethod
def definition_from_xml(cls, xml_object, system): def definition_from_xml(cls, xml_object, system):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment