Details
-
Improvement
-
Status: Integration review in progress
-
Minor
-
Resolution: Unresolved
-
4.0
-
None
-
MOODLE_400_STABLE
-
MDL-72188-master_seb_js_integration-no-message
-
Hide
Setup
The following tests should be run on at least the Mac OS and the Windows platforms.
Note acronym, SEB == Safe Exam Browser, going forward.
Note, by default SEB requires the application to be run on a computer with a single built-in screen. This is configurable, but there is currently a bug in the Windows version that does not allow a computer with external screens only (i.e. a Tower), so it's recommended to test on a laptop without any other screens plugged in.
Install SEB Mac
If SEB Mac 3.1 is released, download this version from https://safeexambrowser.org/download_en.html
Or, download the pre-release version from: https://github.com/SafeExamBrowser/seb-mac/releases/tag/3.2pre4
Install SEB Windows
Install SEB Windows
If SEB Windows 3.3.2 is released, download this version from https://safeexambrowser.org/download_en.html
Or, download the pre-release version from: https://sebdev-let.ethz.ch/api/buildjobs/t4047847xq50t0v5/artifacts/SEB_3.3.2.397_SetupBundle.exe
Scenarios
Test quiz access with 'Configure manually' SEB settings
- Log in as an admin.
- Create a test user.
- Create a test course.
- Enrol test user in test course in the 'student' role.
- In test course, create a quiz.
- Give the quiz a name (E.g. 'Test quiz').
- In quiz settings, go to Safe Exam Browser section.
- Set 'Require the use of Safe Exam Browser' to 'Configure manually'.
- Save the quiz settings.
- Add a question to the quiz.
- Log out.
- Open Moodle in a regular web browser (E.g. Firefox, Chrome)
- Log in as test user.
- Go to test course
- Go to test quiz
- You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file."
- You should see button with label: "Launch Safe Exam Browser"
- Click on "Launch Safe Exam Browser"
- Select compatible Safe Exam Browser application
- Log in as test user.
- You should see the quiz landing page
- You should see an alert with message:
- After a short delay, the page should reload.
- You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file."
- You should see button with label: 'Start attempt'
- Click on 'Start attempt'
- You should see the first question of the quiz.
Test quiz access with 'Use an existing template' SEB settings
- Log in as an admin.
- Navigate to Site administration -> Plugins -> Activity modules -> Safe Exam Browser templates
- Click 'Add new template'
- Set new template name to 'Test template'
- Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool.
- Set Enabled to 'Yes'.
- Click 'Save changes'.
- Create a test user.
- Create a test course.
- Enrol test user in test course in the 'student' role.
- In test course, create a quiz.
- Give the quiz a name (E.g. 'Test quiz').
- In quiz settings, go to Safe Exam Browser section.
- Set 'Require the use of Safe Exam Browser' to 'Yes - Use an existing template'.
- For setting 'Safe Exam Browser config template', select the template 'Test template'
- Save the quiz settings.
- Add a question to the quiz.
- Log out.
- Open Moodle in a regular web browser (E.g. Firefox, Chrome)
- Log in as test user.
- Go to test course
- Go to test quiz
- You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with
- correct configuration file."
- You should see button with label: "Launch Safe Exam Browser"
- Click on "Launch Safe Exam Browser"
- Select compatible Safe Exam Browser application
- Log in as test user.
- You should see the quiz landing page
- You should see an alert with message: "Checking access to Safe Exam Browser..."
- After a short delay, the page should reload.
- You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam
- Browser with correct configuration file."
- You should see button with label: 'Start attempt'
- Click on 'Start attempt'
- You should see the first question of the quiz.
Test quiz access with 'Upload my own config' SEB settings
- Log in as an admin.
- Create a test user.
- Create a test course.
- Enrol test user in test course in the 'student' role.
- In test course, create a quiz.
- Give the quiz a name (E.g. 'Test quiz').
- In quiz settings, go to Safe Exam Browser section.
- Set 'Require the use of Safe Exam Browser' to 'Yes - Upload my own config'.
- Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool.
- Save the quiz settings.
- Add a question to the quiz.
- Log out.
- Open Moodle in a regular web browser (E.g. Firefox, Chrome)
- Log in as test user.
- Go to test course
- Go to test quiz
- You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with
- correct configuration file."
- You should see button with label: "Launch Safe Exam Browser"
- Click on "Launch Safe Exam Browser"
- Select compatible Safe Exam Browser application
- Log in as test user.
- You should see the quiz landing page
- You should see an alert with message: "Checking access to Safe Exam Browser..."
- After a short delay, the page should reload.
- You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam
- Browser with correct configuration file."
- You should see button with label: 'Start attempt'
- Click on 'Start attempt'
- You should see the first question of the quiz.
Test quiz access with 'Use SEB client config' SEB settings
- Log in as an admin.
- Create a test user.
- Create a test course.
- Enrol test user in test course in the 'student' role.
- In test course, create a quiz.
- Give the quiz a name (E.g. 'Test quiz').
- In quiz settings, go to Safe Exam Browser section.
- Set 'Require the use of Safe Exam Browser' to 'Yes - Use client config'.
- Save the quiz settings.
- Add a question to the quiz.
- Log out.
- Open Moodle in a regular web browser (E.g. Firefox, Chrome)
- Log in as test user.
- Go to test course
- Go to test quiz
- You should see message: "This quiz has been configured to use the Safe Exam Browser with client configuration."
- You should see button with label: "Launch Safe Exam Browser"
- Click on "Launch Safe Exam Browser"
- Select compatible Safe Exam Browser application
- Log in as test user.
- You should see the quiz landing page
- You should see an alert with message: "Checking access to Safe Exam Browser..."
- After a short delay, the page should reload.
- You should no longer see message: "This quiz has been configured to use the Safe Exam Browser with client configuration."
- You should see button with label: 'Start attempt'
- Click on 'Start attempt'
- You should see the first question of the quiz.
Test quiz access denied with 'Upload my own config'
- Log in as an admin.
- Create a test user.
- Create a test course.
- Enrol test user in test course in the 'student' role.
- In test course, create a quiz.
- Give the quiz a name (E.g. 'Test quiz').
- In quiz settings, go to Safe Exam Browser section.
- Set 'Require the use of Safe Exam Browser' to 'Yes - Upload my own config'.
- Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool.
- Save the quiz settings.
- Add a question to the quiz.
- Log out.
- Open Moodle in a regular web browser (E.g. Firefox, Chrome)
- Log in as test user.
- Go to test course
- Go to test quiz
- You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with
- correct configuration file."
- You should see button with label: "Launch Safe Exam Browser"
- Click on "Launch Safe Exam Browser"
- Select compatible Safe Exam Browser application
- Log in as test user.
- You should see the quiz landing page
- You should see an alert with message: "Checking access to Safe Exam Browser..."
- After a short delay, the page should reload.
- You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam
- Browser with correct configuration file."
- You should see button with label: 'Start attempt'
- Click on 'Start attempt'
- You should see the first question of the quiz.
Test with old version of SEB that doesn't support JS API
- Log in as an admin.
- Create a test user.
- Create a test course.
- Enrol test user in test course in the 'student' role.
- In test course, create a quiz.
- Give the quiz a name (E.g. 'Test quiz').
- In quiz settings, go to Safe Exam Browser section.
- Set 'Require the use of Safe Exam Browser' to 'Yes - Upload my own config'.
- Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool.
- Save the quiz settings.
- Add a question to the quiz.
- Log out.
- Open Moodle in a regular web browser (E.g. Firefox, Chrome)
- Log in as test user.
- Go to test course
- Go to test quiz
- You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with
- correct configuration file."
- You should see button with label: "Launch Safe Exam Browser"
- Click on "Launch Safe Exam Browser"
- Select a Safe Exam Browser application that supports config key but not the JS API. E.g. SEB mac 2.2.3 or SEB windows 3.3.1
- Log in as test user.
- You should see the quiz landing page
- You should not see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser
- with correct configuration file."
- You should see button with label: 'Start attempt'
- Click on 'Start attempt'
- You should see the first question of the quiz.
ShowSetup The following tests should be run on at least the Mac OS and the Windows platforms. Note acronym, SEB == Safe Exam Browser, going forward. Note, by default SEB requires the application to be run on a computer with a single built-in screen. This is configurable, but there is currently a bug in the Windows version that does not allow a computer with external screens only (i.e. a Tower), so it's recommended to test on a laptop without any other screens plugged in. Install SEB Mac If SEB Mac 3.1 is released, download this version from https://safeexambrowser.org/download_en.html Or, download the pre-release version from: https://github.com/SafeExamBrowser/seb-mac/releases/tag/3.2pre4 Install SEB Windows Install SEB Windows If SEB Windows 3.3.2 is released, download this version from https://safeexambrowser.org/download_en.html Or, download the pre-release version from: https://sebdev-let.ethz.ch/api/buildjobs/t4047847xq50t0v5/artifacts/SEB_3.3.2.397_SetupBundle.exe Scenarios Test quiz access with 'Configure manually' SEB settings Log in as an admin. Create a test user. Create a test course. Enrol test user in test course in the 'student' role. In test course, create a quiz. Give the quiz a name (E.g. 'Test quiz'). In quiz settings, go to Safe Exam Browser section. Set 'Require the use of Safe Exam Browser' to 'Configure manually'. Save the quiz settings. Add a question to the quiz. Log out. Open Moodle in a regular web browser (E.g. Firefox, Chrome) Log in as test user. Go to test course Go to test quiz You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: "Launch Safe Exam Browser" Click on "Launch Safe Exam Browser" Select compatible Safe Exam Browser application Log in as test user. You should see the quiz landing page You should see an alert with message: After a short delay, the page should reload. You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: 'Start attempt' Click on 'Start attempt' You should see the first question of the quiz. Test quiz access with 'Use an existing template' SEB settings Log in as an admin. Navigate to Site administration -> Plugins -> Activity modules -> Safe Exam Browser templates Click 'Add new template' Set new template name to 'Test template' Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool. Set Enabled to 'Yes'. Click 'Save changes'. Create a test user. Create a test course. Enrol test user in test course in the 'student' role. In test course, create a quiz. Give the quiz a name (E.g. 'Test quiz'). In quiz settings, go to Safe Exam Browser section. Set 'Require the use of Safe Exam Browser' to 'Yes - Use an existing template'. For setting 'Safe Exam Browser config template', select the template 'Test template' Save the quiz settings. Add a question to the quiz. Log out. Open Moodle in a regular web browser (E.g. Firefox, Chrome) Log in as test user. Go to test course Go to test quiz You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: "Launch Safe Exam Browser" Click on "Launch Safe Exam Browser" Select compatible Safe Exam Browser application Log in as test user. You should see the quiz landing page You should see an alert with message: "Checking access to Safe Exam Browser..." After a short delay, the page should reload. You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: 'Start attempt' Click on 'Start attempt' You should see the first question of the quiz. Test quiz access with 'Upload my own config' SEB settings Log in as an admin. Create a test user. Create a test course. Enrol test user in test course in the 'student' role. In test course, create a quiz. Give the quiz a name (E.g. 'Test quiz'). In quiz settings, go to Safe Exam Browser section. Set 'Require the use of Safe Exam Browser' to 'Yes - Upload my own config'. Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool. Save the quiz settings. Add a question to the quiz. Log out. Open Moodle in a regular web browser (E.g. Firefox, Chrome) Log in as test user. Go to test course Go to test quiz You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: "Launch Safe Exam Browser" Click on "Launch Safe Exam Browser" Select compatible Safe Exam Browser application Log in as test user. You should see the quiz landing page You should see an alert with message: "Checking access to Safe Exam Browser..." After a short delay, the page should reload. You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: 'Start attempt' Click on 'Start attempt' You should see the first question of the quiz. Test quiz access with 'Use SEB client config' SEB settings Log in as an admin. Create a test user. Create a test course. Enrol test user in test course in the 'student' role. In test course, create a quiz. Give the quiz a name (E.g. 'Test quiz'). In quiz settings, go to Safe Exam Browser section. Set 'Require the use of Safe Exam Browser' to 'Yes - Use client config'. Save the quiz settings. Add a question to the quiz. Log out. Open Moodle in a regular web browser (E.g. Firefox, Chrome) Log in as test user. Go to test course Go to test quiz You should see message: "This quiz has been configured to use the Safe Exam Browser with client configuration." You should see button with label: "Launch Safe Exam Browser" Click on "Launch Safe Exam Browser" Select compatible Safe Exam Browser application Log in as test user. You should see the quiz landing page You should see an alert with message: "Checking access to Safe Exam Browser..." After a short delay, the page should reload. You should no longer see message: "This quiz has been configured to use the Safe Exam Browser with client configuration." You should see button with label: 'Start attempt' Click on 'Start attempt' You should see the first question of the quiz. Test quiz access denied with 'Upload my own config' Log in as an admin. Create a test user. Create a test course. Enrol test user in test course in the 'student' role. In test course, create a quiz. Give the quiz a name (E.g. 'Test quiz'). In quiz settings, go to Safe Exam Browser section. Set 'Require the use of Safe Exam Browser' to 'Yes - Upload my own config'. Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool. Save the quiz settings. Add a question to the quiz. Log out. Open Moodle in a regular web browser (E.g. Firefox, Chrome) Log in as test user. Go to test course Go to test quiz You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: "Launch Safe Exam Browser" Click on "Launch Safe Exam Browser" Select compatible Safe Exam Browser application Log in as test user. You should see the quiz landing page You should see an alert with message: "Checking access to Safe Exam Browser..." After a short delay, the page should reload. You should no longer see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: 'Start attempt' Click on 'Start attempt' You should see the first question of the quiz. Test with old version of SEB that doesn't support JS API Log in as an admin. Create a test user. Create a test course. Enrol test user in test course in the 'student' role. In test course, create a quiz. Give the quiz a name (E.g. 'Test quiz'). In quiz settings, go to Safe Exam Browser section. Set 'Require the use of Safe Exam Browser' to 'Yes - Upload my own config'. Upload an unencrypted seb config file. Either use the one attached to tracker or generate one using the Safe Exam Browser config tool. Save the quiz settings. Add a question to the quiz. Log out. Open Moodle in a regular web browser (E.g. Firefox, Chrome) Log in as test user. Go to test course Go to test quiz You should see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: "Launch Safe Exam Browser" Click on "Launch Safe Exam Browser" Select a Safe Exam Browser application that supports config key but not the JS API. E.g. SEB mac 2.2.3 or SEB windows 3.3.1 Log in as test user. You should see the quiz landing page You should not see message: "The config key or browser exam keys could not be validated. Please ensure you are using the Safe Exam Browser with correct configuration file." You should see button with label: 'Start attempt' Click on 'Start attempt' You should see the first question of the quiz.
Description
This tracker created based on danschlet message in in a Telegram channel.
In new macOS and iOS versions of SEB. There are/will support the modern WebKit browser engine (the WKWebView API), which has many advantages. It increases performance, stability and compatibility with web applications. Very important: Is supports access to camera/microphone via WebRTC (getUserMedia etc.). Unfortunately Apple decided to not allow to add custom headers to HTTP request. Therefore we need another way how to transmit the ConfigKey and BrowserExamKey hashes to the assessment web application.
From version 3.0 for IOS SEB supports JavaScript API which allows to query app version details, and the ConfigKey and BrowserExamKey security elements. It is inspired by the Smarter Balanced Assessment Consortium Secure Browser API Specification (https://github.com/SmarterApp/SB_BIRT/blob/master/irp/doc/req/SecureBrowserAPIspecification.md )
Currently the current request header transmission of the CK/BEK is still supported, if sending the CK/BEK is enabled, then the classic WebView is used. But to profit from the benefits of the modern WKWebView in the main browser tab where Moodle is displayed, it would be necessary to support the new SEB JS API for querying the CK/BEK as well.
There are some discussions
- https://github.com/SafeExamBrowser/seb-win-refactoring/discussions/98
- https://github.com/SafeExamBrowser/seb-win-refactoring/issues/84
Thoughts about the steps to support the SEB JS API in Moodle (on an abstract level):
- Support both the HTTP header check and the JavaScript API for the ConfigKey (and if required for the BrowserExamKey BEK). As mentioned, the keys will be same for the same web page (URL). So the web application can check for the availability of the SafeExamBrowser.security.updateKeys() function (or the SafeExamBrowser.version variable). If it‘s available, then the JavaScript API is supported and you can get the ConfigKey/BEK from it. Otherwise get the ConfigKey/BEK from the HTTP headers.
- In the SEB configuration generated by Moodle, set the SEB settings key browserWindowWebView to the policy "Prefer Modern" (integer value 3), which will force the use of the modern WebView and the Javascript API in SEB versions where it is available.
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-73619 Add behat tests to check quiz landing page when SEB is enabled for a quiz
-
- Open
-
- Testing discovered
-
MDL-73404 Quiz access rules should be autoloadable
-
- Open
-
- will help resolve
-
MDL-72351 SEB integration in Moodle 3.9 or Plugin for Moodle 3.7 / 3.8 needs to be updated
-
- Open
-