- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
// считает кол-во основных вопросов в тесте
function get_qnum($file_name) {
$dom = get_str_file($file_name);
$root = $dom->documentElement;
$nodes = $root->childNodes;
$currentTask = array();
foreach ($nodes as $node) {
if ($node->nodeName == 'TASK') {
$currentTaskName = $node->getAttribute('NAME');
if ($currentTaskName == $_SESSION['TEOR']) {
$currentTask['NAME'] = $currentTaskName;
$currentTask['QUEST'] = array();
$Task_info = $node->childNodes;
foreach ($Task_info as $info) {
if ($info->nodeName == 'QUEST')
$currentTask['QUEST'][] = ss_qstn_desc($info);
if ($info->nodeName == 'QUESTYESNO')
$currentTask['QUEST'][] = ss_qstnyesno_desc($info);
}
}
}
}
return count($currentTask['QUEST']);
}