mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
28 lines
745 B
PHP
28 lines
745 B
PHP
<?php // $Id$
|
|
|
|
require_once("../../config.php");
|
|
|
|
$id = required_param('id', PARAM_INT); // Course module ID
|
|
|
|
if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
|
|
print_error('invalidcoursemodule');
|
|
}
|
|
|
|
if (! $hotpot = $DB->get_record("hotpot", array("id"=>$cm->instance))) {
|
|
print_error('invalidhotpotid', 'hotpot');
|
|
}
|
|
|
|
if (! $course = $DB->get_record("course", array("id"=>$hotpot->course))) {
|
|
print_error("invalidcourse");
|
|
}
|
|
|
|
require_login($course->id, false, $cm);
|
|
|
|
if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
|
redirect('report.php?id='.$cm->id);
|
|
} else {
|
|
redirect('view.php?id='.$cm->id);
|
|
}
|
|
|
|
?>
|