javascript - Adding mutliple answers to quiz -


I have to add several questionnaires to use the same code. How can I do this? Answer the questions [0] = ["Apple", "Test"]

  // questions; Answer [1] = "Dynamic HTML"; Answer [2] = "Netscape"; Answer [3] = "Common Gateway Interface";   

As you can see, Ive just tried to add a second quote to your second answer on the code but it does not recognize what is the best way to do this? (There is a "or" command or something like that?

Here is my complete code:

  // var numques = 4; // Insert each question var numChoi Enter the number of questions displayed in the North field var answers = new array (4); // questions [0] = ["apple", "test"]; Answer [1] = "Dynamic HTML", "Test"; Answer [2] = "Netscape", "Test"; Answer [3] = "Common Gateway Interface", "Test"; // Anything belowChange here ... function getScore (form) {var score = 0; var currElt; var for currSelection; for (i = 0; i    

you use javascript object acctal notation var answers = {0: ["Apple", "Test"], 1: "Dynamic HTML", 2: "Netscape", 3: "Common Gateway Interface"};

You can accept your answers with the answer [0], answer [1], ...

Do you mean it?

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -