Hi Jan Philipp,
the quiz is a really complex module and it's really hard to understand how everything works. I agree that the documentation could be better, but even if it was you'd still have to look at some code to be able to understand how everything works.
My first advice is to play with the WebServices, create several quizzes with different configurations and then call the WebServices and see what they're returning. I guess you already know it, but you can see the WebServices details in:
Site administration ▶︎ Plugins ▶︎ Web services ▶︎ API Documentation
The first thing you need to know is that the quiz depends on questions, a different component. Questions have some subplugins: question type and question behaviour. Also, the quiz itself has some subplugins: access rules.
We implemented all that in the app:
- Question component: www/core/components/question
- Question types: www/addons/qtype
- Question behaviour: www/addons/qbehaviour
- Quiz access rules: www/addons/mod/quiz/accessrules
- Quiz component: www/addons/mod/quiz
All the WebService calls are performed in the following files:
www/addons/mod/quiz/services/quiz.js
www/addons/mod/quiz/services/quiz_online.js
In the app what we do is parse the HTML of the questions and then render it in the view. It's important to keep the same name as the original inputs. When the user clicks submit, we get the data of all the inputs and send it to Moodle.
If you want to implement this you'll have to take a look at how Moodle quiz works and try to simulate it, it's what we do when we implement something in the app.
I'm sorry for not being able to explain it in more detail, but it's really complex and it's impossible to explain it all. You should try to look at each feature by itself and try to mimic it in your system.
Kind regards,
Dani