PennController for IBEX › Forums › Support › Maze: comprehension question only in some trials
Tagged: comprehension question, conditional, maze
- This topic has 2 replies, 2 voices, and was last updated 2 years, 1 month ago by MandyLing.
-
AuthorPosts
-
November 8, 2022 at 1:10 pm #9696MandyLingParticipant
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!
MandyNovember 8, 2022 at 3:14 pm #9700JeremyKeymasterHi Mandy,
Apparently the way I wrote the
success
andfailure
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
November 8, 2022 at 3:17 pm #9701MandyLingParticipantThank you so much!
It works now.
Mandy -
AuthorPosts
- You must be logged in to reply to this topic.