Moodle APIs 4.2
Moodle 4.2.7 (Build: 20240422)
Classes | Namespaces
access_rule_base.php File Reference

Base class for rules that restrict the ability to attempt a quiz. More...

Classes

class  mod_quiz\local\access_rule_base
 

Namespaces

namespace  mod_quiz\local
  
 

Detailed Description

Base class for rules that restrict the ability to attempt a quiz.

Quiz access rule plugins must sublclass this one to form their main 'rule' class. Most of the methods are defined in a slightly unnatural way because we either want to say that access is allowed, or explain the reason why it is block. Therefore instead of is_access_allowed(...) we have prevent_access(...) that return false if access is permitted, or a string explanation (which is treated as true) if access should be blocked. Slighly unnatural, but actually the easiest way to implement this.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 2.2