Commit bc1dea3d by Felix Sun Committed by Carlos Andrés Rocha

Fixed bug: When student submits empty string, hinter returns a 500 error.

Added tests to catch said bug.

Fixed some pylint violations.
parent 06529054
......@@ -140,7 +140,11 @@ class CrowdsourceHinterModule(CrowdsourceHinterFields, XModule):
- 'rand_hint_1' and 'rand_hint_2' are two random hints to the answer in `get`.
- 'answer' is the parsed answer that was submitted.
"""
answer = self.capa_answer_to_str(get)
try:
answer = self.capa_answer_to_str(get)
except ValueError:
# Sometimes, we get an answer that's just not parsable. Do nothing.
return
# Look for a hint to give.
# Make a local copy of self.hints - this means we only need to do one json unpacking.
# (This is because xblocks storage makes the following command a deep copy.)
......
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