MDL-37801 mod_glossary - encode / decode links to 'showentry' pages during backup...
[moodle.git] / mod / assign / feedbackplugin.php
blob292f314918dbaa3c59bbca0343c6a88a5c3c2d10
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * This file contains the function for feedback_plugin abstract class
21 * @package mod_assign
22 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') || die();
28 /** Include assignmentplugin.php */
29 require_once($CFG->dirroot.'/mod/assign/assignmentplugin.php');
31 /**
32 * Abstract class for feedback_plugin inherited from assign_plugin abstract class.
34 * @package mod_assign
35 * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
36 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38 abstract class assign_feedback_plugin extends assign_plugin {
40 /**
41 * return subtype name of the plugin
43 * @return string
45 public function get_subtype() {
46 return 'assignfeedback';
49 /**
50 * If this plugin adds to the gradebook comments field, it must specify the format
51 * of the comment
53 * (From weblib.php)
54 * define('FORMAT_MOODLE', '0'); // Does all sorts of transformations and filtering
55 * define('FORMAT_HTML', '1'); // Plain HTML (with some tags stripped)
56 * define('FORMAT_PLAIN', '2'); // Plain text (even tags are printed in full)
57 * define('FORMAT_WIKI', '3'); // Wiki-formatted text
58 * define('FORMAT_MARKDOWN', '4'); // Markdown-formatted
60 * Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment
61 * settings page.
63 * @param stdClass $grade The grade
64 * @return int
66 public function format_for_gradebook(stdClass $grade) {
67 return FORMAT_MOODLE;
70 /**
71 * If this plugin adds to the gradebook comments field, it must format the text
72 * of the comment
74 * Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment
75 * settings page.
77 * @param stdClass $grade The grade
78 * @return string
80 public function text_for_gradebook(stdClass $grade) {
81 return '';
84 /**
85 * Override to indicate a plugin supports quickgrading
87 * @return boolean - True if the plugin supports quickgrading
89 public function supports_quickgrading() {
90 return false;
93 /**
94 * Get quickgrading form elements as html
96 * @param int $userid The user id in the table this quickgrading element relates to
97 * @param mixed $grade grade or null - The grade data. May be null if there are no grades for this user (yet)
98 * @return mixed - A html string containing the html form elements required for quickgrading or false to indicate this plugin does not support quickgrading
100 public function get_quickgrading_html($userid, $grade) {
101 return false;
105 * Has the plugin quickgrading form element been modified in the current form submission?
107 * @param int $userid The user id in the table this quickgrading element relates to
108 * @param stdClass $grade The grade
109 * @return boolean - true if the quickgrading form element has been modified
111 public function is_quickgrading_modified($userid, $grade) {
112 return false;
116 * Save quickgrading changes
118 * @param int $userid The user id in the table this quickgrading element relates to
119 * @param stdClass $grade The grade
120 * @return boolean - true if the grade changes were saved correctly
122 public function save_quickgrading_changes($userid, $grade) {
123 return false;
127 * Return a list of the batch grading operations supported by this plugin
129 * @return array - An array of action and description strings. The action will be passed to grading_batch_operation.
131 public function get_grading_batch_operations() {
132 return array();
136 * Return a list of the grading actions supported by this plugin
138 * A grading action is a page that is not specific to a user but to the whole assignment.
139 * @return array - An array of action and description strings. The action will be passed to grading_action.
141 public function get_grading_actions() {
142 return array();
146 * Show a grading action form
148 * @param string $gradingaction The action chosen from the grading actions menu
149 * @return string The page containing the form
151 public function grading_action($gradingaction) {
152 return '';
156 * Show a batch operations form
158 * @param string $action The action chosen from the batch operations menu
159 * @param array $users The list of selected userids
160 * @return string The page containing the form
162 public function grading_batch_operation($action, $users) {
163 return '';