Hello is there a way I can manage the override of attempts of a quiz from Moodles code? (not doing it from the Moodle page).
Im thinking of using this override with an information gather in a form to add a new attempt to every student that has not achieve a minimum grade in the given quiz.
Could someone point me to a way of doing the override in the backend? Also is there a way to make this revision constanly? So the student get as many attempt as need it to achieve the minimum grado but once they achive the grade do not have any other attemp
A better approach might be to create a Quiz access rule plugin to implement the rule you want about whether the student shoudl be allowed another attempt: https://docs.moodle.org/dev/Quiz_access_rules
Thanks for the information Tim.
Do you know how the prevent_new_attempt function works or where I can find information about it?
Do you know how the prevent_new_attempt function works or where I can find information about it?
In addition to the docs page I linked to above:
- The base class has comments on all the the methods that gives some details.
- There are lots of examples in the code. Have a look at what other access rules do (and their unit tests. Unit tests are often good documentation.)
- Look at how the rule are called. This is co-ordinated by the access-manager class - and you can look to see where that is called.
So, that is Ready The Code, but it is not particularly complicated, and you can be sure that it is up-to-date and accurate.
Hello Tim,
I have the doubt, what part of the code manage that the new appear at the quiz settings?
I have the doubt, what part of the code manage that the new appear at the quiz settings?