Prawko is a small nextjs + prisma application that enables exploration of the test questions for drivers license in Poland.
Functionalities:
- Category selector (license for motorcycles, cars etc.)
- Image / Video display with questions presetnation and dynamic buttons for answers
- Tracking answers results
- Loading the current database of questions (currently needs manual download and unpacking with preprocessing)
Currently the application is written in a way to load a bulk of all questions and display them by their IDs (list on the left side).
Creating randomized forms like in the real theoretical exam can be added, but the priority of this application was to explore all of the questions (randomized tests results in non uniform coverage of the questions because of the question groups and categories creating a bias).
To start the demo app with limited questions just to see how the app behaves run:
npm install
npm run build-demoIn case of problems you can always rerun the build-demo command but remember to recreate the DB to avoid inconsistency problems by running
npm run db-recreateOpen http://localhost:3000 with your browser to see the result.
To start the app with full functionality there are few steps to accomplish:
- Go to the goverment page of Polish Ministry of Infrastructure
- Download questions excel
- Download question related assets (images and videos) [Warning: zip containing assets is pretty large +/- 8 Gb]
- Extract the file, rename it and save as
questions.csvand place into the/publicdirectory (if demo file exists, replace it) - Extract the zip with all of the assets into
/public/mediadirectory - Run the
npm run prepare-datacommand to process all of the data into formats that are digestible by the application (mainly video files to WEB supported formats). This step can take some time but it should be ran once for the whole duration of questions life (it will be good to rerun it with newer data when Ministry of Infrastructure posts changes to the questions/assets). - Run the commands
npm run db-create # creates prisma database
npm run db-seed # creates db entries for questions in the questions.csv
npm run build
npm run startIn case of problems you can always rerun the commands above but remember to recreate the DB (instead of db-create) to avoid inconsistency problems by running
npm run db-recreate # creates prisma database
npm run db-seed # creates db entries for questions in the questions.csv
npm run build
npm run startOpen http://localhost:3000 with your browser to see the result.
- Create a script to make the downloading and preprocessing automatic
- Add randomized tests set utility
- Add support to languages provided in Ministry of Infrastructure files (English, German, Ukrainian)