2009-09-24 08:05:55 +00:00
|
|
|
<?php
|
2008-01-18 14:44:45 +00:00
|
|
|
|
2009-12-16 02:00:48 +00:00
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Grade.php
|
|
|
|
*
|
2010-07-25 10:54:39 +00:00
|
|
|
* @package mod
|
|
|
|
* @subpackage lesson
|
2009-12-16 02:00:48 +00:00
|
|
|
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
|
2010-07-25 10:54:39 +00:00
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
2009-12-16 02:00:48 +00:00
|
|
|
**/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Require config.php
|
|
|
|
*/
|
|
|
|
require_once("../../config.php");
|
|
|
|
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
|
|
|
|
|
2010-07-25 09:30:09 +00:00
|
|
|
$id = required_param('id', PARAM_INT);
|
|
|
|
|
|
|
|
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
|
|
|
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
|
|
|
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
|
|
|
|
2009-12-16 02:00:48 +00:00
|
|
|
require_login($course, false, $cm);
|
|
|
|
|
2010-01-16 15:39:56 +00:00
|
|
|
$PAGE->set_url('/mod/lesson/grade.php', array('id'=>$cm->id));
|
2009-12-16 02:00:48 +00:00
|
|
|
|
|
|
|
if (has_capability('mod/lesson:edit', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
|
|
|
redirect('report.php?id='.$cm->id);
|
|
|
|
} else {
|
|
|
|
redirect('view.php?id='.$cm->id);
|
|
|
|
}
|