From 96c132b333984bfead0e027ede0ef1d4b956a08c Mon Sep 17 00:00:00 2001 From: ichuang Date: Tue, 3 Jul 2012 17:02:01 -0400 Subject: [PATCH] put try around Progress call in capa_module - exception when divide by zero --- common/lib/xmodule/capa_module.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/capa_module.py b/common/lib/xmodule/capa_module.py index 7698c0937e..2c4a9c0465 100644 --- a/common/lib/xmodule/capa_module.py +++ b/common/lib/xmodule/capa_module.py @@ -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