• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

assessment/classes/class.ilQTIResponse.php

Go to the documentation of this file.
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         define ("RT_RESPONSE_LID", "1");
00024         define ("RT_RESPONSE_XY", "2");
00025         define ("RT_RESPONSE_STR", "3");
00026         define ("RT_RESPONSE_NUM", "4");
00027         define ("RT_RESPONSE_GRP", "5");
00028         define ("RT_RESPONSE_EXTENSION", "6");
00029         
00030         define ("R_CARDINALITY_SINGLE", "1");
00031         define ("R_CARDINALITY_MULTIPLE", "2");
00032         define ("R_CARDINALITY_ORDERED", "3");
00033 
00034         define ("RTIMING_NO", "1");
00035         define ("RTIMING_YES", "2");
00036         
00037         define ("NUMTYPE_INTEGER", "1");
00038         define ("NUMTYPE_DECIMAL", "2");
00039         define ("NUMTYPE_SCIENTIFIC", "3");
00040         
00049 class ilQTIResponse
00050 {
00051         var $flow;
00052         var $response_type;
00053         var $ident;
00054         var $rcardinality;
00055         var $render_type;
00056         var $material1;
00057         var $material2;
00058         var $rtiming;
00059         var $numtype;
00060         
00061         function ilQTIResponse($a_response_type = 0)
00062         {
00063                 $this->flow = 0;
00064                 $this->render_type = NULL;
00065                 $this->response_type = $a_response_type;
00066         }
00067         
00068         function setResponsetype($a_responsetype)
00069         {
00070                 $this->response_type = $a_responsetype;
00071         }
00072         
00073         function getResponsetype()
00074         {
00075                 return $this->response_type;
00076         }
00077         
00078         function setIdent($a_ident)
00079         {
00080                 $this->ident = $a_ident;
00081         }
00082         
00083         function getIdent()
00084         {
00085                 return $this->ident;
00086         }
00087         
00088         function setRCardinality($a_rcardinality)
00089         {
00090                 switch (strtolower($a_rcardinality))
00091                 {
00092                         case "single":
00093                         case "1":
00094                                 $this->rcardinality = R_CARDINALITY_SINGLE;
00095                                 break;
00096                         case "multiple":
00097                         case "2":
00098                                 $this->rcardinality = R_CARDINALITY_MULTIPLE;
00099                                 break;
00100                         case "ordered":
00101                         case "3":
00102                                 $this->rcardinality = R_CARDINALITY_ORDERED;
00103                                 break;
00104                 }
00105         }
00106         
00107         function getRCardinality()
00108         {
00109                 return $this->rcardinality;
00110         }
00111         
00112         function setRTiming($a_rtiming)
00113         {
00114                 switch (strtolower($a_rtiming))
00115                 {
00116                         case "no":
00117                         case "1":
00118                                 $this->rtiming = RTIMING_NO;
00119                                 break;
00120                         case "yes":
00121                         case "2":
00122                                 $this->rtiming = RTIMING_YES;
00123                                 break;
00124                 }
00125         }
00126         
00127         function getRTiming()
00128         {
00129                 return $this->rtiming;
00130         }
00131         
00132         function setNumtype($a_numtype)
00133         {
00134                 switch (strtolower($a_numtype))
00135                 {
00136                         case "integer":
00137                         case "1":
00138                                 $this->numtype = NUMTYPE_INTEGER;
00139                                 break;
00140                         case "decimal":
00141                         case "2":
00142                                 $this->numtype = NUMTYPE_DECIMAL;
00143                                 break;
00144                         case "scientific":
00145                         case "3":
00146                                 $this->numtype = NUMTYPE_SCIENTIFIC;
00147                                 break;
00148                 }
00149         }
00150         
00151         function getNumtype()
00152         {
00153                 return $this->numtype;
00154         }
00155         
00156         function setRenderType($a_render_type)
00157         {
00158                 $this->render_type = $a_render_type;
00159         }
00160         
00161         function getRenderType()
00162         {
00163                 return $this->render_type;
00164         }
00165         
00166         function setFlow($a_flow)
00167         {
00168                 $this->flow = $a_flow;
00169         }
00170         
00171         function getFlow()
00172         {
00173                 return $this->flow;
00174         }
00175         
00176         function setMaterial1($a_material)
00177         {
00178                 $this->material1 = $a_material;
00179         }
00180         
00181         function getMaterial1()
00182         {
00183                 return $this->material1;
00184         }
00185 
00186         function setMaterial2($a_material)
00187         {
00188                 $this->material2 = $a_material;
00189         }
00190         
00191         function getMaterial2()
00192         {
00193                 return $this->material2;
00194         }
00195         
00196         function hasRendering()
00197         {
00198                 if ($this->render_type != NULL)
00199                 {
00200                         return TRUE;
00201                 }
00202                 else
00203                 {
00204                         return FALSE;
00205                 }
00206         }
00207 }
00208 ?>

Generated on Fri Dec 13 2013 10:18:26 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1