Commit 95c8797c by Piotr Mitros

Accidentally committed with debug code

parent e9819ffb
......@@ -51,11 +51,8 @@ class customresponse(object):
self.code = answer.text
def grade(self, student_answers):
print "YY", self.answer_ids
print "XX", student_answers
submission = [student_answers[k] for k in sorted(self.answer_ids)]
self.context.update({'submission':submission})
print self.code
exec self.code in global_context, self.context
return zip(sorted(self.answer_ids), self.context['correct'])
......
......@@ -237,15 +237,14 @@ class LoncapaModule(XModule):
for key in get:
answers['_'.join(key.split('_')[1:])]=get[key]
#try:
if True:
try:
old_state = self.lcp.get_state()
lcp_id = self.lcp.problem_id
filename = self.lcp.filename
correct_map = self.lcp.grade_answers(answers)
#except:
# self.lcp = LoncapaProblem(filename, id=lcp_id, state=old_state)
# return json.dumps({'success':'syntax'})
except:
self.lcp = LoncapaProblem(filename, id=lcp_id, state=old_state)
return json.dumps({'success':'syntax'})
self.attempts = self.attempts + 1
self.lcp.done=True
......
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