Howdy, Stranger!

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

Supported by

Inline code when accuracy drops below a percentage in OS

Hi,

I would like to raise a warning message when the participant's accuracy drops below let's say 80%.

I have found the code for the inline script and connected it to a feedback item. My problem I do not know how to make the message appear instantly (i guess with Run if) when the accuracy drops below 80%.

See my pictures please:

The above is what I have done so far. Any ideas for the message to appear please not at the end of the routine but instantly when accuracy drops please?


thanks,

Nomi

Comments

  • FabFab
    edited July 2021

    Hi @nomi,

    You don't actually need any coding, just create a feedback screen with the message you want to display if accuracy is lower than 80% in a block, and set "Run if" to :

    [acc]<80
    

    

    Note that in the future, if you wanted to combine conditions, say for example, to show a warning if % accuracy is lower 80% or mean RT is greater than 800ms, you can insert multiple conditions in the "Run if":

    [acc]<80 or [avg_rt]
    

    I attach a basic script where I implemented it (note that I based in on an example I set up to help someone else, so there's stuff in there you don't need; script to calculate the number of remaining trials . just ignore it. What you want to achieve does not actually require any scripting).

    Hope this helps!

    Fabrice.

    Buy Me A Coffee

  • edited July 2021

    Your are fab Fab! I will give it a try and let you know! It's funny because I tried something like this but in combination with a script as well, and I messed it up I guess!

    I will get back to let you know how I did!

    Thanks again!

  • Hi @nomi,

    Hope it works out! Good luck!

    Fabrice.

    PS: just a tip... when replying in this forum, if you type "@" and your correspondent's username, you'll a see menu from which you can select that correspondent. The advantage of that is that your correspondent then get notified that there's a message from you waiting.

    Example, if you start typing @F:


    Buy Me A Coffee

  • Thanks @Fab !

    I made it! I do not believe it was that easy!!!


    Thanks again,

    Nomi

  • Hi @nomi,

    You're welcome. Glad you got it to work! Good luck with your study!

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.