Skip answer comparison if the user didn't type anything

This commit is contained in:
Damien Elmes 2023-01-28 21:38:14 +10:00
parent 4922654d8f
commit 6b7d372ca9

View file

@ -610,8 +610,11 @@ class Reviewer:
# munge correct value
expected = self.typeCorrect
provided = self.typedAnswer
# compare with typed answer
output = self.mw.col.compare_answer(expected, provided)
if not provided:
output = expected
else:
# compare with typed answer
output = self.mw.col.compare_answer(expected, provided)
# and update the type answer area
def repl(match: Match) -> str:
# can't pass a string in directly, and can't use re.escape as it