Bumped the version up to 1.9.3
[moodle.git] / mod / hotpot / grade.php
blobdbfd904b09b7fa117dbe20a7f03b70118786f288
1 <?php // $Id$
3 require_once('../../config.php');
5 $id = required_param('id', PARAM_INT); // Course module ID
7 if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
8 error("Course Module ID was incorrect");
11 if (! $hotpot = get_record("hotpot", "id", $cm->instance)) {
12 error("hotpot ID was incorrect");
15 if (! $course = get_record("course", "id", $hotpot->course)) {
16 error("Course is misconfigured");
19 require_login($course->id, false);
21 // mod/hotpot/lib.php is required for the "hotpot_is_visible" function
22 // the "require_once" should come after "require_login", to ensure language strings are correct
23 require_once($CFG->dirroot.'/mod/hotpot/lib.php');
25 // check user can access this hotpot activity
26 if (!hotpot_is_visible($cm)) {
27 print_error("activityiscurrentlyhidden");
30 if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
31 redirect('report.php?id='.$cm->id);
32 } else {
33 redirect('view.php?id='.$cm->id);