Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

How to show the responses from practice trials to participants?

YuyanxueYuyanxue Posts: 6
edited January 31 in OpenSesame

Hi OpenSesame developers,
Thanks for creating such a useful tool for us! Almost all the problems arising from my experiment building process were solved by watching the tutorials and reading various posts on this forum!

Now I am trying to show the participant's responses after the practice trials (it's a rating task ranging from 1-7. There is no right or wrong answer, but I would like to check participants' responses after practice trials before they enter the main experiment to see if they need more instructions or practice). I came across this post
forum.cogsci.nl/index.php?p=/discussion/comment/12683/ and also the manual osdoc.cogsci.nl/3.1/manual/response/keyboard/, but what I wanted was all the responses from practice trials instead of the previous trial. Is this possible? I tried adding a sketchpad after the practice block and write [response], as the variable name of the responses is 'response', but it didn't work...

In addition, is it also possible to add a feedback if the difference in responses of the previous two trials is, say, smaller than 2 (as I would expect more difference given the previous instructions they received)?

Thanks a lot,
Mengzhu

Comments

  • eduardeduard Posts: 1,115
    edited February 1

    Hi Mengzhu,

    I tried adding a sketchpad after the practice block and write [response], as the variable name of the responses is 'response', but it didn't work...

    If you try the same with a feedback item instead of a sketchpad does it work then? (The rationale why it could work is explained here: http://osdoc.cogsci.nl/3.1/manual/prepare-run/#sketchpad-and-feedback-items

    In general, what you describe is very possible in python scripts (that is inline_scripts).

    For example. the code below adds the score of some response variable to a string that you can then present at the end of the practice in a feedback item. If you want to add some control layers (difference between any two must be smaller/bigger than 2, you can also add this here, you just have to work out the logic)

    # this inline_script has to be put after the response was given and the script has to be in the run phase
    
    # you also have to create a variable that captures all the responses before the practice loop
    # e.g.: var.practice_responses = ' '
    # I assume it exists for this script
    
    if var.practice == 'yes': # consider responses only when we are in the practice phase
         var.practice_responses += var.response # add the response
         var.practice_responses += '\t' # add some whitespace to have a better view
    
    # Later you can put a textfield into a feedback item and put [practice_responses] as text and you will see all the responses
    

    I hope this make somewhat sense to you.

    Eduard

    Thanked by 1Yuyanxue
  • YuyanxueYuyanxue Posts: 6

    Hi Eduard,
    Thanks very much for your reply.
    Yes, it does work if I use a feedback item. But when I tried the inline_script you've written (the script was in the run phrase and was after the practice_loop), but an error occurred saying:

    'The variable 'practice' does not exist. Tip: Use the variable inspector (Ctrl+I) to see all variables.'

    The weird thing was 'practice' was one of the variables when I checked using both 'variables inspector' or the results file... (someone had the same error message, but I haven't figured out a solution yet http://forum.cogsci.nl/index.php?p=/discussion/212/open-break-from-a-loop-item)

    What problem was this you reckon?

    Thanks a lot,
    Mengzhu

  • eduardeduard Posts: 1,115

    Hi Mengzhu,

    Can you upload your experiment? What you describe sounds a little weird. If the variable cannot be found, it shouldn't be written to the logfile.

    Eduard

  • YuyanxueYuyanxue Posts: 6

    Hi Eduard,
    Please find the mini version of my experiment in the attached.
    Thanks a lot,
    Mengzhu

  • eduardeduard Posts: 1,115

    Hi,

    So, the variable var.response was not defined. Neither was var.practice_responses. As I mentioned in the comments of the code, you have to initialize them in order for the code to work. Also, the inline_script has to be put in the loop, not after the loop. There were a few other little hickups in the code, but the attached experiment should work now.

    Good luck.

    Eduard

    Thanked by 1Yuyanxue
  • It worked. Thank you :)

Sign In or Register to comment.