Ospan-modification help


Author
Message
MilanSchoenmaeckers
MilanSchoenmaeckers
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Hi, 

I'm new to inquisit and trying to modify the regular Ospan-task from the millisecond library for my master's thesis.

https://www.millisecond.com/download/library/ospan/ -> this is the regular task. 

After answering whether the answer for a math problem is correct or incorrect, a letter appears on screen for the participant to memorize. For my task, I want to show the participant a picture of a light bulb above it. This light bulb will be either turned on in 20% of the trials or turned off in 80% of trials. 

These are the stimuli that I made:

<picture lightbulb_off>
/ items = ("lamp_uit.png")
/ position = (50, 30)
/ size = (20%, 20%)
</picture>

<picture lightbulb_on>
/ items = ("lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
</picture>

and this is the script that the regular task uses for the presentation of a letter:

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

Is there anyone who would want to offer me some help with this?

Thanks in advance. 

Dave
Dave
Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)
Group: Administrators
Posts: 10K, Visits: 53K
MilanSchoenmaeckers - 3/5/2020
Hi, 

I'm new to inquisit and trying to modify the regular Ospan-task from the millisecond library for my master's thesis.

https://www.millisecond.com/download/library/ospan/ -> this is the regular task. 

After answering whether the answer for a math problem is correct or incorrect, a letter appears on screen for the participant to memorize. For my task, I want to show the participant a picture of a light bulb above it. This light bulb will be either turned on in 20% of the trials or turned off in 80% of trials. 

These are the stimuli that I made:

<picture lightbulb_off>
/ items = ("lamp_uit.png")
/ position = (50, 30)
/ size = (20%, 20%)
</picture>

<picture lightbulb_on>
/ items = ("lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
</picture>

and this is the script that the regular task uses for the presentation of a letter:

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

Is there anyone who would want to offer me some help with this?

Thanks in advance. 

Create a single <picture> element, have the two images -- lightbulb off and lightbulb on -- be the two items in in that <picture> element. Select the state (off/on) via a value.

<values>
/ lightbulb_state = 1
...
</values>

<picture lightbulb>
/ items = ("lamp_uit.png", "lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
/ select = values.lightbulb_state
</picture>

Create a <list> with 80% the value for off (1), and 20% the value for on (2).

// work out how many trials there are and enter 1 and 2 in the appropriate amounts
<list lightbulbstates>
/ items = (1,1,1,1,1,...., 2,2,2,...)
</list>

Sample a value from that list at the start of the trial and display the lightbulb stimulus just like all the other stimuli in the trial.

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

Finally, log the lightbulb state to the data file by adding values.lightbulb_state to the <data> element's /columns.


MilanSchoenmaeckers
MilanSchoenmaeckers
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Thank you for your fast reply!

However, to make it even more difficult, I made the trial_show_letter into two categories because there will be two blocks of trials called nonacting and acting. The difference between the two is that the frequency of the light bulb presented turned on/off differs between both conditions. In addition, for the acting trials participants need to press the spacebar each time they see the light bulb turned on. 

In regard to your reply, I made the following additions:

<values>
/ lightbulb_state = 1
</values>

<picture lightbulb_nonacting>
/ items = ("lamp_uit.png", "lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
/ select = values.lightbulb_state
</picture>

<list lightbulbstates_nonacting>
/ items = (1,1,1,1,1,1,1,1,1,1,1,1,2,2,2)
</list>

<picture lightbulb_acting>
/ items = ("lamp_uit.png", "lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
/ select = values.lightbulb_state
</picture>

<list lightbulbstates_acting>
/ items = (2,2,2,2,2,2,2,2,2,2,2,2,1,1,1)
</list>


I get the following errors for the following part of the script when I run the experiment:

1. Expression 'list.lightbulbstates.nextvalue' is invalid. Expression contains an unknown element or property name.
2. 'button28' is not a valid setting.


<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (button57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

I really appreciate the help!

Dave
Dave
Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)
Group: Administrators
Posts: 10K, Visits: 53K
MilanSchoenmaeckers - 3/5/2020
Thank you for your fast reply!

However, to make it even more difficult, I made the trial_show_letter into two categories because there will be two blocks of trials called nonacting and acting. The difference between the two is that the frequency of the light bulb presented turned on/off differs between both conditions. In addition, for the acting trials participants need to press the spacebar each time they see the light bulb turned on. 

In regard to your reply, I made the following additions:

<values>
/ lightbulb_state = 1
</values>

<picture lightbulb_nonacting>
/ items = ("lamp_uit.png", "lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
/ select = values.lightbulb_state
</picture>

<list lightbulbstates_nonacting>
/ items = (1,1,1,1,1,1,1,1,1,1,1,1,2,2,2)
</list>

<picture lightbulb_acting>
/ items = ("lamp_uit.png", "lamp_aan.png")
/ position = (50, 30)
/ size = (20%, 20%)
/ select = values.lightbulb_state
</picture>

<list lightbulbstates_acting>
/ items = (2,2,2,2,2,2,2,2,2,2,2,2,1,1,1)
</list>


I get the following errors for the following part of the script when I run the experiment:

1. Expression 'list.lightbulbstates.nextvalue' is invalid. Expression contains an unknown element or property name.
2. 'button28' is not a valid setting.


<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (button57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

I really appreciate the help!

The approach is exactly the same. You just need to sample from the <list>s you actually defined, not a <list> that doesn't actually exist.

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
...
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
...
</trial>

and if you want to define the space bar as response, you need to set the acting trial's /inputdevice to keyboard and define the space bar as response properly.

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)

/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>
MilanSchoenmaeckers
MilanSchoenmaeckers
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Thanks again for your fast reply. 

The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size. 

This is the script of the blocks and the experiment:

<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>

<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
    5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>

And this is the script for the trials:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
    {item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
    {clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>

<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
    if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
    if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
    if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
    if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
    if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
    if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
    if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
    if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
    if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
    if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
    if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
    if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
    {values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>


<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>

<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>

<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>

<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
    {values.tmp_mathopt01=list.MathOpt01.nextvalue;
    values.tmp_mathsign=list.MathSign.nextvalue;
    values.tmp_mathopt02=list.MathOpt02.nextvalue;
    values.mathcorrect=list.MathCorrect.nextvalue;
    values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
    values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
    {values.tmp_mathopt02sign+=3;
    values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
    values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
    values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
    values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
    {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
    {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

All help is appreciated :)

Dave
Dave
Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)
Group: Administrators
Posts: 10K, Visits: 53K
MilanSchoenmaeckers - 3/5/2020
Thanks again for your fast reply. 

The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size. 

This is the script of the blocks and the experiment:

<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>

<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
    5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>

And this is the script for the trials:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
    {item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
    {clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>

<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
    if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
    if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
    if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
    if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
    if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
    if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
    if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
    if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
    if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
    if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
    if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
    if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
    {values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>


<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>

<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>

<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>

<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
    {values.tmp_mathopt01=list.MathOpt01.nextvalue;
    values.tmp_mathsign=list.MathSign.nextvalue;
    values.tmp_mathopt02=list.MathOpt02.nextvalue;
    values.mathcorrect=list.MathCorrect.nextvalue;
    values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
    values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
    {values.tmp_mathopt02sign+=3;
    values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
    values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
    values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
    values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
    {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
    {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

All help is appreciated :)

You're *not* running the modified trials, you're running the regular, old, unmodified show_letter trial.

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
  values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
  {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
  {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>
Dave
Dave
Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)
Group: Administrators
Posts: 10K, Visits: 53K
Dave - 3/5/2020
MilanSchoenmaeckers - 3/5/2020
Thanks again for your fast reply. 

The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size. 

This is the script of the blocks and the experiment:

<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>

<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
    5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>

And this is the script for the trials:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
    {item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
    {clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>

<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
    if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
    if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
    if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
    if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
    if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
    if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
    if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
    if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
    if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
    if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
    if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
    if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
    {values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>


<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>

<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>

<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>

<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
    {values.tmp_mathopt01=list.MathOpt01.nextvalue;
    values.tmp_mathsign=list.MathSign.nextvalue;
    values.tmp_mathopt02=list.MathOpt02.nextvalue;
    values.mathcorrect=list.MathCorrect.nextvalue;
    values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
    values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
    {values.tmp_mathopt02sign+=3;
    values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
    values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
    values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
    values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
    {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
    {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

All help is appreciated :)

You're *not* running the modified trials, you're running the regular, old, unmodified show_letter trial.

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
  values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
  {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
  {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

Perhaps it would be worthwhile to take a step back; take the original, unmodified OSPAN script and work through it until you sufficiently understand how it works. Only then proceed to make further modifications
MilanSchoenmaeckers
MilanSchoenmaeckers
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Dave - 3/5/2020
Dave - 3/5/2020
MilanSchoenmaeckers - 3/5/2020
Thanks again for your fast reply. 

The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size. 

This is the script of the blocks and the experiment:

<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>

<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
    5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>

And this is the script for the trials:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
    {item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
    {clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>

<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
    if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
    if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
    if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
    if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
    if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
    if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
    if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
    if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
    if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
    if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
    if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
    if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
    {values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>


<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>

<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>

<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>

<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
    {values.tmp_mathopt01=list.MathOpt01.nextvalue;
    values.tmp_mathsign=list.MathSign.nextvalue;
    values.tmp_mathopt02=list.MathOpt02.nextvalue;
    values.mathcorrect=list.MathCorrect.nextvalue;
    values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
    values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
    {values.tmp_mathopt02sign+=3;
    values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
    values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
    values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
    values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
    {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
    {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

All help is appreciated :)

You're *not* running the modified trials, you're running the regular, old, unmodified show_letter trial.

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
  values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
  {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
  {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

Perhaps it would be worthwhile to take a step back; take the original, unmodified OSPAN script and work through it until you sufficiently understand how it works. Only then proceed to make further modifications

Thank you for replying and your hel. I will first take a step back and work through that script before posting any further questions. 
Dave
Dave
Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)Supreme Being (795K reputation)
Group: Administrators
Posts: 10K, Visits: 53K
MilanSchoenmaeckers - 3/5/2020
Dave - 3/5/2020
Dave - 3/5/2020
MilanSchoenmaeckers - 3/5/2020
Thanks again for your fast reply. 

The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size. 

This is the script of the blocks and the experiment:

<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>

<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
    5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>

And this is the script for the trials:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
    {item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
    {clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>

<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
    if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
    if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
    if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
    if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
    if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
    if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
    if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
    if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
    if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
    if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
    if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
    if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
    {values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>


<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>

<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>

<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>

<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
    {values.tmp_mathopt01=list.MathOpt01.nextvalue;
    values.tmp_mathsign=list.MathSign.nextvalue;
    values.tmp_mathopt02=list.MathOpt02.nextvalue;
    values.mathcorrect=list.MathCorrect.nextvalue;
    values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
    values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
    {values.tmp_mathopt02sign+=3;
    values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
    values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
    values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
    values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
    {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
    {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

All help is appreciated :)

You're *not* running the modified trials, you're running the regular, old, unmodified show_letter trial.

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
  values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
  {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
  {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

Perhaps it would be worthwhile to take a step back; take the original, unmodified OSPAN script and work through it until you sufficiently understand how it works. Only then proceed to make further modifications

Thank you for replying and your hel. I will first take a step back and work through that script before posting any further questions. 

If you're not sure about parts of the script, i.e. what they do / how they work, let me know here and I'll try to explain. Then, as the second step, I'd suggest you implement your nonacting condition first, because it does not require many major modifications compared to the original. Once you have that running, extend things to include the acting condition.
MilanSchoenmaeckers
MilanSchoenmaeckers
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Dave - 3/5/2020
MilanSchoenmaeckers - 3/5/2020
Dave - 3/5/2020
Dave - 3/5/2020
MilanSchoenmaeckers - 3/5/2020
Thanks again for your fast reply. 

The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size. 

This is the script of the blocks and the experiment:

<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>

<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
    values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
    values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
    values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
    values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>

<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
    {text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
    text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
    text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
    5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>

And this is the script for the trials:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
    {item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
    {clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>

<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
    if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
    if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
    if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
    if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
    if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
    if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
    if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
    if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
    if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
    if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
    if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
    if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
    {values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>


<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>

<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>

<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>

<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
    {values.tmp_mathopt01=list.MathOpt01.nextvalue;
    values.tmp_mathsign=list.MathSign.nextvalue;
    values.tmp_mathopt02=list.MathOpt02.nextvalue;
    values.mathcorrect=list.MathCorrect.nextvalue;
    values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
    values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
    {values.tmp_mathopt02sign+=3;
    values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
    values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
    values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
    values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
    {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
    {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

All help is appreciated :)

You're *not* running the modified trials, you're running the regular, old, unmodified show_letter trial.

<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
  values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
  {values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
  {values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>

Perhaps it would be worthwhile to take a step back; take the original, unmodified OSPAN script and work through it until you sufficiently understand how it works. Only then proceed to make further modifications

Thank you for replying and your hel. I will first take a step back and work through that script before posting any further questions. 

If you're not sure about parts of the script, i.e. what they do / how they work, let me know here and I'll try to explain. Then, as the second step, I'd suggest you implement your nonacting condition first, because it does not require many major modifications compared to the original. Once you have that running, extend things to include the acting condition.

Hi,

I think that I found the error that is causing me troubles with running the modified trials. The script is as followed:

<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
    values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
    {values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
    {values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
    {values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>

So this trial (/ trials = [1=InitSetSize]) is used in every block. Do I need to create two more lines of "/ ontrialbegin = " to incorporate the script below for the implementation of  my own modifications in the initial trial?

<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_nonacting else trial.InitMathProblem01]
/ recorddata = true
</trial>

<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_acting else trial.InitMathProblem01]
/ recorddata = true
</trial>

Again, thanks in advance for any input!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search