Ospan-modification help


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
MilanSchoenmaeckers - 3/6/2020
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!

The init trial sets up the set size for the following "round" in the task, i.e. the amount of letters shown. This happens depending on the block name / the block we're currently in, as you can see here:

<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]
...
</trial>

If you re-named any of the blocks or added differently named blocks, you need to extend or adjust the /ontrialbegin logic accordingly. The init trial also determines what trial then to run next depending on what the current block is per its /branch attribute:

/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]

I.e. if we're in the letter only practice block, it goes to <trial show_letter>, otherwise it goes to <trial InitMathProblem01>. That should make clear that the init trial has nothing to do with invoking your show_letter_nonacting or show_letter_acting trials. That only happens later and has to be done by other trials. Read through the script and focus on the /branch attributes to see the flow, i.e. which trial invokes what other trial after depending on what's currently going on (i.e. the block we're in, whether there are still letters to show in the current round, etc.).

MilanSchoenmaeckers
MilanSchoenmaeckers
Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Hi,

I encountered the following problem. First, when the picture of the lightbulb is shown on screen, the white background of the image stays onscreen whilst the next screen is loaded. Does this have to do with the picture itself or that I made a mistake in the script?

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

Second, there seems to be going something wrong in my blocks. From the practice_both block onwards, the math problem is shown, followed by the possible answer that the participant has to give, and then the letter for later recall is shown with the picture of the light bulb. This is how the experiment should look like. However, this sequence is only followed for the first math-answer-letter combination, as the second combination only follows the sequence math-letter.

answer script:
<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_nonacting]
/ branch = [trial.show_letter_acting]
/ recorddata = true
</trial>

math script:
<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>

letter script:
<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=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]
/ recorddata = true
</trial>

Kind regards
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
MilanSchoenmaeckers - 3/9/2020
Hi,

I encountered the following problem. First, when the picture of the lightbulb is shown on screen, the white background of the image stays onscreen whilst the next screen is loaded. Does this have to do with the picture itself or that I made a mistake in the script?

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

Second, there seems to be going something wrong in my blocks. From the practice_both block onwards, the math problem is shown, followed by the possible answer that the participant has to give, and then the letter for later recall is shown with the picture of the light bulb. This is how the experiment should look like. However, this sequence is only followed for the first math-answer-letter combination, as the second combination only follows the sequence math-letter.

answer script:
<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_nonacting]
/ branch = [trial.show_letter_acting]
/ recorddata = true
</trial>

math script:
<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>

letter script:
<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=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]
/ recorddata = true
</trial>

Kind regards

> the white background of the image stays onscreen whilst the next screen is loaded. Does this have to do with the picture itself or that I made a mistake in the script?

The <picture> element is set to erase at the end of the trial, so that is where the white rectangle comes from.

As to your second question, the code you posted is too incomplete to say anything about it.

MilanSchoenmaeckers
MilanSchoenmaeckers
Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
MilanSchoenmaeckers - 3/9/2020
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.

I'm sorry, but the code you posted is not pertinent to the problem. You need to check the /branch logic that is responsible for invoking trial.letter_recall and trial.letter_feedback.

MilanSchoenmaeckers
MilanSchoenmaeckers
Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.

I'm sorry, but the code you posted is not pertinent to the problem. You need to check the /branch logic that is responsible for invoking trial.letter_recall and trial.letter_feedback.

These are the /branches from each trial currently in my script:

<trial InitSetSize>
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

<trial show_letter_acting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_Acting")trial.show_letter_acting else trial.InitMathProblem01]

<trial recall_letter>
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]

<trial letter_feedback>
/ branch = [trial.InitSetSize]

<trial prac_show_math>
/ branch = [trial.prac_solve_math]

<trial prac_solve_math>
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]

<trial prac_math_feedback>
{No branch in the original script}

<trial InitMathProblem01>
/ 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]

<trial InitMathProblem02>
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]

<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


Thanks again!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
MilanSchoenmaeckers - 3/9/2020
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.

I'm sorry, but the code you posted is not pertinent to the problem. You need to check the /branch logic that is responsible for invoking trial.letter_recall and trial.letter_feedback.

These are the /branches from each trial currently in my script:

<trial InitSetSize>
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

<trial show_letter_acting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_Acting")trial.show_letter_acting else trial.InitMathProblem01]

<trial recall_letter>
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]

<trial letter_feedback>
/ branch = [trial.InitSetSize]

<trial prac_show_math>
/ branch = [trial.prac_solve_math]

<trial prac_solve_math>
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]

<trial prac_math_feedback>
{No branch in the original script}

<trial InitMathProblem01>
/ 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]

<trial InitMathProblem02>
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]

<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


Thanks again!

If the recall_letter trial isn't invoked, then these are what you need to look at:

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

Is the condition ever met? Are you using and updating the values in the if() condition properly in that block?

And these do not make sense:

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]


<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


How is the script supposed to know whether to run the nonacting or acting trial? You're not distinguishing, and only the first /branch will ever be executed.

MilanSchoenmaeckers
MilanSchoenmaeckers
Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.

I'm sorry, but the code you posted is not pertinent to the problem. You need to check the /branch logic that is responsible for invoking trial.letter_recall and trial.letter_feedback.

These are the /branches from each trial currently in my script:

<trial InitSetSize>
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

<trial show_letter_acting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_Acting")trial.show_letter_acting else trial.InitMathProblem01]

<trial recall_letter>
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]

<trial letter_feedback>
/ branch = [trial.InitSetSize]

<trial prac_show_math>
/ branch = [trial.prac_solve_math]

<trial prac_solve_math>
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]

<trial prac_math_feedback>
{No branch in the original script}

<trial InitMathProblem01>
/ 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]

<trial InitMathProblem02>
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]

<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


Thanks again!

If the recall_letter trial isn't invoked, then these are what you need to look at:

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

Is the condition ever met? Are you using and updating the values in the if() condition properly in that block?

And these do not make sense:

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]


<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


How is the script supposed to know whether to run the nonacting or acting trial? You're not distinguishing, and only the first /branch will ever be executed.

Hi again,

I understand that I need to update when the condition is met, but I don't understand the values.

<values AOSPAN>

/completed = 0
/ stopblock=0
/ learninginterval=1000
/ currentsetsize=0
/ lettercount=0
/ correctletters=0
/ totalcorrectletters=0
/ ospan=0
/ totalrecalledsets=0
/ recalledletters=""
/ recallcount=0
/ recalldelay=0
/ mathaccuracy=0
/ mathaccerrors=0
/ mathcurrenterrors=0
/ mathtotalerrors=0
/ mathspeederrors=0
/ mathtimeout=5000
/ mathproblemcount=0
/ matherrorswitch=1
/ mathcorrect=""
/ tmp_mathopt01=""
/ tmp_mathopt02=0
/ tmp_mathsign=""
/ tmp_mathopt02sign=""
/ mathtrueanswer=0
/ tmp_mathrand=0
/ mathanswer=0
/ tmp_initmath01=0
/ tmp_initmath02=0
</values>
0 = script was not completed; 1 = script was completed (all conditions run)

Could you explain to me what this means? Both the regular script and my script use the / currentsetsize = 0 for the / branch logic. 

Thanks!

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
MilanSchoenmaeckers - 3/12/2020
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.

I'm sorry, but the code you posted is not pertinent to the problem. You need to check the /branch logic that is responsible for invoking trial.letter_recall and trial.letter_feedback.

These are the /branches from each trial currently in my script:

<trial InitSetSize>
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

<trial show_letter_acting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_Acting")trial.show_letter_acting else trial.InitMathProblem01]

<trial recall_letter>
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]

<trial letter_feedback>
/ branch = [trial.InitSetSize]

<trial prac_show_math>
/ branch = [trial.prac_solve_math]

<trial prac_solve_math>
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]

<trial prac_math_feedback>
{No branch in the original script}

<trial InitMathProblem01>
/ 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]

<trial InitMathProblem02>
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]

<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


Thanks again!

If the recall_letter trial isn't invoked, then these are what you need to look at:

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

Is the condition ever met? Are you using and updating the values in the if() condition properly in that block?

And these do not make sense:

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]


<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


How is the script supposed to know whether to run the nonacting or acting trial? You're not distinguishing, and only the first /branch will ever be executed.

Hi again,

I understand that I need to update when the condition is met, but I don't understand the values.

<values AOSPAN>

/completed = 0
/ stopblock=0
/ learninginterval=1000
/ currentsetsize=0
/ lettercount=0
/ correctletters=0
/ totalcorrectletters=0
/ ospan=0
/ totalrecalledsets=0
/ recalledletters=""
/ recallcount=0
/ recalldelay=0
/ mathaccuracy=0
/ mathaccerrors=0
/ mathcurrenterrors=0
/ mathtotalerrors=0
/ mathspeederrors=0
/ mathtimeout=5000
/ mathproblemcount=0
/ matherrorswitch=1
/ mathcorrect=""
/ tmp_mathopt01=""
/ tmp_mathopt02=0
/ tmp_mathsign=""
/ tmp_mathopt02sign=""
/ mathtrueanswer=0
/ tmp_mathrand=0
/ mathanswer=0
/ tmp_initmath01=0
/ tmp_initmath02=0
</values>
0 = script was not completed; 1 = script was completed (all conditions run)

Could you explain to me what this means? Both the regular script and my script use the / currentsetsize = 0 for the / branch logic. 

Thanks!

The init trial samples the set size (number of letters to be shown) for the upcoming round from a list and stores the result in values.currentsetsize.

The /branch then invokes the recall trial

/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]

when as many letters (counted in values.lettercount) have been shown as there were supposed to be in the given round, i.e. when the letter count is equal to the set size.

In your modfied trials/blocks, you've evidently broken this logic. I.e. you're either not setting values.currentsetsize correctly, or you're not incrementing values.lettercount correctly, or both.

MilanSchoenmaeckers
MilanSchoenmaeckers
Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)Respected Member (348 reputation)
Group: Forum Members
Posts: 25, Visits: 79
Dave - 3/12/2020
MilanSchoenmaeckers - 3/12/2020
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Dave - 3/9/2020
MilanSchoenmaeckers - 3/9/2020
Hi, 

As for the second problem, my letter_recall and letter_feedback parts of the script aren't running in the Non_Acting block. However, what makes it strange is that they are running in the PracBoth 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 Non_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]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>

<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=="Non_Acting" && list.Non_ActingSetSize.unselectedcount==0)
    {values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>

I am really grateful for all the support.

I'm sorry, but the code you posted is not pertinent to the problem. You need to check the /branch logic that is responsible for invoking trial.letter_recall and trial.letter_feedback.

These are the /branches from each trial currently in my script:

<trial InitSetSize>
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

<trial show_letter_acting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_Acting")trial.show_letter_acting else trial.InitMathProblem01]

<trial recall_letter>
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]

<trial letter_feedback>
/ branch = [trial.InitSetSize]

<trial prac_show_math>
/ branch = [trial.prac_solve_math]

<trial prac_solve_math>
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
    trial.prac_math_feedback else trial.prac_show_math]

<trial prac_math_feedback>
{No branch in the original script}

<trial InitMathProblem01>
/ 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]

<trial InitMathProblem02>
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]

<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


Thanks again!

If the recall_letter trial isn't invoked, then these are what you need to look at:

<trial show_letter_practice>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter_practice else trial.InitMathProblem01]

<trial show_letter_nonacting>
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="TestBoth_NonActing")trial.show_letter_nonacting else trial.InitMathProblem01]

Is the condition ever met? Are you using and updating the values in the if() condition properly in that block?

And these do not make sense:

<trial show_math>
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_nonacting else trial.solve_math]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter_acting else trial.solve_math]


<trial solve_math>
/ branch = [trial.show_letter_nonacting]
/ branch = [trial.show_letter_acting]


How is the script supposed to know whether to run the nonacting or acting trial? You're not distinguishing, and only the first /branch will ever be executed.

Hi again,

I understand that I need to update when the condition is met, but I don't understand the values.

<values AOSPAN>

/completed = 0
/ stopblock=0
/ learninginterval=1000
/ currentsetsize=0
/ lettercount=0
/ correctletters=0
/ totalcorrectletters=0
/ ospan=0
/ totalrecalledsets=0
/ recalledletters=""
/ recallcount=0
/ recalldelay=0
/ mathaccuracy=0
/ mathaccerrors=0
/ mathcurrenterrors=0
/ mathtotalerrors=0
/ mathspeederrors=0
/ mathtimeout=5000
/ mathproblemcount=0
/ matherrorswitch=1
/ mathcorrect=""
/ tmp_mathopt01=""
/ tmp_mathopt02=0
/ tmp_mathsign=""
/ tmp_mathopt02sign=""
/ mathtrueanswer=0
/ tmp_mathrand=0
/ mathanswer=0
/ tmp_initmath01=0
/ tmp_initmath02=0
</values>
0 = script was not completed; 1 = script was completed (all conditions run)

Could you explain to me what this means? Both the regular script and my script use the / currentsetsize = 0 for the / branch logic. 

Thanks!

The init trial samples the set size (number of letters to be shown) for the upcoming round from a list and stores the result in values.currentsetsize.

The /branch then invokes the recall trial

/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]

when as many letters (counted in values.lettercount) have been shown as there were supposed to be in the given round, i.e. when the letter count is equal to the set size.

In your modfied trials/blocks, you've evidently broken this logic. I.e. you're either not setting values.currentsetsize correctly, or you're not incrementing values.lettercount correctly, or both.

I see. So can I ask you where I should set or increment these values? Do I need to make another values. item or a list?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search