Quiz Override attempts

Quiz Override attempts

by Jose Velazquez-Torres -
Number of replies: 5

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

Average of ratings: -
In reply to Jose Velazquez-Torres

Re: Quiz Override attempts

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
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
In reply to Tim Hunt

Re: Quiz Override attempts

by Jose Velazquez-Torres -
Thanks for the information Tim.

Do you know how the prevent_new_attempt function works or where I can find information about it?
In reply to Jose Velazquez-Torres

Re: Quiz Override attempts

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

In addition to the docs page I linked to above:

  1. The base class has comments on all the the methods that gives some details.
  2. 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.)
  3. 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.

In reply to Tim Hunt

Re: Quiz Override attempts

by Jose Velazquez-Torres -
Hello Tim,

I have the doubt, what part of the code manage that the new appear at the quiz settings?