I need to make a quiz where i have one array for the questions, one array for the array for the answers
I don’t know how to get it to compare the users answer to the correct answers to display the score and the percentage.
This is what I’ve come up with so far, I don’t know how to get the line breaks to work.
<html>
<body>
<script type=”text/javascript”>
var Questions = new Array(9);
var Questions = [‘What colour was Arsenals First Kit?’,’Arsenals Stadium Name?’,’Arsenals Top Scorer?’,’Arsenal Team Colours?’,’Arsenals Manager?’,’Who did they lose to in the Championsleague Final?’,’What nationalilty is Robin van Persie?’,’Arsenals Captain?’,’Where did Arsenal Finish Last Season?’,’Where are Arsenal based?’];
var Answers = new Array(29);
var Answers = [‘Red’,’White’,’Redcurrent’,’Wembley’,’Emirates Stadium’,’Highbury’,’Wright’,’Henry’,’Bergkamp’,’Red and White’,’Yellow’,’Black’,’Wenger’,’Taylor’,’Rioch’,’Real Madrid’,’Barcelona’,’Liverpool’,’German’,’Dutch’,’French’,’Clichy’,’Vermaelen’,’Fabregas’,’Second’,’Third’,’Fourth’,’Nottingham’,’Birmingham’,’London’];
document.write(Questions[0]|<BR>);
document.write(Answers[0]<BR>);
document.write(Answers[1]<BR>);
document.write(Answers[2]<BR><BR>);
document.write(Questions[1]<BR>);
document.write(Answers[3]<BR>);
document.write(Answers[4]<BR>);
document.write(Answers[5]<BR><BR>);
document.write(Questions[2])<BR>;
document.write(Answers[6]<BR>);
document.write(Answers[7]<BR>);
document.write(Answers[8]<BR><BR>);
document.write(Questions[3]<BR>);
document.write(Answers[9]<BR>);
document.write(Answers[10]<BR>);
document.write(Answers[11]<BR><BR>);
document.write(Questions[4]<BR>);
document.write(Answers[12]<BR>);
document.write(Answers[13]<BR>);
document.write(Answers[14]<BR><BR>);
document.write(Questions[5]<BR>);
document.write(Answers[15]<BR>);
document.write(Answers[16]<BR>);
document.write(Answers[17]<BR><BR>);
document.write(Questions[6]<BR>);
document.write(Answers[18]<BR>);
document.write(Answers[19]<BR>);
document.write(Answers[20]<BR><BR>);
document.write(Questions[7]<BR>);
document.write(Answers[21]<BR>);
document.write(Answers[22]<BR>);
document.write(Answers[23]<BR><BR>);
document.write(Questions[8]<BR>);
document.write(Answers[24]<BR>);
document.write(Answers[25]<BR>);
document.write(Answers[26]<BR><BR>);
document.write(Questions[9]<BR>);
document.write(Answers[27]<BR>);
document.write(Answers[28]<BR>);
document.write(Answers[29]<BR><BR>);
</script>
</body>
</html>