Skip to content

Rubric Grading: minor fixes, add course-wide grading prompt - #8549

Merged
adi-herwana-nus merged 2 commits into
masterfrom
adi/rubric-grading-coursewide-prompt
Aug 15, 2026
Merged

Rubric Grading: minor fixes, add course-wide grading prompt#8549
adi-herwana-nus merged 2 commits into
masterfrom
adi/rubric-grading-coursewide-prompt

Conversation

@adi-herwana-nus

@adi-herwana-nus adi-herwana-nus commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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 settings hash,
like show_stdout_and_stderr and programming_max_time_limit):

Accessor Purpose
Course#rubric_grading_prompt The prompt text. Setter stores .presence, so blanks are never persisted.
Course#rubric_grading_prompt_enabled Whether the prompt is applied. Independent of the text, so toggling off preserves it for later.

Injection point

Course::Rubric::RubricAdapter#grading_prompt prepends 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.

Screenshot 2026-08-15 at 07 47 31 Screenshot 2026-08-15 at 07 47 55

- 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

Copilot AI 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.

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_rubric so 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.

@adi-herwana-nus
adi-herwana-nus merged commit d8c7170 into master Aug 15, 2026
12 checks passed
@adi-herwana-nus
adi-herwana-nus deleted the adi/rubric-grading-coursewide-prompt branch August 15, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants