/*
 * Copyright (c) 2000, 2001 OutStart, Inc. All rights reserved.
 *
 * $Id: Answer.js,v 1.2 2002/06/24 15:18:06 kbell Exp $
 */
 
function Answer( text, feedback, weightedValue, correct, order )
{

    this.text			= text;
    this.feedback		= feedback;
    this.weightedValue	= weightedValue;
    this.correct		= correct;
	this.order			= order*10;
	
	return this;
	
}

Answer.prototype.toString = function( cnt )
{
	if (cnt==undefined) { cnt=0; }
	cnt++;
	var retVal = "";
			retVal += getCBTag("ANSWER" + cnt, unescape(this.text));
			retVal += getCBTag("FEEDBACK" + cnt, unescape(this.feedback));
			retVal += getCBTag("WEIGHTED_VALUE" + cnt, this.weightedValue);
			retVal += getCBTag("ORDER" + cnt, this.order);
			
			if (this.correct) { this.correct=1; }
			else 			  { this.correct=0; }
			
			retVal += getCBTag("CORRECT_CB" + cnt, this.correct);
	return retVal;
}

