/* 1a test template
 * requires:
 * jquery.js
 * player_test_template.js
 * iliustraData.js
 */

console.log('> template1a.js is iniciated;');

function template1ascript() {
	console.log("function template1ascript(); sectionName=" +sectionName + "; slideName=" +slideName);
	 
        //console.log("BIG_TEST:")
        tObj = getObject();
        
	var mainVars = initMainVars(tObj,sectionName,slideName);
	var tO = mainVars.tO;          
        
       tO = randomizeAnswers(tO);        
       var items = tO['items'];
        
       var check_type = 0;    
    
        // count items
	var itemsCount = tO['items_count']; 	console.log('items count: ' +itemsCount);
	
        if (tO['background']) {
		loadSlideBackground();
	}
        
	var p = {	// properties
		step : 124,		// it is a step for each text, radio, checkbox, check items
		check :{
			top  : 184,
			unchecked		: 'img/check.png',
			checked			: 'img/check_true.png',
			checked_false	: 'img/check_false.png',
			unchecked_false	: 'img/check_false_2.png',
			css  : {
				"position":"absolute",
				'width':'28px',
				'height':'28px',
				'left' : '87px',
				"cursor": "pointer",
				"z-index": "10",
				"background":"url(img/check.png) no-repeat 0px 0px"
			}
		},
		radio :{
			top  : 184,
			unchecked		: 'img/radio.png',
			checked			: 'img/radio_true.png',
			checked_false	: 'img/radio_false.png',
			unchecked_false	: 'img/radio_false_2.png',
			css :{
				"position":"absolute",
				'width':'35px',
				'height':'35px',
				'left' : '87px',
				"cursor": "pointer",
				"z-index": "10",
				"background":"url(img/radio.png) no-repeat 0px 0px"
			}
		},
		text:{
			top  : 185,
			css	:{
				"position":"absolute",
				'width':'984px',
				'height':'116px',
				'left' : '145px',
				"z-index": "7",
				'text-indent':'0px',
				'font-family':'Arial',
				'font-size': '24px',
				'text-align':'left',
				'line-height': '33px'
			}
		}
	}	
	
	p.step = 490/itemsCount;
	var zIndexChange=20;
	
	var text_top = 185;
	
	//  get true - correct ; or falls - incorrect
	this.checkAnswer = checkTestAnswer;
	// check buttton and function to check	
        
        //console.log("question:",tO);
        checkTestButton(this.checkAnswer,tO,p);

	appendQuestion(ssId, ss, tO);
	
	check_type = check_check_or_radio(tO,p,check_type);	
	
	append_items(items,p,1,ss,ssId,check_type);
}