<script type="text/javascript">
var questions = [
['http://i.imgur.com/k0fBtYP.png','0'],
['http://i.imgur.com/1PwDTVY.png','1'],
['http://i.imgur.com/QKE9UFA.png','2'],
['http://i.imgur.com/XEGhtgB.png','3'],
['http://i.imgur.com/QhnCkAp.png','4'],
['http://i.imgur.com/JoL8tco.png','5'],
['http://i.imgur.com/tcZNls4.png','6'],
['http://i.imgur.com/V9DQI0p.png','7'],
['http://i.imgur.com/39ePipM.png','8'],
['http://i.imgur.com/16yFeMy.png','9'],
['http://i.imgur.com/UUo2yNc.png','10'],
['http://i.imgur.com/5sza6Wm.png','11'],
['http://i.imgur.com/ygPZBdY.png','12'],
['http://i.imgur.com/SwJYBRR.png','13'],
['http://i.imgur.com/wNdpJBX.png','14'],
['http://i.imgur.com/wUS7pDs.png','15'],
['http://i.imgur.com/OEI6ZYX.png','16']
];
var qNo = 0;
var correct = 0;
var cnt = 0;
function NextQuestion(response) {
if ((qNo < questions.length) && (response == questions[qNo][1])) { correct++; }
document.getElementById('score').innerHTML
= 'Your score is '+correct+'/'+(cnt+1);
qNo++;
if (qNo < questions.length) { document.getElementById('Pic').src = questions[qNo][0]; cnt++; }
else { alert('Quiz is done'); }
}
onload = function() {
document.getElementById('Pic').src = questions[0][0];
}
</script>
Okay so basically I have 17 questions and 17 answers that are listed using the numbers 0-16, what I want to do is randomize the order in which the pictures are shown so that you cant just find a pattern and not answer it right, also and I cant figure this out, I want to make it so that after each question is answered a green Correct or a Red incorrect shows up depending on If you got the previous question right can anyone help?