Skip to content

feat(TeacherPresentation): Classroom Presentation view for Discussion student work - #2351

Open
hirokiterashima wants to merge 12 commits into
developfrom
feat/teacher-presentation
Open

hirokiterashima wants to merge 12 commits into
developfrom
feat/teacher-presentation

Conversation

@hirokiterashima

@hirokiterashima hirokiterashima commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Notes

Please style as you see fit

Summary

Introduces the TeacherPresentation feature in the grading tool summary display. Teachers can select student work items (posts and comments) via checkboxes, customize student name display modes, edit the classroom prompt, and launch a dedicated presentation dialog designed to be projected on a classroom display.

Selection rules and store management are fully decoupled from discussion-specific hierarchies to support future component types. Authoring support is provided under content.teacher.presentation.prompt.

Changes

1. Presentation Dialog & Presentation Mode

  • TeacherPresentationDialogComponent: Fullscreen modal dialog styled for classroom projectors.
    • Header displays unit and step titles, selected period name, student names display toggle (show, hide, anonymize), a refresh button, and an editable classroom prompt (with pencil icon).
    • Renders the component in presentation mode (mode="presentation").
    • Default prompt is sourced from content.teacher.presentation.prompt (with fallback to default localized prompt).
  • TeacherPresentationButtonComponent: "Present" button located on the summary display header.
    • Enabled only when a specific single period is chosen and at least one item is selected.
    • Shows tooltip explaining requirements when disabled.

2. State Management & Debounced Autosave

  • TeacherPresentationSelectionStore:
    • Component-agnostic selection store managing selected student work IDs (selectedIds: Set<number>), studentNamesDisplay, and custom prompt.
    • Generic selection API: isSelected(), select(), deselect(), toggle(), selectMultiple(), deselectMultiple(), setSelections(), and clearSelections().
    • Debounced 1-second autosave to the backend (TeacherPresentationConfigService). Prompt changes persist immediately.

3. Discussion Component Integration & Hierarchical Selection

  • ClassResponseTeacherComponent:
    • Implements discussion-specific selection logic:
      • Checking a reply automatically selects both the reply and its parent post.
      • Parent post checkbox is disabled/locked whenever any of its child replies are selected.
      • Unchecking a parent post deselects both the parent and all child replies.
      • Unchecking a reply deselects only that reply (parent remains selected).
    • Checkboxes appear in summary display mode and are hidden in presentation view.
  • DiscussionTeacherComponent: Filters responses to display only teacher-selected posts and comments when in presentation mode.

4. Authoring Tool

  • In ComponentContent.ts, added teacher?: { presentation?: { prompt?: string } }.
  • In DiscussionAuthoringComponent, added authoring input for default presentation prompt under a "Classroom Presentation Settings" expansion panel.

5. Summary Display

  • DiscussionSummaryComponent:
    • Extracted inline template to discussion-summary.component.html.
    • Embeds teacher-presentation-button in the summary header.
    • Binds TeacherPresentationSelectionStore across periods and component changes.

How to Test

Test with WISE-Community/WISE-API#362

  1. Authoring Tool:
    • Open or create a Discussion component in the Authoring Tool.
    • Configure a default presentation prompt and reflection questions in the Presentation section.
  2. Classroom Monitor / Teacher Summary:
    • Navigate to the Discussion step summary in the Classroom Monitor.
    • Verify the "Present Student Work" button is disabled until at least one post or comment is selected, showing a helper tooltip on hover.
    • Select one or more posts and/or replies. Verify selecting a comment keeps the parent selected, and deselecting a parent unchecks comments.
    • Enter answers into the Teacher Reflection expansion panel.
  3. Classroom Presentation View:
    • Click "Present Student Work" to open the modal.
    • Toggle between Hide Names, Anonymize Names, and Show Names and verify author headers update accordingly.
    • Edit and save a custom presentation prompt, or click Reset to default.
    • Toggle presentation controls visibility via "Hide Controls" / "Show Controls".
    • Refresh or reopen the dialog for the same period and ensure selected items and custom prompt persist.

@hirokiterashima hirokiterashima changed the title feat(teacher-presentation): Classroom Presentation view for Discussion student work feat(TeacherPresentation): Classroom Presentation view for Discussion student work Oct 9, 2026
@qltysh

qltysh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

❌ 2 blocking issues (2 total)

Tool Category Rule Count
qlty Structure Complex binary expression 2 ❌


private initPresentationStore(): void {
const runId = this.configService.getRunId();
if (runId && this.periodId != null && this.periodId !== -1 && this.nodeId && this.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]

Comment thread src/assets/wise5/teacher-presentation/teacher-presentation-selection.store.ts Outdated
this.componentType.set(componentType);
this.reflectionQuestions.set(reflectionQuestions);

if (runId && periodId && 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]

@qltysh

qltysh Bot commented Oct 9, 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 (8)

RatingFile% DiffUncovered Line #s
New file Coverage rating: F
.../discussion/discussion-teacher/discussion-teacher.component.ts14.3%18-57
New file Coverage rating: A
...5/teacher-presentation/teacher-presentation-selection.store.ts95.7%53, 127-128, 157
New file Coverage rating: A
.../teacher-presentation/teacher-presentation-dialog.component.ts93.8%45, 61
New file Coverage rating: C
.../teacher-presentation/teacher-presentation-button.component.ts78.4%29-36, 47, 64
New file Coverage rating: F
...cussion/discussion-authoring/discussion-authoring.component.ts60.0%27-28
New file Coverage rating: C
...ion/class-response-teacher/class-response-teacher.component.ts64.3%84-87, 95, 108-114, 118
New file Coverage rating: F
...e5/teacher-presentation/teacher-presentation-config.service.ts58.3%11-23
New file Coverage rating: F
...ary-display/discussion-summary/discussion-summary.component.ts15.4%19-62
Total75.3%
🤖 Increase coverage with AI coding...
In the `feat/teacher-presentation` branch, add test coverage for this new code:

- `src/assets/wise5/components/discussion/class-response-teacher/class-response-teacher.component.ts` -- Lines 84-87, 95, 108-114, and 118
- `src/assets/wise5/components/discussion/discussion-authoring/discussion-authoring.component.ts` -- Line 27-28
- `src/assets/wise5/components/discussion/discussion-teacher/discussion-teacher.component.ts` -- Line 18-57
- `src/assets/wise5/directives/teacher-summary-display/discussion-summary/discussion-summary.component.ts` -- Line 19-62
- `src/assets/wise5/teacher-presentation/teacher-presentation-button.component.ts` -- Lines 29-36, 47, and 64
- `src/assets/wise5/teacher-presentation/teacher-presentation-config.service.ts` -- Line 11-23
- `src/assets/wise5/teacher-presentation/teacher-presentation-dialog.component.ts` -- Lines 45 and 61
- `src/assets/wise5/teacher-presentation/teacher-presentation-selection.store.ts` -- Lines 53, 127-128, and 157

🚦 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 self-assigned this Oct 9, 2026
@hirokiterashima hirokiterashima added the enhancement New feature of any size or improvement (UI, performance, security) label Oct 9, 2026
@hirokiterashima
hirokiterashima requested a review from breity October 9, 2026 00:39
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