00001 <?php 00002 /* 00003 +----------------------------------------------------------------------------+ 00004 | ILIAS open source | 00005 +----------------------------------------------------------------------------+ 00006 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne | 00007 | | 00008 | This program is free software; you can redistribute it and/or | 00009 | modify it under the terms of the GNU General Public License | 00010 | as published by the Free Software Foundation; either version 2 | 00011 | of the License, or (at your option) any later version. | 00012 | | 00013 | This program is distributed in the hope that it will be useful, | 00014 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00015 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00016 | GNU General Public License for more details. | 00017 | | 00018 | You should have received a copy of the GNU General Public License | 00019 | along with this program; if not, write to the Free Software | 00020 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 00021 +----------------------------------------------------------------------------+ 00022 */ 00023 00034 class EnhancedAnswerblock { 00042 var $id; 00043 00051 var $answerblock_index; 00052 00060 var $question_id; 00061 00069 var $points; 00070 00078 var $feedback; 00079 00087 var $connections; 00088 00096 var $subquestion_index; 00097 00106 function EnhancedAnswerblock ( 00107 $question_id = -1 00108 ) 00109 { 00110 $this->question_id = $question_id; 00111 $this->subquestion_index = 0; 00112 $this->connections = array(); 00113 $this->feedback = ""; 00114 $this->points = 0; 00115 $this->answerblock_index = 0; 00116 } 00117 00118 00128 function setId($id = -1) 00129 { 00130 $this->id = $id; 00131 } 00132 00133 00143 function getId() 00144 { 00145 return $this->id; 00146 } 00147 00157 function setQuestionId($id = -1) 00158 { 00159 $this->question_id = $question_id; 00160 } 00161 00162 00172 function getQuestionId() 00173 { 00174 return $this->question_id; 00175 } 00176 00186 function setAnswerblockIndex($answerblock_index = -1) 00187 { 00188 $this->answerblock_index = $answerblock_index; 00189 } 00190 00191 00201 function getAnswerblockIndex() 00202 { 00203 return $this->answerblock_index; 00204 } 00205 00215 function setPoints($points = 0) 00216 { 00217 $this->points = $points; 00218 } 00219 00220 00230 function getPoints() 00231 { 00232 return $this->points; 00233 } 00234 00244 function setSubquestionIndex($subquestion_index = 0) 00245 { 00246 $this->subquestion_index = $subquestion_index; 00247 } 00248 00249 00259 function getSubquestionIndex() 00260 { 00261 return $this->subquestion_index; 00262 } 00263 00273 function setFeedback($feedback = 0) 00274 { 00275 $this->feedback = $feedback; 00276 } 00277 00278 00288 function getFeedback() 00289 { 00290 return $this->feedback; 00291 } 00292 00301 function addConnection($answer_id, $order, $boolean_prefix) 00302 { 00303 $connection = new AnswerblockAnswer(); 00304 $connection->setAnswerId($answer_id); 00305 $connection->setOrder($order); 00306 $connection->setBooleanPrefix($boolean_prefix); 00307 $this->connections[$order] = $connection; 00308 } 00309 00319 function getConnection($order) 00320 { 00321 return $this->connections[$order]; 00322 } 00323 00332 function flushConnections() 00333 { 00334 $this->connections = array(); 00335 } 00336 00337 } 00338 00339 ?>