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

var msg = "If it reads 80% or above, then well done! If it reads between 50% and 79%,  you have achieved a good, above average, result. Between 25% and 49% then you need to return to serious reading! If you received below 25%......!.<br> Below are the correct solutions to the questions you got wrong"

// These are the solutions
  var Solution = new Array(Total_Question)
  Solution[0] = "No, Bauman extends the idea of shopping to describe how we, as individuals, 'choose' the communities we join"
  Solution[1] = "If you chose 'social structure' here be absolutely clear that Bauman rejects the term. He sees it as a remnant of a traditional form of sociology, such as that of PARSONS, which perceives society as ordered. "
  Solution[2] = "The correct answer here is: Heavy and Light, or, in a recent work by Bauman - solid and liquid!"
Solution[3] = "Bauman is no conspiracy theorist - so there is no 'knowing elite' contriving this 'society'. Nor is Bauman proposing that free will can construct its own wishes. IN TRUTH OF COURSE BAUMAN WOULD RATHER NOT USE THE CONCEPT SOCIETY AT ALL. HE PREFERS THE IDEA OF SOCIALITY"
Solution[4]= "The correct answer here is 'emotional'"
Solution[5]= "For Bauman, globalisation compounds existing social inequalities"
Solution[6]= "Neo-tribes is the correct answer to this question."
Solution[7]= "'Power lies with the ruling class' is a Marxist idea; 'power as everywhere' belongs to Foucault. Bauman sees power as belonging to those who can shape and change aspects of their habitat"
Solution[8]= "Where there is an 'us', there is also a 'them'"
Solution[9]= "Whilst it is no doubt true that experts charge more for their services and equally true that 'we' appear to trust them less. These two features are consequences of the loss of leadership function of these experts as more and more contending knowledges become available."



// 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=250")
  var MustHave1 = "<HTML><HEAD><TITLE>YOUR SCORE</TITLE></HEAD><BODY><center><font face='Arial' size='4' color='red'><b>Tony's Bauman Quiz.</center></font><br><font face='Arial' size='4' color='black'><center><b> How did you do?<br></center><font face='Arial' size='3' color='black'><b> Your result, given in terms of the percentage of questions you answered correctly is:"
  var Percent = "<H2>Score : "+Math.round(correct/Total_Question*100)
                 + "%</H2><HR>"
  msg = MustHave1 +Percent + msg  + "<br><center><INPUT TYPE='BUTTON' VALUE='Close Window' onClick='window.close()'><BR></FORM><br>Tony Fitzgerald</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)

}
