Skip to content

feat(grading): validate tutor review scores and feedback (BA-043) - #1035

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-043-validate-tutor-review-956
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-043-validate-tutor-review-956

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR addresses issue #956 (BA-043) by enforcing score bounds (0–100 integer) and required feedback/reason validation on tutor reviews with comprehensive boundary test coverage.

  • Changes:
    • BackendAcademy/src/grading/dto/tutor-review.dto.ts: Added feedback field with class-validator decorators, validated score bounds (0 to 100), and enforced required feedback/reason rules for override decisions.
    • BackendAcademy/src/grading/grading.controller.ts: Validated integer score bounds (0 <= score <= 100) and enforced non-empty feedback/reason requirements for override decisions before delegating to GradingService.
    • BackendAcademy/src/grading/grading.service.spec.ts: Added unit tests verifying boundary scores (0, 100), rejection of negative, >100, and fractional scores, missing feedback/reason rejection, and feedback field equivalence.
  • Verification:
    • All 21 tests in grading.service.spec.ts pass cleanly (100% Green).
    • Scope strictly restricted to the 3 allowlisted files.

Closes #956

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.

BA-043 — Validate tutor review scores and feedback

1 participant