Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 08984df

Browse files
committed
automatically mark non-ASCII text input as an incorrect answer
1 parent e652d40 commit 08984df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CodeChallenge/api/questions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ def answer_eval():
226226
correct=False,
227227
js_error=eval_error)
228228

229-
correct = str_cmp(eval_output, q.answer)
229+
try:
230+
correct = str_cmp(eval_output, q.answer)
231+
except TypeError:
232+
return jsonify(correct=False,
233+
status="success")
230234

231235
if request.json.get("checkOnly", False):
232236
return jsonify(correct=correct,

0 commit comments

Comments
 (0)