-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from talview/release/v1.0.0
Release/v1.0.0 to Master Merge
- Loading branch information
Showing
23 changed files
with
3,958 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "*" | ||
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
pull_request: | ||
branches: | ||
- release/* | ||
|
||
name: Upload Release Asset | ||
|
||
jobs: | ||
build: | ||
name: Upload Release Asset | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build project # This would actually build your project, using zip for an example artifact | ||
run: | | ||
composer install | ||
git add vendor -f | ||
stashName=`git stash create` | ||
git archive --prefix=proctor/ -o proctor.zip $stashName | ||
git rm --cache -r vendor | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./proctor.zip | ||
asset_name: proctor.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
*.zip | ||
*.swp | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,69 @@ | ||
# moodle-quizaccess_proctor | ||
# Introduciton | `moodle-quizaccess_proctor` - | ||
|
||
A Quiz Access Moodle Module adding configurations for Local Proview Plugin integration to Moodle. | ||
|
||
This plugin is developed by the team at Talview Inc and implements quiz level configurations for launching “Proview” (which is a proctoring solution developed in Talview) in Moodle LMS. It is an ever growing solution with regular new feature enhancements. The plugin will capture and store the candidate's video while the candidate attempts an exam. | ||
|
||
***Note:** This plugin is free to download but the moodle-local_proview plugin needs to be installed to make full use of it.”.* | ||
|
||
## Installation | ||
|
||
--- | ||
|
||
- In the admin view go to Site Administration -> Plugins -> Install Plugin. | ||
|
||
- Download the plugin from Moodle Plugin Directory. | ||
|
||
- Click on “Install the plugin”. You will be directed through some pages, follow the steps. | ||
|
||
- “On the plugin settings page” | ||
- Click on Checkbox to enable configurations for the plugin (Default Enabled). | ||
|
||
- Add The callback URL provided by Talview | ||
|
||
- Add the username provided by Talview to authenticate the callbacks | ||
|
||
- Add the password provided by Talview to authenticate the callbacks | ||
|
||
- Installation Completed. | ||
|
||
## Post Installation Steps | ||
|
||
--- | ||
|
||
Once the plugin is installed, plugin will initate all the existing quizes with Proctoring and Talview Secure Browser disabled by default. In order to enable Proctoring for a specific quiz please follow the following steps: | ||
- Go to the quiz where Proctoring needs to be enabled. | ||
- On the Right Hand Side a settings icon will be available, click on this icon. | ||
- Click on "Edit Settings" | ||
- Scroll down till "Proview Proctoring Settings" | ||
- Here you can select the type of proctoring from dropdown, Talview supports 3 types of proctorin types: | ||
- **AI Proctoring:** The session is evaluated by an AI engine, which generates an automated Proview Score. | ||
- **Record and Review Proctoring:** The session is evaluated by a proctor after it is complete, and the proctor assigns a Proview Rating. | ||
- **Live Proctoring:** The session is evaluated by a proctor while it is ongoing, and the proctor can communicate with the candidate if necessary. The proctor provides the Proview rating. | ||
|
||
- Select the Enable Talview Secure Browser checkbox of TSB has to be enabled | ||
|
||
**Note:** Talview Secure Browser will only be launched if the quiz is proview enabled. | ||
|
||
## Terms and Conditions | ||
|
||
--- | ||
|
||
Talview Inc and all of its subsidiaries (“Talview”) provides Proview and its related services (“Service”) subject to your compliance with the terms and conditions (“Terms of Service”) set forth. | ||
|
||
Talview reserves the right to update and modify the Terms of Service at any time without notice. New features that may be added to the Service shall be subject to the Terms of Service. Should you continue to use the Service after any such modifications have been made, this shall constitute your agreement to such modifications. You may always view the most recent copy of the Terms of Service at "<https://www.talview.com/proview/terms-conditions>" | ||
|
||
Violation of any part of the Terms of Service will result in termination of your account. | ||
|
||
## Roadmap | ||
|
||
--- | ||
|
||
- [x] Adding quiz level configuration for proctoring type | ||
- [x] Adding quiz level configuration for Talview Secure Browser | ||
- [x] Adding functionality to trigger callbacks to Talview when a quiz is created/updated/deleted | ||
- [ ] Adding functionality to trigger callbacks to Talview when a participant is added/removed to course | ||
- [ ] Additional Configuration for showing candidate custom instructions while loading proview | ||
- [ ] Additional Configuration for adding reference links | ||
- [ ] Moodle 4.x support | ||
- [ ] Merging moodle-local_proview and moodle-quizaccess_proctor plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Manage the access to the quiz. | ||
* | ||
* @package quizaccess_proctor | ||
* @author Talview Inc. | ||
* @copyright Talview, 2023 | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace quizaccess_proctor; | ||
|
||
use context_module; | ||
use quiz; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* Manage the access to the quiz. | ||
* | ||
* @copyright 2020 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class access_manager { | ||
|
||
/** @var quiz $quiz A quiz object containing all information pertaining to current quiz. */ | ||
private $quiz; | ||
|
||
/** @var quiz_settings $quizsettings A quiz settings persistent object containing plugin settings */ | ||
private $quizsettings; | ||
|
||
/** @var context_module $context Context of this quiz activity. */ | ||
private $context; | ||
|
||
/** | ||
* The access_manager constructor. | ||
* | ||
* @param quiz $quiz The details of the quiz. | ||
*/ | ||
public function __construct(quiz $quiz) { | ||
$this->quiz = $quiz; | ||
$this->context = context_module::instance($quiz->get_cmid()); | ||
$this->quizsettings = quiz_settings::get_by_quiz_id($quiz->get_quizid()); | ||
} | ||
|
||
/** | ||
* Check if Safe Exam Browser is required to access quiz. | ||
* If quizsettings do not exist, then there is no requirement for using proctor. | ||
* | ||
* @return bool If required. | ||
*/ | ||
public function tsbenabled() : bool { | ||
if (!$this->quizsettings) { | ||
return false; | ||
} else { | ||
return true; | ||
} | ||
} | ||
|
||
/** | ||
* This is the basic check for the Safe Exam Browser previously used in the quizaccess_safebrowser plugin that | ||
* managed basic Moodle interactions with proctor. | ||
* | ||
* @return bool | ||
*/ | ||
public function validate_basic_header(): bool { | ||
if (!$this->should_validate_basic_header()) { | ||
// Config key should not be checked, so do not prevent access. | ||
return true; | ||
} | ||
|
||
if ($this->get_proctor_use_type() == settings_provider::USE_proctor_CLIENT_CONFIG) { | ||
return $this->is_using_proctor(); | ||
} | ||
return true; | ||
} | ||
|
||
/** | ||
* Check if using Safe Exam Browser. | ||
* | ||
* @return bool | ||
*/ | ||
public function is_using_proctor(): bool { | ||
if (isset($_SERVER['HTTP_USER_AGENT'])) { | ||
return strpos($_SERVER['HTTP_USER_AGENT'], 'proctor') !== false; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
/** | ||
* Check if user has any capability to bypass the Safe Exam Browser requirement. | ||
* | ||
* @return bool True if user can bypass check. | ||
*/ | ||
public function can_bypass_proctor(): bool { | ||
return has_capability('quizaccess/proctor:bypassproctor', $this->context); | ||
} | ||
|
||
/** | ||
* Return the full URL that was used to request the current page, which is | ||
* what we need for verifying the X-SafeExamBrowser-RequestHash header. | ||
*/ | ||
private function get_this_page_url(): string { | ||
global $CFG, $FULLME; | ||
// If $FULLME not set fall back to wwwroot. | ||
if ($FULLME == null) { | ||
return $CFG->wwwroot; | ||
} | ||
return $FULLME; | ||
} | ||
|
||
/** | ||
* Return expected proctor config key. | ||
* | ||
* @return string|null | ||
*/ | ||
public function get_valid_config_key(): ?string { | ||
return $this->validconfigkey; | ||
} | ||
|
||
/** | ||
* Getter for the quiz object. | ||
* | ||
* @return quiz | ||
*/ | ||
public function get_quiz() : quiz { | ||
return $this->quiz; | ||
} | ||
|
||
/** | ||
* Get type of proctor usage for the quiz. | ||
* | ||
* @return char | ||
*/ | ||
public function get_proctor_use_type(): char { | ||
if (empty($this->quizsettings)) { | ||
return 'noproctor'; | ||
} else { | ||
return $this->quizsettings->get('proctortype'); | ||
} | ||
} | ||
|
||
/** | ||
* Set session access for quiz. | ||
* | ||
* @param bool $accessallowed | ||
*/ | ||
public function set_session_access(bool $accessallowed): void { | ||
global $SESSION; | ||
if (!isset($SESSION->quizaccess_proctor_access)) { | ||
$SESSION->quizaccess_proctor_access = []; | ||
} | ||
$SESSION->quizaccess_proctor_access[$this->quiz->get_cmid()] = $accessallowed; | ||
} | ||
|
||
/** | ||
* Check session access for quiz if already set. | ||
* | ||
* @return bool | ||
*/ | ||
public function validate_session_access(): bool { | ||
global $SESSION; | ||
return !empty($SESSION->quizaccess_proctor_access[$this->quiz->get_cmid()]); | ||
} | ||
|
||
/** | ||
* Unset the global session access variable for this quiz. | ||
*/ | ||
public function clear_session_access(): void { | ||
global $SESSION; | ||
unset($SESSION->quizaccess_proctor_access[$this->quiz->get_cmid()]); | ||
} | ||
|
||
/** | ||
* Redirect to proctor config link. This will force Safe Exam Browser to be reconfigured. | ||
*/ | ||
public function redirect_to_proctor_config_link(): void { | ||
global $PAGE; | ||
|
||
$proctorlink = \quizaccess_proctor\link_generator::get_link($this->quiz->get_cmid(), true, is_https()); | ||
$PAGE->requires->js_amd_inline("document.location.replace('" . $proctorlink . "')"); | ||
} | ||
|
||
/** | ||
* Check if we need to redirect to proctor config link. | ||
* | ||
* @return bool | ||
*/ | ||
public function should_redirect_to_proctor_config_link(): bool { | ||
// We check if there is an existing config key header. If there is none, we assume that | ||
// the proctor application is not using header verification so auto redirect should not proceed. | ||
$haskeyinheader = !is_null($this->get_received_config_key()); | ||
|
||
return $this->is_using_proctor() | ||
&& get_config('quizaccess_proctor', 'autoreconfigureproctor') | ||
&& $haskeyinheader; | ||
} | ||
} |
Oops, something went wrong.