Quiz_me is a simple quiz project that allows users to participate in quizzes, submit their answers, and see how their performance compares to others.
- cmd/: Contains the command-line interface (CLI) commands for interacting with the Quiz_me API.
- api/: Contains the API logic and routes.
- db/: Contains the in-memory database logic and data models.
- utils/: Contains utility functions used across the project.
- Go (Golang) installed on your machine.
To run the Quiz_me API server go to root directory and then:
go build
go run quiz_meResponse structure: {questionID}:{responseID} Both questionID and responseID provided in the fetched quiz.
To run the Quiz_me app with commands go to root directory and then:
go run quiz_me getQuiz --count=3
go run quiz_me submitAnswers --user=user1 --responses=10:2,2:2,8:1
go run quiz_me getPerformance --participant=user1Questions are fetched randomly, and any missing responses are automatically populated with -1 as the answer for simplicity. Alternative to each question accomplished by using a field Category. Each category contains alternative questions and response always contain questions with unique IDs.
