Skip to content

Assessment: Show completion and results diagrams on evaluation overview pages#1913

Merged
rappm merged 4 commits into
mainfrom
feat/868-evaluation-diagrams
Jul 15, 2026
Merged

Assessment: Show completion and results diagrams on evaluation overview pages#1913
rappm merged 4 commits into
mainfrom
feat/868-evaluation-diagrams

Conversation

@rappm

@rappm rappm commented Jul 12, 2026

Copy link
Copy Markdown
Member

📝 Pull Request Template

Use this template to provide all necessary information for reviewing and testing your changes. closes #755

✨ What is the change?

Adds assessment-style diagrams to the top of the three lecturer evaluation overview pages (Tutor Overview, Self Evaluations, Peer Evaluations):

  • Completion status — the same completion pie chart (AssessmentDiagram) used on the Assessment Participants page, fed each page's AssessmentType-filtered EvaluationCompletion[].
  • Results distribution — the score-level distribution bar chart (ScoreLevelDistributionDiagram) used on the Assessment Statistics page, fed a per-participant aggregate score level computed from all evaluations of that type.

The per-participant aggregate reuses the existing bulk endpoint GET /course_phase/{id}/evaluation (getAllEvaluationsByPhase) via a new getAllEvaluations query/useGetAllEvaluations hook, and a getScoreLevelsFromEvaluations util that groups evaluations by target participant and averages their score levels with the shared mapScoreLevelToNumber / mapNumberToScoreLevel helpers. AssessmentDiagram and ScoreLevelDistributionDiagram were minimally generalized (broadened participations to a structural shape; AssessmentDiagram gained TUTOR labels; ScoreLevelDistributionDiagram gained optional title/description) rather than duplicated. Existing callers are unchanged.

📌 Reason for the change / Link to issue

Closes #868 and #755. The evaluation overview pages showed only tables; lecturers had no at-a-glance view of completion and results. Grade-distribution diagrams are intentionally omitted for evaluations because evaluations have no grade suggestion (that is assessment-only).

🧪 How to Test

  1. Open an assessment phase with self/peer/tutor evaluations enabled and some submitted evaluations.
  2. Go to the Tutor Overview, Self Evaluations, and Peer Evaluations pages.
  3. Each page shows a completion-status pie and a score-level distribution bar chart above the table.
  4. cd clients/assessment_component && npx tsc --noEmit -p tsconfig.json and npx biome check on the changed files pass.

🖼️ Screenshots (if UI changes are included)

Before After
before after

✅ PR Checklist

  • Tested locally or on the dev environment
  • Code is clean, readable, and documented
  • Tests added or updated (if needed)
  • Screenshots attached for UI changes (if any)
  • Documentation updated (if relevant)

Summary by CodeRabbit

  • New Features
    • Added evaluation analytics diagrams to participant and tutor overview pages.
    • Displayed assessment completion and score-level distributions, including tutor-specific evaluations.
    • Added automatic score-level calculations from evaluation data.
    • Added responsive visualization labels and descriptions for different evaluation types.
  • Bug Fixes
    • Improved evaluation data loading based on the selected course phase.

@rappm rappm requested a review from a team July 12, 2026 14:11
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Evaluation analytics

Layer / File(s) Summary
Evaluation data retrieval and score aggregation
clients/assessment_component/src/assessment/network/queries/getAllEvaluations.ts, clients/assessment_component/src/assessment/pages/hooks/useGetAllEvaluations.ts, clients/assessment_component/src/assessment/pages/utils/getScoreLevelsFromEvaluations.ts
Adds phase-scoped evaluation fetching and per-participant average score-level derivation.
Reusable analytics diagram contracts
clients/assessment_component/src/assessment/pages/components/diagrams/*
Narrows participation props, adds tutor labeling, and supports configurable distribution titles and descriptions.
Participant evaluation analytics
clients/assessment_component/src/assessment/pages/EvaluationParticipantResultsPage/EvaluationParticipantsOverviewPage.tsx
Adds self/peer assessment and score distribution diagrams using fetched evaluations and derived score levels.
Tutor evaluation analytics
clients/assessment_component/src/assessment/pages/TutorOverviewPage/TutorOverviewPage.tsx
Fetches phase-scoped tutor completions, derives tutor score data, and renders tutor analytics diagrams.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TutorOverviewPage
  participant useGetAllEvaluations
  participant AssessmentAPI
  participant getScoreLevelsFromEvaluations
  participant AnalyticsDiagrams
  TutorOverviewPage->>useGetAllEvaluations: load evaluations for phaseId
  useGetAllEvaluations->>AssessmentAPI: request phase evaluations
  AssessmentAPI-->>useGetAllEvaluations: return Evaluation[]
  TutorOverviewPage->>getScoreLevelsFromEvaluations: compute tutor score levels
  TutorOverviewPage->>AnalyticsDiagrams: render participations, completions, and score levels
Loading

Possibly related PRs

Suggested reviewers: mtze, mathildeshagl

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: adding completion and results diagrams to evaluation overview pages.
Description check ✅ Passed The PR follows the template with change, reason, testing, screenshots, and checklist sections filled in.
Linked Issues check ✅ Passed The changes add the requested diagrams to the evaluation overview pages and the supporting evaluation-statistics data flow.
Out of Scope Changes check ✅ Passed All file changes support the new overview-page diagrams or their shared data/utilities; no unrelated changes stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/868-evaluation-diagrams

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rappm rappm changed the title Assessment: Show assessment diagrams on evaluation overview pages Assessment: Show completion and results diagrams on evaluation overview pages Jul 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
clients/assessment_component/src/assessment/pages/components/diagrams/AssessmentDiagram.tsx (1)

34-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Decouple completions type from CompetencyScoreCompletion.

Since participations was broadened to an inline generic type and this component is now used with EvaluationCompletion data, completions should also be broadened. This avoids type mismatches and decouples the component from specific domain interfaces.

♻️ Proposed refactor
   participations: Array<{ courseParticipationID: string }>
   scoreLevels: ScoreLevelWithParticipation[]
-  completions: CompetencyScoreCompletion[]
+  completions: Array<{ courseParticipationID: string; completed?: boolean }>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@clients/assessment_component/src/assessment/pages/components/diagrams/AssessmentDiagram.tsx`
around lines 34 - 36, Update the AssessmentDiagram component’s completions prop
type to use an inline generic shape containing only the fields this component
consumes, rather than CompetencyScoreCompletion. Ensure it accepts
EvaluationCompletion data while preserving the existing completion-handling
behavior and remove the unnecessary domain-interface coupling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@clients/assessment_component/src/assessment/pages/TutorOverviewPage/TutorOverviewPage.tsx`:
- Around line 31-34: Update the useQuery call in TutorOverviewPage to add
enabled: !!phaseId, preventing requests when phaseId is unavailable. Define a
stable module-level empty completions constant typed as EvaluationCompletion[]
and use it instead of the inline [] data fallback, adding the required
EvaluationCompletion import so tutorEvaluationCompletions retains memoization.

---

Nitpick comments:
In
`@clients/assessment_component/src/assessment/pages/components/diagrams/AssessmentDiagram.tsx`:
- Around line 34-36: Update the AssessmentDiagram component’s completions prop
type to use an inline generic shape containing only the fields this component
consumes, rather than CompetencyScoreCompletion. Ensure it accepts
EvaluationCompletion data while preserving the existing completion-handling
behavior and remove the unnecessary domain-interface coupling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74eb3d29-255e-457f-aed1-33e9c6393b3d

📥 Commits

Reviewing files that changed from the base of the PR and between 1691405 and 3139ab2.

📒 Files selected for processing (7)
  • clients/assessment_component/src/assessment/network/queries/getAllEvaluations.ts
  • clients/assessment_component/src/assessment/pages/EvaluationParticipantResultsPage/EvaluationParticipantsOverviewPage.tsx
  • clients/assessment_component/src/assessment/pages/TutorOverviewPage/TutorOverviewPage.tsx
  • clients/assessment_component/src/assessment/pages/components/diagrams/AssessmentDiagram.tsx
  • clients/assessment_component/src/assessment/pages/components/diagrams/ScoreLevelDistributionDiagram.tsx
  • clients/assessment_component/src/assessment/pages/hooks/useGetAllEvaluations.ts
  • clients/assessment_component/src/assessment/pages/utils/getScoreLevelsFromEvaluations.ts

@rappm rappm added the schau mi o Translation: Ready to review label Jul 15, 2026
@rappm rappm merged commit c316ae6 into main Jul 15, 2026
81 of 82 checks passed
@rappm rappm deleted the feat/868-evaluation-diagrams branch July 15, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

schau mi o Translation: Ready to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Diagrams to Tutor Evaluation Overview Evaluation Statistics

2 participants