Generated quiz

Generated quiz

by Aleksander Nikonov -
Number of replies: 2

Hi Moodle community! I am a Moodle newbie, so I ask for your help. I use Moodle v3.6.3

What I need:
A generated quiz. Say, we have a list of themes (question categories). Each theme have 300 questions, for example. User can pick any combination of these themes and get a quiz, consisting of 10 random questions from every selected theme. So, the question count is dynamic and is proportional to selected themes. I know how to override output renderers, so I am searching rather for a mechanics than appearance solution.

What I have explored to solve this issue:
different plugins, question bank API, question engine API, Quiz module code, question behaviours and question types plugin tutorials.

Which solutions do I have now:
1) To copy and change Quiz module completely.
2) To use question APIs directly and build my own module (I'm afraid, it's too complex work and I will lose a lot of features which Quiz module has built in already)
3) To create a new module which will use or extend Quiz module classes and functions overriding files like view.php, startattempt.php, etc. (I am working on it now, but it seems to me too hacky and unreliable).

Could you suggest me a better solution? Smth what I have missed. Maybe some unobvious module which could solve my issue. Or better way to override Quiz module? Everything what can help. Thanks in advance.

Average of ratings: -
In reply to Aleksander Nikonov

Re: Generated quiz

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I think you would be better to clone the quiz module, rename it and then change it as you wish.  This way you could use the same question bank and would not interfere with the existing quiz...

In reply to Emma Richardson

Re: Generated quiz

by Aleksander Nikonov -

Hi, I have created a new module, extending quiz and quiz_attempt classes + overriding the startattempt.php, attempt.php, processattempt.php, etc. and it seems to work now. Anyway, thank you for your advice, it ensures me that changing the module is a right direction for my work smile