MDL-29479 Improved gradingform_controller base class
[moodle.git] / grade / grading / form / rubric / lib.php
CommitLineData
9b8550f8
DM
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
18/**
19 * Grading method controller for the Rubric plugin
20 *
21 * @package gradingform
22 * @subpackage rubric
23 * @copyright 2011 David Mudrak <david@moodle.com>
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 */
26
27defined('MOODLE_INTERNAL') || die();
28
29require_once($CFG->dirroot.'/grade/grading/form/lib.php'); // parent class
30
31/**
32 * This controller encapsulates the rubric grading logic
33 */
34class rubric_grading_controller extends grading_controller {
35
36 /**
37 * Extends the module settings navigation with the rubric grading settings
38 *
39 * This function is called when the context for the page is an activity module with the
40 * FEATURE_ADVANCED_GRADING, the user has the permission moodle/grade:managegradingforms
41 * and there is an area with the active grading method set to 'rubric'.
42 *
43 * @param settings_navigation $settingsnav {@link settings_navigation}
44 * @param navigation_node $node {@link navigation_node}
45 */
46 public function extend_settings_navigation(settings_navigation $settingsnav, navigation_node $node=null) {
47 $node->add(get_string('definerubric', 'gradingform_rubric'),
48 new moodle_url('/grade/grading/form/rubric/edit.php', array('area' => $this->areaid)), settings_navigation::TYPE_CUSTOM,
49 null, null, new pix_icon('icon', '', 'gradingform_rubric'));
50 }
51}