Paragraphs instead of sentences

64 views
Skip to first unread message

jessica.m...@gmail.com

unread,
Sep 25, 2018, 11:31:01 AM9/25/18
to ibexexperiments
Hi all,

I have what I think is a really simple question but I can't seem to find the answer. I'd like to add a line break in the sentence field (s) in AcceptabilityJudgment, i.e. to have two sentences/paragraphs instead of a single sentence.

Currently my sentence in var items looks something like this:

[["practice", 100], "AcceptabilityJudgment", {s: "A: Hi Joan, how are you? B: Hey John, I'm great!" }],

I'd like to have A and B separated by a line break/in separate paragraphs. Is this possible? How do I do it?

Best wishes,

Jessica

P.S. Do you know you have a lot of spam topics about methadone in the most recent topics for this google group?

Jérémy Zehr

unread,
Sep 25, 2018, 12:16:26 PM9/25/18
to ibexexperiments
Hi Jessica,

Unfortunately there is no easy way to insert a linebreak in the s parameter of AcceptabilityJudgment, the reason being that it ignores any <tag> it contains, making it impossible to use HTML tags like <p> or <br>, which would normally render linebreaks. The q parameter evaluates them though, so if you're fine with presenting the sentence using the q parameter instead of s (and maybe then show your actual---one-line---question using the s parameter) then this is one solution:
[["practice", 100], "AcceptabilityJudgment", {q: "A: Hi Joan, how are you?<br>B: Hey John, I'm great!", s: "Do you find this dialogue natural?"}],

If you'd rather stick to using the s parameter and don't want to mess with editing the controllers, here is a not-very-clean workaround, injecting some javascript in the q paramater which will fill the s parameter on runtime (mind the \\ before the apostrophe in the sentence):
[["practice", 100], "AcceptabilityJudgment", {s: "", q: "<script>$('.FlashSentence-FlashSentence').html('A: Hi Joan, how are you?<br>B: Hey John, I\\'m great!');</script>"}],

Let me know if you have questions

jessica.m...@gmail.com

unread,
Dec 6, 2018, 6:16:42 AM12/6/18
to ibexexperiments
Thank you so much - we actually ended up doing this, i.e. just switching around the s and the q. It worked fine for what we needed!

Best wishes,

Jessica
Reply all
Reply to author
Forward
0 new messages