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

assessment/classes/class.ilQTIUtils.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 
00034 class ilQTIUtils
00035 {
00045         function &_getRespcondition($respcondition_node)
00046         {
00047                 $result = array();
00048                 $children = $respcondition_node->child_nodes();
00049                 $not = 0;
00050                 foreach ($children as $index => $node)
00051                 {
00052                         switch ($node->node_name())
00053                         {
00054                                 case "conditionvar":
00055                                         $not = 0;
00056                                         $operation = $node->first_child();
00057                                         $selected = 1;
00058                                         if (strcmp($operation->node_name(), "not") == 0)
00059                                         {
00060                                                 $selected = 0;
00061                                                 $operation = $operation->first_child();
00062                                                 $not = 1;
00063                                         }
00064                                         if (strcmp($operation->node_name(), "varequal") == 0)
00065                                         {
00066                                                 $respident = $operation->get_attribute("respident");
00067                                                 $idx = $operation->get_attribute("index");
00068                                                 $value = $operation->get_content();
00069                                         }
00070                                         elseif (strcmp($operation->node_name(), "varsubset") == 0)
00071                                         {
00072                                                 $respident = $operation->get_attribute("respident");
00073                                                 $value = $operation->get_content();
00074                                         }
00075                                         elseif (strcmp($operation->node_name(), "varinside") == 0)
00076                                         {
00077                                                 $respident = $operation->get_attribute("respident");
00078                                                 $areatype = $operation->get_attribute("areatype");
00079                                                 $value = $operation->get_content();
00080                                         }
00081                                         $result["conditionvar"]["selected"] = $selected;
00082                                         $result["conditionvar"]["respident"] = $respident;
00083                                         $result["conditionvar"]["areatype"] = $areatype;
00084                                         $result["conditionvar"]["index"] = $idx;                                        
00085                                         $result["conditionvar"]["not"] = $not;                                  
00086                                         $result["conditionvar"]["value"] = $value;                                      
00087                                         break;
00088                                 case "setvar":
00089                                         $action = $node->get_attribute("action");
00090                                         $points = $node->get_content();
00091                                         $result["setvar"]["action"] = $action;
00092                                         $result["setvar"]["points"] = $points;
00093                                         break;
00094                                 case "displayfeedback":
00095                                         $feedbacktype = $node->get_attribute("feedbacktype");
00096                                         $linkrefid = $node->get_attribute("linkrefid");
00097                                         $result["displayfeedback"]["feedbacktype"] = $feedbacktype;
00098                                         $result["displayfeedback"]["linkrefid"] = $linkrefid;
00099                                         break;
00100                         }
00101                 }
00102                 return $result;
00103         }
00104 }
00105 
00106 ?>

Generated on Fri Dec 13 2013 09:06:33 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1