Differences Between: [Versions 311 and 400] [Versions 311 and 401]
Manage the access to the quiz.
Author: | Tim Hunt |
Author: | Luca Bösch <luca.boesch@bfh.ch> |
Author: | Andrew Madden <andrewmadden@catalyst-au.net> |
Author: | Dmitrii Metelkin <dmitriim@catalyst-au.net> |
Copyright: | 2019 Catalyst IT |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 300 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
access_manager:: (18 methods):
__construct()
validate_browser_exam_keys()
validate_config_key()
seb_required()
validate_basic_header()
is_using_seb()
can_bypass_seb()
get_this_page_url()
get_valid_config_key()
get_quiz()
check_browser_exam_keys()
check_key()
get_received_config_key()
get_received_browser_exam_key()
get_seb_use_type()
should_validate_basic_header()
should_validate_config_key()
should_validate_browser_exam_key()
Class: access_manager - X-Ref
Manage the access to the quiz.__construct(quiz $quiz) X-Ref |
The access_manager constructor. param: quiz $quiz The details of the quiz. |
validate_browser_exam_keys() X-Ref |
Check if the browser exam key hash in header matches one of the listed browser exam keys from quiz settings. return: bool True if header key matches one of the saved keys. |
validate_config_key() X-Ref |
Check if the config key hash in header matches quiz settings. return: bool True if header key matches saved key. |
seb_required() X-Ref |
Check if Safe Exam Browser is required to access quiz. If quizsettings do not exist, then there is no requirement for using SEB. return: bool If required. |
validate_basic_header() X-Ref |
This is the basic check for the Safe Exam Browser previously used in the quizaccess_safebrowser plugin that managed basic Moodle interactions with SEB. return: bool |
is_using_seb() X-Ref |
Check if using Safe Exam Browser. return: bool |
can_bypass_seb() X-Ref |
Check if user has any capability to bypass the Safe Exam Browser requirement. return: bool True if user can bypass check. |
get_this_page_url() X-Ref |
Return the full URL that was used to request the current page, which is what we need for verifying the X-SafeExamBrowser-RequestHash header. |
get_valid_config_key() X-Ref |
Return expected SEB config key. return: string|null |
get_quiz() X-Ref |
Getter for the quiz object. return: quiz |
check_browser_exam_keys(array $keys, string $header) X-Ref |
Check the hash from the request header against the permitted browser exam keys. param: array $keys Allowed browser exam keys. param: string $header The value of the X-SafeExamBrowser-RequestHash to check. return: bool True if the hash matches. |
check_key($key, $header) X-Ref |
Check the hash from the request header against a single permitted key. param: string $key an allowed key. param: string $header the value of the X-SafeExamBrowser-RequestHash or X-SafeExamBrowser-ConfigKeyHash to check. return: bool true if the hash matches. |
get_received_config_key() X-Ref |
Returns Safe Exam Browser Config Key hash. return: string|null |
get_received_browser_exam_key() X-Ref |
Returns the Browser Exam Key hash. return: string|null |
get_seb_use_type() X-Ref |
Get type of SEB usage for the quiz. return: int |
should_validate_basic_header() X-Ref |
Should validate basic header? return: bool |
should_validate_config_key() X-Ref |
Should validate SEB config key? return: bool |
should_validate_browser_exam_key() X-Ref |
Should validate browser exam key? return: bool |