var num_correct=0;
var cur_question=0;
$(function(){$('#question_0').show();});

function check_answer(key,a,ca){
		$("select.select_question_"+key).attr('disabled','disabled');
		if(a==ca){
			num_correct++;
			$('#correct_'+key).show();
			$('#explanation_'+key).show();
		}else{
			$('#wrong_'+key).show();
			$('#explanation_'+key).show();
		}
		$('#quiz_next_button').removeAttr('disabled');
}

function next_question(total){
	$('#question_'+cur_question).hide();
	cur_question++;
	if(cur_question<total){
		$('#question_'+cur_question).show();
		$('#quiz_next_button').attr('disabled','disabled');
	}else{
		$('.quiz_results').show();
		$('#quiz_next_button').hide();
		$('#quiz_result_text').html("Congratulations!! You answered "+num_correct+" of "+total+" questions correctly.");
	}
}
