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