function Task_Module_1( taskId, panel )
{
	Task_Module_1.superclass.constructor.call(this, taskId, panel);
	this._taskType = 1;
}

Rup.extend(Task_Module_1, Task_Module_Abstract);

Task_Module_1.prototype._createVariants = function( data )
{
    var oAnswersDiv = this._variantElement;
	oAnswersDiv.id = 'EduVariantDiv';
	
	sContStr = data.getAttribute('content');
	sContStr = sContStr.replace(/<v>(.*?)<\/v>/gi, "<span class=\"variant_type_1\">$1</span>");
	
	var oTmp = Rup.create("div");
	oAnswersDiv.innerHTML = "";
	oAnswersDiv.appendChild(oTmp);
	oTmp.innerHTML = sContStr;
	
	var aSpans = oTmp.getElementsByTagName("span");
	
	for( var i = aSpans.length - 1; 0 <= i ; i-- )
	{
		var oCurSpan = aSpans[i];
		if( oCurSpan.className == "variant_type_1" )
		{
			var oVariant = new Task_Variant_1({
				text: oCurSpan.innerHTML,
				groupName: 'radio_variant_' + this._params.taskId
			});
			this._variants.unshift(oVariant);
			
			oCurSpan.parentNode.replaceChild(oVariant.dom(), oCurSpan);
		}
	}
}

Task_Module_1.prototype.setAnswer = function(answerXml)
{
	value = answerXml.getAttribute("rightanswer");
	
	for( var i = 0; i < this._variants.length; i++ )
	{
		this._variants[i].setValue(0);
	}
	
	if( this._variants[value - 1] )
	{
		this._variants[value - 1].setValue(1);
	}
}

Task_Module_1.prototype._getAnswerString = function()
{
	for( var i = 0; i < this._variants.length; i++ )
	{
		if( this._variants[i].getValue() )
		{
			return i+1;
		}
	}
	
	return '0';
}

Task_Module_1.prototype.compareAnswers = function()
{
	var rightanswer = parseInt(this._params.ranswer, 10);
	var correct = true;
	for( var i = 0; i < this._variants.length; i++ )
	{
		if (i == rightanswer-1)
		{
			this._variants[i].addTextClassName('shouldbechecked');
			if (!this._variants[i].getValue())
			{
				this._variants[i].addTextClassName('mistake');
				correct = false;
			}
		}
		else
		{
			if (this._variants[i].getValue())
			{
				this._variants[i].addTextClassName('mistake');
				correct = false;
			}
		}
	}
	return correct ? 100 : 0;
}