	window.onload = init;
	document.getElementById('btnclr1').onclick = newBoard;
	document.getElementById('btn1').onclick = answer;
	document.getElementById('btn2').onclick = check;

	var BtnClr = document.getElementById('btnclr1');
	var BtnReponses = document.getElementById('btn1')
	var BtnValider = document.getElementById('btn2')
	var sc = 1;

var counter=1;
function init() {
	document.getElementById("screen1").style.display = 'block';
	BtnClr.disabled=true;
	BtnClr.setAttribute('style', "color:#D4D0C8;");
	BtnValider.disabled=true;
	BtnValider.setAttribute('style', "color:#D4D0C8;");
	BtnReponses.disabled=true;
	BtnReponses.setAttribute('style', "color:#D4D0C8;");

}

function viewValider() {
	BtnValider.disabled=false;
	BtnValider.setAttribute('style', "color:#000000;");
}
function check() {
	var mySelect = document.getElementsByClassName('no1');
	for(var i=1; i <= mySelect.length; i++) {
		var correctVal = document.getElementById("mySelect"+i);
	if(correctVal.value=="0") {
		correctVal.setAttribute("style","background-color:red; color:#FFFFFF;border:1px solid #EA9800;");
	} else if (correctVal.value=="true") {
		correctVal.setAttribute("style","background-color:#008000; color:#FFFFFF;border:1px solid #EA9800;");
	} else {
		correctVal.setAttribute("style","background-color:red; color:#FFFFFF;border:1px solid #EA9800;");
	}
	}
	BtnReponses.disabled=false;
	BtnReponses.setAttribute('style', "color:#000000;");
	BtnClr.disabled=false;
	BtnClr.setAttribute('style', "color:#000000;");
	sc = 1;
}

function answer() {
	var mySelect = document.getElementsByClassName('no1');
		if (sc=="1") {
		for(var i=1; i <= mySelect.length; i++) {
			var que = document.getElementById('mySelect'+i)
					que.setAttribute('hidden', 'hidden')
			var ans = document.getElementById('e'+i)
					ans.removeAttribute('hidden')
		}
	BtnClr.disabled=true;
	BtnClr.setAttribute('style', "color:#D4D0C8;");
	BtnValider.disabled=true;
	BtnValider.setAttribute('style', "color:#D4D0C8;");
		sc += 1
	 } else {
		for(var i=1; i <= mySelect.length; i++) {
			var que = document.getElementById('mySelect'+i)
					que.removeAttribute('hidden')
			var ans = document.getElementById('e'+i)
					ans.setAttribute('hidden', 'hidden')
		}
		BtnClr.disabled=false;
		BtnClr.setAttribute('style', "color:#000000;");
		BtnValider.disabled=false;
		BtnValider.setAttribute('style', "color:#000000;");
		sc -= 1
	}
}
function newBoard() {
	if (counter < 4) {
		counter+=1;
	} else {
		counter = 1;
	}
	sc = 1;
	BtnValider.disabled=true;
	BtnValider.setAttribute('style', "color:#D4D0C8;");
	var screenElement = document.getElementsByClassName('screen');
	for(var i=1; i < screenElement.length+1; i++) {
		var screenElement1 = document.getElementById('screen'+i).style.display ='none';
	}
	document.getElementById('screen'+counter).style.display = 'block';
	BtnClr.disabled=true;
	BtnClr.setAttribute('style', "color:#D4D0C8;");
	BtnReponses.disabled=true;
	BtnReponses.setAttribute('style', "color:#D4D0C8;");
	for(var i=1; i < screenElement.length+1; i++) {
		var tb1 = document.getElementById('mySelect'+i);
				tb1.value='';
				tb1.removeAttribute('style');
				tb1.removeAttribute('hidden')
		var ans1 = document.getElementById('e'+i);
				ans1.setAttribute('hidden','hidden')
	}
	
}

