summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-09-29 21:51:36 +0530
committeradityacp2020-09-29 21:51:36 +0530
commitf45e194246391926e3546efd73eb519a167f0fdd (patch)
treea61d2d105058783bc2ea033c1581481655e663c0 /yaksh
parentf9103b8e79b7f9a74d1d3e1d6ae2a458a383b270 (diff)
downloadonline_test-f45e194246391926e3546efd73eb519a167f0fdd.tar.gz
online_test-f45e194246391926e3546efd73eb519a167f0fdd.tar.bz2
online_test-f45e194246391926e3546efd73eb519a167f0fdd.zip
Show assignment upload file in view answerpaper
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/views.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 859ce3b..907facb 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1929,8 +1929,8 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None,
course.is_teacher(current_user):
raise Http404('This course does not belong to you')
has_quiz_assignments = AssignmentUpload.objects.filter(
- question_paper_id__in=questionpaper_id
- ).exists()
+ course_id=course_id, question_paper_id__in=questionpaper_id
+ ).exists()
context = {
"users": user_details,
"quiz_id": quiz_id,
@@ -1949,9 +1949,9 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None,
except IndexError:
raise Http404('No attempts for paper')
has_user_assignments = AssignmentUpload.objects.filter(
- question_paper_id__in=questionpaper_id,
- user_id=user_id
- ).exists()
+ course_id=course_id, question_paper_id__in=questionpaper_id,
+ user_id=user_id
+ ).exists()
user = User.objects.get(id=user_id)
data = AnswerPaper.objects.get_user_data(
user, questionpaper_id, course_id, attempt_number
@@ -2212,12 +2212,12 @@ def view_answerpaper(request, questionpaper_id, course_id):
if quiz.view_answerpaper and user in course.students.all():
data = AnswerPaper.objects.get_user_data(user, questionpaper_id,
course_id)
- has_user_assignment = AssignmentUpload.objects.filter(
+ has_user_assignments = AssignmentUpload.objects.filter(
user=user, course_id=course.id,
question_paper_id=questionpaper_id
).exists()
context = {'data': data, 'quiz': quiz, 'course_id': course.id,
- "has_user_assignment": has_user_assignment}
+ "has_user_assignments": has_user_assignments}
return my_render_to_response(
request, 'yaksh/view_answerpaper.html', context
)