Automatically run all stimulus sets in PCIbex without duplicating code

PennController for IBEX Forums Support Automatically run all stimulus sets in PCIbex without duplicating code

Tagged: ,

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #11132
    ayzed
    Participant

    Hi Jeremy and everyone!

    I’m building a Reading Span (R-Span) task in PCIbex as supporting data for the speeded plausibility judgment task. My stimuli are organised in a CSV file with a “set” column (A, B, C) as the sets have different number of sentences to be read.

    set,order,sentence,lastword
    A,1,The boy kicked the ball.,ball
    A,2,The car drank the gasoline.,gasoline
    A,3,The dog chased the mailman.,mailman
    B,1,The teacher graded the test.,test
    B,2,The river ate the mountain.,mountain
    B,3,The book fell off the table.,table
    B,4,The girl ran across the country.,country
    C,1,The man cooked pasta every night.,night
    C,2,The lady sipped the hot tea.,tea

    I already manage to do it manually by repeating the code three times of different sets but I am wondering if I am able to make PCIbex automatically present all sentences for each set (A, B, C), and then show a recall screen after each set — without having to copy-paste the same code block for every set. I have read about the sequence function but it only refers to the string of trial and not element from the csv file hence I’m stuck.

    Here’s my current script:

    PennController.ResetPrefix(null)

    // ——————————
    // SENTENCE TRIALS SET A
    // ——————————
    Template(
    GetTable( “rspan.csv” )
    .filter( row => row.set == “A” )
    ,
    row => newTrial(“sentence”+row.set,
    newController(“AcceptabilityJudgment”, {s : row.sentence,
    q : “أهذه الجملة معقولة؟”,
    as : [“لا”, “نعم”],
    presentHorizontally: “true”,
    })
    .center()
    .log()
    .print()
    .wait()
    .remove()
    ,
    newTimer(“break”, 500)
    .start
    )
    .log(“set”, row.set)
    .log(“order”, row.order)
    .log(“sentence”, row.sentence)
    .log(“lastword”, row.lastword)
    );

    newTrial(“recall”,
    newText (“Please type in the final words for all sentences you read and press Enter”)
    .print()
    .center()
    .after (newCanvas(“empty canvas1”, 1, 40)
    .print()
    )
    ,
    newText (“e.g.: ball, gasoline, mailman”)
    .print()
    .center()
    .after (newCanvas(“empty canvas2”, 1, 40)
    .print()
    )
    ,
    newTextInput(“guess”, “Final words”)
    .print()
    .center()
    .wait()
    .log()
    )

    // ——————————
    // SENTENCE TRIALS SET B
    // ——————————
    Template(GetTable( “rspan.csv” )
    .filter( row => row.set == “B” ) ,
    row => newTrial(“sentence”+row.set,
    newController(“AcceptabilityJudgment”, {s : row.sentence,
    q : “أهذه الجملة معقولة؟”,
    as : [“لا”, “نعم”],
    presentHorizontally: “true”,
    })
    .center()
    .log()
    .print()
    .wait()
    .remove()
    ,
    newTimer(“break”, 500)
    .start
    )
    .log(“set”, row.set)
    .log(“order”, row.order)
    .log(“sentence”, row.sentence)
    .log(“lastword”, row.lastword)
    );

    newTrial(“recall”,
    newText (“Please type in the final words for all sentences you read and press Enter”)
    .print()
    .center()
    .after (newCanvas(“empty canvas1”, 1, 40)
    .print()
    )
    ,
    newText (“e.g.: ball, gasoline, mailman”)
    .print()
    .center()
    .after (newCanvas(“empty canvas2”, 1, 40)
    .print()
    )
    ,
    newTextInput(“guess”, “Final words”)
    .print()
    .center()
    .wait()
    .log()
    )

    // ——————————
    // SENTENCE TRIALS SET C
    // ——————————
    Template(GetTable( “rspan.csv” )
    .filter( row => row.set == “C” ) ,
    row => newTrial(“sentence”,
    newController(“AcceptabilityJudgment”, {s : row.sentence,
    q : “أهذه الجملة معقولة؟”,
    as : [“لا”, “نعم”],
    presentHorizontally: “true”,
    })
    .center()
    .log()
    .print()
    .wait()
    .remove()
    ,
    newTimer(“break”, 500)
    .start
    )
    .log(“set”, row.set)
    .log(“order”, row.order)
    .log(“sentence”, row.sentence)
    .log(“lastword”, row.lastword)
    );

    newTrial(“recall”,
    newText (“Please type in the final words for all sentences you read and press Enter”)
    .print()
    .center()
    .after (newCanvas(“empty canvas1”, 1, 40)
    .print()
    )
    ,
    newText (“e.g.: ball, gasoline, mailman”)
    .print()
    .center()
    .after (newCanvas(“empty canvas2”, 1, 40)
    .print()
    )
    ,
    newTextInput(“guess”, “Final words”)
    .print()
    .center()
    .wait()
    .log()
    )

    I am also wondering if there’s any possibility to produce button element (of the last words from the sentences they read + filler words) as the recall stage rather than text input. However, I am clueless on how to produce buttons that link back to the last words that the participants had read (I had a lastword column in the csv file though!). I tried it few times but it always ended up being in error. It would be helpful if participants are able to do the recall through the button element and the data will turn out cleaner too!

    Much appreciated!

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.