Repository navigation
Tighten the Swayam replacement rules - #1990
Merged
vikrantwiz02 merged 1 commit intoSep 11, 2026
Merged
Conversation
A Swayam course being re-done as a backlog is now replaceable too, not only one that took an elective slot, and the frozen source is picked in a fixed order so it cannot change between page loads. What the new courses are registered as follows the source: - this semester's Swayam in an elective slot stays extra credit - a backlog one, or an elective from an earlier semester, goes by the grade: F, CD or X as a backlog, D, D+ or C as an improvement Backlog and improvement both come off that grade, so a course with no grade on record can no longer be replaced; the elective-slot case is exempt because it never reads the grade. The source list and the submit check now share one definition of a satisfactory grade, which is how S came to be missing from the list the form offered while the submit still refused it. Two smaller corrections: a replacement needs one free Swayam slot when the source is frozen rather than two, since that path names a single new course; and the semester list leaves out semesters holding only passed electives instead of opening an empty course list.
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.
Five changes to the Swayam replace flow, all in
academic_procedures/api/views.py.1. A backlog Swayam is replaceable too. The source auto-fill only matched a Swayam sitting in an elective slot (
OE…); one being re-done as a backlog (BL…) fell through to the manual form, so the course a student was looking at was never offered. It now matches either, and the pick is ordered so the frozen course cannot change between page loads — five student-semesters hold more than one replaceable Swayam, and the unordered query could return a different one each time.2. The registration type follows the source.
Grade-wise means
F,CD,Xas a Backlog andD,D+,Cas an Improvement — the rule that was already there, previously skipped for anything in the current semester.3. A grade on record is now required. Both backlog and improvement are derived from the source grade, so without one there is nothing to register against; it used to fall through to
Improvementregardless. The elective-slot case is exempt, since it registers as extra credit and never reads the grade.4. One definition of a satisfactory grade. The list was written out twice and the two copies had drifted: the form's source list omitted
Swhile the submit refused it, so a course gradedSwas offered and then rejected. Both now readSATISFACTORY_GRADES.5. Two corrections to what the screens offer. A replacement needed two free Swayam slots to open the tab, but the frozen path names only one new course, so a student with one free slot and a freezable source was locked out of a request that would have fit. And the semester list included any semester holding an elective, including ones where every elective was passed — picking such a semester opened an empty course list. It now lists only semesters with something replaceable in them.
Checked against a copy of the production database. The widened match picks up the backlog case without changing any existing elective-slot case; the type resolution was walked across every combination of term, slot and grade; the slot gate reports one free slot needed with a freezable source and two without; and for one student the semester list drops from four semesters to the two that actually have a replaceable course, with no empty list left behind.