I have this code:
<!DOCTYPE html>
<html>
<head>
<script language="JavaScript">
<!-- Hide from old browsers
function pickimg(){
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1;
images = new Array
images[1] = "1.png"
images[2] = "2.png"
images[3] = "3.png"
images[4] = "4.png"
images[5] = "5.png"
var image = images[rand1]
document.randimg.src = image
}
// -- End Hiding Here -->
</script>
</head>
<body onLoad="pickimg()">
<a href="" onClick="pickimg();return false;"><IMG SRC="YOUR IMAGE" name="randimg" border=0></a>
</body>
</html>
This give me a random image and it changes when i click on it. This images are 5 math questions, i want to add 5 answers images: answer1.png, answer2.png ... answer5.png
I want my script to do this:
When i enter webpage to give me a random image (question)
when i click on it to give me the answer image. Ex. If random image is 1.png to give me answer1.png
when i click answer1.png to give me another random question then the answer to that question and so on ... I don't want to get repeated questions until are all displayed then go another random sequence of 5 images and answers.
Thank you!
Or i can use different webpages with links instead of images, but is harder to meke no repeat. What do you think?