Skip to content

feat(inVideoQuiz): allow multiple in-video quiz problems at the same timestamp - #104

Merged
abhalsod-sonata merged 2 commits into
release-ulmofrom
feat/LP-242
Jun 23, 2026
Merged

feat(inVideoQuiz): allow multiple in-video quiz problems at the same timestamp#104
abhalsod-sonata merged 2 commits into
release-ulmofrom
feat/LP-242

Conversation

@abhalsod-sonata

@abhalsod-sonata abhalsod-sonata commented Jun 19, 2026

Copy link
Copy Markdown
  • Removed duplicate timestamp validation from InVideoQuizEditor, allowing multiple problems to share the same timestamp.
  • Updated quiz item handling in the Redux thunk actions to support expanded timemap formats, including legacy and multi-problem structures.
  • Introduced new utility functions for normalizing problem IDs and jump-back fields, improving code organization and readability.
  • Added comprehensive unit tests for new and existing functionality to ensure robustness and correctness.

Support ticket:


Summary

Updates the In-Video Quiz editor MFE to configure multiple problems at the same timestamp, with per-problem jump-back values. Removes duplicate-time validation and adds timemap/jump-back helpers with legacy data support on load and save.

Changes

Editor (InVideoQuizEditor/index.jsx)

  • Remove duplicate-timestamp validation so multiple problems can share the same time (e.g. both at 01:30)
  • Save/load round-trip via updated thunk helpers

Data layer (inVideoQuiz.js)

  • normalizeProblemIds() — handle string or array timemap values
  • expandTimemapToQuizItems() — load legacy + multi-problem timemaps into editor rows
  • buildTimemapFromQuizItems() — save single string or array per timestamp
  • buildJumpBackFromQuizItems() — save jump-back keyed by problem ID
  • normalizeJumpBackField() / resolveQuizItemJumpBack() — legacy global MM:SS, time-keyed, and per-problem maps
  • parseJumpBackField() — parse legacy plain jump-back strings from studio_view HTML

Tests

  • New inVideoQuiz.test.js19 tests for timemap/jump-back helpers
  • InVideoQuizEditor/index.test.jsx — save allowed with duplicate timestamps

Supported data formats

Format Load Save
Single problem per time {"1:30": "id1"} Same
Multiple problems per time {"1:30": ["id1", "id2"]} Same
Legacy time-keyed jump-back {"1:30": "1:29"} Per-problem on re-save
Per-problem jump-back {"id1": "1:29", "id2": "1:45"} Same

Test plan

  • npm test -- inVideoQuiz passes
  • npm test -- InVideoQuizEditor passes
  • Studio: add 2 problems at 01:30 with different jump-backs → Save succeeds
  • Reopen editor → both problems and jump-back values persist
  • Legacy course (single problem, time-keyed jump-back) loads correctly in editor
  • End-to-end with LMS: sequential quiz + jump-back after last problem

…map handling

- Removed duplicate timestamp validation from InVideoQuizEditor, allowing multiple problems to share the same timestamp.
- Updated quiz item handling in the Redux thunk actions to support expanded timemap formats, including legacy and multi-problem structures.
- Introduced new utility functions for normalizing problem IDs and jump-back fields, improving code organization and readability.
- Added comprehensive unit tests for new and existing functionality to ensure robustness and correctness.## Backend PR —
- Added  state to manage loading status of unit content in the InVideoQuizEditor.
- Updated logic to determine visibility of alerts based on the new loading state.
- Enhanced Redux actions and reducers to handle the new state, ensuring proper updates during content loading.
- Modified tests to cover scenarios involving the new loading state, ensuring accurate rendering and behavior during content fetch.
@abhalsod-sonata
abhalsod-sonata merged commit 0580fdf into release-ulmo Jun 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants