Commit e17db85d by Vik Paruchuri Committed by Victor Shnayder

Add in max score attribute for proper instructor scoring

parent 0c69c466
...@@ -1889,6 +1889,18 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1889,6 +1889,18 @@ class OpenEndedResponse(LoncapaResponse):
else: else:
self.answer = "No answer given." self.answer = "No answer given."
#Parse max_score
top_score = oeparam.find('max_score')
if top_score is not None:
try:
self.max_score= int(top_score.text)
except:
self.top_score=1
else:
self.max_score = 1
log.debug(self.max_score)
def get_score(self, student_answers): def get_score(self, student_answers):
try: try:
...@@ -1925,7 +1937,11 @@ class OpenEndedResponse(LoncapaResponse): ...@@ -1925,7 +1937,11 @@ class OpenEndedResponse(LoncapaResponse):
} }
#Update contents with student response and student info #Update contents with student response and student info
contents.update({'student_info': json.dumps(student_info), 'student_response': submission}) contents.update({
'student_info': json.dumps(student_info),
'student_response': submission,
'max_score' : self.max_score
})
# Submit request. When successful, 'msg' is the prior length of the queue # Submit request. When successful, 'msg' is the prior length of the queue
(error, msg) = qinterface.send_to_queue(header=xheader, (error, msg) = qinterface.send_to_queue(header=xheader,
......
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