How do I transfer array elements to an another array?

Get help using Construct 2

Post » Wed Aug 26, 2015 10:13 am

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?
B
12
S
1
Posts: 63
Reputation: 633

Post » Wed Aug 26, 2015 10:21 am

https://www.dropbox.com/s/ysroslaj27oqr0i/sample%20MOOSAD.capx?dl=0

here is the app
B
12
S
1
Posts: 63
Reputation: 633

Post » Wed Aug 26, 2015 3:11 pm

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
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Fri Aug 28, 2015 6:31 am

Thanks for the reply/suggestions =)
B
12
S
1
Posts: 63
Reputation: 633


Return to How do I....?

Who is online

Users browsing this forum: alextro, Ryan Kocourek and 3 guests