window.onload = initall;
var  save ;
var quizId;
var questionId;
function initall() {
    save=document.getElementById('save_ans')//save_ans
    save.onclick = save_ans;
}

function save_ans() {
    var ans = $("input:radio[name=name]:checked").val()
    var url = '/save_ans?ans='+ans+'&quizId='+document.getElementById('quizId').innerHTML+'&questionId='+document.getElementById('questionId').innerHTML
    var req = new XMLHttpRequest();
    req.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
    //  alert(req.responseText)
    }
  };
  if(1==1)
  {
    req.open("GET",'/save_cribs?cribs'+document.getElementById("cribs").value+'&quizId='+document.getElementById('quizId').innerHTML+'&questionId='+document.getElementById('questionId').innerHTML,true)
    alert('/save_cribs?cribs='+document.getElementById("cribs").value+'&quizId='+document.getElementById('quizId').innerHTML+'&questionId='+document.getElementById('questionId').innerHTML)
    req.send();
  }
  req.open("GET", url, true);
  req.send();
}
