var Total_Question = 10         // Remember to change this value
                                // according to # of questions

var msg = ""

// These are the solutions
  var Solution = new Array(Total_Question)
  Solution[0] = "No, the correct answer is Daniel Bell"
  Solution[1] = "Giddens rejects the idea of a postmodern age and insists that we are living in an era of  'late modernity' ."
  Solution[2] = "Whilst it is true that all the 'founding fathers' thought 'Rationality' was important to modernity, it is Max Weber who is most associated with the idea."
Solution[3] = "No, this is an idea of Georg Simmel's."
Solution[4]= "No. Many people think, mistakenly, that Marx thought equality important. In fact he suggested it to be a 'bourgeios concept!"
Solution[5]= "No, it was in fact Foucault."
Solution[6]= "No, it is fact Paul Gilroy; he wrote the book with the title 'The Black Atlantic'."
Solution[7]= "No, Foucault again. GET READING!!"
Solution[8]= "It is the neofunctionalist Jeffrey Alexander who argues the present postmodern era is being displaced by neo-modernity."
Solution[9]= "It was in the early 1980s that Fredric Jameson first propounded this view of postmodernism"


// end of solutions

function GetSelectedButton(ButtonGroup)
{
  for (var x=0; x < ButtonGroup.length; x++)
    if (ButtonGroup[x].checked) return x
  return 0
} 

function ReportScore(correct)
{ 
  var SecWin = 
      window.open("","","scrollbars,width=400,height=300")
  var MustHave1 = "<HTML><HEAD><TITLE>Your Score</TITLE></HEAD><body bgcolor='2c448b' text='ffffff';"
  var Percent = "<H1>You have scored  : "+Math.round(correct/Total_Question*100)
                 + "% on the Modernity Quiz</H1><HR>"
  msg = MustHave1 +Percent + msg  + "</BODY></HTML>"
  
  SecWin.document.write(msg)
  msg = ""  // Clear message
}

function Grade()
{
  var correct = 0
  var wrong = 0
  for (number=0; number < Total_Question; number++)
    {
      var form = document.forms[number]      // Question #
      var i = GetSelectedButton(form.q1)
      if (form.q1[i].value == "1")
         { correct++ } 
        else 
         { wrong++
           msg += "<H4>Question "+(number+1)+".</H4>"
                  +Solution[number]+"<BR>"
         }
    }
    ReportScore(correct)

}
