From 5dc77d2b97347d1302b3f261ff653a3ba7d69e4e Mon Sep 17 00:00:00 2001 From: Abhyuday Singh Date: Wed, 4 Dec 2024 18:02:13 +0530 Subject: [PATCH] changes in examination --- FusionIIIT/applications/examination/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FusionIIIT/applications/examination/views.py b/FusionIIIT/applications/examination/views.py index 19a9ce931..ec86e6730 100644 --- a/FusionIIIT/applications/examination/views.py +++ b/FusionIIIT/applications/examination/views.py @@ -1522,10 +1522,10 @@ def generate_pdf(request): academic_year = request.POST.get('academic_year') course_info = get_object_or_404(Courses, id=course_id) grades = Student_grades.objects.filter(course_id_id=course_id, year=academic_year).order_by("roll_no") - course=CourseInstructor.objects.get(course_id_id=course_id,year=academic_year) + course=CourseInstructor.objects.filter(course_id_id=course_id,year=academic_year,instructor_id_id=request.user.username) if not course: return JsonResponse({"success": False, "error": "course not found."}, status=404) - semester=course.semester_no + semester=course.first().semester_no all_grades = ["O", "A+", "A", "B+", "B", "C+", "C", "D+", "D", "F", "I", "S", "X"] grade_counts = {grade: grades.filter(grade=grade).count() for grade in all_grades} @@ -1713,7 +1713,7 @@ def generate_result(request): ).first() if not semester_info: return JsonResponse({'error': 'Semester not found'}, status=404) - + # print(batch, branch) course_slots = CourseSlot.objects.filter(semester_id=semester_info) course_ids = course_slots.values_list('courses', flat=True) courses = Courses.objects.filter(id__in=course_ids)