Skip to content

feat(Grading Tool): Teacher Reflection Questions - #2352

Merged
hirokiterashima merged 20 commits into
developfrom
feat/teacher-reflection-questions
Oct 14, 2026
Merged

hirokiterashima merged 20 commits into
developfrom
feat/teacher-reflection-questions

Conversation

@hirokiterashima

@hirokiterashima hirokiterashima commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Description

Introduces support for Teacher Reflection Questions, enabling curriculum authors to author reflection prompts on components and allowing teachers to view and record reflection responses during classroom runs in the grading tool.


Changes

1. Authoring Tool (src/app/authoring-tool/)

  • New Component EditComponentTeacherReflectionsComponent:
    • Allows authors to view, add, edit, and delete reflection questions attached to a component.
    • Added a confirmation prompt dialog when deleting a reflection question to prevent accidental data loss.
    • Added instructional description text and placeholder prompts for author clarity.
  • Advanced Authoring Integration:
    • Exported EditComponentTeacherReflectionsComponent via EditComponentAdvancedSharedModule.
    • Added the Teacher Reflection Questions section under the Advanced > General authoring view across components (Open Response, Multiple Choice, Table, Match, Draw, HTML, AI Chat, Concept Map, Discussion, etc.).

2. Runtime & VLE (src/assets/wise5/teacher-reflection/ & src/app/vle/)

  • New Component TeacherReflectionComponent:
    • Renders reflection questions in an expansion panel (expanded by default).
    • Built with modern Angular conventions: signal-based inputs (input()), state signals (signal()), and ChangeDetectionStrategy.OnPush.
    • Automatically saves teacher answers with debouncing and includes workgroupId.
    • Shows visual save status feedback via NotificationService ("Saving...", "Saved").
  • New Service TeacherReflectionService:
    • Manages HTTP requests for retrieving and saving teacher reflection answers for given runs and components.
  • Model & Type Definitions:
    • Created TeacherReflectionQuestion and TeacherReflectionAnswer models in teacher-reflection.model.ts.
    • Added optional teacherReflectionQuestions?: TeacherReflectionQuestion[] to ComponentContent.ts.
  • Component Summary Integration:
    • Integrated TeacherReflectionComponent into ComponentSummaryComponent to display reflection questions/answers when viewing student/class work.
    • Excluded from discussion summary display where not applicable.

3. Tests

  • Added unit tests for TeacherReflectionService (teacher-reflection.service.spec.ts).
  • Added unit tests for TeacherReflectionComponent (teacher-reflection.component.spec.ts), including mocked NotificationService.
  • Added unit tests for EditComponentTeacherReflectionsComponent (edit-component-teacher-reflections.component.spec.ts), verifying add, edit, and delete-confirmation workflows.

Test

Note: test with WISE-Community/WISE-API#364

Manual Verification

1. Authoring Tool (Authoring Reflection Questions)

  • Open a project in the Authoring Tool and navigate to any component editor (e.g., Open Response, Dialog Guidance, Multiple Choice, Table, HTML).
  • Switch to the Advanced > General tab and locate the Teacher Reflection Questions section.
  • Verify the section displays instructional description text and default prompts.
  • Click Add Question and enter text in the prompt field.
  • Click the Delete button on a question:
    • Verify a confirmation modal prompt appears asking to confirm deletion.
    • Cancel the prompt and confirm the question is not deleted.
    • Confirm deletion and verify the question is removed.
  • Save the project and reload the authoring tool to verify questions persist.

2. Teacher View / Component Summary

  • Launch a classroom run for the authored project as a teacher.
  • Navigate to a step with authored teacher reflection questions in the Component Summary view.
  • Verify the Teacher Reflection panel is:
    • Visible and expanded by default.
    • Displays the authored prompt(s) and instructions.
  • Enter an answer into the reflection text area:
    • Verify the debounced save notification displays ("Saving..." followed by "Saved").
    • Inspect the network request to verify the POST payload includes runId, componentId, workgroupId, and answer content.
  • Refresh the page and confirm the saved reflection answer is retrieved and displayed.
  • Navigate to the Open Response Summary (if applicable) and confirm teacher reflection is excluded from display where not intended.

Automated Tests

Run the unit test suite for the new components and service:

npm run test -- --include="src/assets/wise5/teacher-reflection/**/*.spec.ts"
npm run test -- --include="src/app/authoring-tool/edit-component-teacher-reflections/**/*.spec.ts"

@qltysh

qltysh Bot commented Oct 12, 2026

Copy link
Copy Markdown

❌ 2 blocking issues (2 total)

Tool Category Rule Count
qlty Structure Complex binary expression 2 ❌

const periodId = this.periodId();
const nodeId = this.nodeId();
const componentId = this.componentId();
if (!runId || periodId == null || periodId === -1 || !nodeId || !componentId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Complex binary expression [qlty:boolean-logic]


const req = httpMock.expectOne(
(r) =>
r.url === '/api/teacher/reflection' &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Complex binary expression [qlty:boolean-logic]

@hirokiterashima hirokiterashima changed the title Feat/teacher reflection questions feat(Grading Tool): Teacher Reflection Questions Oct 12, 2026
@hirokiterashima hirokiterashima self-assigned this Oct 12, 2026
@hirokiterashima hirokiterashima added the enhancement New feature of any size or improvement (UI, performance, security) label Oct 12, 2026
@qltysh

qltysh Bot commented Oct 12, 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 (4)

RatingFile% DiffUncovered Line #s
New file Coverage rating: A
src/assets/wise5/teacher-reflection/teacher-reflection.service.ts100.0%
New file Coverage rating: A
...er-reflections/edit-component-teacher-reflections.component.ts100.0%
New file Coverage rating: A
...ssets/wise5/teacher-reflection/teacher-reflection.component.ts92.3%46, 79, 88, 107
New file Coverage rating: F
...torComponents/component-summary/component-summary.component.ts100.0%
Total95.6%
🤖 Increase coverage with AI coding...
In the `feat/teacher-reflection-questions` branch, add test coverage for this new code:

- `src/assets/wise5/teacher-reflection/teacher-reflection.component.ts` -- Lines 46, 79, 88, and 107

🚦 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.

@hirokiterashima
hirokiterashima force-pushed the feat/teacher-reflection-questions branch from 3813bbf to 183bf1a Compare October 12, 2026 22:27

@breity breity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hirokiterashima
hirokiterashima merged commit 2966fbb into develop Oct 14, 2026
4 checks passed
@hirokiterashima
hirokiterashima deleted the feat/teacher-reflection-questions branch October 14, 2026 21:10
@hirokiterashima

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 5.244.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) released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants