var Total_Question = 13         // 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] = "The correct answer is Berlin"
  Solution[1] = "The correct answer is that Simmel was only to achieve Professor status late in his career in 1910 in Strasbourg"
  Solution[2] = "Calculation; Indifference; Intellectualisation; Blase attitude, is the correct combination"
Solution[3] = "The person who enters the community and stays is the best definition of Simmel's stranger"
Solution[4]= "According to British sociologist David Frisby, Simmel's sociology was informed by French Impressionism"
Solution[5]= "The correct answer is Methodological Relationalism"
Solution[6]= "The correct answer is that objective culture becomes increasingly reified."
Solution[7]= "If you did put baker, you probably need to resign NOW!The correct answer is that a flaneur is someone who walks the city just to experience it"
Solution[8]= "The correct answer is a pattern of social behaviour which is repeated over at least three generations"
Solution[9]= "Neo-Kantian is the correct answer"
Solution[10]= "The correct answer is that by sociability Simmel meant he play form of human association"
Solution[11]= "Relationality means that everything and everyone is related to one another"
Solution[12]= "For Simmel fashion demonstrates the extent to which individuals both wish to be members of a group/society and yet remain in some sense distinctive individuals."



// 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 Simmel 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)

}

