Skip to content

Implement B.Tech sectioning and per-instructor grade submission#1929

Merged
vikrantwiz02 merged 9 commits into
FusionIIIT:prod-testfrom
vikrantwiz02:sections
Jul 9, 2026
Merged

Implement B.Tech sectioning and per-instructor grade submission#1929
vikrantwiz02 merged 9 commits into
FusionIIIT:prod-testfrom
vikrantwiz02:sections

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

This pull request introduces section support for undergraduate students in the academic information system. It adds a section field to the Student model, provides a management command to backfill section data, exposes new APIs for section assignment and querying, and integrates section filtering and display throughout the student list export and course APIs.

Major features and changes:

Section support for students

  • Added a section field (A–F) to the Student model, with choices and logic to compute the value from discipline and roll number parity. Includes a migration to add the field. [1] [2] [3]
  • Added a management command backfill_sections to populate the section field for existing undergraduate students based on their discipline and roll number.

Section assignment and admin APIs

  • Implemented three new APIs for academic admins: list running batches (section_batches), list students with their section in a batch (section_students), and bulk assign/clear section values for students (assign_section). [1] [2]

Section filtering and display in student lists

  • Enhanced the student list export (generate_xlsheet_api) to filter by section, display section in the Excel sheet, and include section information in filenames and headers. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Course and offering logic updates

  • Updated the available courses API to report which sections exist for each course, and improved instructor resolution to handle sectioned offerings. [1] [2] [3]
  • Added a helper resolve_offering to determine the correct CourseInstructor for a student and course, considering section assignments. [1] [2]

These changes collectively enable the system to assign, manage, and utilize section information for undergraduate students, improving accuracy and flexibility in academic administration.

- Add Student.section (A-F), derived from discipline + roll-number parity
  via compute_section(); assigned at student onboarding and recomputed on
  branch change. backfill_sections management command for existing students.
- Make CourseInstructor a per-section offering: add section_label and change
  uniqueness to (course, year, semester_type, section_label) so each section
  has exactly one owning faculty; single-offering enforcement for electives.
- Bind registrations and grades to their offering: add course_instructor FK
  to course_registration, FinalRegistration and Student_grades; resolve_offering()
  + binding at verification; bind_course_offerings management command.
- Scope grade submission per instructor/section in UploadGradesProfAPI (a
  faculty may only grade their own section); remove the acadadmin proxy
  submission path (SubmitGradesView / UploadGradesAPI).
- Harden ModerateStudentGradesAPI (term-aware, no MultipleObjectsReturned) and
  make GradeStatusAPI report status per section.
- Make the student roll list (generate_xlsheet_api) section-aware: optional
  section filter, Section column, section-aware instructor.
- Migrations: academic_information 0003, programme_curriculum 0033,
  academic_procedures 0021, online_cms 0005.
- Add StudentBatchUpload.section, auto-derived in save() from discipline +
  roll-number parity, so a student's section is decided when data is fed via
  Admin > Upcoming Batches (recomputed on every save, e.g. when a roll number
  is later assigned). Auto-exposed by StudentBatchUploadSerializer (fields '__all__').
- Migration: programme_curriculum 0034.
- get_batch_students now includes each student's section in its response so the
  Upcoming Batches admin view can display it (StudentBatchUpload.section, derived
  at admission from discipline + roll-number parity).
- New acadadmin Section Assignment API: section/batches, section/students, section/assign
- Stop auto-deriving Student.section (onboarding + StudentBatchUpload.save); branch change clears it
- get_batch_students shows the assigned section read-only (by roll number)
- available_courses exposes per-course sections from enrolled students' Student.section
- Faculty assigned-courses API returns each offering's section
- SubmitGradesProfAPI: allow acadadmin (lists all offerings that term) and
  return per-course sections (faculty = own offerings' section_labels, acadadmin
  = all); electives/interdisciplinary have none.
- UploadGradesProfAPI: allow acadadmin (bypass instructor ownership), accept an
  optional section to scope the roster; each grade still binds to the student's
  own offering via resolve_offering.
- download_template + PreviewGradesAPI: accept section to scope the roster.
student_questions now resolves each registered course's instructor via
resolve_offering (the student's own section offering), falling back to any
offering for single-offering / legacy no-section courses.
- FeedbackResponse.course_instructor FK (migration 0022) so responses are tied
  to the offering rated; student_submit binds it via the shown offering.
- student_questions: skip courses with no instructor; show the student's section instructor.
- admin_course_list: split sectioned courses into per-instructor rows (+ an
  "unassigned" row for responses with no offering recorded).
- admin_all_stats: filter by course_instructor (incl. isnull); fixed section order.
- GradeStatusAPI: report each offering by its own status; fall back to
  course-level only when no offering has grades bound (was marking unsubmitted
  sections as Submitted/Verified).
- download_template & PreviewGradesAPI: faculty may only access courses they
  teach (acadadmin/Dean: any); previously any faculty could pull any roster.
- UploadGradesProfAPI: reset reSubmit only for this submission's roster (never
  course-wide when programme_type is empty).
- student_submit: accept an option only if it belongs to the question, and
  derive the section from the question instead of trusting the request.
@vikrantwiz02
vikrantwiz02 merged commit 13295b1 into FusionIIIT:prod-test Jul 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant