No reading times on results file

PennController for IBEX Forums Support No reading times on results file

Tagged: 

This topic contains 8 replies, has 2 voices, and was last updated by Avatar noedoc1 2 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #5855
    Avatar
    noedoc1
    Participant

    Hi, Jeremy!
    I’m trying to run an experiment in which participants have to read a sentence, press the spacebar, and then answer a multiple-choice question. So far I think I have managed to write the correct syntax, however, I’m not getting the reading time on the results file. So I’m definitely doing something wrong. I’d like to have the sentence reading time and the question reading time.

    Here’s my syntax so far:

    Template( variable=>
    newTrial("experimento",
        newText("*")
        .print() 
    ,
        newKey(" ")
        .wait()
        .log("all")
    ,
        getText("*")
        .remove()
    ,
        newText(variable.oracion)
        .print()
    ,
        newKey(" ")
        .wait()
        .log("all")
    ,
        getText(variable.oracion)
        .remove()
    ,    
        newText(variable.pregunta)
        .print()
    ,
       newButton("fem.s", variable.uno)
        .print()
    ,
        newButton("mixto", variable.dos)
        .print()
    ,
        newButton("fem.p", variable.tres)
        .print()
    ,
        newButton("masc.s", variable.cuatro)
        .print()
    ,
        newButton("masc.p", variable.cinco)
        .print()
    ,
        newButton("fem.tres", variable.seis)
        .print()
    ,
        newButton("ninguna", variable.siete)
        .print()
    ,
    newSelector()
        .add(getButton("fem.s"), getButton("mixto"), getButton("fem.p"), getButton("masc.s"), getButton("masc.p"), getButton("fem.tres"), getButton("ninguna"))
        .shuffle()
        .log("all")
        .wait()
    )
        .log( "oracion" , variable.oracion )
    )
    ;
    

    And here are some lines of my results file, corresponding to two items: (24 and 33):

    2861 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 24 0 "experimento" "NULL" "PennController" "25" "_Trial_" "Start" 1595564331998 "Les caminioneres con experiencia manejan por la ruta durante toda la noche." "NULL" " " " " " " " "
    2862 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 24 0 "experimento" "NULL" "Key" " " "PressedKey" " " 1595564332456 "Les caminioneres con experiencia manejan por la ruta durante toda la noche." "Wait success" " " " " " " " "
    2863 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 24 0 "experimento" "NULL" "Key" " 2" "PressedKey" " " 1595564332806 "Les caminioneres con experiencia manejan por la ruta durante toda la noche." "Wait success" " " " " " " " "
    2864 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 24 0 "experimento" "NULL" "Key" " " "PressedKey" " " 1595564332806 "Les caminioneres con experiencia manejan por la ruta durante toda la noche." "NULL" " " " " " " " "
    2865 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 24 0 "experimento" "NULL" "Selector" "unnamed-Selector" "Selection" "fem.s" 1595564334205 "Les caminioneres con experiencia manejan por la ruta durante toda la noche." "NULL" " " " " " " " "
    2866 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 24 0 "experimento" "NULL" "PennController" "25" "_Trial_" "End" 1595564334206 "Les caminioneres con experiencia manejan por la ruta durante toda la noche." "NULL" " " " " " " " "
    2867 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 33 0 "experimento" "NULL" "PennController" "34" "_Trial_" "Start" 1595564334209 "Las médicas de guardia están más exigidas que sus compañeros varones." "NULL" " " " " " " " "
    2868 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 33 0 "experimento" "NULL" "Key" " " "PressedKey" " " 1595564334730 "Las médicas de guardia están más exigidas que sus compañeros varones." "Wait success" " " " " " " " "
    2869 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 33 0 "experimento" "NULL" "Key" " 2" "PressedKey" " " 1595564335126 "Las médicas de guardia están más exigidas que sus compañeros varones." "Wait success" " " " " " " " "
    2870 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 33 0 "experimento" "NULL" "Key" " " "PressedKey" " " 1595564335126 "Las médicas de guardia están más exigidas que sus compañeros varones." "NULL" " " " " " " " "
    2871 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 33 0 "experimento" "NULL" "Selector" "unnamed-Selector" "Selection" "mixto" 1595564335805 "Las médicas de guardia están más exigidas que sus compañeros varones." "NULL" " " " " " " " "
    2872 1595564356 "b9b85da84e978f2ab2924b91c15fa986" "PennController" 33 0 "experimento" "NULL" "PennController" "34" "_Trial_" "End" 1595564335807 "Las médicas de guardia están más exigidas que sus compañeros varones." "NULL" " " " " " " " "
    

    Do you spot why I’m not getting the reading times?

    Thanks for your time!
    Noe.

    #5856
    Jeremy
    Jeremy
    Keymaster

    Hi Noe,

    You can get the reading times by subtracting the timestamps of the two Key elements, named " " and " 2" in the results file. For example, you have a reading time of 350ms for item 24 and a reading time of 396ms for item 33.

    If you know R, you can take a look at this R script from the tutorial to get a sense of how to automatize RT calculation.

    One suggestion for your script: you could .disable your first Key element immediately after its .wait command, this way your results file wouldn’t report two keypress events on the wait of the second Key element (at that point, your first Key element is still active, which is why the single keypress gets detected twice).

    Jeremy

    #5858
    Avatar
    noedoc1
    Participant

    Thanks for your quick response, Jeremy!
    I was afraid something like this might happen. I know how to use R but I’m not a programmer so I get lost really easy. Is there a way I could just get the plain reading times on the results file? Adding something like a timer would do the trick? And if so how do I add this? Or the only way around it is through the R script?
    And what are those numbers anyway (e.g. 1595564332456 and 1595564332806 for item 24)? Why are they so big? When does that timer started?

    And thanks for the suggestion for the key element!
    Noe.

    #5859
    Jeremy
    Jeremy
    Keymaster

    You can get plain RT using a global Var element in which you compute the time difference, like this:

    newTrial("experimento",
      newText("*")
        .print()
      ,
      newKey(" ")
        .wait()
        .log("all")
        .disable()
      ,
      getText("*")
        .remove()
      ,
      newText(variable.oracion)
        .print()
      ,
      newVar("RT")
        .global()
        .set(v=>Date.now())
      ,
      newKey(" ")
        .wait()
        .log("all")
      ,
      getVar("RT")
        .set(v=>Date.now()-v)
      ,
      getText(variable.oracion)
        .remove()
    )
    .log( "ReadingTime" , getVar("RT") )

    The timestamps correspond to the number of milliseconds that have elapsed since January 1, 1970. They tell you when the event happened (e.g. 1595564332806 corresponds to July 24, 2020, 9:38am GMT-0400) but are most useful for subtraction, like we’re doing here. The expression Date.now() in the script above returns such timestamps.

    Jeremy

    #5860
    Avatar
    noedoc1
    Participant

    Thanks, Jeremy! This worked perfectly! I also wanna get the question reading time, so considering what you’ve sent, I wrote this. I just wanted to run it by you to check if it’s ok where I place the second RT variable:

    Template( variable=>
    newTrial("experimento",
        newText("*")
        .css("font-size", "1.3em")
        .print() 
    ,
        newKey(" ")
        .wait()
        .log("all")
        .disable()
    ,
        getText("*")
        .remove()
    ,
        newText(variable.oracion)
        .css("font-size", "1.3em")
        .print()
        .log()
    ,
        newVar("RToracion")
        .global()
        .set(v=>Date.now())
    ,    
        newKey(" ")
        .wait()
        .log("all")
    ,
        getVar("RToracion")
        .set(v=>Date.now()-v)
    ,
        getText(variable.oracion)
        .remove()
    ,    
        newText(variable.pregunta)
        .css("font-size", "1.3em")
        .print()
    ,
        newVar("RTpregunta")
        .global()
        .set(v=>Date.now())
    ,
        newButton("fem.s", variable.uno)
        .css("font-size", "1.3em")
        .print()
    ,
        newButton("mixto", variable.dos)
        .css("font-size", "1.3em")
        .print()
    ,
        newButton("fem.p", variable.tres)
        .css("font-size", "1.3em")
        .print()
    ,
        newButton("masc.s", variable.cuatro)
        .css("font-size", "1.3em")
        .print()
    ,
        newButton("masc.p", variable.cinco)
        .css("font-size", "1.3em")
        .print()
    ,
        newButton("fem.tres", variable.seis)
        .css("font-size", "1.3em")
        .print()
    ,
        newButton("ninguna", variable.siete)
        .css("font-size", "1.3em")
        .print()
    ,
    newSelector()
        .add(getButton("fem.s"), getButton("mixto"), getButton("fem.p"), getButton("masc.s"), getButton("masc.p"), getButton("fem.tres"), getButton("ninguna"))
        .shuffle()
        .log("all")
        .wait()
    ,
        getVar("RTpregunta")
        .set(v=>Date.now()-v)
    )
        .log( "RToracion" , getVar("RToracion") )
        .log( "RTpregunta" , getVar("RTpregunta") )
    )
    

    Thanks again for everything!

    #5861
    Jeremy
    Jeremy
    Keymaster

    Yes it looks fine to me, but the best way to know is always to try it out and check the results file

    Jeremy

    #5867
    Avatar
    noedoc1
    Participant

    Yes, I’ve tried it out and the reading times are ok in almost all questions, however there are some cases where I have a difference of 2 or 3 miliseconds. This doesn’t change the times, but I was wondering why this was happening.

    I also have one more question (I promise it’s the last one!). I am uploading the sentences from a table and I want to randomize the presentation. So I put this at the beggining:

    Sequence("bienvenida", "identificacion", randomize("experimento"), "enviardatos", "despedida")
    

    I get the sentences presented in a random order, but it’s always the same random order. So then I checked an old PCIbex script and change the code to this:

    Sequence("bienvenida", "identificacion", shuffle(randomize("experimento")), "enviardatos", "despedida")
    

    But it didn’t work either, it gets the sentences in the same random order. Do you spot what I’m missing?

    Thanks!
    Noe.

    #5872
    Jeremy
    Jeremy
    Keymaster

    Hi Noe,

    Differences of a few milliseconds are to be expected: executing commands from the script takes time, and sometimes browsers experience light slowdowns, resulting in slight delays between a log command being executed and the creation/assignment of the Var element targeting the event.

    The command shuffle regularly intersperse trials from two sets of trials, while randomize randomly reorders all the trials in a given set. You can always replace shuffle(randomize("..."), randomize("..."), ...) with the shorthand rshuffle("...", "...", ...). But since in your case you only have one set of trials (“experimento”) you can just use randomize like you tried at first

    Try a hard refresh on your experiment’s page and you should see a new order (sometimes it takes several shots if you only have a couple trials in the set, because there only are so many possible permutations)

    Jeremy

    #5876
    Avatar
    noedoc1
    Participant

    Great! Thanks, Jeremy, for all the tips and explanations!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.