Skip to content

Conversation

@Duy-Nguyen1104
Copy link

@Duy-Nguyen1104 Duy-Nguyen1104 commented Sep 16, 2025

Description

(The PR contains commit for previous PR as it has not been merged yet)

(The PR assumes that the backend has added features from this PR: thoth-tech/doubtfire-api#71)

This PR implements comprehensive prerequisite validation for the course map feature, ensuring that units with prerequisites are properly validated when placed in study periods. The validation system provides real-time warnings when prerequisite requirements are not met.

Features Added

  1. Prerequisite Validation Service
  • New Service: PrerequisiteValidationService
  • Validates unit placement against prerequisite requirements
  • Checks that prerequisites are placed in previous trimesters (not same trimester)
  1. Visual Warning: Unit Card with prerequisite warnings

  2. Validation Rules Implemented

  • Prerequisites must be completed in previous trimesters (not same trimester)
  • Missing prerequisites trigger warnings

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

image

Manual Testing Scenarios

  • Place a unit with prerequisites → warnings appear if prerequisites missing
  • Place prerequisites after dependent units → warnings on both units
  • Move units around → validation updates in real-time
  • Place prerequisites in same trimester → appropriate warnings shown
  • Complete valid progression → no warnings displayed

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Edge

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • My changes generate no new warnings

Copy link

@giangnht19 giangnht19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Duy-Nguyen1104, the feature is well-structured and the rules are clearly enforced. I like the real-time warnings on unit cards, that’s going to make the course map much more user-friendly. Thanks for covering the edge cases around same-trimester prerequisites. Approved !

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.

2 participants