Skip to content

Commit

Permalink
MDL-82659 quizaccess_seb: Fix indentation syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kotlyar committed Aug 28, 2024
1 parent f2b3bdb commit 38f5fea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
19 changes: 10 additions & 9 deletions mod/quiz/accessrule/seb/classes/settings_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,14 @@ public static function get_seb_config_element_types(): array {
}

/**
* Check that we have conflicting permissions.
* Check that we have conflicting permissions with the current SEB settings.
*
* In Some point we can have settings save by the person who use specific
* type of SEB usage (e.g. use templates). But then another person who can't
* use template (but still can update other settings) edit the same quiz. This is
* conflict of permissions and we'd like to build the settings form having this in
* mind.
* Check if the existing settings of the quiz (if any) are conflicting with the
* capabilities of the managing user.
*
* E.g. a quiz is using an SEB template and a site admin is able to select this
* option while a course manager cannot. Therefore it will return true for a course
* manager and return false for a site admin.
*
* @param \context $context Context used with capability checking.
*
Expand All @@ -535,7 +536,7 @@ public static function is_conflicting_permissions(\context $context) {
}

if (!self::can_use_seb_template($context) &&
$settings->get('requiresafeexambrowser') == self::USE_SEB_TEMPLATE) {
$settings->get('requiresafeexambrowser') == self::USE_SEB_TEMPLATE) {
return true;
}

Expand All @@ -545,12 +546,12 @@ public static function is_conflicting_permissions(\context $context) {
}

if (!self::can_upload_seb_file($context) &&
$settings->get('requiresafeexambrowser') == self::USE_SEB_UPLOAD_CONFIG) {
$settings->get('requiresafeexambrowser') == self::USE_SEB_UPLOAD_CONFIG) {
return true;
}

if (!self::can_configure_manually($context) &&
$settings->get('requiresafeexambrowser') == self::USE_SEB_CONFIG_MANUALLY) {
$settings->get('requiresafeexambrowser') == self::USE_SEB_CONFIG_MANUALLY) {
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/accessrule/seb/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'editingteacher' => CAP_ALLOW
]
],
// Ability to select "Yes – Configure manually" as an option for "Require the use of Safe Exam Browser".
'quizaccess/seb:manage_seb_configuremanually' => [
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
Expand All @@ -58,6 +59,7 @@
],
'clonepermissionsfrom' => 'quizaccess/seb:manage_seb_requiresafeexambrowser',
],
// Ability to select "Yes – Use SEB client config" as an option for "Require the use of Safe Exam Browser".
'quizaccess/seb:manage_seb_usesebclientconfig' => [
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
Expand Down
3 changes: 3 additions & 0 deletions mod/quiz/accessrule/seb/rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public static function add_settings_form_fields(mod_quiz_mod_form $quizform, Moo
/**
* Validate the data from any form fields added using {@link add_settings_form_fields()}.
*
* If the managing user cannot configure SEB by either lack of permissions or locked
* settings, then the form fields will be frozen and no validation will be done.
*
* @param array $errors the errors found so far.
* @param array $data the submitted form data.
* @param array $files information about any uploaded files.
Expand Down

0 comments on commit 38f5fea

Please sign in to comment.