Replace score message with dictionary

This commit is contained in:
Vik Paruchuri
2013-01-04 14:08:51 -05:00
parent 825821ae88
commit c3a91f5908

View File

@@ -457,7 +457,7 @@ class OpenEndedModule():
correct: Correctness of submission (Boolean)
score: Points to be assigned (numeric, can be float)
"""
fail = ScoreMessage(valid=False, correct=False, points=0, msg='')
fail = {'valid' : False, 'correct' : False, 'points' : 0, 'msg' : ''}
try:
score_result = json.loads(score_msg)
except (TypeError, ValueError):
@@ -486,8 +486,7 @@ class OpenEndedModule():
correct = (score_ratio >= 0.66)
#Currently ignore msg and only return feedback (which takes the place of msg)
return ScoreMessage(valid=True, correct=correct,
points=score_result['score'], msg=feedback)
return {'valid' : True, 'correct' : correct, 'points' : score_result['score'], 'msg' : feedback}
def handle_ajax(self, dispatch, get, system):
'''