Commit ff4716ef by kimth

Further simplification after restricting to one answer field

parent bff86c32
...@@ -773,7 +773,7 @@ class CodeResponse(LoncapaResponse): ...@@ -773,7 +773,7 @@ class CodeResponse(LoncapaResponse):
# The following process is lifted directly from ExternalResponse # The following process is lifted directly from ExternalResponse
ad = rxml.find('awarddetail').text ad = rxml.find('awarddetail').text
admap = {'EXACT_ANS':'correct', # TODO: handle other loncapa responses admap = {'EXACT_ANS': 'correct', # TODO: handle other loncapa responses
'WRONG_FORMAT': 'incorrect', 'WRONG_FORMAT': 'incorrect',
} }
self.context['correct'] = ['correct'] self.context['correct'] = ['correct']
...@@ -794,10 +794,10 @@ class CodeResponse(LoncapaResponse): ...@@ -794,10 +794,10 @@ class CodeResponse(LoncapaResponse):
# does NOT require a queue submission, and the answer is computed (extracted from problem XML) locally. # does NOT require a queue submission, and the answer is computed (extracted from problem XML) locally.
def get_answers(self): def get_answers(self):
anshtml = '<font color="blue"><span class="code-answer"><br/><pre>%s</pre><br/></span></font>' % self.answer anshtml = '<font color="blue"><span class="code-answer"><br/><pre>%s</pre><br/></span></font>' % self.answer
return dict(zip(self.answer_ids,[anshtml])) return { self.answer_id: anshtml }
def get_initial_display(self): def get_initial_display(self):
return dict(zip(self.answer_ids,[self.initial_display])) return { self.answer_id: self.initial_display }
# CodeResponse._send_to_queue implements the same interface as defined for ExternalResponse's 'get_score' # CodeResponse._send_to_queue implements the same interface as defined for ExternalResponse's 'get_score'
def _send_to_queue(self, extra_payload): def _send_to_queue(self, extra_payload):
......
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