Logging the participant ID

PennController for IBEX Forums Support Logging the participant ID

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5201
    suphasiree
    Participant

    Hello Jeremy,

    Sorry to bother you again!

    I’ve piloted the experiment and took a look at the results file, and it didn’t record the Participant ID.

    In the piloting, I used an experiment link that did contain a value for “id”, something like: https://expt.pcibex.net/ibexexps/username/experimentname/server.py?withsquare=2&id=12345

    The value recorded in the ParticipantID column says “undefined”. I was expecting it to record “12345”.

    Do you happen to know what might be causing it? Is it because the program somehow knows that I’m not a real participant from SONA?

    This is the code I am using at the beginning of the file:

    // What is in Header happens at the beginning of every single trial
    Header(
        // We will use this global Var element later to store the participant's id
        newVar("id")
            .global()
        ,
        // Delay of 500ms before every trial
        newTimer(500)
            .start()
            .wait()
    )
    .log( "ParticipantID" , getVar("id"), PennController.GetURLParameter("id") );
    // This log command adds a column reporting the participant's id to every line saved to the results

    Thanks so much for your help.

    #5205
    Jeremy
    Keymaster

    Hello,

    You are passing three arguments to the trial log command, when it should take only two: the first argument is the name of the column to be added, the second argument is the value of that column on each trial row in the results file.

    If you simply get the participant’s id by looking up the URL (as opposed to, say, asking them to type it in a field) then you don’t need to use a Var element, just use:

    .log( "ParticipantID" , GetURLParameter("id") )

    Jeremy

    #5206
    suphasiree
    Participant

    Hello Jeremy, thank you for your fast response, I will give it a try!

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