Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[Solved] Getting a certain number of correct responses to move on.

edited October 2021 in OpenSesame

Hello!

I'm creating a task that involves participants learning 2 rules and then being tested on how they respond to these rules. After the initial rule learning, there are 2 practice trials, and then 16 experimental trials. I would like to program the experiment so that participants have to get each rule correct at least once during either the learning phase or the practice phase, in order to move onto the experimental trials. If they don't get each of the rules correct once, I want the experiment to finish. This is being done with kids, and is a way to ensure that they understand what is being asked of them.

I'm not sure how to go about doing this...I originally tried run-if statements, but this ended up getting too complicated.

Currently, I have a practice sequence that includes the rule learning and practice trials, and then an experimental sequence with my experimental loop.

Any help is appreciated, thank you!


Sophia

Comments

  • FabFab
    edited July 2021

    Hi @sophia88,

    There are probably different ways of achieving what you're after, and it may depend on the exact characteristics of your task, but here's one that might help based on your general description. You'll need to adapt the method to the specifics of your own experiment.

    You were on the right track using the "Run if" feature of sequences, but you need to combine it with some coding. You basically need to use Python or Javascript code (in the example below, I use Javascript) to count the number of correct rule applications, then make the presentation of certain parts of your experiment visible only if that count is greater than some criteria (in your case, 1 correct application).

    Here you can see the structure of a very basic task containing a training block, a test block and a loop used to display a message in case of not meeting the criterion. The code in the "count_correct_responses" basically counts the number of trials completed and, most importantly, the number of trials receiving a correct response (which I count as a correct rule application). Depending on the specific of your experiment and how you define a correct rule application, this code may be more complex.

    Then, just make the presentation of the relevant parts conditioned by the value of the rule_appiication variable. Here, I make the instructions for the test block and the test block visible if rule_application is greater than 1, and the failure loop is it is smaller than 2.


    Note that an alternative way, without having to use code, would be to use [acc], the % correct responses in a block, in the conditions defined under "Run if", but I using code to count the number of correct responses presents advantages: more flexibility if you wish to use the variables across different parts of your experiment, being able to reset them more flexibly, more flexible if you want to allow the training phase to go on until the criterion is met, it's easier and cleaner to define the number of correct responses required than the % of correct responses required.

    Here's a basic example I put together:

    In this example, training lasts 10 trials. If the participant produces at least 1 correct response in the training phase, the test phase is presented next (otherwise, the experiment ends).

    In case you were interested in making the training phase go on until at least one correct response is collected, you'd have to modify properties of the learning loop as follows:

    Hope this helps. Good luck!

    Fabrice.

    Buy Me A Coffee

  • Hi Fabrice,

    I can't thank you enough for this detailed explanation and example file! I adapted it to my experiment and it's working beautifully. Very much appreciated!

    All the best,

    Sophia

  • Hi @sophia88 ,

    Great! I'm glad it was helpful and that your experiment is now working well 👍️

    I hadn't immediately seen your message (little tip: when you reply on this forum, if you type "@" followed by the name of the user you're replying to, you'll be able to use the user's handle, which means that that user will be notified of your message). For example, if you type "@fa", the following will appear:

    Good luck with your experiment!

    Best,

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.