Howdy, Stranger!

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

Supported by

[solved] data from base_form

edited June 2013 in OpenSesame

Hi again,

I used the item "form_base" to create a form with a question and 4 buttons - answers, the script goes as follows:

set rows "1;1;1;1;1;1;1;1;1" 
set description "A generic form plug-in" 
set spacing "25" 
set cols "1;1;1;1;1;1;1;1" 
set theme "plain" 
set margins "150;100;50;100" 
widget 0 0 8 2 label center="yes" text="What shape did you see?" 
widget 0 6 2 2 button center="yes" text="[op1]" frame="yes" var="op1_response" 
widget 2 6 2 2 button center="yes" text="[op2]" frame="yes" var="op2_response" 
widget 4 6 2 2 button center="yes" text="[op3]" frame="yes" var="op3_response" 
widget 6 6 2 2 button center="yes" text="[op4]" frame="yes" var="op4_response"

at first the variables were all var="response", that didn't work so I tried this, but I still can't find the variables in the data files. What is the right way to collect data from this item? I need to know what answer (button) the participant chose.

Thanks, Nagham

Comments

  • edited 6:09AM

    Hi Nagham,

    When I try to run your form it works perfectly. The variables 'op1_response', 'op2_response', 'op3_response' and 'op4_response' appear as column headers in the .csv file, and contain the value 'yes' of the corresponding box was ticked, and the variable 'no' if the box was not ticked.

    image

    Are you sure you place your logger item after the form_base?

    If the form_base variables really don't appear in your output file, perhaps you can try to log them manually like so:

    image

    Does this help? Please let us know if you have any further questions.

    Best,

    Lotje

  • edited 6:09AM

    Hi,

    It is now working properly in this item but not in other custom made forms, and when I try to "Add custom variable" it appears in the list of variables in the logger item but not in the data file.
    Also, Should I use the same logger throughout the whole experiment, or use multiple ones?

    Thanks again,
    Nagham

  • edited June 2013

    To be specific,
    The items are 1) custom base_form and 2) Form Text Input, which response is not being recorded.

  • edited 6:09AM

    Actually i fixed the first (the custom) manually as you said, only the second one is a problem now.
    By the way, what does NA in the data file mean? Because I do see the name of the variable as a header in the data file but it doesn't contain a value, only "NA".

  • edited 6:09AM

    And what units is the time logged in? it can't be ms because it has values like:
    6167826
    6171770
    6175396
    6179439

    Sorry about all the separate messages, and thanks again.

  • edited June 2013

    Hi Nagham,

    Should I use the same logger throughout the whole experiment, or use multiple ones?

    Yes, in general I would advise to use one logger item for your whole experiment.

    By the way, what does NA in the data file mean? Because I do see the name of the variable as a header in the data file but it doesn't contain a value, only "NA".

    By default, all variables that OpenSesame knows of are logged, even if they are not yet defined when the logger is called. Such missing values are logged as ‘NA’.

    For more info about both of these issues, please see:

    And what units is the time logged in?

    Response variables, such as 'response_time', are in ms. Variables such as 'time_form_base' are timestamps in experiment time of the last call of the item 'form_base'. So, a time stamp of 6167826 would mean that, on a particular trial, this item was called 6167826 ms after you launched your experiment.

    Would it be possible to upload your experimental script on pastebin, such that we can figure out why some of your variables are not logged? Or does appending the same logger item instead of different ones already solve the problem?

    Best,

    Lotje

  • edited June 2013

    Hi Lotje,

    I understand that the variable which collects the time from the point where an option to respond is given to the point where it's actually given is "response_tima_variablename", I followed this and made a custom new variable to each of the items I want the time for:

    1. HowDidYouKnow
    2. Confidence
    3. Rel_question
    4. Non_Rel_que

    as you can see in the picture.
    In the data file, though, I don't get any values to these variables- it's NA (as you can see in the second picture).
    My questions are:

    1. Do I have to write the actual command for collecting the time data in each of the items??
    2. I don't get the text response of the 'text_input_form' item that's called 'Confidence', it is also NA as you can see in the data picture, although I did write it down as the response variable 'response_Confidence'.

    Thank you,

    Nagham

  • edited June 2013

    Hi Nagham,

    Could you perhaps put your experimental code on pastebin? Otherwise I'm afraid I can't understand what's going wrong.

    To share the experimental code:

    • Open the "General properties" tab, click "Script editor" and copy the whole script,
    • go to http://pastebin.com or https://gist.github.com, upload your script there (simply paste and submit)
    • and provide us with the resulting URL that appears in your address bar

    Best,

    Lotje

  • edited 6:09AM

    The pastbin.com and gist.github.com show this notice:
    "Page Not Found
    The page you were looking for could not be found."

  • edited 6:09AM

    Sorry, now they should work! :)

  • edited 6:09AM

    The pastbin.com and gist.github.com show this notice: "Page Not Found The page you were looking for could not be found."

    And also: Come on, surely you could have found out that the addresses are http://pastebin.com and http://gist.github.com.

  • edited 6:09AM

    Oh! awkward hh
    I just clicked on the link in Lotje's message.
    Yes it works now I'll upload it in a sec.

  • edited 6:09AM

    Here's the link: http://pastebin.com/uF5XkkNq
    Some of the variables' contents are in hebrew though.

  • edited June 2013

    .

  • edited June 2013

    Hi Nagham,

    Firstly, the fact that the response variables 'response_c_op1' to 'response_c_op5' do not have a value in your output file is because of the following:
    In your Image_Que loop you set the number of cycles to 8 and the number of repetitions to .20. Since 8 * .20 is 1.60, which is rounded to 1, the corresponding sequence (which you called 'loop1') is ran only once. As a consequence, the run-if statement
    [count_loop1]==7 will never be met, and N8 and R8 are never run.

    I understand that the variable which collects the time from the point where an option to respond is given to the point where it's actually given is "response_tima_variablename", I followed this and made a custom new variable to each of the items I want the time for.

    Response times are only determined for variables collected with response items (such as a keyboard_response item or a mouse_item). If you want to determine response times for other response variables (such as text input from a form), you will have to first calculate and set it yourself in an inline_script item. After setting the new variable (by using the exp.set() function described in the link below) it will automatically be logged by the logger item (you can check the "Automatically detect ..." box and don't have to add them manually).

    You can calculate and set the response times by appending an inline_script item immediately after a given form item, and put something like the following code in its Run phase tab:

    # Determine the starting time of the form item:
    starting_time = self.get("time_Rel_question")
    
    # Determine the current time:
    current_time = self.time()
    
    # The time it took to complete the form base is the 
    # difference score between the two:
    my_rt = current_time - starting_time
    
    # Set the new variable for future use in the
    # GUI (notably, the logger item):
    exp.set("my_rt", my_rt)
    

    For more info about setting and getting variables, see:

    I don't get the text response of the 'text_input_form' item that's called 'Confidence'

    The text input variable ('response_Confidence') is not logged because you should explicitly give the name of the to-be-logged experimental variable to the text_input widget, even though you already did so in the 'Response variable' box in the GUI. So, in the editor of your 'Confidence' item, change:

    widget 4 2 1 1 text_input focus="yes" stub="" return_accepts="yes"
    

    into:

    widget 4 2 1 1 text_input focus="yes" stub="" return_accepts="yes" var="[form_var]"
    

    I hope this helps!

    Good luck!

    Lotje

  • edited 6:09AM

    Thank you very much for your patience and help.
    It works now :)

    Nagham

Sign In or Register to comment.