Presenting self-defined regions in self-paced reading

PennController for IBEX Forums Support Presenting self-defined regions in self-paced reading

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9849
    JunLyu
    Participant

    Hi Jeremy,

    I may have posted a question earlier without creating a topic title. I apologize if I am reposting.

    My previous question is how I can present self-defined regions in a self-paced reading experiment. For example, “this is” “what” “I” “have” “in mind”. In the old Ibex Farm (Drummond, 2013), this is accomplished by closing the self-defined regions in double or single quotes. In the new Ibex, this is defined by space. I tried using double quotes in the csv template which I feed to the script, but the output looks like the regions are still defined by spaces. Is there anyway I can fix this?

    Thank you!

    #9853
    Jeremy
    Keymaster

    Hi,

    PennController is a simple extension to IBEX, so you can still do what you used to do. For example, this is still valid:

    items = [
      ["label", "DashedSentence", {s: ["This is", "what", "I", "have", "in mind"]}]
    ];

    However, you can only store strings in a CSV file, you cannot directly store a javascript array (which is what ["This is", "what", "I", "have", "in mind"] is) so to accomplish the same using a string from a CSV file, you need to split it into an array, using a character of your choice to serve as the splitting character. Say you choose to use ~, then you can have This is~what~I~have~in mind in your CSV file, and then do this in your Template command:

    Template( row =>
      newTrial( 
        newController("DashedSentence", {s: row.sentence.split("~")})
            .print()
            .log()
            .wait()
      )
    )

    Jeremy

    #9855
    JunLyu
    Participant

    Thank you Jeremy! This is helpful! I discovered that using the underscore _ also works to concatenate strings. But I did not know that we can define our own splitters.

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