A simple api for a quiz.
Clone the repository. Run 'composer install' and make sure you have a MySQL database. Then, copy the '.env.example' file and initialize it, and run the migration. Note that there is an SQL file in the 'database' folder named 'questions.sql', which contains some example questions that you can use. Just run it on your database.
POST
name - the desired username.
email - the desired email.
password . the desired password.
(json) api-key - the api-key of the user.
POST
name - the users username.
password . the users password.
(json) api-key - the api-key of the user.
Creates a new game for the user.
POST
NOQ - the number of questions that you want the game to have.
api_key . the users api key.
(json) game_id - the id of the game created.
Get the current question from a game.
GET
game_id - the id of the game you want to get the question from.
api_key . the api_key for the user that is set on the game.
(json)
the_question - the actuall question
alt_1 - alternative 1
alt_2 - alternative 2
alt_3 - alternative 3
alt_4 - alternative 4
Send a answer to the question that is current in a game.
POST
api_key . the api_key for the user that is set on the game.
asnwer - The answer either 1, 2, 3 or 4.
game_id - the id of the game you want to post to.
(json)
result - either true if the answer was correct or false if the answer was incorrect.
gameDone - true if the game is done or false if not.
Attempt to brew coffee
418
You can't brew coffee in a teapot:smile: