Repeat practice trials until succeeding

Skip to first unread message

Jul 1, 2021, 10:30:33 AM7/1/21
to ibexexperiments

I'm currently trying to implement the practice session in such a way that participants must get the trial correctly in order to proceed; if they answered a practice trial incorrectly, they'll be provided a feedback to repeat the trial. An example of my practice trials is the following:

[["practice", 1], "Message", {transfer: 3000, html: {include: "1-1.html"}},
        "Form", {html: { include: "1-2.html" }, q: " ", hasCorrect: "Yes"},
        "Separator",{transfer: "keypress",
        normalMessage: "That's correct! Press SPACE to continue.",
        errorMessage: "Oops! That was the wrong answer! Press SPACE to try again."}],

So if participants answered correctly (in this case, "Yes"), they see the normalMessage and move on to the next practice trial. If they answered incorrectly (in this case, "No"), they will see the errorMessage and will be asked to repeat the trial. 

Has anyone else implemented something like this for the practice session? Would it involve a conditional statement of some sort? 

Thank you in advance!


Alexandre Cremers

Jul 1, 2021, 10:40:36 AM7/1/21
Hi Sherry,

This might be a bit complicated to do properly, but a dirty hack would be to have each item repeated many times and include an if-statement in the controller definition so that if the previous item was answered correctly, the next one is also flagged as correct and skipped. This way, as soon as the item is correctly answered, you skip the rest of the stack (just make the stack big enough that any reasonable participant wouldn't fail enough times to reach the end). There was a discussion a few months ago about adding an if-statement to skip an item based on the answer to the previous question, which might be helpful.


You received this message because you are subscribed to the Google Groups "ibexexperiments" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Jeremy Zehr

Jul 1, 2021, 12:16:20 PM7/1/21
to ibexexperiments
Hi Sherry,

The latest version of PennController (you can download and upload this file to your project's js_includes folder) comes with a jump command which allows you to dynamically navigate your sequence of items, so you can go back to your practice trial for example. Here's a minimal adaptation of your code:

    [["practice", 1], "PennController", newTrial(

I needed to make the response (the Scale element) external to the html document so I could run a test on it and conditionally execute jump("practice"), but it's still quite close to what you had. Note that the command jump("practice") will go back to the very first item labeled "practice" in your sequence of items (so not necessarily this trial, unless it actually is the first practice trial). Note also that the jump command can sometimes mess with the practice bar (eg. it can overflow)

Reply all
Reply to author
0 new messages