From 5ce516a3a0cd0d9d2b14a7caec0f762252aa9b50 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Thu, 6 Sep 2012 15:23:19 -0400 Subject: [PATCH] Clamp progress to be greater than zero --- common/lib/xmodule/xmodule/progress.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/lib/xmodule/xmodule/progress.py b/common/lib/xmodule/xmodule/progress.py index af47f50fd7..7adbb02646 100644 --- a/common/lib/xmodule/xmodule/progress.py +++ b/common/lib/xmodule/xmodule/progress.py @@ -42,6 +42,9 @@ class Progress(object): if a > b: a = b + if a < 0: + a = 0 + if b <= 0: raise ValueError('fraction a/b = {0}/{1} must have b > 0'.format(a, b))