<?xml version="1.0" encoding="UTF-8"?>
<!--
$RCSfile: rnmc_labwork_question.xml,v $
$Revision: 957 $

last change: $Date: 2009-02-17 14:00:06 +0300 (Вт, 17 фев 2009) $
             $Author: toha $

	Lacerta Project
	version 1.0.0.1
	Copyright (C) 2007-2009 RNMC
-->

<rmml>
<composition name="rnmc_labwork_question" class="rnmc_labwork_base">
<script><![CDATA[
	this.type = "RNMC_LABWORK_QUESTION";

//	загрузка шага
	function loadStep(srcNode){
	
		var questionObject = new Composition();
		questionObject._class = "rnmc_stdQuestion";
		questionObject.parent = this;

//		srcNode.nodeName == "question";
		if(!questionObject.initFromNode(srcNode))
			return false;

		questionObject.visibility = OBJECT_VISIBILITY_TRUE;

		this.childObjects = new Array();
		this.childObjects.push(questionObject);

		rnmc_labwork_base_loadStep(srcNode);

		var xmlNode = null;
		var xmlAttributeMap = null;
		var xmlAttribute = null;

		this.questionsArray = new Array();

		xmlNode = srcNode.firstChild;
		while(xmlNode){
			if(xmlNode.nodeName == "settings"){
			// разбор стандартных настроек
				this.parseSettingsNode(xmlNode);
			} else if(xmlNode.nodeName == "actions"){
				this.parseActionsNode(xmlNode);
			} else if(xmlNode.nodeName == "conditions"){
				var conditionNode = xmlNode.firstChild;
				while(conditionNode){
					if(conditionNode.nodeName == "condition"){
						this.parseConditionNode(conditionNode);
					}
					conditionNode = conditionNode.nextSibling;
				}
				this.parseConditionNode(xmlNode);
			}

			xmlNode = xmlNode.nextSibling;
		}

		return true;
	}

	function doAction(singleAction){
		switch (singleAction[0]) {
			case "goToStep":
			case "goToStepWithId":
			case "goPreviousStep":
			case "goNextStep":
			case "goFirstStep":
			case "goLastStep":
			case "goToSummary":
      case "increaseErrors":
      case "decreaseErrors":
      case "increaseHelps":
      case "decreaseHelps":
				rnmc_labwork_base_doAction(singleAction);
				break;
				
			default:
				if (this.childObjects && this.childObjects.length > 0)
					this.childObjects[0].doAction(singleAction);
				break;
		}
	}	
]]></script>
</composition>
</rmml>
