Implement B.Tech sectioning and per-instructor grade submission#1929
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces section support for undergraduate students in the academic information system. It adds a
sectionfield to theStudentmodel, 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
sectionfield (A–F) to theStudentmodel, with choices and logic to compute the value from discipline and roll number parity. Includes a migration to add the field. [1] [2] [3]backfill_sectionsto populate thesectionfield for existing undergraduate students based on their discipline and roll number.Section assignment and admin APIs
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
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
resolve_offeringto determine the correctCourseInstructorfor 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.