How to store and save correct answers with a set of digits as response in Digit span task?

  1. Delete the loop called trials_2
  2. Delete the routine called nReps
  3. The nReps field for show_digits should be nDigits

  1. In the text element where you currently have $sequence[show_digits.thisN] change this to $msg

  2. Add msg = sequence[show_digits.thisN]

  3. Change the code to Both and change show_digits.thisN to snapshot.thisN on the JavaScript side to fix .thisN online. I think this may occur twice.

I did 4 and 6 but for 5. Add msg = sequence[show_digits.thisN] where? in the text elements after $msg?

At the bottom of your Begin Routine code. Add a semi-colon at the end of the JS code

Is it right?

No

At the end after the } bracket so it happens for every digit.

On the left hand side that means not tabbed

Right now?

Change show_digits to snapshot

Doesn’t need to change that into snapshot in right side window?

sorry in left side?

However, since you did step 6 before step 5 then your experiment won’t work locally because step 5 only exists on one side

Now I know reversed needs to be defined to work online. It might already be in @thomas_pronk ‘s PolyFill component described in my crib sheet or you can wait for me to be on a computer to work out the JS code you’d need to define it on the JS side of Before Experiment.

Thank you and waiting for you…

Put the following in Before Experiment on the JS side only

function reversed(x) {
    var revList;
    revList = [];
    for (var i = 0, _pj_a = x.length; (i < _pj_a); i += 1) {
        revList.push(x[((x.length - 1) - i)]);
    }
    return revList;
}

I put it in the code component of learn routine but reverse error appeared again.

@Sara_Eskandari, try putting it in “Before Experiment”
@wakecarter, reversed isn’t in the PsychoPolyfill yet, so let’s add it. I made a ticket for it referencing your implementation: Add `reversed` function (#1) · Issues · Thomas Pronk / demo_polyfill · GitLab

First just three digits appeared then the error : line 335

F

Edit. I see you already posted that line. What do you want to accomplish by calling the list function?