Commit 4e5af13d by Calen Pennington

Merge pull request #374 from MITx/kimth/lms-coderesponse

Kimth/lms coderesponse
parents f2c8d5b4 062eff12
......@@ -818,7 +818,7 @@ class CodeResponse(LoncapaResponse):
'''
Configure CodeResponse from XML. Supports both CodeResponse and ExternalResponse XML
Determines whether in synchronous or asynchronous (queued) mode
TODO: Determines whether in synchronous or asynchronous (queued) mode
'''
xml = self.xml
self.url = xml.get('url', None) # XML can override external resource (grader/queue) URL
......
......@@ -9,6 +9,7 @@ import unittest
import os
import fs
import json
import numpy
import xmodule
......@@ -291,9 +292,14 @@ class CodeResponseTest(unittest.TestCase):
for i in range(numAnswers):
old_cmap.update(CorrectMap(answer_id=answer_ids[i], queuekey=1000 + i))
# Message format inherited from ExternalResponse
correct_score_msg = "<edxgrade><awarddetail>EXACT_ANS</awarddetail><message>MESSAGE</message></edxgrade>"
incorrect_score_msg = "<edxgrade><awarddetail>WRONG_FORMAT</awarddetail><message>MESSAGE</message></edxgrade>"
# TODO: Message format inherited from ExternalResponse
#correct_score_msg = "<edxgrade><awarddetail>EXACT_ANS</awarddetail><message>MESSAGE</message></edxgrade>"
#incorrect_score_msg = "<edxgrade><awarddetail>WRONG_FORMAT</awarddetail><message>MESSAGE</message></edxgrade>"
# New message format common to external graders
correct_score_msg = json.dumps({'correct':True, 'score':1, 'msg':'MESSAGE'})
incorrect_score_msg = json.dumps({'correct':False, 'score':0, 'msg':'MESSAGE'})
xserver_msgs = {'correct': correct_score_msg,
'incorrect': incorrect_score_msg,
}
......
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