Skip to content

feat(TeacherPresentation): Ideas and Discussions - #365

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

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

Conversation

@hirokiterashima

@hirokiterashima hirokiterashima commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Overview

This PR adds backend support and persistence for the Teacher Presentation classroom display feature (WISE-Client #2359).

It provides endpoints, domain entities, and polymorphic payload validation to persist teachers' curated presentation configurations across runs, periods, nodes, and components for both Discussion and Student Ideas (Open Response and Dialog Guidance).


Key Features & Changes

1. Database Migrations

  • V3__create_teacher_presentation_tables.sql: Creates teacher_presentation_config table with unique constraint on (runId, periodId, nodeId, componentId).

2. Domain Model (TeacherPresentationConfig.java)

  • Entity storing presentation state:
    • runId, periodId, nodeId, componentId, componentType
    • type: Discussion or Ideas (@Column(name = "\type`")`)
    • items: JSON array storing either Discussion work IDs ([{"studentWorkId": 101}]) or categorized Ideas ([{"ideaId": "...", "responses": [...]}])
    • studentNamesDisplay: show, hide, or anonymize
    • showComponentPrompt: boolean (toggle display of original question)
    • prompt: Custom presentation prompt override (nullable)
    • updatedByWorkgroup, createdAt, updatedAt

3. Service Layer (TeacherPresentationConfigService)

  • Polymorphic Validation & Normalization:
    • validateAndNormalizeDiscussionItems: Validates student work IDs against database and verifies run/period ownership.
    • validateAndNormalizeIdeasItems: Validates idea IDs (<= 100 chars), total responses (<= 500), student work ownership, and text snapshot lengths (truncated to 2,000 chars).
  • Serializes and deserializes polymorphic item payloads using Jackson TypeReference.

4. REST Controller (TeacherPresentationConfigAPIController)

  • GET /api/teacher/presentation-config: Retrieves existing configuration for a period component, or returns sensible defaults if unconfigured.
  • PUT /api/teacher/presentation-config: Saves updated presentation settings.
  • Enforces teacher permissions (isAllowedToViewStudentWork, isAllowedToGradeStudentWork).
  • Records: ConfigRequest and ConfigResponse typed with String type.

Testing & Verification

  • Manual test with feat(TeacherPresentation): Ideas and Discussions WISE-Client#2359. See testing instructions there.
  • Database migration should occur automatically (via Flyway) when you restart WISE-API.
  • Unit tests added and updated:
    • TeacherPresentationConfigAPIControllerTest: Covers authorization, validation, Discussion payloads, Ideas payloads, default fallbacks, and error scenarios.
    • TeacherPresentationConfigServiceImplTest: Covers item limits, prompt length validation, student work run/period checks, and Ideas response normalization.
    • HibernateTeacherPresentationConfigDaoTest: Verifies DB query semantics and constraints.
  • Maven build and test-compile passed cleanly with zero errors (mvn clean compile test-compile).

@hirokiterashima
hirokiterashima marked this pull request as ready for review October 20, 2026 18:58
@hirokiterashima
hirokiterashima merged commit 166b492 into develop Oct 20, 2026
2 checks passed
@hirokiterashima
hirokiterashima deleted the feat/teacher-presentation-ideas branch October 20, 2026 19:35
@hirokiterashima

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.27.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 or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants