Adding extra check for negative checks where question wasn't asked
parent
22a8f7e214
commit
f30492472a
|
@ -42,6 +42,8 @@ def check_actual_answers_against_expression(check_answer, actual_answer, check_q
|
|||
|
||||
# Negative Value Expressions
|
||||
if check_answer.startswith("!"):
|
||||
if len(actual_answer) == 0:
|
||||
return False
|
||||
for actual_answer in actual_answer:
|
||||
if actual_answer == '':
|
||||
return False
|
||||
|
|
|
@ -41,6 +41,7 @@ class QuestionSetTests(TestCase):
|
|||
self.assertFalse(check_actual_answers_against_expression('3C', '3B', check_question))
|
||||
self.assertTrue(check_actual_answers_against_expression('!3C', '3B', check_question))
|
||||
self.assertFalse(check_actual_answers_against_expression('!3C', '', check_question))
|
||||
self.assertFalse(check_actual_answers_against_expression('!3C', [''], check_question))
|
||||
|
||||
def test_dependencies_for_numeric_checks(self):
|
||||
check_question = Question()
|
||||
|
|
Loading…
Reference in New Issue