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

Asked

Viewed 55 times

1

Hello, I am developing an android app with java for the Moodle platform, and I would like to know if there is a function that returns a list with the quiz question and the alternatives. Something more or less like this:

{ "question": "1 + 1 vale:", alternatives":[2,3,10,8] }

1 answer

1

Follow SQL to generate the 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)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.