Introducing a new way to review your PRs.

Read the announcement

nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.

View on GitHub

20 documents · Updated Nov 6, 2026

docs / planner-and-module-bank

Planner and module bank

The planner lets a student build a prospective study plan across academic years and semesters. It combines course choices with course data from the module bank so the student can see units, offering terms, exams, and possible study-plan conflicts before moving courses into a timetable. See the academic planning page for the wider planning model and academic calendar utilities for the semester and academic-year context.

Planner purpose

The planner is a forward-looking workspace rather than a record of the active timetable. A student can place known courses into future terms, mark completed courses as exemptions, keep possible choices in a separate plan-to-take list, and use the result to shape later timetable work.

Prospective study plan

The planner represents each planned item by its academic year, semester, and position in that semester. It keeps the plan separate from the timetable while offering a direct path from a planned course to the timetable for the current academic year.

The planner also shows a count of courses and total units at the whole-plan and academic-year levels. These totals help a student review the size of a plan without changing the timetable itself. References: website/…/PlannerContainer.tsx• L166-201, website/…/PlannerYear.tsx• L55-72, website/…/reducers.ts• L139-179

Planner route

The planner is available at /planner and loads as its own page. The surrounding application loads the course list before it renders the main pages, so planner course search starts with the shared list of known courses. References: website/…/Routes.tsx• L24-41, website/…/index.tsx• L1-20, website/…/AppShell.tsx• L44-64, website/…/AppShell.tsx• L107-163

Planner views

The planner view presents the plan as grouped columns. Academic years contain semester columns, while special lists sit beside them so that completed courses and possible future courses remain visible without being mistaken for scheduled study.

Academic-year groups

Each academic-year group presents the semesters in order and marks the current academic year for quick access. Regular semesters are shown by default. A student can reveal Special Term when needed, and the term remains visible when it has planned courses.

The planner scrolls to the current academic year when the page opens. This keeps the active planning area near the reader while preserving access to earlier and later years. References: website/…/PlannerContainer.tsx• L211-256, website/…/PlannerYear.tsx• L30-47, website/…/PlannerYear.tsx• L76-129

Special planning groups

The planner uses three groups outside the normal academic-year grid:

  • Exemptions hold courses that the student has already completed or does not need to take. They can count as completed when prerequisite checks assess later courses.
  • Plan to Take holds possible courses that the student wants to keep in view but that should not count as completed for prerequisite checks.
  • iBLOCs hold courses taken before matriculation when the student enables the iBLOC setting. They are shown in a special-term area and can support later prerequisite checks.

These groups use the same course cards and actions as regular semesters. Their separate placement gives the planner enough context to assess a plan without placing every course in a future term. References: website/…/PlannerContainer.tsx• L227-297, website/…/planner.ts• L167-194, website/…/planner.ts• L14-28

Course cards

Each course card links to the course page and can show its units and exam date when the data is available. A card can also show a warning for a missing course record, an unavailable term, an exam clash, an unmet prerequisite, or a duplicate course in the same semester.

The card menu lets the student edit custom course data, add the course to the matching timetable, open that timetable, or remove the course. Placeholder cards use the same surface but first ask the student to choose a course that fits the placeholder group. References: website/…/PlannerModule.tsx• L44-59, website/…/PlannerModule.tsx• L61-128, website/…/ModuleMenu.tsx• L23-34

Planner actions

Planner actions describe the changes a student can make to the plan. The planner view turns those actions into add, move, remove, edit, settings, import, export, and reset controls.

Course placement

The add control accepts one or more course codes and can also add a category placeholder. Search results are limited to courses offered in the selected semester for normal semester columns. The Plan to Take and Exemptions groups do not apply that term filter because they are not scheduled terms.

When a student drops a card into another semester, the planner moves it and preserves the order of both the source and destination lists. Dropping a card on the trash area removes it. References: website/…/AddModule.tsx• L40-69, website/…/PlannerModuleSelect.tsx• L82-99, website/…/PlannerContainer.tsx• L107-135, website/…/planner.ts• L38-88

Course information overrides

The planner can store a custom unit value and an optional title for a course. This supports courses that are missing from current course data or cases where the student needs to correct displayed information. The custom values take priority over the module bank values when the planner displays the card and totals.

The edit form validates the unit value before saving. Reset Info restores the displayed values from the current course record without saving until the student chooses Save. References: website/…/CustomModuleForm.tsx• L25-63, website/…/planner.ts• L343-379, website/…/reducers.ts• L159-168

Timetable handoff

The planner can add one course or all courses in the current academic-year semester to the matching timetable. Before the handoff, it fetches the course details so the timetable has the data needed to display the course. A card then changes from Add to Timetable to View in Timetable when the course is already present.

This handoff connects prospective planning to the separate timetable workflow. It does not turn courses in past or future planner years into active timetable entries. References: website/…/PlannerSemester.tsx• L71-77, website/…/PlannerSemester.tsx• L115-175, website/…/PlannerContainer.tsx• L147-148, website/…/PlannerModule.tsx• L203-209

Plan transfer

Download produces a JSON file containing the planner state. Upload accepts a JSON file only after it passes the planner state shape check, then reloads the course details needed by the cards. Reset clears both the plan and its planner settings, so the UI asks for confirmation first.

The transfer flow supports moving a plan between browser sessions without requiring a server-side student account. The planner state is also part of the persisted client state, so normal page use can retain the plan. References: website/…/PlannerImportButton.tsx• L15-65, website/…/export.ts• L72-87, website/…/PlannerClearButton.tsx• L12-51, website/…/index.ts• L15-29

Planner settings

Planner settings define the time range and the context used to assess a prospective plan. They do not add courses themselves; they change which year groups appear and which checks apply to those groups.

Planning range

The student selects a matriculation year and a graduation year. The reducer keeps these bounds valid by moving the other bound when a selection would otherwise make the range invalid. The planner then creates year groups across the selected range.

The available choices cover students who matriculated several years earlier through students who have not yet matriculated. The graduation choices extend several years beyond the current academic year. References: website/…/PlannerSettings.tsx• L34-67, website/…/PlannerSettings.tsx• L69-116, website/…/planner.ts• L65-77, website/…/planner.ts• L200-221

Eligibility context

The student can enable iBLOCs to add the pre-matriculation course group. The student can also disable prerequisite checking when the available course rules are not reliable for the plan. The latter removes prerequisite warnings rather than proving that the plan meets its requirements.

When checking prerequisites, the planner uses the matriculation year and the undergraduate or graduate schedule setting from the wider application. It evaluates courses in order, treating exemptions and iBLOCs as already taken while leaving Plan to Take courses outside that completed set. References: website/…/PlannerSettings.tsx• L118-153, website/…/planner.ts• L200-263, website/…/planner.ts• L192-272

Module bank

The module bank is the shared course-data source for planner search and display. It provides a compact list for selection, detailed records for cards and checks, and archived records when older academic-year data is needed.

Course data layers

The module bank has three useful views of course data:

Data layerPurpose in planning
Course listSupplies searchable course codes, titles, and offered semesters.
Course detailsSupplies units, titles, exam data, timetable data, and prerequisite rules.
Archived detailsSupplies prior-year data when a current record needs historical special-term context.

The application fetches the course list when the shell starts. The planner fetches details for courses already in the plan when its page opens, and it fetches new or imported courses as they enter the plan. The bank stores fetched details for reuse across the planner, timetable, course pages, and other views. References: website/…/AppShell.tsx• L44-105, website/…/PlannerContainer.tsx• L88-105, website/…/moduleBank.ts• L23-27, website/…/moduleBank.ts• L20-62

Course lookup

Planner search reads from the shared course list and narrows it by text, selected categories, and the target semester when the target is a real semester. The search keeps the list small enough to scan and lets a student paste several course codes into the add field.

The module bank also exposes a fast lookup by course code. Planner selectors use that lookup to join a planned item with its detailed record and custom values before the view renders it. References: website/…/PlannerModuleSelect.tsx• L34-40, website/…/PlannerModuleSelect.tsx• L119-175, website/…/moduleBank.ts• L12-19, website/…/planner.ts• L123-153

Course cache lifecycle

Course details are loaded on demand and marked as recently used when accessed. The bank can remove old cached records when its limit is exceeded, while protecting data that active timetables still need. This keeps the shared bank useful without making the planner state depend on a permanently complete course catalog.

If a course cannot be loaded, the planner keeps the planned entry and shows a notification. A student can then enter custom units and a title for the missing course. References: website/…/moduleBank.ts• L89-138, website/…/PlannerContainer.tsx• L101-105, website/…/moduleBank.ts• L64-82

Module grouping

Module grouping lets the planner represent a requirement before the student knows the exact course. A placeholder names the requirement and constrains the courses that can fill it.

Placeholder categories

The add control groups placeholders into broad university-level requirements and Computer Science requirements. General placeholders use course-code rules, while the Science requirement uses a fixed set of acceptable course codes. The groups are data for the planner UI rather than separate planner state.

Each placeholder starts without a course code. The student selects a matching course from its filtered search, and the placeholder then displays the selected course while preserving the requirement name. References: website/…/AddModule.tsx• L25-38, website/…/index.ts• L1-12, website/…/general.ts• L3-34, website/…/cs.ts• L3-49

Placeholder completion

Placeholder search can restrict choices to an explicit set or apply a course filter. It still applies the semester offering check when the placeholder sits in a normal semester. This connects a broad requirement to a realistic course choice without forcing the student to leave the planner.

Until a course is selected, the placeholder contributes its default four-unit value for planner display. After selection, the selected course supplies the title, units, offering data, and conflict checks. References: website/…/planner.ts• L123-151, website/…/PlannerModule.tsx• L142-184, website/…/PlannerModuleSelect.tsx• L82-99

Planner state flow

The planner flow joins user intent, planner state, and course data before it renders a card. This diagram shows how a course choice moves from the shared list into a plan and then into checks or a timetable.

flowchart LR
    A[Course list] --> B[Planner search]
    B --> C[Add course or placeholder]
    C --> D[Planner state]
    D --> E[Planner selectors]
    F[Course details] --> E
    E --> G[Grouped planner views]
    E --> H[Conflict warnings]
    G --> I[Current semester timetable]

The same state path supports imported plans. Import replaces the planner state, then the page requests details for each imported course so the view can rebuild its course context without a refresh. References: website/…/planner.ts• L38-105, website/…/planner.ts• L85-157, website/…/PlannerContainer.tsx• L150-160

Derived plan information

The stored planner state records placement and custom data. Selectors derive the grouped view, join course details, calculate totals, and attach conflicts. This separation lets one plan support several views without storing display-only values in each course entry.

Conflict checks cover missing course data, wrong offering semester, current-year exam clashes, duplicate courses, and unmet prerequisites. The planner displays the most useful conflict for the year and context instead of treating every warning as equally urgent. References: website/…/planner.ts• L27-121, website/…/planner.ts• L197-265, website/…/planner.ts• L383-402

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to the planner entry shape must stay compatible with the upload schema and the download path. The planner can receive files created by an earlier version.
  • Changes to special group markers must stay aligned across grouping selectors, semester labels, prerequisite ordering, and the add-to-Plan-to-Take action.
  • Changes to module-list fields must preserve both planner search filters and the code-to-course lookup used to enrich planner cards.
  • Changes to course-detail loading must preserve the planner's ability to render missing records with custom unit and title data.
  • Changes to current-year semester handling must be checked against both exam-clash warnings and the handoff to the timetable.

Important failure modes

TriggerConsequenceGuard
A planned course is not present in the module bankThe card has no official title or units and shows a missing-data warningAllow custom unit and title data through the course edit action
A course is placed in a semester in which it is not offeredThe plan may not be valid for that termShow the semester warning from the course list and keep the warning visible on the card
Two courses in the same current semester have clashing examsThe proposed schedule may contain an exam clashDerive exam clashes from the current semester's detailed course records
A prerequisite rule is not metThe student may plan a course before its required coursesBuild the taken set in plan order and allow the student to disable checks only when needed
An uploaded file does not match the planner state shapeThe plan is not imported and the existing plan remains in placeValidate the JSON before dispatching the import action
Reset is confirmedAll planner courses, custom data, and planner settings are clearedRequire confirmation and offer download as a backup path

Key files

FileWhy to read it
website/…/PlannerContainer.tsxShows the planner page layout and how user actions connect to the planner, module bank, and timetable.
website/…/PlannerYear.tsxShows academic-year and semester grouping.
website/…/PlannerSemester.tsxShows semester-level totals, course addition, conflict context, and timetable handoff.
website/…/PlannerModule.tsxShows the course-card behavior and the placeholder completion surface.
website/…/planner.tsDefines the user-level changes that the planner can apply.
website/…/planner.tsDefines how plan placement, order, settings, custom data, import, and reset change state.
website/…/planner.tsExplains how stored plan entries become grouped course views and warnings.
website/…/PlannerSettings.tsxShows the planning range and eligibility controls.
website/…/CustomModuleForm.tsxShows how students supply or override missing course information.
website/…/PlannerModuleSelect.tsxShows how planner course search uses the shared module list.
website/…/moduleBank.tsShows the course-list and course-detail loading lifecycle.
website/…/moduleBank.tsShows the shared course-data state and cache behavior.
website/…/index.tsShows how placeholder groups are assembled for planner requirements.
website/…/export.tsShows planner download validation and file creation.