Skip to content
Snippets Groups Projects
Commit 9f2bce00 authored by David Ormsbee's avatar David Ormsbee Committed by Calen Pennington
Browse files

Catch common case where problem answers are specified with units but don't expect them in the input

parent 3cbb74ae
No related merge requests found
......@@ -11,6 +11,7 @@ import sys
from cStringIO import StringIO
from calc import UndefinedVariable
from capa_problem import LoncapaProblem
logging.basicConfig(format="%(levelname)s %(message)s")
......@@ -108,6 +109,9 @@ def check_that_suggested_answers_work(problem):
log.debug(real_results)
assert(all(result == 'correct'
for answer_id, result in real_results.items()))
except UndefinedVariable as uv_exc:
log.error("The variable \"{0}\" specified in the ".format(uv_exc) +
"solution isn't recognized (is it a units measure?).")
except AssertionError:
log.error("The following generated answers were not accepted for {0}:"
.format(problem))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment