Context
From 2019 to 2021 I created the web test-player module in the learner app and designed it at module level. I was its primary engineer, and a teammate set the adapter pattern the module follows.
The problem
Schools sell test series and mock exams in many formats. Learners need a reliable timed player that behaves like the real exam. One quiz-state layer had to drive formats with different navigation, timing and scoring rules.
What I did
I created the module in December 2019. Its first big pull request added about 5.3k lines, and 67 of its 68 commits were mine.
I put all quiz state in one adapter: answer, mark for review, clear, pause, submit and practice show-answer. Presentational templates are chosen per exam type.
I built one exam template myself and a teammate added more on the same structure.
I built a sectional UI, a result player, a calculator, explanations, a test report, an essay uploader and partial marking.
In 2020 I refactored the UI into composable header, footer, content and question wrappers, which shrank the default template from about 780 lines. I also added test-series analytics and auto-save.
Key decision
I kept state in one adapter and made exam formats swappable templates. Adding a format meant adding a template, not touching state.
The trade-off was that templates still held some rules. In 2026 I moved those into data, which is the test engine rebuild.
Result
The module shipped and ran on web and, through a bridge, inside the mobile app. I made 223 commits on the web module, against 131 for the next person.
What I learned
I would again separate state from templates. I would push exam rules into data from the first version, as I did later.
Stack
- JavaScript
- React
- Redux
- Next.js
