Commit a6c273bd by Vik Paruchuri

More informative dictionary keys

parent d02b9d9c
...@@ -296,13 +296,10 @@ class OpenEndedModule(): ...@@ -296,13 +296,10 @@ class OpenEndedModule():
log.debug(score_msg) log.debug(score_msg)
score_msg = self._parse_score_msg(score_msg) score_msg = self._parse_score_msg(score_msg)
if not score_msg['valid']: if not score_msg['valid']:
score_msg['msg'] = 'Invalid grader reply. Please contact the course staff.' score_msg['feedback'] = 'Invalid grader reply. Please contact the course staff.'
return oldcmap
correctness = 'correct' if score_msg.correct else 'incorrect' self._record_latest_score(score_msg['score'])
self._record_latest_feedback(score_msg['feedback'])
self._record_latest_score(score_msg['points'])
self._record_latest_feedback(score_msg['msg'])
self.state=self.POST_ASSESSMENT self.state=self.POST_ASSESSMENT
return True return True
...@@ -465,13 +462,12 @@ class OpenEndedModule(): ...@@ -465,13 +462,12 @@ class OpenEndedModule():
self.submission_id=score_result['submission_id'] self.submission_id=score_result['submission_id']
self.grader_id=score_result['grader_id'] self.grader_id=score_result['grader_id']
# HACK: for now, just assume it's correct if you got more than 2/3. return {'valid' : True, 'score' : score_result['score'], 'feedback' : feedback}
# Also assumes that score_result['score'] is an integer.
score_ratio = int(score_result['score']) / float(self.max_score)
correct = (score_ratio >= 0.66)
#Currently ignore msg and only return feedback (which takes the place of msg) def is_submission_correct(self, score):
return {'valid' : True, 'correct' : correct, 'points' : score_result['score'], 'msg' : feedback} score_ratio = int(score) / float(self.max_score)
correct = (score_ratio >= 0.66)
return correct
def handle_ajax(self, dispatch, get, system): def handle_ajax(self, dispatch, get, 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