MDL-16221
[moodle-linuxchix.git] / mod / lesson / grade.php
blob66d2c197e10fbc00eae4e0fbe3cbc2e82e2cf0ae
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('lesson', $id)) {
8 error("Course Module ID was incorrect");
11 if (! $lesson = get_record("lesson", "id", $cm->instance)) {
12 error("lesson ID was incorrect");
15 if (! $course = get_record("course", "id", $lesson->course)) {
16 error("Course is misconfigured");
19 require_login($course->id, false, $cm);
21 if (has_capability('mod/lesson:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
22 redirect('report.php?id='.$cm->id);
23 } else {
24 redirect('view.php?id='.$cm->id);