put try around Progress call in capa_module - exception when divide by zero

This commit is contained in:
ichuang
2012-07-03 17:02:01 -04:00
parent 105f429d61
commit 96c132b333

View File

@@ -109,7 +109,12 @@ class Module(XModule):
score = d['score']
total = d['total']
if total > 0:
return Progress(score, total)
try:
return Progress(score, total)
except Exception as err:
if self.DEBUG:
return None
raise
return None