.wait() on getDropDown issue

PennController for IBEX Forums Support .wait() on getDropDown issue

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6459
    CBill
    Participant

    Hi 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,
    Cory

    #6461
    Jeremy
    Keymaster

    Hi 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

    #6482
    CBill
    Participant

    Hi Jeremy,

    Yes that works well.

    Thanks again!

    Cory

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