How to get a list of all moodle questions and alternatives?

1
Hello, I am developing an android application with java for the moodle platform, and I would like to know if there is any function that returns a list with the quiz question and the alternatives. Something like this:

{ "question": "1 + 1 vale:", alternatives":[2,3,10,8] }
    
asked by anonymous 05.11.2017 / 01:01

1 answer

1

Follow SQL to generate list of questions and answer alternatives:

SELECT q.id, q.questiontext as questão, q.qtype as tipo, qa.answer as alternativas
FROM mdl_question q
INNER JOIN mdl_question_answers qa on qa.question = q.id
WHERE q.id = ? -- Id do questionário(quiz)
    
23.11.2017 / 18:35