Hi dave,
Thanks again for the answer, that really helps a lot.
I however cannot figure out how to use / responsemessage to play an errorsound and errormessage.
This part of the script is in the first comment.
Furthermore, I came across another problem.
I have 3 blocks that branch and thus repeat after each other.
I want them to stop after 20 minutes.
This is tried to program this with the timeout function, however this does not work.
Then I tried to branch the experiment after 20 minutes.
The elapsed time of the experiment does not seem to be correct in my output.
It shows an amount of time that is way to long.
Do you know a solution to this problem?
This part of the script is bellow.
Thanks in advance.
Johanne
<expt bversion>
/ subjects = (1 of 1)
/ skip = [values.experimentswitch==1]
/ skip = [values.experimentswitch==3]
/ onexptbegin = [if (!values.showdeckinfo) text.deck.textcolor = white]
/ blocks = [1 = color]
/ preinstructions = (welcome, page1)
/ postinstructions = (endb)
/ onexptend = [values.completed = 1]
/ branch = [if (expt.bversion.elapsedtime < 1200000) expt.cversion]
</expt>
<block color>
/ stop = [values.quitb == 1]
/ onblockbegin = [values.correctstreak = 0; values.errorsum_block = 0]
/ onblockbegin = [values.PerseverativeResponse = 0]
/ onblockbegin = [values.colorblockcount = values.colorblockcount + 1]
/ onblockbegin = [values.category = 1]
/ trials = [1 = selectcard]
/ skip = [values.colorblockcount >= values.cstotalblocks]
/ stop = [expressions.toomanytrials]
/ stop = [values.correctstreak > 0 && mod(values.correctstreak, values.correctstreakthreshold)==0]
/ onblockend = [if (values.colorblockcount == 1) values.trialscompletefirstcategory = values.colortrialcount]
/ onblockend = [if (values.correctstreak == values.correctstreakthreshold )
values.completedcategories = values.completedcategories + 1]
/ onblockend = [if (values.colorblockcount == 1) values.percenterror_C1 = 100 * (values.errorsum_block/trial.selectcard.count)
else values.percenterror_C2 = 100*(values.errorsum_block/trial.selectcard.count)]
/ branch = [if (values.colorblockcount > values.cstotalblocks) ]
/ branch = [if (expressions.toomanytrials) ]
/ branch = [if (values.correctstreak > 0 && mod(values.correctstreak, values.correctstreakthreshold)==0)
{values.OldRuleWindow = 1; values.RuleChange = 1; block.form}]
/ timeout = max(1200000 - block.color.elapsedtime - block.form.elapsedtime - block.number.elapsedtime, 1)
</block>
<block form>
/ stop = [values.quitb == 1]
/ onblockbegin = [values.correctstreak = 0; values.errorsum_block = 0]
/ onblockbegin = [values.PerseverativeResponse = 0]
/ onblockbegin = [values.formblockcount = values.formblockcount + 1]
/ onblockbegin = [values.category = 2]
/ trials = [1 = selectcard]
/ skip = [values.formblockcount >= values.cstotalblocks]
/ stop = [expressions.toomanytrials]
/ stop = [values.correctstreak > 0 && mod(values.correctstreak, values.correctstreakthreshold)==0]
/ onblockend = [if (values.correctstreak == values.correctstreakthreshold )
values.completedcategories = values.completedcategories + 1]
/ onblockend = [if (values.formblockcount == 1) values.percenterror_F1 = 100 * (values.errorsum_block/trial.selectcard.count)
else values.percenterror_F2 = 100*(values.errorsum_block/trial.selectcard.count)]
/ branch = [if (values.formblockcount > values.cstotalblocks)]
/ branch = [if (expressions.toomanytrials)]
/ branch = [if (values.correctstreak > 0 && mod(values, values.correctstreakthreshold)==0)
{values.OldRuleWindow = 1; values.RuleChange = 1; block.number}]
/ timeout = max(1200000 - block.color.elapsedtime - block.form.elapsedtime - block.number.elapsedtime, 1)
</block>
<block number>
/ stop = [values.quitb == 1]
/ onblockbegin = [values.correctstreak = 0; values.errorsum_block = 0]
/ onblockbegin = [values.PerseverativeResponse= 0]
/ onblockbegin = [values.numberblockcount = values.numberblockcount + 1]
/ onblockbegin = [values.category = 3]
/ trials = [1 = selectcard]
/ skip = [values.numberblockcount >= values.cstotalblocks]
/ stop = [expressions.toomanytrials]
/ stop = [values.correctstreak > 0 && mod(values.correctstreak, values.correctstreakthreshold)==0]
/ onblockend = [if (values.correctstreak == values.correctstreakthreshold )
values.completedcategories = values.completedcategories + 1]
/ onblockend = [if (values.numberblockcount == 1) values.percenterror_N1 = 100 * (values.errorsum_block/trial.selectcard.count)
else values.percenterror_N2 = 100*(values.errorsum_block/trial.selectcard.count)]
/ branch = [if (values.numberblockcount > values.cstotalblocks)]
/ branch = [if (expressions.toomanytrials)]
/ branch = [if (values.correctstreak > 0 && mod(values.correctstreak, values.correctstreakthreshold) ==0)
{values.OldRuleWindow = 1; values.RuleChange = 1; block.color}]
/ timeout = max(1200000 - block.color.elapsedtime - block.form.elapsedtime - block.number.elapsedtime, 1)
</block>