diff options
author | maheshgudi | 2017-01-13 01:24:27 +0530 |
---|---|---|
committer | maheshgudi | 2017-01-13 01:24:27 +0530 |
commit | 57a5d99c7ed5aed498943686b2c951bdaba3852a (patch) | |
tree | 8969f5db3aeb70350e089e97fb5e37bd0e4db1ab /yaksh/views.py | |
parent | 7fb288ffd992c912a8e2288aa97d6c6ceeedf1a1 (diff) | |
download | online_test-57a5d99c7ed5aed498943686b2c951bdaba3852a.tar.gz online_test-57a5d99c7ed5aed498943686b2c951bdaba3852a.tar.bz2 online_test-57a5d99c7ed5aed498943686b2c951bdaba3852a.zip |
Fixed a bug which would mark all MCQ and MCC questions' answers as correct
1. Due to the new evaluator, an unchecked bug, which marked all mcq and mcc attempts as correct, despite actually marking the wrong answer, has been fixed.
2. Added Test case to check for incorrect mcq and mcc questions
3. question.html would also render error msg for mcq and mcc questions. This has also been fixed.
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 7ecf6aa..0d54f8a 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -488,12 +488,12 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None): # safely in a separate process (the code_server.py) running as nobody. json_data = current_question.consolidate_answer_data(user_answer) \ if current_question.type == 'code' else None - correct, result = paper.validate_answer(user_answer, current_question, json_data) - if correct or result.get('success'): + result = paper.validate_answer(user_answer, current_question, json_data) + if result.get('success'): new_answer.marks = (current_question.points * result['weight'] / current_question.get_maximum_test_case_weight()) \ if current_question.partial_grading and current_question.type == 'code' else current_question.points - new_answer.correct = correct + new_answer.correct = result.get('success') error_message = None new_answer.error = json.dumps(result.get('error')) next_question = paper.completed_question(current_question.id) |