PennController for IBEX › Forums › Support › Prevent long stimuli from splitting in two lines
- This topic has 4 replies, 2 voices, and was last updated 2 years, 7 months ago by DariaBelova.
-
AuthorPosts
-
April 28, 2022 at 5:24 pm #8125DariaBelovaParticipant
Hi!
In my experiment I have quite long sentences and some of them split in two lines, but this is very unfortunate. Could you please provide me some ways of keeping them in one line? I tried to change the font size with .css command but it didn’t help, the text doesn’t change, but maybe I’m doing something wrong. Here is the demonstration link: https://farm.pcibex.net/r/RQqgmh/
Thank you!April 28, 2022 at 5:38 pm #8126JeremyKeymasterHi,
You could use
.css("white-space", "nowrap")
Also, I see in your code that you have
defaultText.css("font-size", "80")
but then you don’t create any Text element, instead you use Controller elements to display content: thecss
command won’t affect those elements. You can try calling.css("font-size", "80")
on each Controller elementBesides, you might want to edit Aesthetics/PennController.css to change
width: 40em !important;
towidth: 60em !important;
for example (you would then need to changemargin-left: calc(50vw - 20em);
tomargin-left: calc(50vw - 30em);
to keep the content centered)Jeremy
April 29, 2022 at 9:36 am #8129DariaBelovaParticipantHi Jeremy, thank you very much for your help!
I tried to use .css(“white-space”, “nowrap”) and it worked for the DashedSentence controller, but as soon as I change the controller to AcceptabilityJudgment (I also checked DashedAcceptabilityJudgment but it’s the same) the sentences continue to split. Am I doing something wrong? Here is the code I’m using:
newController("AcceptabilityJudgment", { s: row.sentence, as: ["1", "2", "3", "4", "5", "6", "7"], presentAsScale: true, leftComment: "Плохо", rightComment: "Хорошо", timeout: 10000 }) .css("white-space","nowrap") .center() .print() .wait() .log() .remove()
Sincerely,
DariaApril 29, 2022 at 4:49 pm #8133JeremyKeymasterHi Daria,
You can remove
.css("white-space","nowrap")
and add this to Aesthetics/global_main.css instead:.PennController-nowrap .FlashSentence-flashed-sentence, .PennController-nowrap .DashedSentence-sentence { white-space: nowrap; }
This will apply the CSS rule to the sentence in your controller as long as you name the element
"nowrap"
:newController("nowrap", "AcceptabilityJudgment", { s: row.sentence, as: ["1", "2", "3", "4", "5", "6", "7"], presentAsScale: true, leftComment: "Плохо", rightComment: "Хорошо", timeout: 10000 }) .center() .print() .wait() .log() .remove()
Jeremy
April 30, 2022 at 5:46 pm #8137DariaBelovaParticipantThank you very much, Jeremy, it worked!
-
AuthorPosts
- You must be logged in to reply to this topic.