var quiz = new function()
{
	this.questions = {};
	this._currquestion = null;
	this._currresponse = null;
	
	this.addQuestion = function(sQuestionID,sQuestion)
	{
		var oQuestion = {};
		oQuestion.id = sQuestionID;
		oQuestion.html = sQuestion;
		oQuestion.responses = [];
		
		this._currquestion = oQuestion.id;
		this._currresponse = null;
		this.questions[oQuestion.id] = oQuestion;
		return true;
	}
	this.addResponse = function(sResponse)
	{
		if(null == this._currquestion) return false;
		var oQuestion = this.questions[this._currquestion];
		
		var oResponse = {};
		
		oResponse.id = oQuestion.responses.length;
		oResponse.html = sResponse;
		oResponse.leanings = [];
		
		this._currresponse = oResponse.id;
		oQuestion.responses.push(oResponse);

		return true;
	}
	this.addLeaning = function(sCode,iValue)
	{
		if(null == this._currquestion) return false;
		if(null == this._currresponse) return false;


		var oResponse = this.questions[this._currquestion].responses[this._currresponse];
				
		oResponse.leanings[sCode] = iValue;

		return true;
	}
	
	return this;
}
