Beispiel #1
0
    //Most frametops don't include footer, and pre-post blocks
    $PAGE->blocks->show_only_fake_blocks();
    //Disable blocks for layouts which do include pre-post blocks
} else {
    if ($launchcontainer == LTI_LAUNCH_CONTAINER_REPLACE_MOODLE_WINDOW) {
        redirect('launch.php?id=' . $cm->id);
    } else {
        $PAGE->set_pagelayout('incourse');
    }
}
require_login($course);
// Mark viewed by user (if required).
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
$params = array('context' => $context, 'objectid' => $lti->id);
$event = \mod_lti\event\course_module_viewed::create($params);
$event->add_record_snapshot('course_modules', $cm);
$event->add_record_snapshot('course', $course);
$event->add_record_snapshot('lti', $lti);
$event->trigger();
$pagetitle = strip_tags($course->shortname . ': ' . format_string($lti->name));
$PAGE->set_title($pagetitle);
$PAGE->set_heading($course->fullname);
// Print the page header
echo $OUTPUT->header();
if ($lti->showtitlelaunch) {
    // Print the main part of the page
    echo $OUTPUT->heading(format_string($lti->name, true, array('context' => $context)));
}
if ($lti->showdescriptionlaunch && $lti->intro) {
    echo $OUTPUT->box(format_module_intro('lti', $lti, $cm->id), 'generalbox description', 'intro');
Beispiel #2
0
/**
 * Mark the activity completed (if required) and trigger the course_module_viewed event.
 *
 * @param  stdClass $lti        lti object
 * @param  stdClass $course     course object
 * @param  stdClass $cm         course module object
 * @param  stdClass $context    context object
 * @since Moodle 3.0
 */
function lti_view($lti, $course, $cm, $context)
{
    // Trigger course_module_viewed event.
    $params = array('context' => $context, 'objectid' => $lti->id);
    $event = \mod_lti\event\course_module_viewed::create($params);
    $event->add_record_snapshot('course_modules', $cm);
    $event->add_record_snapshot('course', $course);
    $event->add_record_snapshot('lti', $lti);
    $event->trigger();
    // Completion.
    $completion = new completion_info($course);
    $completion->set_module_viewed($cm);
}