moodle/mod/assign/feedbackplugin.php
Damyon Wiese bbd0e548c3 MDL-31270 mod_assign: introducing the assignment module
* Includes an assignment upgrade tool to convert from the old mod_assignment.
* Hides mod_assignment on new installs
2012-05-03 14:44:06 +08:00

85 lines
2.7 KiB
PHP

<?php
// 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/>.
/**
* This file contains the function for feedback_plugin abstract class
*
*
* @package mod_assign
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** Include assignmentplugin.php */
require_once($CFG->dirroot.'/mod/assign/assignmentplugin.php');
/**
* Abstract class for feedback_plugin inherited from assign_plugin abstract class.
*
* @package mod_assign
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class assign_feedback_plugin extends assign_plugin {
/**
* return subtype name of the plugin
*
* @return string
*/
public function get_subtype() {
return 'assignfeedback';
}
/**
* If this plugin adds to the gradebook comments field, it must specify the format
* of the comment
*
* (From weblib.php)
* define('FORMAT_MOODLE', '0'); // Does all sorts of transformations and filtering
* define('FORMAT_HTML', '1'); // Plain HTML (with some tags stripped)
* define('FORMAT_PLAIN', '2'); // Plain text (even tags are printed in full)
* define('FORMAT_WIKI', '3'); // Wiki-formatted text
* define('FORMAT_MARKDOWN', '4'); // Markdown-formatted
*
* Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment
* settings page.
*
* @param stdClass $grade The grade
* @return int
*/
public function format_for_gradebook(stdClass $grade) {
return FORMAT_MOODLE;
}
/**
* If this plugin adds to the gradebook comments field, it must format the text
* of the comment
*
* Only one feedback plugin can push comments to the gradebook and that is chosen by the assignment
* settings page.
*
* @param stdClass $grade The grade
* @return string
*/
public function text_for_gradebook(stdClass $grade) {
return '';
}
}