1
<?php //$Id: edit.php,v 1.4.2.2 2009/01/07 19:51:18 skodak Exp $
3
///////////////////////////////////////////////////////////////////////////
5
// NOTICE OF COPYRIGHT //
7
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
8
// http://moodle.com //
10
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
12
// This program is free software; you can redistribute it and/or modify //
13
// it under the terms of the GNU General Public License as published by //
14
// the Free Software Foundation; either version 2 of the License, or //
15
// (at your option) any later version. //
17
// This program is distributed in the hope that it will be useful, //
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20
// GNU General Public License for more details: //
22
// http://www.gnu.org/copyleft/gpl.html //
24
///////////////////////////////////////////////////////////////////////////
3
// This file is part of Moodle - http://moodle.org/
5
// Moodle is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
10
// Moodle is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
26
19
require_once '../../../config.php';
27
20
require_once $CFG->dirroot.'/grade/lib.php';
32
25
$id = optional_param('id', 0, PARAM_INT);
34
27
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
36
30
// a bit complex access control :-O
32
$heading = get_string('editoutcome', 'grades');
38
34
/// editing existing outcome
39
35
if (!$outcome_rec = get_record('grade_outcomes', 'id', $id)) {
40
36
error('Incorrect outcome id');
63
59
} else if ($courseid){
60
$heading = get_string('addoutcome', 'grades');
64
61
/// adding new outcome from course
65
62
if (!$course = get_record('course', 'id', $courseid)) {
66
63
print_error('nocourseid');
119
116
redirect($returnurl);
122
$strgrades = get_string('grades');
123
$strgraderreport = get_string('graderreport', 'grades');
124
$stroutcomeedit = get_string('outcome', 'grades');
127
$navigation = grade_build_nav(__FILE__, $stroutcomeedit, array('courseid' => $courseid));
128
print_header_simple($strgrades.': '.$strgraderreport, ': '.$stroutcomeedit, $navigation, '', '', true, '', navmenu($course));
120
print_grade_page_head($courseid, 'outcome', 'edit', $heading);
131
122
require_once $CFG->libdir.'/adminlib.php';
132
123
admin_externalpage_setup('outcomes');