Howdy, Stranger!

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

Supported by

Ending experiment

Hello ,

how could I end the experiment for the participant ,if he makes 4 incorrect responses in sequence !

Thanks


Comments

  • edited February 2021

    Hi @maizaiz ,


    You can achieve this by using a break-if statement. Are you running your script locally or online? If locally, you can do the following:


    • Initialize a variable that will keep track of the number of consecutive errors in you block_sequence. To do that append an inline_script item and define the counter variable like so (in the Prepare tab):
    var.counter = 0
    
    • Next, append another inline_script item, this time to the trial_sequence, and place it after the item that you use for response collection (e.g. the keyboard_response item). Determine whether the counter variable should be updated or reset, depending on whether the participant responded correctly or not on the current trial. You can do that with the following piece of script (this time in the Run tab):
    # If an incorrect response was given, 
    # increment the counter by one:
    if var.correct == 0:
        var.counter += 1
    
    # If not, reset the counter to 0:
    elif var.correct == 1:
        var.counter = 0
    


    • Use the following break-if statement in the block_loop item:
    [counter] >= 4
    




    I attached an example experiment.



    Hope this helps!


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • thanks alot that was so helpful .

  • Great to hear @maizaiz !

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Hello,, can u help me please ! I can't find what`s wrong with the experiment I did.

    First I did a loop for practice ; it contains three pictures and the participant has to choose the right answer in each pictures he has 5 choices and there is just one correct answer ; if he didn`t well so he will gets explanation of the right answer ', i did an if statement for that by using run if [correct]=0 . but that doesnt work , actually it run just the first time i used it and when I repeated again it always show the explanation\instruction whether the answer was correct or not .

    another thing when I run the experiment it doesnt continue to the experimental loop I just get a freeze on the screen and don't have any reaction .

    I will be very thankful if you instruct me how to fix those tow problems .

  • Hi @maizaiz ,


    Could you upload your experiment here, by clicking the paper clip icon? I'm sure we'll find a way to solve the issues. :)


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • I've tried to upload it but I get :Request failed with status code 413

  • I sent by the e-mail

  • Hi @maizaiz ,


    I spotted several issues in your experimental file:


    • Firstly, the loop items called 'practiceloop' and experimental_loop' contained many empty rows that don't seem to serve any purpose. You can simply delete them.
    • Secondly, in the practice loop you were not collecting keypresses by using a keyboard_response item. Instead, you set the duration of the sketchpads to "keypress". By doing this, the variable "correct" was not determined correctly. It's better to set the duration of the sketchpads to 0 and place a keyboard_response item right after it.
    • It's better to use the square-bracket syntax to show the images, just in the same way as you did in the experimental loop.
    • You can also use the square-bracket syntax for the form_text_display items that you use for feedback. You can simply add a new column to the "practice_block_loop" containing the feedback message that you want to show on the current trial (if the participant responds incorrectly).




    I attached the modified script, but please note that I removed the images from the file pool (otherwise the experiment was too large to upload). (Also, note that I only looked at the practice phase.)


    Good luck!


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Did you like my answer? Feel free to Buy Me A Coffee :)

  • YOu are so great ,Thank you alot 💐

  • Hi,

    Someone can help me ? I have to do an experiment for my last year of study and I’m lost... I also have a problem with my experience, I can’t create a sound variable with different sound files and python script crashes every time. I can't reach her because I am receiving error code 413.

  • edited March 2021

    @débutanteopensesame , please keep the forum clean by posting your questions only once. I'll reply in the other thread you opened:

    https://forum.cogsci.nl/discussion/6989/experiment-doesnt-work#latest

    Did you like my answer? Feel free to Buy Me A Coffee :)

Sign In or Register to comment.