Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 ?>