Skip to content

Tighten the Swayam replacement rules - #1990

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:swayam-replace-rules
Sep 11, 2026
Merged

vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:swayam-replace-rules

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

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.

Source Registered as
This semester, elective slot Extra Credits
This semester, backlog slot grade-wise
An earlier semester grade-wise

Grade-wise means F, CD, X as a Backlog and D, D+, C as 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 Improvement regardless. 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 S while the submit refused it, so a course graded S was offered and then rejected. Both now read SATISFACTORY_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.

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.
@vikrantwiz02
vikrantwiz02 merged commit 4a75db3 into FusionIIIT:prod/acad-react Sep 11, 2026
1 check passed
@vikrantwiz02
vikrantwiz02 deleted the swayam-replace-rules branch September 11, 2026 12:45
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