Skip to content

lukalomidze/quiz-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quiz-backend

Backend for the quiz app. Required to be self hosted. Currently configured to use PostgreSQL. Backend features:

  1. On startup, quiz.txt available in the resources folder is put into the database. The file uses the following convention:
  • First up is the question prompt, written on a single line.
  • Next several lines are possible answers, the correct one must begin with *, only one correct answer is permitted per question
  • Each individual question ("quiz item") is separated by an empty line
  1. /get-quiz returns the whole quiz, i.e all of the questions in the database
  2. /get-correct-answer/{id} returns the id of the correct answer for a given question

Currently, there is no way to make several different quizzes. In addition, no measures have been taken to avoid cheating for now, as /get-correct-answer is publicly available. To implement anti-cheat, one option could be to track user's progress on the backend instead of frontend and only provide the correct answer id after a question has been submitted

Uses Spring Boot as the backend framework and Spring Data JPA for database interaction

Demo

About

Backend code for the quiz app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages