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

Rup.extend(Task_Module_4_Client, Task_Module_4);

Task_Module_4_Client.prototype._createVariants = function( data )
{
	Task_Module_4_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_4_Client.prototype.getRightAnswer = function()
{
	this.setAnswer(this._dataXml);
}

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

Task_Module_4_Client.prototype.checkVariant = function(variantNum)
{	
	var aRightAnswer = this._dataXml.getAttribute("rightanswer").split(",");
	
	if( !this._variants[variantNum].getValue() || aRightAnswer[variantNum] != this._variants[variantNum].getValue() )
	{
		this._showClientHelp([variantNum]);
	}
}