Skip to content

Commit

Permalink
changes in examination
Browse files Browse the repository at this point in the history
  • Loading branch information
Lone24wolf committed Dec 4, 2024
1 parent ab4ad45 commit 5dc77d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions FusionIIIT/applications/examination/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5dc77d2

Please sign in to comment.