MDL-85023 quiz: allow WebRTC with SEB on Mac
This commit is contained in:
@@ -134,6 +134,16 @@ class seb_quiz_settings extends persistent {
|
||||
'default' => 0,
|
||||
'null' => NULL_ALLOWED,
|
||||
],
|
||||
'allowcapturecamera' => [
|
||||
'type' => PARAM_INT,
|
||||
'default' => 0,
|
||||
'null' => NULL_ALLOWED,
|
||||
],
|
||||
'allowcapturemicrophone' => [
|
||||
'type' => PARAM_INT,
|
||||
'default' => 0,
|
||||
'null' => NULL_ALLOWED,
|
||||
],
|
||||
'allowspellchecking' => [
|
||||
'type' => PARAM_INT,
|
||||
'default' => 0,
|
||||
@@ -644,6 +654,8 @@ class seb_quiz_settings extends persistent {
|
||||
'allowreloadinexam' => 'browserWindowAllowReload',
|
||||
'allowuserquitseb' => 'allowQuit',
|
||||
'enableaudiocontrol' => 'audioControlEnabled',
|
||||
'allowcapturecamera' => 'browserMediaCaptureCamera',
|
||||
'allowcapturemicrophone' => 'browserMediaCaptureMicrophone',
|
||||
'filterembeddedcontent' => 'URLFilterEnableContentFilter',
|
||||
'muteonstartup' => 'audioMute',
|
||||
'showkeyboardlayout' => 'showInputLanguage',
|
||||
|
||||
@@ -472,6 +472,8 @@ class settings_provider {
|
||||
'seb_showwificontrol' => 'selectyesno',
|
||||
'seb_enableaudiocontrol' => 'selectyesno',
|
||||
'seb_muteonstartup' => 'selectyesno',
|
||||
'seb_allowcapturecamera' => 'selectyesno',
|
||||
'seb_allowcapturemicrophone' => 'selectyesno',
|
||||
'seb_allowspellchecking' => 'selectyesno',
|
||||
'seb_activateurlfiltering' => 'selectyesno',
|
||||
'seb_filterembeddedcontent' => 'selectyesno',
|
||||
@@ -501,6 +503,8 @@ class settings_provider {
|
||||
'seb_showwificontrol' => PARAM_BOOL,
|
||||
'seb_enableaudiocontrol' => PARAM_BOOL,
|
||||
'seb_muteonstartup' => PARAM_BOOL,
|
||||
'seb_allowcapturecamera' => PARAM_BOOL,
|
||||
'seb_allowcapturemicrophone' => PARAM_BOOL,
|
||||
'seb_allowspellchecking' => PARAM_BOOL,
|
||||
'seb_activateurlfiltering' => PARAM_BOOL,
|
||||
'seb_filterembeddedcontent' => PARAM_BOOL,
|
||||
@@ -645,6 +649,8 @@ class settings_provider {
|
||||
'seb_showkeyboardlayout' => 1,
|
||||
'seb_showwificontrol' => 0,
|
||||
'seb_enableaudiocontrol' => 0,
|
||||
'seb_allowcapturecamera' => 0,
|
||||
'seb_allowcapturemicrophone' => 0,
|
||||
'seb_muteonstartup' => 0,
|
||||
'seb_allowspellchecking' => 0,
|
||||
'seb_activateurlfiltering' => 0,
|
||||
@@ -914,6 +920,8 @@ class settings_provider {
|
||||
'seb_enableaudiocontrol' => [
|
||||
'seb_muteonstartup' => [],
|
||||
],
|
||||
'seb_allowcapturecamera' => [],
|
||||
'seb_allowcapturemicrophone' => [],
|
||||
'seb_allowspellchecking' => [],
|
||||
'seb_activateurlfiltering' => [
|
||||
'seb_filterembeddedcontent' => [],
|
||||
|
||||
@@ -198,6 +198,22 @@ $capabilities = [
|
||||
'editingteacher' => CAP_ALLOW
|
||||
]
|
||||
],
|
||||
'quizaccess/seb:manage_seb_allowcapturecamera' => [
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'archetypes' => [
|
||||
'manager' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
],
|
||||
],
|
||||
'quizaccess/seb:manage_seb_allowcapturemicrophone' => [
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'archetypes' => [
|
||||
'manager' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
],
|
||||
],
|
||||
'quizaccess/seb:manage_seb_allowspellchecking' => [
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
|
||||
@@ -64,6 +64,8 @@ function xmldb_quizaccess_seb_install() {
|
||||
$sebsettings->userconfirmquit = null;
|
||||
$sebsettings->enableaudiocontrol = null;
|
||||
$sebsettings->muteonstartup = null;
|
||||
$sebsettings->allowcapturecamera = null;
|
||||
$sebsettings->allowcapturemicrophone = null;
|
||||
$sebsettings->allowspellchecking = null;
|
||||
$sebsettings->allowreloadinexam = null;
|
||||
$sebsettings->activateurlfiltering = null;
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<FIELD NAME="userconfirmquit" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether confirm quit popup should appear."/>
|
||||
<FIELD NAME="enableaudiocontrol" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool to show volume and audio controls."/>
|
||||
<FIELD NAME="muteonstartup" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether browser starts muted."/>
|
||||
<FIELD NAME="allowcapturecamera" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether SEB may access camera."/>
|
||||
<FIELD NAME="allowcapturemicrophone" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether SEB may access microphone."/>
|
||||
<FIELD NAME="allowspellchecking" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether spell checking will happen in SEB."/>
|
||||
<FIELD NAME="allowreloadinexam" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether user can reload."/>
|
||||
<FIELD NAME="activateurlfiltering" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="Bool whether URLs will be filtered."/>
|
||||
|
||||
@@ -34,6 +34,9 @@ require_once($CFG->dirroot . '/mod/quiz/accessrule/seb/lib.php');
|
||||
* @return bool Result.
|
||||
*/
|
||||
function xmldb_quizaccess_seb_upgrade($oldversion) {
|
||||
global $DB;
|
||||
$dbman = $DB->get_manager();
|
||||
|
||||
// Automatically generated Moodle v4.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
@@ -46,5 +49,28 @@ function xmldb_quizaccess_seb_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2024121801) {
|
||||
|
||||
// Define field allowcapturecamera to be added to quizaccess_seb_quizsettings.
|
||||
$table = new xmldb_table('quizaccess_seb_quizsettings');
|
||||
$field = new xmldb_field('allowcapturecamera', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'muteonstartup');
|
||||
|
||||
// Conditionally launch add field allowcapturecamera.
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Define field allowcapturemicrophone to be added to quizaccess_seb_quizsettings.
|
||||
$field = new xmldb_field('allowcapturemicrophone', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'allowcapturecamera');
|
||||
|
||||
// Conditionally launch add field allowcapturemicrophone.
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Seb savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2024121801, 'quizaccess', 'seb');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -92,6 +92,8 @@ $string['seb'] = 'Safe Exam Browser';
|
||||
$string['seb:bypassseb'] = 'Bypass the requirement to view quiz in Safe Exam Browser.';
|
||||
$string['seb:manage_filemanager_sebconfigfile'] = 'Change SEB quiz setting: Select SEB config file';
|
||||
$string['seb:manage_seb_activateurlfiltering'] = 'Change SEB quiz setting: Activate URL filtering';
|
||||
$string['seb:manage_seb_allowcapturecamera'] = 'Change SEB quiz setting: Allow browser access to camera';
|
||||
$string['seb:manage_seb_allowcapturemicrophone'] = 'Change SEB quiz setting: Allow browser access to microphone';
|
||||
$string['seb:manage_seb_allowedbrowserexamkeys'] = 'Change SEB quiz setting: Allowed browser exam keys';
|
||||
$string['seb:manage_seb_allowreloadinexam'] = 'Change SEB quiz setting: Allow reload';
|
||||
$string['seb:manage_seb_allowspellchecking'] = 'Change SEB quiz setting: Enable spell checking';
|
||||
@@ -119,6 +121,10 @@ $string['seb:manage_seb_usesebclientconfig'] = 'Change SEB quiz setting: Use SEB
|
||||
$string['seb:managetemplates'] = 'Manage SEB configuration templates';
|
||||
$string['seb_activateurlfiltering'] = 'Enable URL filtering';
|
||||
$string['seb_activateurlfiltering_help'] = 'If enabled, URLs will be filtered when loading web pages. The filter set has to be defined below.';
|
||||
$string['seb_allowcapturecamera'] = 'Allow browser access to camera';
|
||||
$string['seb_allowcapturecamera_help'] = 'If enabled, users will be asked to grant access to the camera for SEB before the exam session is started. In macOS 12/iOS 15 or later, disabling this setting prevents web applications from accessing the camera in any case, i. e. video recording via WebRTC will not be possible.';
|
||||
$string['seb_allowcapturemicrophone'] = 'Allow browser access to microphone';
|
||||
$string['seb_allowcapturemicrophone_help'] = 'If enabled, users will be asked to grant access to the microphone for SEB before the exam session is started. In macOS 12/iOS 15 or later, disabling this setting prevents web applications from accessing the microphone in any case, i. e. audio recording via WebRTC will not be possible.';
|
||||
$string['seb_allowedbrowserexamkeys'] = 'Allowed browser exam keys';
|
||||
$string['seb_allowedbrowserexamkeys_help'] = 'In this field you can enter the allowed browser exam keys for versions of Safe Exam Browser that are permitted to access this quiz. If no keys are entered, then browser exam keys are not checked.';
|
||||
$string['seb_allowreloadinexam'] = 'Enable reload in exam';
|
||||
|
||||
@@ -252,6 +252,8 @@ class quizaccess_seb extends access_rule_base {
|
||||
. 'seb.userconfirmquit AS seb_userconfirmquit, '
|
||||
. 'seb.enableaudiocontrol AS seb_enableaudiocontrol, '
|
||||
. 'seb.muteonstartup AS seb_muteonstartup, '
|
||||
. 'seb.allowcapturecamera AS seb_allowcapturecamera, '
|
||||
. 'seb.allowcapturemicrophone AS seb_allowcapturemicrophone, '
|
||||
. 'seb.allowspellchecking AS seb_allowspellchecking, '
|
||||
. 'seb.allowreloadinexam AS seb_allowreloadinexam, '
|
||||
. 'seb.activateurlfiltering AS seb_activateurlfiltering, '
|
||||
|
||||
@@ -39,13 +39,13 @@ Feature: Safe Exam Browser settings in quiz edit form
|
||||
| contextlevel | System |
|
||||
| reference | |
|
||||
And the following "user" exists:
|
||||
| username | teacher |
|
||||
| firstname | Teacher |
|
||||
| lastname | One |
|
||||
| username | teacher |
|
||||
| firstname | Teacher |
|
||||
| lastname | One |
|
||||
And the following "course enrolment" exists:
|
||||
| user | teacher |
|
||||
| course | C1 |
|
||||
| role | editingteacher |
|
||||
| user | teacher |
|
||||
| course | C1 |
|
||||
| role | editingteacher |
|
||||
And I log in as "teacher"
|
||||
# Create the quiz.
|
||||
When I add a quiz activity to course "Course 1" section "0" and I fill the form with:
|
||||
@@ -81,6 +81,8 @@ Feature: Safe Exam Browser settings in quiz edit form
|
||||
Then I should not see "Show Wi-Fi control"
|
||||
Then I should not see "Enable audio controls"
|
||||
Then I should not see "Mute on startup"
|
||||
Then I should not see "Allow browser access to camera"
|
||||
Then I should not see "Allow browser access to microphone"
|
||||
Then I should not see "Enable spell checking"
|
||||
Then I should not see "Enable URL filtering"
|
||||
Then I should not see "Filter also embedded content"
|
||||
@@ -113,6 +115,8 @@ Feature: Safe Exam Browser settings in quiz edit form
|
||||
Then I should not see "Show Wi-Fi control"
|
||||
Then I should not see "Enable audio controls"
|
||||
Then I should not see "Mute on startup"
|
||||
Then I should not see "Allow browser access to camera"
|
||||
Then I should not see "Allow browser access to microphone"
|
||||
Then I should not see "Enable spell checking"
|
||||
Then I should not see "Enable URL filtering"
|
||||
Then I should not see "Filter also embedded content"
|
||||
@@ -143,6 +147,8 @@ Feature: Safe Exam Browser settings in quiz edit form
|
||||
Then I should not see "Show Wi-Fi control"
|
||||
Then I should not see "Enable audio controls"
|
||||
Then I should not see "Mute on startup"
|
||||
Then I should not see "Allow browser access to camera"
|
||||
Then I should not see "Allow browser access to microphone"
|
||||
Then I should not see "Enable spell checking"
|
||||
Then I should not see "Enable URL filtering"
|
||||
Then I should not see "Filter also embedded content"
|
||||
@@ -177,6 +183,8 @@ Feature: Safe Exam Browser settings in quiz edit form
|
||||
Then I should not see "Show Wi-Fi control"
|
||||
Then I should not see "Enable audio controls"
|
||||
Then I should not see "Mute on startup"
|
||||
Then I should not see "Allow browser access to camera"
|
||||
Then I should not see "Allow browser access to microphone"
|
||||
Then I should not see "Enable spell checking"
|
||||
Then I should not see "Enable URL filtering"
|
||||
Then I should not see "Filter also embedded content"
|
||||
@@ -207,6 +215,8 @@ Feature: Safe Exam Browser settings in quiz edit form
|
||||
Then I should see "Show Wi-Fi control"
|
||||
Then I should see "Enable audio controls"
|
||||
Then I should not see "Mute on startup"
|
||||
Then I should see "Allow browser access to camera"
|
||||
Then I should see "Allow browser access to microphone"
|
||||
Then I should see "Enable spell checking"
|
||||
Then I should see "Enable URL filtering"
|
||||
Then I should not see "Filter also embedded content"
|
||||
|
||||
@@ -40,6 +40,7 @@ final class helper_test extends \advanced_testcase {
|
||||
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
|
||||
. "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><true/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><true/><key>browserMediaCaptureMicrophone</key><true/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><true/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>hashedQuitPassword</key>"
|
||||
. "<string>9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08</string><key>URLFilterRules</key>"
|
||||
@@ -177,7 +178,8 @@ final class helper_test extends \advanced_testcase {
|
||||
. "<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key>"
|
||||
. "<false/><key>showReloadButton</key><true/><key>showTime</key><true/><key>showInputLanguage</key>"
|
||||
. "<true/><key>allowQuit</key><true/><key>quitURLConfirm</key><true/><key>audioControlEnabled</key>"
|
||||
. "<false/><key>audioMute</key><false/><key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key>"
|
||||
. "<false/><key>audioMute</key><false/><key>browserMediaCaptureCamera</key><false/><key>browserMediaCaptureMicrophone"
|
||||
. "</key><false/><key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key>"
|
||||
. "<true/><key>URLFilterEnable</key><false/><key>URLFilterEnableContentFilter</key><false/>"
|
||||
. "<key>URLFilterRules</key><array/><key>startURL</key><string>$url</string>"
|
||||
. "<key>sendBrowserExamKey</key><true/><key>browserWindowWebView</key><integer>3</integer>"
|
||||
|
||||
@@ -82,6 +82,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
|
||||
. "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><true/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><true/><key>browserMediaCaptureMicrophone</key><true/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><true/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>hashedQuitPassword</key>"
|
||||
. "<string>9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08</string><key>URLFilterRules</key>"
|
||||
@@ -115,6 +116,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
|
||||
. "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><true/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><true/><key>browserMediaCaptureMicrophone</key><true/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><true/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>hashedQuitPassword</key>"
|
||||
. "<string>9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08</string><key>URLFilterRules</key>"
|
||||
@@ -132,6 +134,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
|
||||
. "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><true/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><true/><key>browserMediaCaptureMicrophone</key><true/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><true/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><true/><key>hashedQuitPassword</key>"
|
||||
. "<string>9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08</string><key>URLFilterRules</key>"
|
||||
@@ -150,7 +153,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
|
||||
$quizsettings = new seb_quiz_settings(0, $settings);
|
||||
$configkey = $quizsettings->get_config_key();
|
||||
$this->assertEquals("65ff7a3b8aec80e58fbe2e7968826c33cbf0ac444a748055ebe665829cbf4201",
|
||||
$this->assertEquals("24712dcecc69a2ca8ad19f4f8928375038f087e13ce9f504cfc4496846aaaf27",
|
||||
$configkey
|
||||
);
|
||||
}
|
||||
@@ -163,12 +166,12 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
|
||||
$quizsettings = new seb_quiz_settings(0, $settings);
|
||||
$configkey = $quizsettings->get_config_key();
|
||||
$this->assertEquals("65ff7a3b8aec80e58fbe2e7968826c33cbf0ac444a748055ebe665829cbf4201",
|
||||
$this->assertEquals("24712dcecc69a2ca8ad19f4f8928375038f087e13ce9f504cfc4496846aaaf27",
|
||||
$configkey);
|
||||
|
||||
$quizsettings->set('filterembeddedcontent', 1); // Alter the settings.
|
||||
$configkey = $quizsettings->get_config_key();
|
||||
$this->assertEquals("d975b8a2ec4472495a8be7c64d7c8cc960dbb62472d5e88a8847ac0e5d77e533",
|
||||
$this->assertEquals("e2f6dc2a6ddb9bdfa7530dc8afbae996499c34a954e1c635c4fed894e47c1abc",
|
||||
$configkey);
|
||||
}
|
||||
|
||||
@@ -565,6 +568,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
. "<key>allowWlan</key><false/><key>showReloadButton</key>"
|
||||
. "<true/><key>showTime</key><true/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><false/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><false/><key>browserMediaCaptureMicrophone</key><false/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><false/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>URLFilterRules</key><array>"
|
||||
. "<dict><key>action</key><integer>1</integer><key>active</key><true/>"
|
||||
@@ -593,6 +597,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
. "<key>allowWlan</key><false/><key>showReloadButton</key>"
|
||||
. "<true/><key>showTime</key><true/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><false/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><false/><key>browserMediaCaptureMicrophone</key><false/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><false/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>URLFilterRules</key><array>"
|
||||
. "<dict><key>action</key><integer>0</integer><key>active</key><true/>"
|
||||
@@ -621,6 +626,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
. "<key>allowWlan</key><false/><key>showReloadButton</key>"
|
||||
. "<true/><key>showTime</key><true/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><false/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><false/><key>browserMediaCaptureMicrophone</key><false/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><false/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>URLFilterRules</key><array>"
|
||||
. "<dict><key>action</key><integer>1</integer><key>active</key><true/>"
|
||||
@@ -649,6 +655,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
. "<key>allowWlan</key><false/><key>showReloadButton</key>"
|
||||
. "<true/><key>showTime</key><true/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><false/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><false/><key>browserMediaCaptureMicrophone</key><false/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><false/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>URLFilterRules</key><array>"
|
||||
. "<dict><key>action</key><integer>0</integer><key>active</key><true/>"
|
||||
@@ -677,6 +684,7 @@ final class quiz_settings_test extends \advanced_testcase {
|
||||
. "<key>allowWlan</key><false/><key>showReloadButton</key>"
|
||||
. "<true/><key>showTime</key><true/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><false/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><false/><key>browserMediaCaptureMicrophone</key><false/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><false/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>URLFilterRules</key><array><dict><key>action</key>"
|
||||
. "<integer>1</integer><key>active</key><true/><key>expression</key><string>*</string>"
|
||||
|
||||
@@ -177,7 +177,7 @@ final class settings_provider_test extends \advanced_testcase {
|
||||
public function test_hideifs(): void {
|
||||
$settinghideifs = settings_provider::get_quiz_hideifs();
|
||||
|
||||
$this->assertCount(23, $settinghideifs);
|
||||
$this->assertCount(25, $settinghideifs);
|
||||
|
||||
$this->assertArrayHasKey('seb_templateid', $settinghideifs);
|
||||
$this->assertCount(1, $settinghideifs['seb_templateid']);
|
||||
@@ -362,6 +362,26 @@ final class settings_provider_test extends \advanced_testcase {
|
||||
settings_provider::USE_SEB_CONFIG_MANUALLY
|
||||
);
|
||||
|
||||
$this->assertArrayHasKey('seb_allowcapturecamera', $settinghideifs);
|
||||
$this->assertCount(1, $settinghideifs['seb_allowcapturecamera']);
|
||||
$this->assert_hide_if(
|
||||
$settinghideifs['seb_allowcapturecamera'][0],
|
||||
'seb_allowcapturecamera',
|
||||
'seb_requiresafeexambrowser',
|
||||
'noteq',
|
||||
settings_provider::USE_SEB_CONFIG_MANUALLY
|
||||
);
|
||||
|
||||
$this->assertArrayHasKey('seb_allowcapturemicrophone', $settinghideifs);
|
||||
$this->assertCount(1, $settinghideifs['seb_allowcapturemicrophone']);
|
||||
$this->assert_hide_if(
|
||||
$settinghideifs['seb_allowcapturemicrophone'][0],
|
||||
'seb_allowcapturemicrophone',
|
||||
'seb_requiresafeexambrowser',
|
||||
'noteq',
|
||||
settings_provider::USE_SEB_CONFIG_MANUALLY
|
||||
);
|
||||
|
||||
$this->assertArrayHasKey('seb_muteonstartup', $settinghideifs);
|
||||
$this->assertCount(2, $settinghideifs['seb_muteonstartup']);
|
||||
$this->assert_hide_if(
|
||||
@@ -1319,6 +1339,8 @@ final class settings_provider_test extends \advanced_testcase {
|
||||
$allsettings->seb_regexblocked = 20;
|
||||
$allsettings->seb_templateid = 21;
|
||||
$allsettings->seb_allowedbrowserexamkeys = 22;
|
||||
$allsettings->seb_allowcapturecamera = 23;
|
||||
$allsettings->seb_allowcapturemicrophone = 24;
|
||||
|
||||
return $allsettings;
|
||||
}
|
||||
@@ -1422,6 +1444,8 @@ final class settings_provider_test extends \advanced_testcase {
|
||||
'seb_enableaudiocontrol' => [
|
||||
'seb_muteonstartup' => [],
|
||||
],
|
||||
'seb_allowcapturecamera' => [],
|
||||
'seb_allowcapturemicrophone' => [],
|
||||
'seb_allowspellchecking' => [],
|
||||
'seb_activateurlfiltering' => [
|
||||
'seb_filterembeddedcontent' => [],
|
||||
|
||||
@@ -54,6 +54,7 @@ final class template_test extends \advanced_testcase {
|
||||
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
|
||||
. "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><true/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><true/><key>browserMediaCaptureMicrophone</key><true/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><true/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>hashedQuitPassword</key>"
|
||||
. "<string>9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08</string><key>URLFilterRules</key>"
|
||||
@@ -102,6 +103,7 @@ final class template_test extends \advanced_testcase {
|
||||
<plist version=\"1.0\"><dict><key>showTaskBar</key><true/><key>allowWlan</key><false/><key>showReloadButton</key><true/>"
|
||||
. "<key>showTime</key><false/><key>showInputLanguage</key><true/><key>allowQuit</key><true/>"
|
||||
. "<key>quitURLConfirm</key><true/><key>audioControlEnabled</key><true/><key>audioMute</key><false/>"
|
||||
. "<key>browserMediaCaptureCamera</key><true/><key>browserMediaCaptureMicrophone</key><true/>"
|
||||
. "<key>allowSpellCheck</key><false/><key>browserWindowAllowReload</key><true/><key>URLFilterEnable</key><true/>"
|
||||
. "<key>URLFilterEnableContentFilter</key><false/><key>hashedQuitPassword</key>"
|
||||
. "<string>9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08</string><key>URLFilterRules</key>"
|
||||
@@ -129,6 +131,8 @@ final class template_test extends \advanced_testcase {
|
||||
'linkquitseb' => '',
|
||||
'userconfirmquit' => '1',
|
||||
'enableaudiocontrol' => '1',
|
||||
'allowcapturecamera' => '1',
|
||||
'allowcapturemicrophone' => '1',
|
||||
'muteonstartup' => '0',
|
||||
'allowspellchecking' => '0',
|
||||
'allowreloadinexam' => '1',
|
||||
|
||||
@@ -300,6 +300,8 @@ trait quizaccess_seb_test_helper_trait {
|
||||
'userconfirmquit' => '1',
|
||||
'enableaudiocontrol' => '1',
|
||||
'muteonstartup' => '0',
|
||||
'allowcapturecamera' => '1',
|
||||
'allowcapturemicrophone' => '1',
|
||||
'allowspellchecking' => '0',
|
||||
'allowreloadinexam' => '1',
|
||||
'activateurlfiltering' => '1',
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2024121800;
|
||||
$plugin->version = 2024121801;
|
||||
$plugin->requires = 2024100100;
|
||||
$plugin->component = 'quizaccess_seb';
|
||||
$plugin->maturity = MATURITY_STABLE;
|
||||
|
||||
@@ -301,6 +301,8 @@ class restore_quiz_activity_structure_step extends restore_questions_activity_st
|
||||
$sebsettings->userconfirmquit = null;
|
||||
$sebsettings->enableaudiocontrol = null;
|
||||
$sebsettings->muteonstartup = null;
|
||||
$sebsettings->allowcapturecamera = null;
|
||||
$sebsettings->allowcapturemicrophone = null;
|
||||
$sebsettings->allowspellchecking = null;
|
||||
$sebsettings->allowreloadinexam = null;
|
||||
$sebsettings->activateurlfiltering = null;
|
||||
|
||||
Reference in New Issue
Block a user