2024-07-05 09:13:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
|
|
|
require_once(dirname(__FILE__) . '/lib.php');
|
|
|
|
|
|
|
|
$id = optional_param('id', 0, PARAM_INT); // Course Module ID
|
|
|
|
$n = optional_param('n', 0, PARAM_INT); // exp360 instance ID
|
|
|
|
|
|
|
|
if ($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);
|
|
|
|
} else if ($n) {
|
|
|
|
$exp360 = $DB->get_record('exp360', array('id' => $n), '*', MUST_EXIST);
|
|
|
|
$course = $DB->get_record('course', array('id' => $exp360->course), '*', MUST_EXIST);
|
|
|
|
$cm = get_coursemodule_from_instance('exp360', $exp360->id, $course->id, false, MUST_EXIST);
|
|
|
|
} else {
|
|
|
|
print_error('You must specify a course_module ID or an instance ID');
|
|
|
|
}
|
|
|
|
|
|
|
|
require_login($course, true, $cm);
|
|
|
|
|
|
|
|
$PAGE->set_url('/mod/exp360/view.php', array('id' => $cm->id));
|
|
|
|
$PAGE->set_title(format_string($exp360->name));
|
|
|
|
$PAGE->set_heading(format_string($course->fullname));
|
|
|
|
|
|
|
|
echo $OUTPUT->header();
|
|
|
|
|
|
|
|
$content_id = $exp360->content_id;
|
2024-09-23 06:43:57 +00:00
|
|
|
$activity_name = $exp360->name;
|
2024-07-05 09:13:58 +00:00
|
|
|
|
|
|
|
echo "<script
|
|
|
|
data-activity-id='$content_id'
|
2024-09-23 06:43:57 +00:00
|
|
|
data-activity-name='$activity_name'
|
2024-07-05 09:13:58 +00:00
|
|
|
src='/mod/exp360/script.js'>
|
|
|
|
</script>";
|
|
|
|
|
|
|
|
echo $OUTPUT->footer();
|