Skip to content

feat(CRaterRubric): add authoring and display of idea sample responses - #2371

Merged
breity merged 5 commits into
developfrom
feat/crater-rubric-sample-responses
Nov 4, 2026
Merged

breity merged 5 commits into
developfrom
feat/crater-rubric-sample-responses

Conversation

@breity

@breity breity commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Changes

  • Add sampleResponses to CRaterIdea and IdeaData.
  • Add hasSampleResponses to CRaterRubric, set to true when any idea in the rubric has at least one non-empty sample response.
  • Update EditCRaterIdeaDescriptionsComponent to allow authors to add, edit, and delete sample responses for each idea, and to initialize sample response inputs when importing a rubric via CRaterItemSelectComponent.
  • Update CRaterRubricComponent to display ideas and their sample responses in a single column ("Ideas"), with sample responses rendered directly beneath the idea text.
  • Add a "Show sample responses" / "Hide sample responses" toggle button in the CRaterRubricComponent table header when sample responses are present (hidden by default), with accessible keyboard support (Enter and Space).
  • Add and updated unit tests in CRaterRubric.spec.ts, crater-rubric.component.spec.ts, and edit-crater-idea-descriptions.component.spec.ts.

Test

  1. Authoring Tool (Open Response / Dialog Guidance with CRater):
    • Open an existing or new CRater-enabled component in the Authoring Tool.
    • Select an AI Model ID in c-rater-item-select to import a rubric and verify that each imported idea displays a Sample Response input field (or multiple fields if the imported rubric already contains sample responses).
    • Add a new Idea Description and verify that it starts with a Sample Response input field.
    • Add multiple sample responses to an idea using the + button, verify that the labels update to Sample Response #1, Sample Response #2, etc., and verify that the x delete button removes a sample response after confirmation.
  2. Classroom Monitor / Rubric Dialog:
    • Open the Idea Detection Rubric dialog for a component where no ideas have sample responses:
      • Verify the table has a single Ideas column and no toggle button appears in the header.
    • Open the Idea Detection Rubric dialog for a component where at least one idea has a non-empty sample response:
      • Verify the table has a single Ideas column and shows a "Show sample responses" button in the header row.
      • Verify sample responses start out hidden.
      • Click "Show sample responses" (or press Enter / Space while focused) and verify non-empty sample responses appear indented under their respective idea texts.
      • Verify the button text updates to "Hide sample responses" and clicking it collapses the sample responses again.

@breity breity self-assigned this Nov 3, 2026
@breity breity added enhancement New feature of any size or improvement (UI, performance, security) feature request someone requests a feature labels Nov 3, 2026
@qltysh

qltysh Bot commented Nov 3, 2026

Copy link
Copy Markdown

❌ 1 blocking issue (1 total)

Tool Category Rule Count
qlty Structure Function with many parameters (count = 6): constructor 1 ❌

text?: string,
tags?: string[],
color?: string,
sampleResponses?: string[]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 6): constructor [qlty:function-parameters]

@qltysh

qltysh Bot commented Nov 3, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (5)

RatingFile% DiffUncovered Line #s
New file Coverage rating: A
...ponents/common/cRater/crater-rubric/crater-rubric.component.ts100.0%
New file Coverage rating: A
src/assets/wise5/components/common/cRater/IdeaData.ts100.0%
New file Coverage rating: A
src/assets/wise5/components/common/cRater/CRaterIdea.ts85.7%14
New file Coverage rating: A
src/assets/wise5/components/common/cRater/CRaterRubric.ts100.0%
New file Coverage rating: D
...r-idea-descriptions/edit-crater-idea-descriptions.component.ts40.0%59-86
Total69.7%
🤖 Increase coverage with AI coding...
In the `feat/crater-rubric-sample-responses` branch, add test coverage for this new code:

- `src/assets/wise5/components/common/cRater/CRaterIdea.ts` -- Line 14
- `src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.ts` -- Line 59-86

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

github-actions Bot and others added 4 commits November 3, 2026 01:03
- Update rubric table to a single Ideas column and place sample responses below idea text
- Add toggle link in table header to show/hide sample responses (hidden by default)
- Support keyboard activation (Enter/Space) and role="button" for toggle link
- Update unit tests in crater-rubric.component.spec.ts
@breity
breity merged commit 52a016f into develop Nov 4, 2026
4 checks passed
@breity
breity deleted the feat/crater-rubric-sample-responses branch November 4, 2026 00:38
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 5.251.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature of any size or improvement (UI, performance, security) feature request someone requests a feature released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants