Skip to content

Commit

Permalink
Merge pull request #56 from talview/release/v3.1.1
Browse files Browse the repository at this point in the history
Release/v3.1.1
  • Loading branch information
devang1281 committed Aug 23, 2023
2 parents 9b5db21 + b02c97c commit a48e66f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions datastore.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
$template->session_id = $template->session_type === "live_proctor" ? $quizid.'-'.$USER->id : $quizid.'-'.$USER->id.'-'.$attempt; // Do not append attempt number for live proctoring. Re-attempting same quiz not supported in live proctoring.
$template->proview_url = trim(get_config('local_proview', 'proview_url'));
$template->token = trim(get_config('local_proview', 'token'));
$template->proview_playback_url = rtrim(trim(get_config('local_proview', 'proview_playback_url')), '/');
echo json_encode($template);
return;
}
Expand Down
15 changes: 6 additions & 9 deletions frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function startProview(
proview_url,
additionalInstruction,
reference_link,
proview_playback_url,
skipHardwareTest,
previewStyle,
clear) {
Expand All @@ -114,11 +115,11 @@ function startProview(
clear: clear || false,
skipHardwareTest: skipHardwareTest || false,
previewStyle: previewStyle || 'position: fixed; bottom: 0px;',
initCallback: createCallback(proview_url, profileId)/* onProviewStart */
initCallback: createCallback(proview_playback_url, profileId)/* onProviewStart */
});
}

function createCallback (proview_url, profile_id) {
function createCallback (proview_playback_url, profile_id) {
return function onProviewStart(err, id) {
try {
const urlParams = new URLSearchParams(window.location.search);
Expand All @@ -143,15 +144,11 @@ function createCallback (proview_url, profile_id) {
id // Playback ID
]
}, childOrigin);

let url = proview_url || '//cdn.proview.io/init.js';
url = ((
url.search('v5')!=-1) ? 'https://appv5.proview.io/embedded/':(url.search('client')!=1 || url.search('v7')!=1)
? "https://appv7.proview.io/embedded/" : 'https://app.proview.io/embedded/') + id;

const arr = {
"user_id" : profile_id,
"quiz_id" : urlParams.get('quizId'),
"proview_url" : url,
"proview_url" : proview_playback_url+'/'+id,
"sesskey" : "<?php echo $sesskey ?>"
}
const xmlhttp = new XMLHttpRequest();
Expand Down Expand Up @@ -229,7 +226,7 @@ function run(){
response=xmlhttp.responseText;
response=JSON.parse(response);
window.quizPassword = response.quiz_password;
startProview(response.token, response.profile_id, response.session_id, response.session_type, response.proview_url, response.instructions, response.reference_link);
startProview(response.token, response.profile_id, response.session_id, response.session_type, response.proview_url, response.instructions, response.reference_link, response.proview_playback_url);
}
}
xmlhttp.open("GET", "datastore.php?quiz_id=" + urlParams.get('quizId') + "&sesskey=" + "<?php echo $sesskey?>" , true);
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2023081601;
$plugin->version = 2023082301;
$plugin->requires = 2020061500;
$plugin->release = '3.1.0 (Build: 2023081601)';
$plugin->release = '3.1.1 (Build: 2023082301)';
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'local_proview';

Expand Down

0 comments on commit a48e66f

Please sign in to comment.