Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6866447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:11:06+00:00 2026-05-27T03:11:06+00:00

Hey Guys my goal for this multi dimensional array is to document the answers

  • 0

Hey Guys my goal for this multi dimensional array is to document the answers (right or wrong) for a test that the user is taking. In the beginning the test array is set up. as the user goes throught the questions the app should add to the array. Note: the page doesnt reload, the questions come via ajax.

Here is what i have so far

   var test = new array();

   function nextquestion(){
      var result;

    if (document.getElementById('rb2').checked = true){
  result = 'correct' ;
    }
else{

result = 'incorrect';
}
var num = document.getElementByName('rb').value;

var question =new Array(); 
question1[0]= document.getElementByName('rb').value; //question id    
question1[1]= result;

I want the test array to hold the data like so

   test[0]
  test[1][0] = question 1
  test[1][1] = correct
  test[2][0] = question 4
  test[2][1] = incorrect
  test[3][0] = question 17
  test[3][1] = correct
  test[4][0] = question 12
  test[4][1] = incorrect



  test[0]
  test[1][0] = question 1
  test[1][1] = correct
  test[2][0] = question 2
  test[2][1] = incorrect
  test[3][0] = question 3
  test[3][1] = correct
  test[4][0] = question 4
  test[4][1] = incorrect

also what must i add to the next function to get the value of the question id so that i can + 1 to get the next question from the database

thanks in advance!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:11:06+00:00Added an answer on May 27, 2026 at 3:11 am

    If you want elements of your test array to hold other arrays, you have to set that up manually:

    var test = [];
    test.push([]);
    test[0].push("Question 1");
    test[0].push(true); //or "correct"
    
    var q1 = test[0][0];
    //"Question 1"
    
    var wasQ1Correct = test[0][1];
    //true
    

    And so on

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys. This is a follow-on from this question : After getting the right
Hey guys I know that this is probably just a simple sql statement but
Hey guys i wrote a quick test. I want delete to call deleteMe which
Hey guys, I want to store a categorized list of URLs. This is an
Hey Guys, here is my code for this, the only help i get from
Hey Guys I've been struggling with this for the last hour and pouring over
Hey guys I just noticed that my join statement here SELECT * FROM reports
Hey guys I can't seem to get the syntax here right, I'm just trying
Hey guys! I have this little problem: I have one ViewController which adds 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.