forked from EvokeNet/moodle-local_evokegame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
badgecriterias.php
36 lines (24 loc) · 1.01 KB
/
badgecriterias.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Configure course badgecriterias.
*
* @package mod_evokeportfolio
* @copyright 2021 World Bank Group <https://worldbank.org>
* @author Willian Mano <[email protected]>
*/
require(__DIR__.'/../../config.php');
// Course module id.
$id = required_param('id', PARAM_INT);
$evokebadge = $DB->get_record('evokegame_badges', ['id' => $id], '*', MUST_EXIST);
$course = $DB->get_record('course', ['id' => $evokebadge->courseid], '*', MUST_EXIST);
require_course_login($course, true);
$context = context_course::instance($course->id);
$PAGE->set_url('/local/evokegame/badgecriterias.php', ['id' => $course->id]);
$PAGE->set_title(format_string($course->fullname));
$PAGE->set_heading(format_string($course->fullname));
$PAGE->set_context($context);
echo $OUTPUT->header();
$renderer = $PAGE->get_renderer('local_evokegame');
$contentrenderable = new \local_evokegame\output\badgecriterias($course, $context, $evokebadge);
echo $renderer->render($contentrenderable);
echo $OUTPUT->footer();