Commit 5f89be8f by Piotr Mitros

Bug fixes

parent 006b6cd0
...@@ -22,7 +22,7 @@ def evaluator(variables, functions, string): ...@@ -22,7 +22,7 @@ def evaluator(variables, functions, string):
suffixes={'%':0.01,'k':1e3,'M':1e6,'G':1e9, suffixes={'%':0.01,'k':1e3,'M':1e6,'G':1e9,
'T':1e12,#'P':1e15,'E':1e18,'Z':1e21,'Y':1e24, 'T':1e12,#'P':1e15,'E':1e18,'Z':1e21,'Y':1e24,
'c':1e-2,'m':1e-3,'u':1e-6, 'c':1e-2,'m':1e-3,'u':1e-6,
'n':1e-9,'p':1e-12,'f'}#:1e-15,'a':1e-18,'z':1e-21,'y':1e-24} 'n':1e-9,'p':1e-12}#,'f':1e-15,'a':1e-18,'z':1e-21,'y':1e-24}
def super_float(text): def super_float(text):
''' Like float, but with si extensions. 1k goes to 1000''' ''' Like float, but with si extensions. 1k goes to 1000'''
......
...@@ -238,12 +238,16 @@ class LoncapaModule(XModule): ...@@ -238,12 +238,16 @@ class LoncapaModule(XModule):
answers['_'.join(key.split('_')[1:])]=get[key] answers['_'.join(key.split('_')[1:])]=get[key]
try: try:
ocm = lcp.correct_map print "A"
oa = lcp.answers ocm = self.lcp.correct_map
print "."
oa = self.lcp.answers
print "."
correct_map = self.lcp.grade_answers(answers) correct_map = self.lcp.grade_answers(answers)
print "."
except: except:
lcp.correct_map = ocm # HACK: Reset state self.lcp.correct_map = ocm # HACK: Reset state
lcp.answers = oa self.lcp.answers = oa
return json.dumps({'success':'syntax'}) return json.dumps({'success':'syntax'})
self.attempts = self.attempts + 1 self.attempts = self.attempts + 1
......
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