Millisecond Forums

correctstreak not resetting at the end of block

https://forums.millisecond.com/Topic15071.aspx

By Alexx - 11/26/2014

I have a trial element across several different blocks that has skip = [correctstreak=3] but it does not reset once a new block starts. Is this normal? Documentation suggests that it only tracks correctsreaks within the block. Other properties are resetting normally like trialcount. (I can use a values element instead, but I want to know what the issue is). Thanks
By Dave - 11/26/2014

No, it's not normal -- the correctstreak should reset, but does not (which I can confirm). It's most certainly a bug.

I can think of several ways to work around this (a lot depends on your overall design), but tracking streaks via <values> certainly applies and gives you the most control / flexibility.
By Alexx - 12/2/2014

FYI, I thought it might be only correctstreak but I have another task where trialcount does not reset. Just wanted to let you know.
By Dave - 12/2/2014

Thanks for the addition. Oddly enough, I cannot seem to reproduce the trialcount issue in 4.0.7.0. When running e.g.

<expt>
/ blocks = [1=block1; 2=block2]
</expt>

<block block1>
/ trials = [1-10 = mytrial]
</block>

<block block2>
/ trials = [1-10 = mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%trial.mytrial.trialcount%>")
</text>

trialcount resets as expected for me. The same is true for

<expt>
/ blocks = [1=block1; 2=block1 ]
</expt>

<block block1>
/ trials = [1-10 = mytrial]
</block>

<block block2>
/ trials = [1-10 = mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("<%trial.mytrial.trialcount%> | <%block.block1.trialcount%>")
</text>

(a) What happens when you run the above -- does it reset or not?

(b) How exactly are you using the property in your script?
By Alexx - 12/2/2014

That does work. After some more testing, I've determined that trialcount does not reset when there following conditions are met (but it could be more general than that):
1) the same block element is repeated, e.g.  [1-5=block1]
2) the trial for which trialcount does not reset is branched from another trial specified in the block
I've modified your script to replicate the issue:

Note: if you change [1=begin] to [1=mytrial]  or if you insert the block1,block2 sequence, trialcount will reset.

<expt>
/ blocks = [1-4=block1]
</expt>
/ blocks = [1=sequence(block1,block2)]

<block block1>
/ trials = [1=begin]
</block>

<block block2>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57,28)
/ branch = [if(response!=28) trial.mytrial]
</trial>

<trial begin>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
/ branch = [trial.mytrial]
</trial>

<text mytext>
/ items = ("<%trial.mytrial.trialcount%>")
</text>
By Dave - 12/2/2014

Thanks for the additional details -- that's very helpful. I can confirm your observation and will file a bug for this so this gets fixed in the next release.

As a possible workaround for the time being, note that the block-level trialcount appears to reset properly in your scenario:

<expt>
/ blocks = [1-4=block1]
</expt>

<block block1>
/ trials = [1=begin]
</block>

<block block2>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57,28)
/ branch = [if(response!=28) trial.mytrial]
</trial>

<trial begin>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
/ branch = [trial.mytrial]
</trial>

<text mytext>
/ items = ("Block # <%script.currentblocknumber%> | Trial level count <%trial.mytrial.trialcount%> | Block level count <%block.block1.trialcount%>")
</text>