Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
quizaccess_seb\seb_access_manager Class Reference

Manage the access to the quiz. More...

Public Member Functions

 __construct (quiz_settings $quiz)
 The access_manager constructor.
 
 can_bypass_seb ()
 Check if user has any capability to bypass the Safe Exam Browser requirement.
 
 clear_session_access ()
 Unset the global session access variable for this quiz.
 
 get_quiz ()
 Getter for the quiz object.
 
 get_received_browser_exam_key ()
 Returns the Browser Exam Key hash.
 
 get_received_config_key ()
 Returns Safe Exam Browser Config Key hash.
 
 get_seb_use_type ()
 Get type of SEB usage for the quiz.
 
 get_valid_config_key ()
 Return expected SEB config key.
 
 is_using_seb ()
 Check if using Safe Exam Browser.
 
 redirect_to_seb_config_link ()
 Redirect to SEB config link.
 
 seb_required ()
 Check if Safe Exam Browser is required to access quiz.
 
 set_session_access (bool $accessallowed)
 Set session access for quiz.
 
 should_redirect_to_seb_config_link ()
 Check if we need to redirect to SEB config link.
 
 should_validate_basic_header ()
 Should validate basic header?
 
 should_validate_browser_exam_key ()
 Should validate browser exam key?
 
 should_validate_config_key ()
 Should validate SEB config key?
 
 validate_basic_header ()
 This is the basic check for the Safe Exam Browser previously used in the quizaccess_safebrowser plugin that managed basic Moodle interactions with SEB.
 
 validate_browser_exam_key (?string $browserexamkey=null, ?string $url=null)
 Validate browser exam key.
 
 validate_config_key (?string $configkey=null, ?string $url=null)
 Validate a config key.
 
 validate_session_access ()
 Check session access for quiz if already set.
 

Detailed Description

Manage the access to the quiz.

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

Constructor & Destructor Documentation

◆ __construct()

quizaccess_seb\seb_access_manager::__construct ( quiz_settings $quiz)

The access_manager constructor.

Parameters
quiz_settings$quizThe details of the quiz.

Member Function Documentation

◆ can_bypass_seb()

quizaccess_seb\seb_access_manager::can_bypass_seb ( )

Check if user has any capability to bypass the Safe Exam Browser requirement.

Return values
boolTrue if user can bypass check.

◆ get_quiz()

quizaccess_seb\seb_access_manager::get_quiz ( )

Getter for the quiz object.

Return values
mod_quiz\quiz_settings

◆ get_received_browser_exam_key()

quizaccess_seb\seb_access_manager::get_received_browser_exam_key ( )

Returns the Browser Exam Key hash.

Return values
string|null

◆ get_received_config_key()

quizaccess_seb\seb_access_manager::get_received_config_key ( )

Returns Safe Exam Browser Config Key hash.

Return values
string|null

◆ get_seb_use_type()

quizaccess_seb\seb_access_manager::get_seb_use_type ( )

Get type of SEB usage for the quiz.

Return values
int

◆ get_valid_config_key()

quizaccess_seb\seb_access_manager::get_valid_config_key ( )

Return expected SEB config key.

Return values
string|null

◆ is_using_seb()

quizaccess_seb\seb_access_manager::is_using_seb ( )

Check if using Safe Exam Browser.

Return values
bool

◆ redirect_to_seb_config_link()

quizaccess_seb\seb_access_manager::redirect_to_seb_config_link ( )

Redirect to SEB config link.

This will force Safe Exam Browser to be reconfigured.

◆ seb_required()

quizaccess_seb\seb_access_manager::seb_required ( )

Check if Safe Exam Browser is required to access quiz.

If quizsettings do not exist, then there is no requirement for using SEB.

Return values
boolIf required.

◆ set_session_access()

quizaccess_seb\seb_access_manager::set_session_access ( bool $accessallowed)

Set session access for quiz.

Parameters
bool$accessallowed

◆ should_redirect_to_seb_config_link()

quizaccess_seb\seb_access_manager::should_redirect_to_seb_config_link ( )

Check if we need to redirect to SEB config link.

Return values
bool

◆ should_validate_basic_header()

quizaccess_seb\seb_access_manager::should_validate_basic_header ( )

Should validate basic header?

Return values
bool

◆ should_validate_browser_exam_key()

quizaccess_seb\seb_access_manager::should_validate_browser_exam_key ( )

Should validate browser exam key?

Return values
bool

◆ should_validate_config_key()

quizaccess_seb\seb_access_manager::should_validate_config_key ( )

Should validate SEB config key?

Return values
bool

◆ validate_basic_header()

quizaccess_seb\seb_access_manager::validate_basic_header ( )

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 values
bool

◆ validate_browser_exam_key()

quizaccess_seb\seb_access_manager::validate_browser_exam_key ( ?string $browserexamkey = null,
?string $url = null )

Validate browser exam key.

It will validate a provided browser exam key if provided, then will fall back to checking the header.

Parameters
string | null$browserexamkeyOptional. Can validate a provided key, or will fall back to checking header.
string | null$urlOptionally provide URL of page to validate.
Return values
bool

◆ validate_config_key()

quizaccess_seb\seb_access_manager::validate_config_key ( ?string $configkey = null,
?string $url = null )

Validate a config key.

It will check a provided config key if provided then will fall back to checking config key in header.

Parameters
string | null$configkeyOptional. Can validate a provided key, or will fall back to checking header.
string | null$urlURL of page to validate.
Return values
bool

◆ validate_session_access()

quizaccess_seb\seb_access_manager::validate_session_access ( )

Check session access for quiz if already set.

Return values
bool

The documentation for this class was generated from the following file: