PennController for IBEX › Forums › Support › Separator feedback
- This topic has 2 replies, 2 voices, and was last updated 2 years, 7 months ago by jesslaw.
-
AuthorPosts
-
January 25, 2022 at 5:16 am #7692jesslawParticipant
Hi Jeremy,
I encountered a potential bug with the feedback function of the “Separator” controller and wondered if you could help me out. I was trying use the “Communications between elements” aspect of this controller to give feedback to the answer to a previous “Question” controller. The relevant codes are given below:
newController("prac_cq", "Question", {q: row.question, as: ["Yes", "No"], randomOrder: false, hasCorrect:row.answer}) .print() .wait() .log("Item", row.item) , newController("prac_sep", "Separator", {transfer: 1000, normalMessage: "Correct", errorMessage: "Incorrect"}) .print() .wait()
For some reason, the feedback the separator controller gives is not based on the success/failure state of the element right before it, but based on the success/failure state of a previous trail. What this means is that there is a delay of one trial in terms of feedback—if I answer a question in Trial #1 incorrectly, the feedback is given in the separator element in Trial #2. Since there is no trial preceding Trial #1, the separator element in Trial #1 always gives the feedback “Correct” even if the question element right before it is answered incorrectly.
Any idea why this is happening? I didn’t have this problem when using the same function a month or so ago. Thanks a lot!
- This topic was modified 2 years, 7 months ago by Jeremy. Reason: moved to support
January 25, 2022 at 11:06 am #7694JeremyKeymasterHi,
I’m not sure whether this should qualify as a bug: the
newController
command injects the content of what you’d get when creating a dedicated trial using the corresponding controller, inside the current trial (newTrial
). When you inject two controllers usingnewController
within the same trial, you are not moving from one trial to the other after you complete the first Controller element: this is why the success/failure of your Separator controller tracks the preceding trial, not the preceding Controller elementIf you want to use native-Ibex controllers, you could simply design a native-Ibex experiment (note that you can use
Template
to generate regular Ibex items). Alternatively, you could design your task within a full-PennController framework:defaultText.center() , newText( "<p>"+row.question+"</p>" ).print() , newText("Yes").print(),newText("No").print() , newSelector("answer") .add(getText("Yes"),getText("No")) .keys("F","J") .log() .wait() , clear() , getSelector("answer") .test.selected( getText(row.answer) ) .success( newText("Correct").print() ) .failure( newText("Incorrect").print() ) , newTimer(1000).start().wait()
NB: the Controller element’s
log
command takes no argumentsLet me know if you have questions
Jeremy
January 26, 2022 at 1:57 am #7695jesslawParticipantThanks, Jeremy! I wasn’t aware that newController works this way. That makes a lot of sense to me now and the suggested solution works beautifully!
Since this is not really a bug, is there a way I can move this post somewhere else (or perhaps you can)?And thanks for making the documentation and everything so accessible!!
-
AuthorPosts
- You must be logged in to reply to this topic.