Rubric Grading: context UI improvements and minor fixes#8490
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the rubric grading playground and grading-context UX by introducing dedicated mock-answer management (including renameable mock answers), adding a read-only “view answer” flow that resolves grading contexts against a submission, and fixing/covering grading-context duplication semantics when duplicating questions. It also adds a migration + schema changes for rubric answer-evaluation feedback ratings and updates related translations/UI polish.
Changes:
- Add renameable, editable mock answers with full CRUD support (API, controller, serializers, reducer/types) and new playground prompts for create/edit + view-answer.
- Add an endpoint + client wiring to fetch grading contexts resolved for a specific real answer’s submission.
- Fix grading-context duplication behavior for rubric-gradable questions and expand specs/docs/migration/schema for related rubric grading enhancements.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/models/course/assessment/question/grading_context_spec.rb | Adds duplication specs for grading-context copying and source re-pointing. |
| spec/controllers/course/assessment/rubrics_controller_spec.rb | Adds controller coverage for deleting mock-answer evaluations and resolving answer contexts. |
| spec/controllers/course/assessment/mock_answers_controller_spec.rb | New specs covering mock answer create/update/destroy/index JSON behavior. |
| docs/rubric_ai_feedback_rating_plan.md | Design plan for rating LLM-generated rubric feedback (new table + lifecycle). |
| docs/mock_answer_management_prompt_plan.md | Design plan for dedicated mock-answer prompt and renameable mock answers. |
| db/schema.rb | Updates schema for mock answer name and new ratings table + FKs/indexes. |
| db/migrate/20260701100000_create_rubric_evaluation_rating_table.rb | Creates course_rubric_answer_evaluation_ratings and adds mock-answer name column. |
| config/routes.rb | Adds answer grading-contexts route and enables mock_answers update. |
| client/tailwind.config.ts | Adds .field-sizing-content utility used by new prompt textarea sizing. |
| client/locales/zh.json | Updates/adds rubric-playground strings (labels, prompts, context headings). |
| client/locales/ko.json | Updates/adds rubric-playground strings (labels, prompts, context headings). |
| client/locales/en.json | Updates/adds rubric-playground strings (labels, prompts, context headings). |
| client/app/types/course/rubrics.ts | Adds RubricMockAnswerData + grading-context join-row typing. |
| client/app/bundles/course/assessment/translations.ts | Improves grading-context hint copy for clarity. |
| client/app/bundles/course/assessment/submission/containers/RubricModerationRow.tsx | Makes moderation field tolerate intermediate numeric inputs (e.g. “-”, “1.”). |
| client/app/bundles/course/assessment/submission/containers/QuestionGrade.tsx | Adjusts reevaluate button visibility logic for rubric/AI grading UI. |
| client/app/bundles/course/assessment/question/rubric-playground/ViewAnswerPrompt.tsx | New read-only prompt to view a real answer + resolved grading-context content. |
| client/app/bundles/course/assessment/question/rubric-playground/translations.ts | Adds/updates playground translation keys for new prompts/actions and rubric info copy. |
| client/app/bundles/course/assessment/question/rubric-playground/RubricPlaygroundPage.tsx | Wires new MockAnswerPrompt and ViewAnswerPrompt with shared page state. |
| client/app/bundles/course/assessment/question/rubric-playground/RubricHeader/index.tsx | Uses translations for active/inactive rubric info alert text. |
| client/app/bundles/course/assessment/question/rubric-playground/operations/mockAnswers.ts | Adds update path and returns full mock-answer payloads from API. |
| client/app/bundles/course/assessment/question/rubric-playground/operations/answers.ts | Adds fetchAnswerGradingContexts operation for resolved contexts. |
| client/app/bundles/course/assessment/question/rubric-playground/MockAnswerPrompt.tsx | New create/edit prompt for mock answers + per-context content editing. |
| client/app/bundles/course/assessment/question/rubric-playground/ContextHeading.tsx | New shared context heading renderer for mock/view prompts. |
| client/app/bundles/course/assessment/question/rubric-playground/AnswerEvaluationsTableHeader.tsx | Removes custom-answer flow from add-answers prompt; adds “Add Mock Answer” button. |
| client/app/bundles/course/assessment/question/rubric-playground/AnswerEvaluationsTable/index.tsx | Adds view/edit action buttons and improves layout for answer rows. |
| client/app/bundles/course/assessment/question/rubric-playground/AddAnswersPrompt.tsx | Simplifies prompt to “specific answers” / “random student” + shared “current only” toggle. |
| client/app/bundles/course/assessment/question/rubric-based-responses/components/AIGradingFields.tsx | Removes unused useParams usage. |
| client/app/bundles/course/assessment/question/reducers/rubrics.ts | Stores mock answers as RubricMockAnswerData and adds update action. |
| client/app/api/course/Assessment/Question/Rubrics.ts | Adds answerGradingContexts API method. |
| client/app/api/course/Assessment/Question/MockAnswers.ts | Adds typed payload builder and PATCH update API for mock answers. |
| app/views/course/assessment/rubrics/answer_grading_contexts.json.jbuilder | New JSON view for resolved grading contexts per answer. |
| app/views/course/assessment/mock_answers/show.json.jbuilder | New show view rendering the mock answer partial. |
| app/views/course/assessment/mock_answers/index.json.jbuilder | Switches index to render shared partial with preloaded grading contexts. |
| app/views/course/assessment/mock_answers/_mock_answer.json.jbuilder | New partial serializing mock answer + per-context join rows. |
| app/models/course/assessment/question/rubric_based_response.rb | Ensures grading contexts duplicate for rubric-based response questions. |
| app/models/course/assessment/question/grading_context.rb | Adds duplication hook to re-point consumer/source linkages. |
| app/models/course/assessment/question/forum_post_response.rb | Ensures grading contexts duplicate for forum-post response questions. |
| app/models/course/assessment/question.rb | Adds helper to duplicate contexts and fix up source links regardless of duplication order. |
| app/controllers/course/assessment/rubrics_controller.rb | Adds answer_grading_contexts and keeps mock answers when dismissing evaluations. |
| app/controllers/course/assessment/mock_answers_controller.rb | Adds update/destroy and returns full mock-answer payload on create/update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adi-herwana-nus
force-pushed
the
adi/rubric-grading-context-ui-updates
branch
from
July 20, 2026 11:23
bff1382 to
3f4b8dd
Compare
…ng context - add name column to mock_answers table - add update route to mock_answers - refactor out mock answer + context config into a separate prompt
- implemented missing destroy route for mock answers - fixed duplicate "Re-evaluate Answer" button rendering for rubric forum posts - fixed handling of negative moderation values in RubricPanel grading view - fixed duplication behavior for grading context links - fixed unused variable nags in AIGradingFields
…ui overhaul - add route to fetch all grading contexts for a given answer - wording pass - rework add existing answers prompt - make table row top-aligned
adi-herwana-nus
force-pushed
the
adi/rubric-grading-context-ui-updates
branch
from
July 20, 2026 11:59
3f4b8dd to
9e4e75b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration contains database changes for adding ratings to AI generated replies (coming in next PR).