Skip to content

feat(TeacherPresentation): Ideas and Discussions - #2359

Merged
hirokiterashima merged 37 commits into
developfrom
feat/teacher-presentation-ideas
Oct 20, 2026
Merged

hirokiterashima merged 37 commits into
developfrom
feat/teacher-presentation-ideas

Conversation

@hirokiterashima

@hirokiterashima hirokiterashima commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

feat: Teacher Presentation Mode for Discussion and Student Ideas

Overview

This PR introduces the Teacher Presentation classroom display feature, enabling teachers to project curated student work for whole-class discussions.

It combines the initial Teacher Presentation implementation for Discussion steps (#2351) and the Ideas Presentation extension (feat/teacher-presentation-ideas), allowing teachers to curate and present student responses from Discussion, Open Response, and Dialog Guidance steps.

Associated Backend PR: WISE-API #365


Key Features & Changes

1. Presentation Dialog & Controls (teacher-presentation-dialog)

  • Full-Screen Presentation Modal: Launches a distraction-free, projector-friendly view showing only the teacher's selected items.
  • Custom Presentation Prompt:
    • Displays a default contextual prompt (e.g., "Here are some of your classmates' posts. Pick one to discuss with your partner" or "Here are your classmates' ideas. Which ideas do you agree with or want to explore further?").
    • Teachers can edit, save (with Enter key or icon button), cancel, or reset to authoring defaults.
  • Presentation Controls Toggle: Collapsible header toolbar (tune icon button) to hide controls during presentation.
  • Student Name Display Modes: Toggle student names between Hide, Show, or Anonymize (generates consistent, colored workgroup avatar badges).
  • Activity Question Toggle: Toggle the component's original question display (show / hide) via the showComponentPrompt setting.

2. Discussion Presentation (discussion-teacher, discussion-summary)

  • Checkboxes in teacher view to select student posts and comments for presentation.
  • Real-time selection count and disabled "Present" button with informative tooltips when no items are selected.
  • Renders selected posts/comments cleanly with replies and anonymous avatars when enabled.

3. Ideas Presentation (ideas-summary, ideas-presentation)

  • Granular Selection: Checkboxes on both top-level idea categories and individual student responses in the Ideas summary table.
  • Additive & Standalone Response Handling:
    • Preserves selected student responses even if their parent category is unchecked (displayed under standalone cards).
    • Re-adopts standalone responses when the category is re-checked.
    • Snapshots student response text at selection time for instant rendering without re-querying CRater NLP or student history.
  • Projector UI (ideas-presentation): Renders idea category cards with lightbulb icons, student response counts, and expandable/scrollable responses with workgroup badges.

4. State Management Refactoring (teacher-presentation-selection.store)

  • Extracted and decoupled selection domain logic into two dedicated, pure state classes:
    • DiscussionSelectionState: Manages selected post/comment IDs (Set<number>).
    • IdeasSelectionState: Manages selected idea category IDs, nested response maps, and standalone responses.
  • TeacherPresentationSelectionStore coordinates both sub-states with Angular signals:
    • type: 'Discussion' | 'Ideas'
    • 1000ms debounced auto-saving to backend with OnDestroy lifecycle cleanup.
    • Clean backward-compatible aliases for itemType.

How to Test Manually

Test with WISE-Community/WISE-API#365

  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.

Automated Testing & Verification

  • Unit test coverage added and updated for:
    • TeacherPresentationSelectionStore (teacher-presentation-selection.store.spec.ts)
    • DiscussionSelectionState (discussion-selection-state.spec.ts)
    • IdeasSelectionState (ideas-selection-state.spec.ts)
    • TeacherPresentationDialogComponent (teacher-presentation-dialog.component.spec.ts)
    • IdeasPresentationComponent (ideas-presentation.component.spec.ts)
    • IdeasSummaryComponent (ideas-summary.component.spec.ts)
  • TypeScript compilation passed cleanly with 0 errors (npx tsc --noEmit -p src/tsconfig.spec.json && npx tsc --noEmit -p src/tsconfig.app.json).

hirokiterashima and others added 30 commits October 8, 2026 13:59
…ation button text, and update translation file
- Change show/hide controls toggle to a button toggle
- Replace student names toggle button group with a mat-select dropdown
- Convert prompt Save, Cancel, and Reset actions to inline icon buttons
- Allow saving empty presentation prompt and display placeholder when controls are visible
- Save prompt on Enter keypress in textarea
- Only show Reset button when the saved prompt differs from default
- Add and update unit tests for presentation dialog and store
- Exit edit prompt mode when hiding controls
- Save prompt on Enter key press when focused on textarea
…on-ideas

~ Conflicts:
~	src/assets/wise5/teacher-presentation/teacher-presentation-dialog.component.html
…ring logic in ideas summary component and tests
@hirokiterashima hirokiterashima changed the title Feat/teacher presentation ideas feat(TeacherPresentation): Ideas and Discussions Oct 19, 2026
@hirokiterashima hirokiterashima self-assigned this Oct 19, 2026
@hirokiterashima hirokiterashima added the enhancement New feature of any size or improvement (UI, performance, security) label Oct 19, 2026
@qltysh

qltysh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

❌ 7 blocking issues (7 total)

Tool Category Rule Count
qlty Duplication Found 23 lines of similar code in 2 locations (mass = 102) 4 ❌
qlty Structure Function with many parameters (count = 6): init 1 ❌
qlty Structure Function with high complexity (count = 22): init 1 ❌
qlty Structure Complex binary expression 1 ❌

@qltysh

qltysh Bot commented Oct 19, 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 (13)

RatingFile% DiffUncovered Line #s
New file Coverage rating: A
...her-presentation/state/teacher-presentation-selection.store.ts93.3%17, 105-106, 170-171...
New file Coverage rating: A
...wise5/teacher-presentation/state/discussion-selection-state.ts100.0%
New file Coverage rating: B
...acher-summary-display/ideas-summary/ideas-summary.component.ts85.3%42, 44, 93-94...
New file Coverage rating: F
.../discussion/discussion-teacher/discussion-teacher.component.ts14.3%18-57
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.ts72.2%75-78, 84-87...
New file Coverage rating: C
...r-presentation-button/teacher-presentation-button.component.ts79.5%29-36, 47, 67
New file Coverage rating: F
...r-presentation/services/teacher-presentation-config.service.ts58.3%11-23
New file Coverage rating: A
...sets/wise5/teacher-presentation/state/ideas-selection-state.ts100.0%
New file Coverage rating: A
...r-presentation-dialog/teacher-presentation-dialog.component.ts95.8%61, 67
New file Coverage rating: A
...resentation/ideas-presentation/ideas-presentation.component.ts97.5%37
New file Coverage rating: A
...se5/teacher-presentation/models/teacher-presentation-config.ts100.0%
New file Coverage rating: F
...ary-display/discussion-summary/discussion-summary.component.ts15.4%19-62
Total85.8%
🤖 Increase coverage with AI coding...
In the `feat/teacher-presentation-ideas` branch, add test coverage for this new code:

- `src/assets/wise5/components/discussion/class-response-teacher/class-response-teacher.component.ts` -- Lines 75-78, 84-87, 111-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/directives/teacher-summary-display/ideas-summary/ideas-summary.component.ts` -- Lines 42, 44, 93-94, 125-128, and 266-269
- `src/assets/wise5/teacher-presentation/ideas-presentation/ideas-presentation.component.ts` -- Line 37
- `src/assets/wise5/teacher-presentation/services/teacher-presentation-config.service.ts` -- Line 11-23
- `src/assets/wise5/teacher-presentation/state/teacher-presentation-selection.store.ts` -- Lines 17, 105-106, 170-171, 188, and 203
- `src/assets/wise5/teacher-presentation/teacher-presentation-button/teacher-presentation-button.component.ts` -- Lines 29-36, 47, and 67
- `src/assets/wise5/teacher-presentation/teacher-presentation-dialog/teacher-presentation-dialog.component.ts` -- Lines 61 and 67

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

breity and others added 5 commits October 19, 2026 16:37
- Arrange idea and standalone response cards in a responsive two-column layout
- Apply distinct pastel tints from branchPathBackgroundColors to each card
- Stack responses vertically inside idea cards and render standalone responses as individual cards
… into models, services, state, and component subdirectories
nodeId: string,
componentId: string,
componentType: string,
type: TeacherPresentationType

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

this.reset();
}
});
}

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 high complexity (count = 22): init [qlty:function-complexity]

this.componentType.set(componentType);
this.type.set(type);

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]

@hirokiterashima
hirokiterashima marked this pull request as ready for review October 20, 2026 19:00
@hirokiterashima
hirokiterashima merged commit 1258191 into develop Oct 20, 2026
4 checks passed
@hirokiterashima
hirokiterashima deleted the feat/teacher-presentation-ideas branch October 20, 2026 19:36
@hirokiterashima

Copy link
Copy Markdown
Member Author

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