Commit 4e43b662 by kimth

CodeResponse admits only one student response

parent 80b62bf0
...@@ -848,13 +848,13 @@ class CodeResponse(LoncapaResponse): ...@@ -848,13 +848,13 @@ class CodeResponse(LoncapaResponse):
def get_score(self, student_answers): def get_score(self, student_answers):
try: try:
submission = [student_answers[self.answer_id]] submission = student_answers[self.answer_id]
except Exception as err: except Exception as err:
log.error('Error in CodeResponse %s: cannot get student answer for %s; student_answers=%s' % (err, self.answer_id, student_answers)) log.error('Error in CodeResponse %s: cannot get student answer for %s; student_answers=%s' % (err, self.answer_id, student_answers))
raise Exception(err) raise Exception(err)
self.context.update({'submission': submission}) self.context.update({'submission': submission})
extra_payload = {'edX_student_response': json.dumps(submission)} extra_payload = {'edX_student_response': submission}
r, queuekey = self._send_to_queue(extra_payload) # TODO: Perform checks on the xqueue response r, queuekey = self._send_to_queue(extra_payload) # TODO: Perform checks on the xqueue response
...@@ -925,7 +925,6 @@ class CodeResponse(LoncapaResponse): ...@@ -925,7 +925,6 @@ class CodeResponse(LoncapaResponse):
payload = {'xqueue_header': json.dumps(header), payload = {'xqueue_header': json.dumps(header),
'xqueue_body' : json.dumps(body), 'xqueue_body' : json.dumps(body),
} }
payload.update(extra_payload)
# Contact queue server # Contact queue server
try: try:
......
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