How do I transfer array elements to an another array?

0 favourites
  • 4 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • Scenario:

    My first array is Questions then my second array is Incorrect. Elements on the array Questions came from a text data using AJAX, When the elements in Questions are shuffled using this action "set rnd to floor(random(Questions.Width) and deleting the index of the array Questions to prevent from duplicating.

    Here is the problem, whenever the user get a wrong answer, the value (all) of the index of the wrong answer in the array Questions should transfer to the array Incorrect.

    How do I implement that?


    here is the app

  • Let me make sure that I understand you correctly:

    Questions: [question0, question1, question2, ... ]

    Incorrect answers: [ic0, ic1, ic2, ic3, ... ] <--- Are these question IDs or answerIds?

    Are you transferring all of the incorrect answers at once, or one at a time?

    I think you might be better of transferring them one at a time, while the user is taking the test.

    Something like:

    if answerChosen is incorrect

    --- questionArray: Remove questionIndex

    --- incorrectArray: Push (at end) questionIndex

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply/suggestions =)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)