summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorCruiseDevice2021-02-19 15:05:42 +0530
committerCruiseDevice2021-02-19 15:05:42 +0530
commit9a2717b662c7dd3fca54e8b8f2e526454ad72d83 (patch)
treeeb176072b82cbfd081867b489487f531a8b581d6 /yaksh/views.py
parentb2bf7b9fef33d59cd1e55776a51577d66a252322 (diff)
downloadonline_test-9a2717b662c7dd3fca54e8b8f2e526454ad72d83.tar.gz
online_test-9a2717b662c7dd3fca54e8b8f2e526454ad72d83.tar.bz2
online_test-9a2717b662c7dd3fca54e8b8f2e526454ad72d83.zip
Fix upload assignment issue for multiple attempts
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 1965191..ceebda6 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -722,7 +722,7 @@ def show_question(request, question, paper, error_message=None,
assignmentQuestion_id=question.id,
course_id=course_id,
user=request.user,
- question_paper_id=paper.question_paper_id
+ answer_paper=paper
)
files = FileUpload.objects.filter(question_id=question.id, hide=False)
course = Course.objects.get(id=course_id)
@@ -861,7 +861,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None,
assignment_files = AssignmentUpload.objects.filter(
assignmentQuestion=current_question, course_id=course_id,
assignmentFile__icontains=fname, user=user,
- question_paper=questionpaper_id)
+ answer_paper=paper.id)
if assignment_files.exists():
assign_file = assignment_files.first()
if os.path.exists(assign_file.assignmentFile.path):
@@ -870,7 +870,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None,
AssignmentUpload.objects.create(
user=user, assignmentQuestion=current_question,
course_id=course_id,
- assignmentFile=fname, question_paper_id=questionpaper_id
+ assignmentFile=fname, answer_paper_id=paper.id
)
user_answer = 'ASSIGNMENT UPLOADED'
if not current_question.grade_assignment_upload: