diff options
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index b5bde04..4859d3e 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1321,15 +1321,15 @@ class AnswerPaper(models.Model): 'weight': 0.0} if user_answer is not None: if question.type == 'mcq': - expected_answer = question.get_test_case(correct=True).options - if user_answer.strip() == expected_answer.strip(): + expected_answer = question.get_test_case(correct=True).id + if user_answer.strip() == str(expected_answer).strip(): result['success'] = True result['error'] = ['Correct answer'] elif question.type == 'mcc': expected_answers = [] for opt in question.get_test_cases(correct=True): - expected_answers.append(opt.options) + expected_answers.append(str(opt.id)) if set(user_answer) == set(expected_answers): result['success'] = True result['error'] = ['Correct answer'] |