Skip to content

feat(Grade By Step): Summarize student work using AI#2266

Open
hirokiterashima wants to merge 17 commits intodevelopfrom
cm-component-ai-summarizer
Open

feat(Grade By Step): Summarize student work using AI#2266
hirokiterashima wants to merge 17 commits intodevelopfrom
cm-component-ai-summarizer

Conversation

@hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Feb 4, 2026

This is a new feature that uses OpenAI LLM to summarize Open Response and Discussion activities in the Teacher Tools.

Changes

For units with AI enabled (see "Test Prep" below), in the CM for any OpenResponse and Discussion items:

  • Show "Generate Student Summary" button if there is at least one response for the period selected (includes when "All Periods" is selected)
    • Clicking on the button generates summary and displays it.
      • Show spinner while waiting
      • Shows summary in the same language as the prompt
      • Show (# responses) after summary
    • Summary is saved in localStorage. Coming back to the component should re-display the summary
    • Clicking on the button again generates new summary and overwrites the existing one.
  • Show "No student responses" if there is no response for the period selected

Test Prep

  1. Test with feat(OpenAI integration): Specify chat api url WISE-API#317. Set values for openai.api.key and openai.chat.api.url.
  2. Add top-level json field in the unit to enable this feature:
{
  ...
  "ai": { "enabled": true }
  ...
}

Test

  • Changes work as described above
  • Units that don't have AI enabled do not show the summarizer

@hirokiterashima hirokiterashima self-assigned this Feb 4, 2026
@qltysh
Copy link

qltysh bot commented Feb 4, 2026

❌ 1 blocking issue (1 total)

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

@qltysh
Copy link

qltysh bot commented Feb 4, 2026

Qlty

Coverage Impact

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

Modified Files with Diff Coverage (8)

RatingFile% DiffUncovered Line #s
New file Coverage rating: F
src/app/services/chat/chat.service.ts0.0%6-31
New file Coverage rating: F
src/app/services/localStorageService.ts30.0%10-40
New file Coverage rating: A
...open-response-ai-summary/open-response-ai-summary.component.ts100.0%
New file Coverage rating: B
src/app/chatbot/chatbot.component.ts77.8%170, 178
New file Coverage rating: C
src/app/services/chat/openAiChat.service.ts100.0%
New file Coverage rating: A
...ves/teacher-summary-display/ai-summary/ai-summary.component.ts92.1%44-47
New file Coverage rating: F
...splay/discussion-ai-summary/discussion-ai-summary.component.ts41.2%20-38
New file Coverage rating: F
...torComponents/component-summary/component-summary.component.ts50.0%103
Total65.5%
🤖 Increase coverage with AI coding...

In the `cm-component-ai-summarizer` branch, add test coverage for this new code:

- `src/app/chatbot/chatbot.component.ts` -- Lines 170 and 178
- `src/app/services/chat/chat.service.ts` -- Line 6-31
- `src/app/services/localStorageService.ts` -- Line 10-40
- `src/assets/wise5/classroomMonitor/classroomMonitorComponents/component-summary/component-summary.component.ts` -- Line 103
- `src/assets/wise5/directives/teacher-summary-display/ai-summary/ai-summary.component.ts` -- Line 44-47
- `src/assets/wise5/directives/teacher-summary-display/discussion-ai-summary/discussion-ai-summary.component.ts` -- Line 20-38

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

private dataService: TeacherDataService,
private dialog: MatDialog,
private projectService: ProjectService,
private summaryService: SummaryService
Copy link

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 = 7): constructor [qlty:function-parameters]

@hirokiterashima hirokiterashima added the enhancement New feature of any size or improvement (UI, performance, security) label Mar 19, 2026
@hirokiterashima hirokiterashima marked this pull request as ready for review March 19, 2026 22:45
@hirokiterashima hirokiterashima requested a review from breity March 19, 2026 22:45
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant