Thanks to visit codestin.com
Credit goes to github.com

Skip to content

palucdev/prawko

Repository files navigation

Prawko is a small nextjs + prisma application that enables exploration of the test questions for drivers license in Poland.

App overview

application main page

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).

Demo mode

To start the demo app with limited questions just to see how the app behaves run:

npm install
npm run build-demo

In 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-recreate

Open http://localhost:3000 with your browser to see the result.

Full mode

To start the app with full functionality there are few steps to accomplish:

  1. Go to the goverment page of Polish Ministry of Infrastructure
  2. Download questions excel excel download button
  3. Download question related assets (images and videos) [Warning: zip containing assets is pretty large +/- 8 Gb] assets download button
  4. Extract the file, rename it and save as questions.csv and place into the /public directory (if demo file exists, replace it)
  5. Extract the zip with all of the assets into /public/media directory
  6. Run the npm run prepare-data command 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).
  7. 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 start

In 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 start

Open http://localhost:3000 with your browser to see the result.

Planned improvements

  • 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)

About

Small app that enables exploration of the test questions for drivers license in Poland

Topics

Resources

License

Stars

Watchers

Forks