Function backend::questionid

source ·
pub(crate) async fn questionid(id: Path<String>) -> impl Responder
Expand description

Returns a specific question when provided with the question ID.

How to use:

The request structure is the following: http://ip_address/questionid/<QUESTION_ID> where <QUESTION_ID> is the id of the question you want to receive

The returned json object has the following structure:

question: "<QUESTION_TEXT>"
a: "<POSSIBLE_ANSWER_1>"
b: "<POSSIBLE_ANSWER_2>"
correct: "<CORRECT>"
number: <QUESTION_ID>
  • <CORRECT> is either a or b, representing one of the possible answers
  • <QUESTION_ID> is supplied so players can later be judged on the correct question