|
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_feedbackreviewer_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', 'assessmentsettings', get_string('assessmentsettings', 'workshop')); 00042 00043 if (!empty($options['editableweight'])) { 00044 $mform->addElement('select', 'weight', 00045 get_string('assessmentweight', 'workshop'), workshop::available_assessment_weights_list()); 00046 $mform->setDefault('weight', 1); 00047 } 00048 00049 $mform->addElement('static', 'gradinggrade', get_string('gradinggradecalculated', 'workshop')); 00050 if (!empty($options['overridablegradinggrade'])) { 00051 $grades = array('' => get_string('notoverridden', 'workshop')); 00052 for ($i = (int)$workshop->gradinggrade; $i >= 0; $i--) { 00053 $grades[$i] = $i; 00054 } 00055 $mform->addElement('select', 'gradinggradeover', get_string('gradinggradeover', 'workshop'), $grades); 00056 00057 $mform->addElement('editor', 'feedbackreviewer_editor', get_string('feedbackreviewer', 'workshop'), null, $editoropts); 00058 $mform->setType('feedbackreviewer_editor', PARAM_RAW); 00059 } 00060 00061 $mform->addElement('hidden', 'asid'); 00062 $mform->setType('asid', PARAM_INT); 00063 00064 $mform->addElement('submit', 'save', get_string('saveandclose', 'workshop')); 00065 00066 $this->set_data($current); 00067 } 00068 00069 function validation($data, $files) { 00070 global $CFG, $USER, $DB; 00071 00072 $errors = parent::validation($data, $files); 00073 return $errors; 00074 } 00075 }