Howdy, Stranger!

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

Supported by

[solved] Log variables from inline

edited July 2015 in OpenSesame

Dear all,

In my task I have an inline where I update the position of a cursor that moves along a rating scale (a line with numbers from 0 to 10) based on participant's button press (each left button press moves the cursor to the left and each right button press moves the cursor to the right, on the top of each number). When the participant reaches the number that corresponds to her choice, she presses the middle button. I do this with a while loop (i.e., while the response is different from the down button, update the cursor position). How can I record in the results file where the cursor was when the subject pressed the down button? I ask two questions in my rating scale, therefore I created a variable "response" for the first, and a variable "response_2" for the second. I think I need to record each button press in order to retrieve where the cursor was when the down button was pressed (because participant can move the cursor as many times as she wants on the right/left before reaching her decision).

Any tip would be great!

Comments

  • edited 9:36PM

    Hi,

    Looking at the script you posted in the previous thread i think the fastest option is to manually log your pointer value since it changes with each button press.

    Insert in your inline after the middle button has been pushed:

    self.log(pointer)

    The same for your second question:

    self.log(pointer_2)

    I'm not sure how it interacts with the existing log file (i.e if the file remains readable), but otherwise you can create your own log file at the beginning of your experiment which replaces the standard logger.

  • edited 9:36PM

    Hi Manu,

    What Knante said works fine, but keep in mind that manually logging variables besides having all variables automatically logged may result in messy logfiles. You can also simply set the pointer value as a variable once the participant has pressed the middle button: exp.set("decision", pointer) - and let the automatic log item do the rest. The logger automatically logs all experimental variables, so you would end up with a column called "decision" with all the pointer values for every trial in your logfile.

    Cheers,

    Josh

Sign In or Register to comment.