Hi,
So i'm currently trying to write a script for a test in which I present a pattern image with a missing square, and subjects pick the right square which completes the pattern. I've gotten the images to load with the proper positioning and mouse click responses displaying correct/incorrect.
The trick here, however, is that I need to code the stop cue, which occurs when the subject gets 3 out of the last 5 answers incorrect.
Here's how I have it set up:
Each trial is one question with 5 different answer options. There's currently one block which dictates all these trials to run in order, and the experiment dictates the one block to run.
To try and solve the scoring issue, I've tried several things:
- Coding /branch [if (trial.a25.correct + trial.a26.correct +trial.a27.correct + trial.a28.correct + trial.a29.correct <= 2) trial.endtrial] into trials. This should theoretically count the last 5 answers (#25-29), and if the subject gets only 2 or less right (3 wrong), it would branch to the last trial trial.endtrial. No good.
- Coding /ontrialend [if (trial.a25.correct + trial.a26.correct +trial.a27.correct + trial.a28.correct + trial.a29.correct <= 2) trial.endtrial] into trials. Similar result.
- Coding /stop [trial.a25.correct + trial.a26.correct +trial.a27.correct + trial.a28.correct + trial.a29.correct <= 2] into block. I believe this similarly didn't stop the block.
- Coding /stop [trial.a25.correct + trial.a26.correct +trial.a27.correct + trial.a28.correct + trial.a29.correct <= 2] into expt. This simply stopped the experiment before a single trial was run.
- Coding /branch [if (trial.a25.correct + trial.a26.correct +trial.a27.correct + trial.a28.correct + trial.a29.correct <= 2) page.end] to see if it would jump to an end page after catching the branch, but no good.
- Coding /branch [if (trial.a25.correct + trial.a26.correct +trial.a27.correct + trial.a28.correct + trial.a29.correct <= 2) block.endblock] to see if it would jump to an end block after catching the branch, but no good.
Any advice would be lovely, as I'm at my wit's end here trying to figure out how to make this work. I've considered the possibility of creating some sort of vector measurement that would automatically take the last 5 recorded answers and check if percent correct is less than 40%, but I don't know how to code that.
Here are some example codes:
<expt exptest3>
/preinstructions = (intro, getready)
/postinstructions = (end)
/blocks = [1=block1]
</expt>
<block block1>
/ trials = [1=A20,A21,A22,A23,A24,A25,A26,A27,A28,A29]
</block>
<trial A25>
/ showmousecursor = true
/validresponse = (A25.1,A25.2,A25.3,A25.4,A25.5,A25.6)
/correctresponse = (A25.5)
/ stimulusframes = [1=A25.big; 2=A25.1,A25.2,A25.3,A25.4,A25.5,A25.6]
/errormessage = true(error, 300)
</trial>
Thanks!
Calvin