QTI helper class to support operations on QTI files. More...
Public Member Functions | |
| & | _getRespcondition ($respcondition_node) |
| Retrieves the information on an respcondition node in a DOM XML QTI document. | |
QTI helper class to support operations on QTI files.
QTI helper class to support operations on QTI files
class.ilQTIUtils.php Assessment
Definition at line 34 of file class.ilQTIUtils.php.
| & ilQTIUtils::_getRespcondition | ( | $ | respcondition_node | ) |
Retrieves the information on an respcondition node in a DOM XML QTI document.
Retrieves the information on an respcondition node in a DOM XML QTI document
| object | $respcondition_node A DOM XML node representing a respcondition tag |
Definition at line 45 of file class.ilQTIUtils.php.
Referenced by ASS_OrderingQuestion::from_xml(), ASS_MultipleChoice::from_xml(), ASS_MatchingQuestion::from_xml(), ASS_ImagemapQuestion::from_xml(), and ASS_ClozeTest::from_xml().
{
$result = array();
$children = $respcondition_node->child_nodes();
$not = 0;
foreach ($children as $index => $node)
{
switch ($node->node_name())
{
case "conditionvar":
$not = 0;
$operation = $node->first_child();
$selected = 1;
if (strcmp($operation->node_name(), "not") == 0)
{
$selected = 0;
$operation = $operation->first_child();
$not = 1;
}
if (strcmp($operation->node_name(), "varequal") == 0)
{
$respident = $operation->get_attribute("respident");
$idx = $operation->get_attribute("index");
$value = $operation->get_content();
}
elseif (strcmp($operation->node_name(), "varsubset") == 0)
{
$respident = $operation->get_attribute("respident");
$value = $operation->get_content();
}
elseif (strcmp($operation->node_name(), "varinside") == 0)
{
$respident = $operation->get_attribute("respident");
$areatype = $operation->get_attribute("areatype");
$value = $operation->get_content();
}
$result["conditionvar"]["selected"] = $selected;
$result["conditionvar"]["respident"] = $respident;
$result["conditionvar"]["areatype"] = $areatype;
$result["conditionvar"]["index"] = $idx;
$result["conditionvar"]["not"] = $not;
$result["conditionvar"]["value"] = $value;
break;
case "setvar":
$action = $node->get_attribute("action");
$points = $node->get_content();
$result["setvar"]["action"] = $action;
$result["setvar"]["points"] = $points;
break;
case "displayfeedback":
$feedbacktype = $node->get_attribute("feedbacktype");
$linkrefid = $node->get_attribute("linkrefid");
$result["displayfeedback"]["feedbacktype"] = $feedbacktype;
$result["displayfeedback"]["linkrefid"] = $linkrefid;
break;
}
}
return $result;
}
Here is the caller graph for this function:
1.7.1