Add AI comment selection, LLM feedback, and usage stats dashboard#3662
Add AI comment selection, LLM feedback, and usage stats dashboard#3662tzj04 wants to merge 54 commits intosource-academy:masterfrom
Conversation
… into feature-ai-comments
…c and save guards
Pull Request Test Coverage Report for Build 23139665438Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR introduces AI-assisted grading UX for selecting/editing generated comments, adds an in-grading LLM feedback submission dialog, and adds a ground-control UI for monitoring LLM usage statistics and feedback.
Changes:
- Adds selectable AI comment suggestions in grading, with persistence of chosen indices + edited text.
- Adds LLM feedback submission UI in grading and new request handlers/typings for LLM stats + feedback.
- Adds a ground control “LLM statistics” cell and drill-down dialog for assessment/task usage + feedback.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/GradingCommentSelector.module.scss | Adds styles for selectable comment rows, edit/diff preview styling, and selected state. |
| src/pages/academy/groundControl/subcomponents/LLMStatsDialog.tsx | New dialog to display assessment/task LLM usage stats and feedback lists. |
| src/pages/academy/groundControl/subcomponents/GroundControlLLMStatsCell.tsx | New control cell to open the LLM stats dialog when LLM grading is enabled. |
| src/pages/academy/groundControl/GroundControl.tsx | Wires the new LLM stats cell into the ground control row actions. |
| src/pages/academy/grading/subcomponents/LLMFeedbackButton.tsx | New dialog/button for graders to submit rating + feedback on LLM comments. |
| src/pages/academy/grading/subcomponents/GradingWorkspace.tsx | Passes assessmentId down to the grading editor to support feedback submission. |
| src/pages/academy/grading/subcomponents/GradingEditor.tsx | Major refactor: selection-by-index, editor synchronization via internal markers, save guards, and feedback button integration. |
| src/pages/academy/grading/subcomponents/GradingCommentSelector.tsx | Updates selector UI to checkbox-based selection and selected-row styling. |
| src/commons/sagas/RequestsSaga.ts | Adds request helpers for saving chosen comments + fetching/submitting LLM stats/feedback; replaces prior save-final-comment API call. |
| src/commons/assessment/AssessmentTypes.ts | Extends AssessmentOverview with isLlmGraded for conditional LLM stats UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…screen-reader friendly
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements LLM usage tracking and AI-assisted grading, adding a course-wide statistics dashboard, configurable token costs, and an updated grading editor for selecting and editing AI-generated comments. Key feedback includes addressing potential CSV corruption in report downloads due to missing field escaping, refactoring the fragile use of invisible Unicode delimiters for parsing comment strings in the editor, and improving the robustness of request ID generation currently relying on non-unique timestamps.
…nto feature-ai-comments
…and rollback AI comment selections when save-and-continue grading save fails
Summary
This PR adds AI-assisted grading comment UX, LLM feedback submission, and ground-control LLM usage monitoring UI.
What Changed
Frontend Scope
src/pages/academy/grading/subcomponents/GradingEditor.tsxsrc/pages/academy/grading/subcomponents/GradingCommentSelector.tsxsrc/pages/academy/grading/subcomponents/GradingWorkspace.tsxsrc/pages/academy/grading/subcomponents/LLMFeedbackButton.tsxsrc/commons/sagas/RequestsSaga.tssrc/commons/assessment/AssessmentTypes.tssrc/pages/academy/groundControl/GroundControl.tsxsrc/pages/academy/groundControl/subcomponents/GroundControlLLMStatsCell.tsxsrc/pages/academy/groundControl/subcomponents/LLMStatsDialog.tsxsrc/styles/GradingCommentSelector.module.scss