diff options
author | ankitjavalkar | 2016-02-11 15:41:32 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-02-11 15:41:32 +0530 |
commit | 9830ae48d9b8e062796fea6d134f58fe64425e88 (patch) | |
tree | fa0e7e89d30bdcc9bc8f577097223ee6c9e1e50a | |
parent | b626dbd94ea6342e5257bd5c79d47e9821b3fdde (diff) | |
download | online_test-9830ae48d9b8e062796fea6d134f58fe64425e88.tar.gz online_test-9830ae48d9b8e062796fea6d134f58fe64425e88.tar.bz2 online_test-9830ae48d9b8e062796fea6d134f58fe64425e88.zip |
Fix bug: Double submission of answers
-rw-r--r-- | yaksh/settings.py | 4 | ||||
-rw-r--r-- | yaksh/views.py | 14 |
2 files changed, 4 insertions, 14 deletions
diff --git a/yaksh/settings.py b/yaksh/settings.py index 4b1828e..63bd875 100644 --- a/yaksh/settings.py +++ b/yaksh/settings.py @@ -21,8 +21,8 @@ URL_ROOT = '' code_evaluators = { "python": "python_code_evaluator.PythonCodeEvaluator", - "c": "c_cpp_code_evaluator.CCPPCodeEvaluator", - "cpp": "c_cpp_code_evaluator.CCPPCodeEvaluator", + "c": "cpp_code_evaluator.CppCodeEvaluator", + "cpp": "cpp_code_evaluator.CppCodeEvaluator", "java": "java_code_evaluator.JavaCodeEvaluator", "bash": "bash_code_evaluator.BashCodeEvaluator", "scilab": "scilab_code_evaluator.ScilabCodeEvaluator", diff --git a/yaksh/views.py b/yaksh/views.py index 99e9f3b..0f6675a 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -833,7 +833,7 @@ def start(request, attempt_num=None, questionpaper_id=None): user_dir = get_user_dir(user) return start(request, attempt_num, questionpaper_id) -@login_required + def get_questions(paper): ''' Takes answerpaper as an argument. Returns the total questions as @@ -912,13 +912,6 @@ def show_question(request, q_id, attempt_num, questionpaper_id, success_msg=None question_paper=q_paper) if not user.is_authenticated() or paper.end_time < datetime.datetime.now(): return my_redirect('/exam/login/') - old_qid = request.POST.get('question_id') - if old_qid is not None: - quest = Question.objects.get(pk=old_qid) - user_code = request.POST.get('answer') - if quest.type == 'code': - old_skipped = paper.answers.filter(question=quest, skipped=True) - _save_skipped_answer(old_skipped, user_code, paper, quest) if len(q_id) == 0: msg = 'Congratulations! You have successfully completed the quiz.' return complete(request, msg, attempt_num, questionpaper_id) @@ -1019,9 +1012,6 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None): if not paper.question_paper.quiz.active: reason = 'The quiz has been deactivated!' return complete(request, reason, attempt_num, questionpaper_id) - if not paper.question_paper.quiz.active: - reason = 'The quiz has been deactivated!' - return complete(request, reason, attempt_num, questionpaper_id) questions, to_attempt, submitted = get_questions(paper) old_answer = paper.answers.filter(question=question, skipped=True) if old_answer: @@ -1209,7 +1199,7 @@ def monitor(request, questionpaper_id=None): context_instance=ci) -@login_required + def get_user_data(username): """For a given username, this returns a dictionary of important data related to the user including all the user's answers submitted. |