Maze: comprehension question only in some trials

PennController for IBEX Forums Support Maze: comprehension question only in some trials

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9696
    MandyLing
    Participant

    Hi Jeremy,

    I’m creating a Maze task and having trouble implementing comprehension questions. I want a question to appear only if the participant succeeded in the task, and only if there is really a comprehension question for that specific sentence (about half, listed in the CSV).
    I managed to limit the question to only successful trials, but when I tried add the second condition, and limit it to only trials with a question, it skips the question-related sequence of events completely. That is, either conditions works independently, but not together.

    Here is how i tried to do it:

    newController("Maze", {s: row.sentence, a:row.distractor}) 
                .center()
                .print()
                .log()
                .wait()
                .remove()
                .test.passed()
                .failure(newText("!אופס").center().print().cssContainer({"font-size": "32px", "color": "red", "line-height": "150%"}),
                        newTimer("oops",1000).start().wait())
                .success(
                ( row.QuestYN =="Y" ? [
           newController("Question", {q: row.question, as: ["לא","כן"]})
                .center()
                .print()
                .log()
            ,
            newTimer("timeout_practice", 10000)
                .start()
                .log()
            ,
            newKey("answer_practice", "EI")
                .callback( getTimer("timeout_practice").stop() )
                .log("all")
            ,
            
            getTimer("timeout_practice")
                .wait()
            ,
            
            getController("Question")
                .remove()
            ,
            
            getKey("answer_practice")
             .test.pressed()
             .failure(newText("לאט מדי")
                .settings.center()
                .cssContainer({"font-size": "32px", "color": "red"}) 
                .print()
                .log()
                ,
                newTimer("afterSentence2", 1000)
                    .start()
                    .wait()
             )
            ]:[
             (newTimer("afterSentence2", 1000)
             .start()
             .wait()
             )
            ])
    

    Any help would be very appreciated!
    Mandy

    #9700
    Jeremy
    Keymaster

    Hi Mandy,

    Apparently the way I wrote the success and failure commands, they don’t accept arrays of commands; instead, they require a comma-separated list of commands. Just add ... before ( row.QuestYN =="Y" ? [ to tell the script to coerce the arrays into a comma-separated list, like this: ...( row.QuestYN =="Y" ? [

    Jeremy

    #9701
    MandyLing
    Participant

    Thank you so much!
    It works now.
    Mandy

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