diff options
author | prathamesh | 2017-01-13 16:49:16 +0530 |
---|---|---|
committer | prathamesh | 2017-01-13 16:49:16 +0530 |
commit | c70c38dd55e159a5e7aa6706bb23bb8e70ca10bd (patch) | |
tree | f85d78faa6d51046b79e26ee59efa15e3c16bd75 /yaksh/views.py | |
parent | 5ee9b4647c7f1ba9803a95ad3871f6acfc92c1c0 (diff) | |
parent | 0e3e0cdbf322df9b5c8b7da0301cebe71eadcbe9 (diff) | |
download | online_test-c70c38dd55e159a5e7aa6706bb23bb8e70ca10bd.tar.gz online_test-c70c38dd55e159a5e7aa6706bb23bb8e70ca10bd.tar.bz2 online_test-c70c38dd55e159a5e7aa6706bb23bb8e70ca10bd.zip |
Merge branch 'master' of https://github.com/FOSSEE/online_test into UI-modifications-phase-2
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 257a383..14faa9b 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -486,12 +486,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) |