|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00027 defined('MOODLE_INTERNAL') || die(); 00028 00029 require_once($CFG->dirroot . '/lib/formslib.php'); 00030 00031 class workshop_feedbackauthor_form extends moodleform { 00032 00033 function definition() { 00034 $mform = $this->_form; 00035 00036 $current = $this->_customdata['current']; 00037 $workshop = $this->_customdata['workshop']; 00038 $editoropts = $this->_customdata['editoropts']; 00039 $options = $this->_customdata['options']; 00040 00041 $mform->addElement('header', 'feedbackauthorform', get_string('feedbackauthor', 'workshop')); 00042 00043 if (!empty($options['editablepublished'])) { 00044 $mform->addElement('checkbox', 'published', get_string('publishsubmission', 'workshop')); 00045 $mform->addHelpButton('published', 'publishsubmission', 'workshop'); 00046 $mform->setDefault('published', false); 00047 } 00048 00049 $mform->addElement('static', 'grade', get_string('gradecalculated', 'workshop')); 00050 00051 $grades = array('' => get_string('notoverridden', 'workshop')); 00052 for ($i = (int)$workshop->grade; $i >= 0; $i--) { 00053 $grades[$i] = $i; 00054 } 00055 $mform->addElement('select', 'gradeover', get_string('gradeover', 'workshop'), $grades); 00056 00057 $mform->addElement('editor', 'feedbackauthor_editor', get_string('feedbackauthor', 'workshop'), null, $editoropts); 00058 $mform->setType('feedbackauthor_editor', PARAM_RAW); 00059 00060 $mform->addElement('hidden', 'submissionid'); 00061 $mform->setType('submissionid', PARAM_INT); 00062 00063 $mform->addElement('submit', 'save', get_string('saveandclose', 'workshop')); 00064 00065 $this->set_data($current); 00066 } 00067 00068 function validation($data, $files) { 00069 global $CFG, $USER, $DB; 00070 00071 $errors = parent::validation($data, $files); 00072 return $errors; 00073 } 00074 }