PennController for IBEX › Forums › Support › How to present two lines on one page?
Tagged: self-paced reading
- This topic has 5 replies, 2 voices, and was last updated 4 years, 5 months ago by
JunLyu.
-
AuthorPosts
-
April 4, 2020 at 12:41 am #4989
JunLyu
ParticipantDear Jeremy,
I want to present two sentences on one page such that the first sentence is presented as a whole chunk with the second sentence presented word by word on the second line. An example is as follows:
“Today is a very nice day!” (presented first but hidden by “__” after presentation)
“So, I went outside for a walk.” (presented word by word)Is there a way that can accomplish this? I know that in Ibex, the whole sentence would be put in [“word1”, “word2”, …]. So if there is a way to break line, it would solve the problem. I’m not sure if PC Ibex (and Ibex as well) can make this happen.
Many thanks!!!
Jun
April 4, 2020 at 3:56 pm #4991Jeremy
KeymasterHello Jun,
Yes, one option would be to inject the native-Ibex DashedSentence controller in a PCIbex trial, like this:
newTrial( newText("context", "Today is a very nice day!") .css('font-family', 'monospace') .center() .print() , newText("instructions", "
Press Space to start reading the next sentence
").italic().print() , newKey(" ").wait() , getText("instructions").remove() , getText("context").text("_____ __ _ ____ ____ ____") , newController( "DashedSentence" , {s: "So, I went outside for a walk.", display: "in place"} ) .print() .wait() )More info on the DashedSentence controller in the original Ibex documentation
Jeremy
-
This reply was modified 4 years, 5 months ago by
Jeremy. Reason: Tried to make the example closer to what was described
April 4, 2020 at 4:46 pm #4994Jeremy
KeymasterSorry, posting a new message because after re-reading your message I think I just realized that you want something slightly different. Would you be OK with having two DashedSentence back-to-back, like this?
newTrial( newController( "DashedSentence" , {s: ["Today is a very nice day!"]} ) .print() .wait() , newController( "DashedSentence" , {s: "So I went outside for a walk."} ) .print() .wait() )
April 4, 2020 at 5:01 pm #4995JunLyu
ParticipantThanks so much Jeremy! If I understand correctly, in PCIbex, I don’t need to specify the size of the word or phrase by including them in “”. So in your code with “DashedSentence” command, each word in “Today is a very nice day!” will be presented based on space, correct? Also, by adding a new controller, the two sentences can be presented on the same page now, yes? If so, then how do I, say, present the first sentence in its entirety? So, basically, a participant sees the whole chunk “Today is a very nice day!”, followed on the second line by “So”,”I”,”went” … in a word-by-word fashion?
Jun
April 4, 2020 at 5:49 pm #4997Jeremy
KeymasterThe code in my second message actually already does what you describe: it presents the sentence “Today is a very nice day!” as a whole chunk, and the second sentence word-by-word
This is actually how the DashedSentence controller works by default in Ibex: if you take a close look at the s parameter, the first time it is an array of one element (that element being the string) whereas the second time it is a string, directly (no square brackets). When the parameter is an array, every element is presented as a chunk, but when the parameter is directly a string, it is split using the space character and each word (separated by a space) is a chunk.
Jeremy
April 4, 2020 at 6:20 pm #5001JunLyu
ParticipantI see! This really helps! Thanks so much!
Best,
Jun -
This reply was modified 4 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.