Skip to content

feat(peer-review): implement double-blind peer review assessment module - #1154

Open
shreyasmene06 wants to merge 17 commits into
vicharanashala:mainfrom
shreyasmene06:feat/peer-review-assessment
Open

shreyasmene06 wants to merge 17 commits into
vicharanashala:mainfrom
shreyasmene06:feat/peer-review-assessment

Conversation

@shreyasmene06

@shreyasmene06 shreyasmene06 commented Jul 11, 2026 •

Copy link
Copy Markdown

Description

Implement a complete, production-ready version of the double-blind peer review assessment module. This PR introduces end-to-end support for peer-based evaluations, automated matching algorithms, anti-collusion & malpractice handling, rubric-based score overrides, and responsive UI components.

Key Modules & Improvements:

  • Backend Repositories, Controllers & Services:

    • Full support for PeerReviewAssessment, PeerReviewSubmission, PeerReviewAssignment, and PeerReviewReview entities in MongoDB.
    • Endpoints for creating assessments, submitting student work, assigning peer reviews, retrieving feedback, closing assessments, and grade calculation.
  • Teacher Controls, Anti-Collusion & Reviewer Disqualification:

    • Manual Reviewer Disqualification: Instructors can manually disqualify colluding or cheating students as reviewers via POST /peer-review-assessments/submissions/:submissionId/exclude-student with required audit trail reasons.
    • Review Exclusion & Hiding: Automatically invalidates assignments submitted by disqualified reviewers (EXCLUDED status) and hides their reviews from target peers' feedback lists.
    • Student Submission Evaluation Preservation: Ensures the disqualified student's own submission remains active and evaluated normally by peer reviews.
    • Automatic Reassignment & Grade Recalculation: Automatically reassigns replacement reviewers from eligible cohort members when available, or recomputes target peers' final grades dynamically based on remaining valid reviews.
    • Rubric-Based Score Overrides: Teachers can override student final scores with criterion-by-criterion rubric scoring breakdown.
  • Scheduled Tasks & Anti-Collusion:

    • Automated cron jobs for reviewer matching/assignment, due date notifications (24h/1h reminders), and score finalization.
    • Anti-collusion checks to detect reciprocal high-scoring collusion and extreme reviewer score discrepancies.
  • Frontend User Interface & Layout Refinements:

    • Teacher Assessment Dashboard: Comprehensive management view with submission overview, rubric editor, and override/disqualification forms.
    • Collapsible Analytics Dashboard: Minimalistic "Assessment Analytics & Insights" panel with a Show More Insights toggle button and malpractice alert badges.
    • Single Top-Level Override Control: Streamlined override controls to prevent UI clutter.
    • Fixed Sidebar Scroll Layout: Constrained container bounds (h-screen overflow-hidden) so the left navigation sidebar remains stationary while only the main content pane scrolls independently.
    • Student Peer Review Hub: Submissions, review assignments interface with double-blind anonymity enforcement.
  • Security, Double-Blind Guarantees & Test Coverage:

    • Runtime sanitization ensuring author and reviewer identities are masked in double-blind mode.
    • Full Vitest suite covering assessment creation, reviewer assignment, double-blind privacy, score computation, teacher overrides, and student reviewer exclusion (PeerReviewStudentExclusion.test.ts). All 96 tests passing.

@github-actions github-actions Bot added docs Improvements or additions to documentation frontend Changes to the frontend of the project dependencies Modifications to any frontend or backend external dependencies backend labels Jul 11, 2026
@shreyasmene06
shreyasmene06 force-pushed the feat/peer-review-assessment branch from 0c29f16 to 322b0a6 Compare July 11, 2026 20:39
…ontrollers, and jobs

(cherry picked from commit cfe922b)
… workflow

(cherry picked from commit e55d6154746519723102ae7f82733989fa5b48cf)
ProgressService.stopItem calls ItemRepository.readItemById to validate
the item being submitted. readItemById only checked
video/quiz/blog/project/feedback collections, but
PeerReviewAssessmentService.create writes peer-review items into
peerReviewAssessmentCollection (alias of peer_review_assessments).
A student starting then submitting a peer-review item would hit
'Item not found' on stopItem, blocking every submission.

Add the peerReviewAssessmentCollection lookup to readItemById so it
matches the same collection that createItem routes PEER_REVIEW_ASSESSMENT
to. Tested via e2e/tests/peer-review-ui-full-flow.spec.ts.

(cherry picked from commit fe3b4f9f36ec10e2d3a2e3da2d9c726a816818b7)
9-step serial spec that drives every requirement of the peer-review
feature through a real browser, complementing the existing
peer-review-full-flow.spec.ts (which hits the API directly):

  Step 1: Teacher creates assessment via API (same path the imperative
          teacher modal uses)
  Step 2: Student 1 logs into the real browser, navigates to the
          assessment, fills label+URL, waits for the public-access
          check, submits
  Step 3: 3 other students submit via API
  Step 4: Deadline enforcement — past-deadline submit rejected
  Step 5: Teacher closes assessment — post-close blocked, assignments
          created
  Step 6: Student 1 logs into the browser, opens Peer Reviews, submits
          a rubric review
  Step 7: 3 other students submit reviews via API
  Step 8: Finalization computes finalScore per submission (trimmed-mean
          algorithm)
  Step 9: Teacher logs into the browser, performs manual score override

Test fixture seeds courseSettings (proctors disabled, linear progression
disabled), wipes stale itemsGroup so the new item is the only one, and
signs ethics consent for the UI student so the proctoring gate opens on
first load. Verifies mongo state at every step (peer_review_submissions,
peer_review_assignments, peer_review_reviews, finalScore).

9/9 passing consecutively. Total runtime ~1m 10s.

(cherry picked from commit 5c1ece668d0667e1ae996d18f9239c7f46336ae3)
@shreyasmene06
shreyasmene06 force-pushed the feat/peer-review-assessment branch from 322b0a6 to 14dfe4d Compare July 30, 2026 05:21
…ssessment

The prior-pair loader was bypassing the repo via a raw getCollection
query and a dynamic ObjectId re-import. The repo's findByAssessment
already handles ObjectId coercion correctly (the exact bug class
this code was working around), so the bypass was both redundant and
fragile. Replace with the repo call, drop the (this as any).database
cast, drop the dynamic import and its void-silencer. No behavior
change — 93/93 tests still green.
…lback picker

lastFallbackPairs was declared, never assigned, and only silenced by
the void line — pure dead code. The fallback reviewer picker built a
filtered candidate list and a Set, then ran a second loop as a
'ran-out' defensive branch that could only fire if order.length
was 1 — which the early N < 2 guard above rules out. Collapse into a
single pass. Behavior unchanged: 93/93 tests still green.
…on, teacher override display & reset

- Calculate reviewsTotal dynamically based on assigned pairs generated by small class circle algorithm
- Trigger scoreSubmission automatically when assigned reviews are completed or assessment closes
- Perform on-the-fly score calculation on teacher submission list GET endpoint
- Return effective overridden scores in listReviewsForTeacher payload
- Add clearTeacherOverride and support reset in teacherOverride endpoint and frontend UI
- Fix missing Textarea component import in teacher course page
- Add student accounts seed script and update CLAUDE.md documentation
@shreyasmene06
shreyasmene06 force-pushed the feat/peer-review-assessment branch from 4671517 to 24a80c4 Compare August 1, 2026 10:22
…ollusion malpractice tracker

- Add class average, completion rate, and malpractice alert stat cards
- Add score distribution PieChart and rubric criterion performance BarChart using recharts
- Implement reciprocal high-scoring collusion and review score discrepancy detection
- Add Flagged / Malpractice filter toggle and alert boxes for flagged submissions
…ollusion malpractice tracker

- Add class average, completion rate, and malpractice alert stat cards
- Add score distribution PieChart and rubric criterion performance BarChart using recharts
- Implement reciprocal high-scoring collusion and review score discrepancy detection
- Add Flagged / Malpractice filter toggle and alert boxes for flagged submissions
- Fix React Rule of Hooks ordering in PeerReviewSubmissionsSection
…l review flag check

- Restore handleStartOverride, handleSaveOverride, and handleResetOverride handlers in PeerReviewSubmissionsSection
- Add queryClient cache invalidation on score override save and reset
- Default teacherManualReviewEnabled config state to true
- Update override control condition to allow manual overrides when teacherManualReviewEnabled is not false
…student submissions

- Add PATCH /peer-review-assessments/submissions/:submissionId/teacher-override endpoint
- Add applyTeacherOverride and clearTeacherOverride to PeerReviewSubmissionRepository
- Update PeerReviewScoringService to respect submission-level teacherOverrideScore
- Add useTeacherOverrideSubmissionFinalScore hook to frontend
- Add overall final score override controls and inline form to student submission cards on teacher dashboard
…dent final scores

- Allow teachers to evaluate and score each rubric criterion individually when overriding a student submission final score
- Compute live overall total score from rubric criterion inputs
- Store teacherOverrideScores and finalScoreBreakdown in PeerReviewSubmissionRepository
- Update PeerReviewScoringService and PeerReviewTeacherController to calculate and return rubric breakdown
…ompatibility

- Replace hardcoded background:white inline styles with Shadcn theme classes (bg-popover, text-popover-foreground, border-border, bg-background, text-foreground, border-input)
- Ensure all text labels, headings, and input fields adapt cleanly to dark mode

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend dependencies Modifications to any frontend or backend external dependencies docs Improvements or additions to documentation frontend Changes to the frontend of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant