|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00017 abstract class feedback_item_base { 00018 protected $type; 00019 00024 public function __construct() { 00025 $this->init(); 00026 } 00027 00028 //this function only can used after the call of build_editform() 00029 public function show_editform() { 00030 $this->item_form->display(); 00031 } 00032 00033 public function is_cancelled() { 00034 return $this->item_form->is_cancelled(); 00035 } 00036 00037 public function get_data() { 00038 if ($this->item = $this->item_form->get_data()) { 00039 return true; 00040 } 00041 return false; 00042 } 00043 00044 public function value_type() { 00045 return PARAM_RAW; 00046 } 00047 00048 public function value_is_array() { 00049 return false; 00050 } 00051 00052 abstract public function init(); 00053 abstract public function build_editform($item, $feedback, $cm); 00054 abstract public function save_item(); 00055 abstract public function check_value($value, $item); 00056 abstract public function create_value($data); 00057 abstract public function compare_value($item, $dbvalue, $dependvalue); 00058 abstract public function get_presentation($data); 00059 abstract public function get_hasvalue(); 00060 abstract public function can_switch_require(); 00061 00070 abstract public function excelprint_item(&$worksheet, $row_offset, 00071 $xls_formats, $item, 00072 $groupid, $courseid = false); 00073 00081 abstract public function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false); 00082 00088 abstract public function get_printval($item, $value); 00089 00099 abstract public function get_analysed($item, $groupid = false, $courseid = false); 00100 00108 abstract public function print_item_preview($item); 00109 00119 abstract public function print_item_complete($item, $value = '', $highlightrequire = false); 00120 00129 abstract public function print_item_show_value($item, $value = ''); 00130 00131 } 00132 00133 //a dummy class to realize pagebreaks 00134 class feedback_item_pagebreak extends feedback_item_base { 00135 protected $type = "pagebreak"; 00136 00137 public function show_editform() { 00138 } 00139 public function is_cancelled() { 00140 } 00141 public function get_data() { 00142 } 00143 public function init() { 00144 } 00145 public function build_editform($item, $feedback, $cm) { 00146 } 00147 public function save_item() { 00148 } 00149 public function check_value($value, $item) { 00150 } 00151 public function create_value($data) { 00152 } 00153 public function compare_value($item, $dbvalue, $dependvalue) { 00154 } 00155 public function get_presentation($data) { 00156 } 00157 public function get_hasvalue() { 00158 } 00159 public function excelprint_item(&$worksheet, $row_offset, 00160 $xls_formats, $item, 00161 $groupid, $courseid = false) { 00162 } 00163 00164 public function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false) { 00165 } 00166 public function get_printval($item, $value) { 00167 } 00168 public function get_analysed($item, $groupid = false, $courseid = false) { 00169 } 00170 public function print_item_preview($item) { 00171 } 00172 public function print_item_complete($item, $value = '', $highlightrequire = false) { 00173 } 00174 public function print_item_show_value($item, $value = '') { 00175 } 00176 public function can_switch_require() { 00177 } 00178 00179 } 00180 00181