Jump to content

Javascript people got a question for you


justinwebb

Recommended Posts

so for work I have to make a test and just using simple javascript arrays to create the questions and such. It tells them if its right or wrong but trying to figure out a way if incorrect to tell them the correct answer as well as tell them they are wrong. Right now it shows a red X beside it and locks out the question.

 

here is an example of the question

 

questions[6] = "7) Why are you on CR";

choices[6] = new Array();

choices[6][0] = "I have no life";

choices[6][1] = "I wish to be cool";

choices[6][2] = "I have a fast car";

choices[6][3] = "I like cheese";

answers[6] = choices[6][1];

 

now as you can see the answer is I wish to be cool but if someone pics i like cheese i want it to tell them that the real answer is i wish to be cool

 

here is the control file also if anyone wants to look at it

http://www.shweet.org/filez/quiz_functions.js

 

i really appreciate the help i know its something simple but havent done javascript in years

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...