Skip to content

module 1 quiz tweaks + shared exercise card

jedmund requested to merge jedmund/quiz-tweaks into main

Created by: jedmund

Summary

A bundle of tactical tweaks across module 1 quizzes plus a couple of layout/behavior fixes that were long overdue.

Quiz content (module 1)

Question counts and octave ranges trimmed via config fields — no prompt pools shortened unless necessary.

  • Chromatic Scale Quiz 1 (1-ex1): cap 8 questions (pool of 12).
  • Chromatic Scale Quiz 2 (1-ex2): cap 8 questions (pool of 10).
  • Half Steps ex4 (2-ex4): cap 4 questions (pool of 6 roots).
  • Naming Intervals Quiz 1 (3-ex1): octave_range 3 octaves to 2, cap 8 questions.
  • Naming Intervals Quiz 2 (3-ex2, Name That Gap): rewritten to progressive_intervals mode starting P5/P4/P8 and unlocking M3/m3/M2/m2/TT at threshold 2, total 8.
  • Sixths ex1 (4-ex1, Wide Intervals): octave_range 3 octaves to 2.
  • Sixths ex2 (4-ex2, Thirteen Sounds): 16 to 8 questions.
  • Augmented/Diminished ex1 (5-ex1, Stretch and Squeeze): octave_range 3 octaves to 2, accept_any_octave: true.
  • Augmented/Diminished ex2 (5-ex2, Stable/Bright/Strange): cap 8 questions (pool of 10).

Keyboard quiz pacing

Inter-prompt delay in NoteIdentifier and ScaleBuilder: 1.5s to 0.6s.

Shared exercise card layout

New .exerciseLessonCard() modifier in Views/Exercises/ExerciseLessonCard.swift. Applied to the lessonLayout of all 7 scored exercises (listening and keyboard): adaptive width via containerRelativeFrame (60% of container clamped 320–680pt), fixed 320pt height so the card doesn't resize through question / feedback / completion. Standalone layouts untouched.

Bug: completed exercises restart after swiping away and back

initializeIfNeeded() in every scored exercise guarded only on !state.isPreCompleted (set by persisted-progress restoration), so a live-completed exercise got state.reset(...) on view recreation. Added !state.isComplete to the guards across all 7 scored exercises.

Bug: Linnstrument tab shows keyboard diagram

HardwareSplitDiagramView only checked prompt.devices (specific device names, which are empty in the registry). Now also checks prompt.deviceCategories where the "linnstrument" tag actually lives. Fixes every lesson with a Linnstrument tab, not just Scale Degrees.

Test plan

  • Build in Xcode and run on iPad simulator.
  • Each touched quiz reports its new question count (8/8/4/8/8/8/2-oct/8/8).
  • Keyboard quiz advance feels snappier (0.6s).
  • Name That Gap: first three prompts draw from P5/P4/P8; unlock cadence works at threshold 2.
  • Listening + keyboard exercise cards stay the same size across question / feedback / completion states, and resize with window width.
  • Complete any exercise in a lesson, swipe away, swipe back: score summary stays, no restart.
  • Module 2 Scale Degrees lesson: Linnstrument tab shows the Linnstrument grid, not a keyboard.

Merge request reports

Loading