Function backend::send_question

source ·
pub(crate) async fn send_question() -> impl Responder
Expand description

Replies with a random question from the set

How to use

The request structure is the following http://ip_address/question

The returned json object has the following structure:

question: "<QUESTION_TEXT>"
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