Commit 95c8797c by Piotr Mitros

Accidentally committed with debug code

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