~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to grade/edit/outcome/edit.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php  //$Id: edit.php,v 1.4.2.2 2009/01/07 19:51:18 skodak Exp $
2
 
 
3
 
///////////////////////////////////////////////////////////////////////////
4
 
//                                                                       //
5
 
// NOTICE OF COPYRIGHT                                                   //
6
 
//                                                                       //
7
 
// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
8
 
//          http://moodle.com                                            //
9
 
//                                                                       //
10
 
// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
11
 
//                                                                       //
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.                                   //
16
 
//                                                                       //
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:                          //
21
 
//                                                                       //
22
 
//          http://www.gnu.org/copyleft/gpl.html                         //
23
 
//                                                                       //
24
 
///////////////////////////////////////////////////////////////////////////
 
1
<?php
 
2
 
 
3
// This file is part of Moodle - http://moodle.org/
 
4
//
 
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.
 
9
//
 
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.
 
14
//
 
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/>.
 
17
 
25
18
 
26
19
require_once '../../../config.php';
27
20
require_once $CFG->dirroot.'/grade/lib.php';
32
25
$id       = optional_param('id', 0, PARAM_INT);
33
26
 
34
27
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
 
28
$heading = null;
35
29
 
36
30
// a bit complex access control :-O
37
31
if ($id) {
 
32
    $heading = get_string('editoutcome', 'grades');
 
33
 
38
34
    /// editing existing outcome
39
35
    if (!$outcome_rec = get_record('grade_outcomes', 'id', $id)) {
40
36
        error('Incorrect outcome id');
61
57
    }
62
58
 
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);
120
117
}
121
118
 
122
 
$strgrades       = get_string('grades');
123
 
$strgraderreport = get_string('graderreport', 'grades');
124
 
$stroutcomeedit  = get_string('outcome', 'grades');
125
 
 
126
119
if ($courseid) {
127
 
    $navigation = grade_build_nav(__FILE__, $stroutcomeedit, array('courseid' => $courseid));
128
 
    print_header_simple($strgrades.': '.$strgraderreport, ': '.$stroutcomeedit, $navigation, '', '', true, '', navmenu($course));
129
 
 
 
120
    print_grade_page_head($courseid, 'outcome', 'edit', $heading);
130
121
} else {
131
122
    require_once $CFG->libdir.'/adminlib.php';
132
123
    admin_externalpage_setup('outcomes');