Create a multiple-choice game web app where the user guesses the correct author for a given quote.
Back-end
Develop a Django application that retrieves quotes and their corresponding authors from an external source. Store this data in a database and utilize it to generate questions for a multiple-choice game.
- Implement a
/quotes
endpoint that returns a random quote from the database along with four potential authors in JSON format. - The initial call to the endpoint should trigger the seeding of the database. Determine the necessity of this action by checking if the database table is empty.
Front-end Develop a JavaScript application that interacts with your back-end endpoint to present a Multiple-Choice Game.
- Display a quote and four buttons, each labeled with a potential author's name, roughly following the provided wireframe layout.
- When a selection is made, the user interface should indicate whether the user's guess was correct. Incorrect answers will remove that option, allowing the user another attempt. Correct answers will proceed to the next quote.
Specific Requirements:
- Each quiz must present four unique author choices without any repetition.
- The correct author must always be included among the options, with their position randomized for each new question.
This project uses Django Framework, Django Rest Framework, and Alpine.js.
git clone https://github.com/jcroot/quotes.git
cd quotes
python -m venv venv
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
python manage.py seed_authors
python manage.py seed_quotes
Get Random quote with authors
/api/quotes