This project aims to develop a web application prototype that allows users to play previously saved multiple-choice questions, with the choices generated in a different order each time they play. The project also focuses on incorporating standard engineering practices such as automated testing, continuous integration, continuous deployment, and maintaining descriptive changes through small pull requests and focused commits.
- Node.js: I use v18 and if you use nvm, you can run
nvm useto switch to that version. - Yarn: Follow the instructions here for how to enabling Yarn if you haven't.
yarn installto install dependenciesyarn devto start the development server
-
Question Bank Stored in Browser Local Storage
-
Score Calculation
-
Randomized Order of Choices: Each time a user plays, they will experience a different order of choices for each question. This concept was initially inspired by an idea from a friend, and I have made modifications to create my own version of it.
The project currently utilizes Next.js for web application development and leverages Vercel for continuous deployment. The codebase is a work in progress, and ongoing refactoring will be carried out to improve readability and maintainability.
In this project, some classes have creation methods like Xyz.create and Xyz.createNull respectively. It is a pattern learnt from Testing Without Mocks: A Pattern Language by James Shore.
Xyz.create is the creation method for production code. Xyz.createNull is the creation method for testing side that support parameterless instantiation and provided some fake implementation for some external dependencies to enhance testability and maintainability of unit test test cases. See Nullable Pattern for more details.