PennController for IBEX › Forums › Support › .wait() on getDropDown issue
- This topic has 2 replies, 2 voices, and was last updated 3 years, 8 months ago by
CBill.
-
AuthorPosts
-
December 18, 2020 at 11:12 am #6459
CBill
ParticipantHi again,
So now I seem to be having some trouble with the wait() command on a DropDown element. Specifically, I am trying to set things up so that the DropDown element sits in the middle of a sentence and the participant selects the relevant word from a list. However, when the selection is made, the experiment does not continue.
Below is the relevant code:
PennController.ResetPrefix(null) // Shorten command names (keep this line here) PennController( newText("BLand.Text.1", "4. Sie haben den Großteil Ihrer ersten 10 Lebensjahre in") .settings.css("margin", "25px auto") .print() , newDropDown("BLand.Select", "Bitte wählen Sie") .settings.add("Baden-Württenmberg", "Bayern", "Berlin", "Brandenburg", "Bremen", "Hamburg", "Hessen", "Niedersachsen", "Mecklenburg-Vorpommern", "Nordrhein-Westfalen", "Rheinland-Pfalz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig-Holstein", "Thüringen") .settings.before(getText("BLand.Text.1")) .settings.css("margin", "25px auto") .print() , newText("BLand.Text.2", "gelebt") .settings.before(getDropDown("BLand.Select")) .settings.css("margin", "25px auto") .print() , getDropDown("BLand.Select") .wait() , newButton("Weitermachen") .settings.css("margin", "25px auto") .print() .wait() )
Thanks for any help,
CoryDecember 18, 2020 at 12:16 pm #6461Jeremy
KeymasterHi Cory,
There seems to be a bug where re-printing the DropDown element causes the script to ignore selections. In your case, the DropDown element gets re-printed in the before command on your BLand.Text.2 Text element. Barely one day after releasing PennController 1.9, we find a bug to fix for the next release 🙂
Meanwhile, the workaround I recommend consists in not re-printing the DropDown element, and printing your Text elements around it instead:
newTrial( defaultText.css("white-space", "nowrap") // prevent linebreaks , newDropDown("BLand.Select", "Bitte wählen Sie") .add("Baden-Württenmberg", "Bayern", "Berlin", "Brandenburg", "Bremen", "Hamburg", "Hessen", "Niedersachsen", "Mecklenburg-Vorpommern", "Nordrhein-Westfalen", "Rheinland-Pfalz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig-Holstein", "Thüringen") .before(newText("BLand.Text.1","4. Sie haben den Großteil Ihrer ersten 10 Lebensjahre in")) .after(newText("BLand.Text.2","gelebt")) .css("margin", "0px 25px") .print() .wait() , newButton("Weitermachen") .settings.css("margin", "25px auto") .print() .wait() )
Let me know if you have questions
Jeremy
January 4, 2021 at 6:49 am #6482CBill
ParticipantHi Jeremy,
Yes that works well.
Thanks again!
Cory
-
AuthorPosts
- You must be logged in to reply to this topic.