Pre-determined line breaks in self-paced reading experiment

PennController for IBEX Forums Support Pre-determined line breaks in self-paced reading experiment

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9916
    KateK
    Participant

    Hello!

    I am looking for a way to preserve intentionally marked line breaks (currently marked with /n in my .csv) that have been chosen/placed already.

    Is there a way to do this in PCIbex? My trials are being iterated using a Template right now.

    Here is my experiment for your reference: https://farm.pcibex.net/r/bOIUXY/

    Thank you in advance for your advice!

    #9920
    Jeremy
    Keymaster

    Hello,

    The DashedSentence controller does accept the \n character as a linebreak, but when looking up the table Template reads that sequence as two characters (\+n) which in a javascript string you would write as \\n

    The solution is to replace all occurrences of \\n with \ns: row.acceptability.replace(/\\n/g,"\n")

    Jeremy

    #9926
    KateK
    Participant

    Jeremy,

    Thanks so much! This worked great.

    Best,
    Kate

    #9968
    acr1408
    Participant

    Hi,

    Sorry for asking again, but I’m very new to this system. Could you please explain where I should place the line that Jeremy suggested as solution: row.acceptability.replace(/\\n/g,”\n”)
    Should I put this line in the “DashedSentence.js” module or in the “main.js”? I don’t know in which chuck part it should be included.

    Sorry for bothering and thanks for your help.

    Best,
    Álvaro

    #9971
    Jeremy
    Keymaster

    Hi,

    If you look at the code of https://farm.pcibex.net/r/bOIUXY/ in main.js, you’ll see this line: newController("DashedSentence", {s: row.acceptability}). This is where to substitue row.acceptability.replace(/\\n/g,"\n"): newController("DashedSentence", {s: row.acceptability.replace(/\\n/g,"\n")})

    Jeremy

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