Additional plugin options - Quiz

Additional plugin options - Quiz

by Paul K -
Number of replies: 2

Hi,


I have added some additional functions into quiz activity in moodle. One of the newly added quiz parameters is stored in an int column in the mod_quiz database. I must read this certain parameter directly from the PHP class in the attemptlib.php file. I have found out, that there is a command called get_config('quiz', 'columnname') which probably could be helpful to get this value. However using this command I'm able to get the default global value which is defined for the entire quiz plugin instance, instead of the value of the column of this certain quiz instance. I'm doing something wrong, or maybe I'm using wrong function to get the value of this certain column from the quiz instance?

$branchinggrade = get_config('quiz', 'branchinglevel');
echo "Branching level:"; echo $branchinggrade; echo ("</br>");


Average of ratings: -
In reply to Paul K

Re: Additional plugin options - Quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You probably need to learn more about Moodle development in general. It is clear what you are trying to do, but your guesses about what might be the way to do it do not match how Moodle actually works.

This docs page might help: https://docs.moodle.org/dev/Quiz_access_rules

In reply to Tim Hunt

Re: Additional plugin options - Quiz

by Paul K -

Thank you. You are absolutely right, but the development of the Moodle plugins is not my major task at work, therefore sometimes its better to ask to spare some time smile Nevertheless thanks for this link.