function Task_Module_3_Client( taskXml, panel, link )
{
	Task_Module_3_Client.superclass.constructor.call(this, taskXml, panel, link);
}

Rup.extend(Task_Module_3_Client, Task_Module_3);

Task_Module_3_Client.prototype._createVariants = function( data )
{
	Task_Module_3_Client.superclass._createVariants.call(this, data);
	this._dataXml = data;
	
	var instance = this;
	
	for( var i = 0; i < this._variants.length; i++ )
	{
		this._variants[i].setHandler(this.checkVariant, this, i);
	}
}

Task_Module_3_Client.prototype.getRightAnswer = function()
{
	this.setAnswer(this._dataXml);
}

Task_Module_3_Client.prototype.answer = function()
{
	var sAnswer = this._getAnswerString();
	var delimit = this._dataXml.getAttribute("delimit") || "|";
	var aRightAnswer = this._dataXml.getAttribute("rightanswer").split(delimit);
	
	var right = true;
	var variants = [];
	for( var i = 0; i < this._variants.length; i++ )
	{
		var answerVariants = aRightAnswer[i].split('~');
		var ansEqals = false;
		var userAns = this._variants[i].getValue();
		for (var k = 0; k < answerVariants.length; k++)
		{
			if (answerVariants[k] == userAns)
			{
				ansEqals = true;
				break;
			}
		}
		if( !ansEqals )
		{
			variants.push(i);
			right = false;
		}
	}
	
	if( right )
	{
		this.setDisabled();
		this.panel.showAnswer( this._createAnswerXml(100) );
	}
	else
	{
		this._showClientHelp(variants);
	}
}

Task_Module_3_Client.prototype.checkVariant = function(variantNum)
{	
	if (inputToBeFocused) return;
	
	inputToBeFocused = this._variants[variantNum]._input;
	
	var sAnswer = this._getAnswerString();
	var delimit = this._dataXml.getAttribute("delimit") || "|";
	var aRightAnswer = this._dataXml.getAttribute("rightanswer").split(delimit);
	
	var answerVariants = aRightAnswer[variantNum].split('~');
	var ansEqals = false;
	var userAns = this._variants[variantNum].getValue();
	for (var k = 0; k < answerVariants.length; k++)
	{
		if (answerVariants[k] == userAns)
		{
			ansEqals = true;
			break;
		}
	}
	
	if( ansEqals )
	{
		inputToBeFocused = null;
	}
	else
	{
		this._showClientHelp([variantNum]);
	}
}