2024-07-05 09:13:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
|
|
|
require_once(dirname(__FILE__) . '/lib.php');
|
|
|
|
|
2024-09-23 08:07:31 +00:00
|
|
|
require_once($CFG->libdir . '/completionlib.php');
|
|
|
|
|
2024-07-05 09:13:58 +00:00
|
|
|
$id = required_param('id', PARAM_INT); // Course Module ID
|
|
|
|
|
|
|
|
$cm = get_coursemodule_from_id('exp360', $id, 0, false, MUST_EXIST);
|
|
|
|
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
|
|
|
$exp360 = $DB->get_record('exp360', array('id' => $cm->instance), '*', MUST_EXIST);
|
|
|
|
|
|
|
|
$content_id = $exp360->content_id;
|
|
|
|
|
2024-09-23 08:07:31 +00:00
|
|
|
// Ensure completion is enabled for the course module.
|
|
|
|
$completion = new completion_info($course);
|
|
|
|
|
|
|
|
if ($completion->is_enabled($cm)) {
|
|
|
|
// Mark the activity as completed for this user.
|
|
|
|
$completion->update_state($cm, COMPLETION_COMPLETE, $userId);
|
|
|
|
}
|
|
|
|
|
2024-07-05 09:13:58 +00:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<style>
|
|
|
|
html,
|
|
|
|
body {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2024-07-08 12:19:55 +00:00
|
|
|
<script src='https://cdn.exp360.com/embed/js/exp360-embed-3.8.59.js?d=d667dff2-97bb-437e-85d2-f7550d87a4d0&p=web'></script>
|
2024-07-05 09:13:58 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function startContent() {
|
|
|
|
exp360.openContent('<?php echo $content_id; ?>', {
|
|
|
|
popup: false,
|
|
|
|
autorotate: true,
|
|
|
|
autorotate_speed: 5,
|
|
|
|
autorotate_delay: 2500,
|
|
|
|
teleport_animation: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var currentUrl = window.location.href;
|
|
|
|
var url = new URL(currentUrl);
|
|
|
|
var searchParams = new URLSearchParams(url.search);
|
|
|
|
|
|
|
|
var params = {};
|
|
|
|
searchParams.forEach((value, key) => {
|
|
|
|
params[key] = value;
|
|
|
|
});
|
|
|
|
|
|
|
|
function initialize() {
|
|
|
|
var newDiv = document.createElement('div');
|
|
|
|
newDiv.setAttribute('data-exp360-type', 'player');
|
|
|
|
newDiv.setAttribute('data-exp360-id', '<?php echo $content_id; ?>');
|
|
|
|
var windowWidth = document.documentElement.clientWidth;
|
|
|
|
var windowHeight = document.documentElement.clientHeight;
|
|
|
|
newDiv.setAttribute('data-exp360-params', `width=${windowWidth};height=${windowHeight};`);
|
|
|
|
document.body.appendChild(newDiv);
|
|
|
|
}
|
|
|
|
|
|
|
|
window.onload = initialize;
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|