Response time on comprehension questions

PennController for IBEX Forums Support Response time on comprehension questions

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6647
    smithle91
    Participant

    Good morning!

    I have a self-paced reading experiment, in which participants read French sentences and then choose which one of two pictures best corresponds with the sentence they previously read. I wanted to know if there was an easy way to log the response time to the comprehension questions. The results file currently records when the trial starts, when the pictures appear, when the choice is made, and when the trial ends.

    _Trial_,Start,1610552747906,La professeure fait apprendre les verbes à Michel.,stim,NULL
    PennController,10,1,fullstim,NULL,Canvas,Canvas,Print,NA,1610552747907,La professeure fait apprendre les verbes à Michel.,stim,NULL
    PennController,10,1,fullstim,NULL,Selector,unnamed-Selector,Selection,male,1610552748979,La professeure fait apprendre les verbes á Michel.,stim,female;male
    _Trial_,End,1610552750589,La professeure fait apprendre les verbes à Michel.,stim,NULL

    Is there an easier way than subtracting the bolded values to capture response time to these questions? Here is the code I have:

    PennController.ResetPrefix(null)
    PennController.DebugOff()
    newTrial( "welcome" ,
        defaultText
            .print()
        ,
        newText("<p>Welcome!</p>")
        ,
        newText("<p>In this practice session, you will read a sentence one word at a time. Then, you will choose which picture matches the sentence you just read.</p>")
        ,
        newText("<p> For the sentence: Press the <strong>SPACEBAR</strong> to show each word in the sentence.<p>")
        ,
        newText("<p>For the pictures: Press the <strong>A</strong> key for Picture A, or the <strong>B</strong> key for Picture B. You will receive feedback on your responses. </p>")
        ,
        newText("<p>Please enter your ID and then click the button below to start the practice session.</p>")
        ,
        newText("<p>When you reach the end of the practice session, please alert the researcher.</p>")
        ,
        newTextInput("inputID")
            .print()
        ,
        newButton("Start")
            .print()
            .wait()
        ,
        newVar("ID")
            .global()
            .set( getTextInput("inputID") )
    )
    .log( "ID" , getVar("ID") )
    
    Template("fullstim.csv",
        row => ["fullstim",
            "DashedSentence", {s: row.Sentence},
            "PennController", newTrial("experiment",
        defaultImage
            .size(500,350)
            ,
        newImage("male", row.MaleImageFile)
            ,  
        newImage("female", row.FemaleImageFile)
           ,
        newCanvas(1000,500)
            .add(   -50 , 0 , newCanvas("left" , 500, 500) )  
            .add( 475 , 0 , newCanvas("right", 500, 500) )  
            .print()
            .log()
            ,
        newCanvas(50,50)
            .add(180,-100, newText("(A)"))
            .add(700,-100, newText("(B)"))
            .print()
            ,
        
        getCanvas("left").add( 0 , 0 , getImage(row.LeftPicture))
        ,
        getCanvas("right").add( 0, 0 , getImage(row.RightPicture))
        ,
        newSelector()
            .disableClicks()
            .add( getImage(row.LeftPicture) , getImage(row.RightPicture) )
            .keys(          "A"    ,          "B"   )
            .log()
            .wait()
            .test.selected( getImage(row.Target) )
            .success( newText("Correct! Remember, <i> faire </i> plus the infinitive shows that the object performs the action. Otherwise, the subject performs the action.").css("font-size","1.5em").print() )
            .failure( newText("Incorrect! Remember, <i> faire </i> plus the infinitive shows that the object performs the action. Otherwise, the subject performs the action.").css("font-size", "1.5em").print() )
            ,
        newButton("Next").print().wait()
        )
        .log('Item', row.Sentence)
        .log('Group', row.Group)
    ])
    
    

    Thanks!

    • This topic was modified 3 years, 9 months ago by smithle91.
    • This topic was modified 3 years, 9 months ago by smithle91.
    #6651
    Jeremy
    Keymaster

    Good morning,

    There sure are alternative/additional ways, but subtracting the two timestamps is probably the most accurate measure you can get: each timestamp reports when the event happened, to the millisecond (modulo browser lag). In your case, you know that the participant pressed a key almost exactly one second (1072ms) after the main Canvas element was displayed. Subtracting the timestamps is a simple operation in R (line 7).

    If you really need to report the RT at the end of every row, you can use a global Var element that you set to Date.now() when printing the Canvas and whose value you subtract to Date.now() after selection happened, and you can log it on your newTrial:

    Template("fullstim.csv",
        row => ["fullstim",
            "DashedSentence", {s: row.Sentence},
            "PennController", newTrial("experiment",
        defaultImage
            .size(500,350)
            ,
        newImage("male", row.MaleImageFile)
            ,  
        newImage("female", row.FemaleImageFile)
           ,
        newCanvas(1000,500)
            .add(   -50 , 0 , newCanvas("left" , 500, 500) )  
            .add( 475 , 0 , newCanvas("right", 500, 500) )  
            .print()
            .log()
            ,
        newVar("RT").global().set( v=>Date.now() )
            ,
        newCanvas(50,50)
            .add(180,-100, newText("(A)"))
            .add(700,-100, newText("(B)"))
            .print()
            ,
        
        getCanvas("left").add( 0 , 0 , getImage(row.LeftPicture))
        ,
        getCanvas("right").add( 0, 0 , getImage(row.RightPicture))
        ,
        newSelector()
            .disableClicks()
            .add( getImage(row.LeftPicture) , getImage(row.RightPicture) )
            .keys(          "A"    ,          "B"   )
            .log()
            .wait()
            .test.selected( getImage(row.Target) )
            .success( newText("Correct! Remember, <i> faire </i> plus the infinitive shows that the object performs the action. Otherwise, the subject performs the action.").css("font-size","1.5em").print() )
            .failure( newText("Incorrect! Remember, <i> faire </i> plus the infinitive shows that the object performs the action. Otherwise, the subject performs the action.").css("font-size", "1.5em").print() )
            ,
        getVar("RT").set( v=>Date.now()-v )
            ,
        newButton("Next").print().wait()
        )
        .log('Item', row.Sentence)
        .log('Group', row.Group)
        .log('RT', getVar("RT"))
    ])

    Jeremy

    #6652
    smithle91
    Participant

    Hi Jeremy,

    Thanks for your quick response! I’m using R, so if it is more accurate to subtract the timestamps, I’ll just do that and use the R operation when I’m ready to analyze the data.

    Thanks so much!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.