Reformat code
This commit is contained in:
@@ -106,10 +106,10 @@ class CombinedOpenEndedModule(CombinedOpenEndedFields, XModule):
|
||||
icon_class = 'problem'
|
||||
|
||||
js = {'coffee':
|
||||
[resource_string(__name__, 'js/src/combinedopenended/display.coffee'),
|
||||
resource_string(__name__, 'js/src/collapsible.coffee'),
|
||||
resource_string(__name__, 'js/src/javascript_loader.coffee'),
|
||||
]}
|
||||
[resource_string(__name__, 'js/src/combinedopenended/display.coffee'),
|
||||
resource_string(__name__, 'js/src/collapsible.coffee'),
|
||||
resource_string(__name__, 'js/src/javascript_loader.coffee'),
|
||||
]}
|
||||
js_module_name = "CombinedOpenEnded"
|
||||
|
||||
css = {'scss': [resource_string(__name__, 'css/combinedopenended/display.scss')]}
|
||||
|
||||
@@ -461,7 +461,7 @@ class CombinedOpenEndedV1Module():
|
||||
last_response_dict = {
|
||||
'response': last_response,
|
||||
'score': last_score,
|
||||
'all_scores' : all_scores,
|
||||
'all_scores': all_scores,
|
||||
'post_assessment': last_post_assessment,
|
||||
'type': task_type,
|
||||
'max_score': max_score,
|
||||
@@ -750,7 +750,7 @@ class CombinedOpenEndedV1Module():
|
||||
score = last_response.get('all_scores', None)
|
||||
if score is not None:
|
||||
#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:
|
||||
score[z] = 0
|
||||
score[z] *= float(self.weight)
|
||||
|
||||
@@ -72,7 +72,8 @@ class OpenEndedChild(object):
|
||||
try:
|
||||
instance_state = json.loads(instance_state)
|
||||
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:
|
||||
instance_state = {}
|
||||
|
||||
@@ -81,8 +82,8 @@ class OpenEndedChild(object):
|
||||
# element.
|
||||
# Scores are on scale from 0 to max_score
|
||||
|
||||
self.child_history=instance_state.get('child_history',[])
|
||||
self.child_state=instance_state.get('child_state', self.INITIAL)
|
||||
self.child_history = instance_state.get('child_history', [])
|
||||
self.child_state = instance_state.get('child_state', self.INITIAL)
|
||||
self.child_created = instance_state.get('child_created', False)
|
||||
self.child_attempts = instance_state.get('child_attempts', 0)
|
||||
|
||||
@@ -166,7 +167,7 @@ class OpenEndedChild(object):
|
||||
"""None if not available"""
|
||||
if not self.child_history:
|
||||
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):
|
||||
"""Empty string if not available"""
|
||||
|
||||
@@ -291,7 +291,7 @@ class SelfAssessmentDescriptor():
|
||||
template_dir_name = "selfassessment"
|
||||
|
||||
def __init__(self, system):
|
||||
self.system =system
|
||||
self.system = system
|
||||
|
||||
@classmethod
|
||||
def definition_from_xml(cls, xml_object, system):
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user