Rubric Grading: minor fixes, add course-wide grading prompt - #8549
Merged
Conversation
- properly duplicate sibling-answer questions if it was a text response - deep-copy active_rubric on forum post question duplication to prevent cross-course coupling - detach old v1 response selection creation on grading
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the rubric AI grading pipeline to support a course-wide grading prompt (configured in Assessment Settings) that is prepended to each rubric question’s prompt when enabled, while also addressing a couple of rubric-related duplication edge cases and cleaning up deprecated v1 rubric-selection scaffolding.
Changes:
- Add course settings (API + UI + i18n) for enabling and editing a course-wide rubric AI grading prompt, and prepend it in
Course::Rubric::RubricAdapter#grading_prompt. - Fix duplication behavior for (a) sibling-answer grading context sources that can be text-response questions, and (b) forum-post questions’
active_rubricso duplicates don’t share the source rubric. - Remove deprecated v1 rubric-selection factory/initializer paths and update specs accordingly.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/models/course/rubric/rubric_adapter_spec.rb | Adds specs covering course-wide prompt composition behavior. |
| spec/models/course/assessment/question/grading_context_spec.rb | Expands duplication coverage for sibling context sources (forum + text response). |
| spec/models/course/assessment/question/forum_post_response_spec.rb | Ensures duplicated forum questions get a duplicated active_rubric. |
| spec/factories/course_assessment_answer_rubric_based_response.rb | Removes unused v1 with_selections trait from factory. |
| spec/factories/course_assessment_answer_rubric_based_response_selection.rb | Deletes deprecated selection factory. |
| spec/controllers/course/admin/assessment_settings_controller_spec.rb | Adds controller spec ensuring course-wide prompt settings persist. |
| client/locales/en.json | Adds UI strings for rubric grading settings. |
| client/locales/ko.json | Adds UI strings for rubric grading settings (Korean). |
| client/locales/zh.json | Adds UI strings for rubric grading settings (Chinese). |
| client/app/types/course/admin/assessments.ts | Extends assessment settings types for prompt enable flag + prompt text. |
| client/app/bundles/course/admin/pages/AssessmentSettings/translations.ts | Adds message descriptors for new rubric grading settings UI. |
| client/app/bundles/course/admin/pages/AssessmentSettings/operations.ts | Sends new prompt settings fields in update payload. |
| client/app/bundles/course/admin/pages/AssessmentSettings/AssessmentSettingsForm.tsx | Adds form controls (checkbox + multiline prompt field) and validation. |
| app/views/course/admin/assessment_settings/edit.json.jbuilder | Exposes new settings in assessment settings JSON payload. |
| app/models/course/rubric/rubric_adapter.rb | Prepends optional course-wide prompt to rubric prompt when enabled. |
| app/models/course/assessment/question/text_response.rb | Ensures duplicated text responses participate in grading-context fix-up as sibling sources. |
| app/models/course/assessment/question/forum_post_response.rb | Duplicates active_rubric during question duplication to avoid sharing rubrics. |
| app/models/course/assessment/question.rb | Updates documentation for grading-context duplication responsibilities. |
| app/models/course/assessment/answer/rubric_based_response.rb | Removes v1 selection creation path; keeps deprecated association with clarification. |
| app/models/course.rb | Adds getters/setters for course-wide rubric grading prompt and enable flag in settings store. |
| app/models/concerns/course/assessment/submission/answers_concern.rb | Removes v1 selection initialization during bulk answer creation. |
| app/controllers/course/admin/assessment_settings_controller.rb | Permits new course settings parameters for rubric grading prompt. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Adds a course-wide grading prompt that course staff can set once, in the assessment settings page,
and have prepended to every rubric-graded question's own grading prompt during AI grading. Alongside
it, this branch fixes a duplication gap for rubric-graded forum questions and removes a piece of dead
v1 rubric-selection machinery from the answer-creation path.
1. Course-wide grading prompt
What it does
When enabled and non-blank, the course prompt is inserted before a question's own grading prompt
whenever a rubric-graded answer is autograded by AI. It gives staff a single place to express grading
guidance that should apply across the whole course, without editing each question.
Storage
Two settings on the assessments component (no migration — these live in the course
settingshash,like
show_stdout_and_stderrandprogramming_max_time_limit):Course#rubric_grading_prompt.presence, so blanks are never persisted.Course#rubric_grading_prompt_enabledInjection point
Course::Rubric::RubricAdapter#grading_promptprepends the course prompt (when enabled and present)before the rubric's own grading prompt, joined by a blank line; either side may be empty. Because every
grading path — real auto-grading, the apply-evaluations job, and the rubric playground / mock
evaluations — resolves its prompt through this one adapter, the course prompt applies uniformly and the
playground behaves exactly like real grading.