PennController for IBEX › Forums › Support › Scale feedback and timeout
- This topic has 2 replies, 2 voices, and was last updated 3 months, 4 weeks ago by
Jeremy.
-
AuthorPosts
-
February 5, 2023 at 12:59 pm #9890
Mercedes
ParticipantHi Jeremy!
I am programming and Acceptability judgement task with oral stimuli. Right now I’ve been having two issues:
1. I created a timeout timer so that after 7 seconds the trial ends and they show a message saying “Too Slow”. The problem is that after that message shows, the button does not continue to the next trial.
2. I want to add a correct answer to my scale, so that if participants press 1 they will get a message saying “Correct” and if the press any of the other numbers, they will get a message saying “Incorrect”, but it does not allow me to use if…else inside test selected, or I am doing ir wrong.
Here’s my code:
newTrial("checks", newText("prueba", "Presione la barra espaciadora para continuar") .center() .print() , newKey("separador_2", " ") .callback(getText("prueba").remove()) .wait() , newAudio("check_97", "check_97.mp3") , newImage("speaker_1", "altavoz.png") .print() .center() .size(250, 200) , newTimer("focus",250) .start() .wait() , getAudio("check_97") .play() .wait() , getImage("speaker_1") .remove() , newTimer("timer", 7000) .start() .callback(getScale("acceptability").remove(), newText("lento","<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Muy lento!</p>") .center() .print() , newButton("recomenzar", "Click aquí para continuar") .center() .print() ) , newScale("acceptability", 7) .before(newText("<p style=font-family:lucilda margin-right:2em><i>completamente inaceptable</i></p>")) .after(newText("<p style=font-family:lucilda><i>completamente aceptable</i></p>")) .callback(getTimer("timer") .stop()) .button() .keys() .center() .print() .wait() , getScale("acceptability") .test.selected(getScale("acceptability") == 1) .success(newText ("correct") .print()) .failure(newText("incorrect") .print()) , getTimer("timer") .callback(getButton("recomenzar") .wait() .remove()) .callback(getText("lento") .remove()) .wait("first") )
and the link to the demo: https://farm.pcibex.net/r/dnBMvb/
Thank you!
February 6, 2023 at 1:01 pm #9891Mercedes
ParticipantHi! Sorry for the stack replies, but I solved the problem with the correct/incorrect feedback below the scale. Now the issue is that when I implement the timer, the incorrect/correct feedback overlaps with the “Too Slow” message and they both appear together on the same screen.
My idea is that when they press the button on the scale, they will see whether they pressed the correct key or not and then they press the space bar to continue to the next trial. If the timer times out before they select a key, they will get the too slow message and then press the space bar to continue to the next trial. This is my code now:
Template("attention_checks.csv", row => newTrial(row.condition, newText("prueba", "<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>") .center() .print() , newKey("separador_2", " ") .callback(getText("prueba").remove()) .wait() , newAudio(row.audio) , newImage("speaker_1", "altavoz.png") .print() .center() .size(250, 200) , newTimer("focus",250) .start() .wait() , getAudio(row.audio) .play() .wait() , getImage("speaker_1") .remove() , newTimer("timer", 7000) .start() .callback(getScale("acceptability_checks").remove(), newText("lento","<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Muy lento!</p>") .center() .print(), newText("seguir", "<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>") .center() .print(), newKey("recomenzar", " ") ) .callback(getText("label_practice") .remove()) , newText("label_checks", "<p style=font-family:lucilda margin-right:2em>Usá el teclado o el mouse para responder</p>") .css("font-size", "0.9em") .css("font-style", "italic") .css("position", "relative") .css("top", "120px") .css("font-weight", "100") .center() .print() , newScale("acceptability_checks", 7) .before(newText("<p style=font-family:lucilda margin-right:2em><i>completamente inaceptable</i></p>")) .after(newText("<p style=font-family:lucilda><i>completamente aceptable</i></p>")) .callback(getTimer("timer") .stop()) .button() .keys() .center() .print() .wait() , newVar("score_attention") .set(getScale("acceptability_checks")) , newVar("check_attention") .set(row.check) .test.is("") .or(getVar("check_attention").test.is(getVar("score_attention"))) .success( newText("bien", "<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Correcto!</p>") .print() .center() , newText("continuar_bien","<p style=font-family:helvetica;color:red padding-bottom: 25px>Presione la barra espaciadora para continuar</p>") .print() .center() , newKey(" ") .wait() ) .failure( newText("<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Incorrecto!</p>") .print() .center() , newText("<p style=font-family:helvetica;color:red padding-bottom: 25px>Presione la barra espaciadora para continuar</p>") .print() .center() , newKey("continuar_mal" , " ") .wait() ) , getTimer("timer") .callback(getText("lento") .remove()) .callback(getText("seguir") .remove()) .callback(getKey("recomenzar") .wait()) .wait("first") ) .log("group", row.group) .log("item", row.item) .log("condition", row.condition) )
February 8, 2023 at 3:11 pm #9901Jeremy
KeymasterHi,
I wrote a simplified version of your trial where I took out some elements for the sake of illustration. The main takeaway is that, since all three scenarios (correct choice, incorrect choice, no choice) end the same way (print “press a key” and wait for a keypress) you don’t have to repeat that sequence of events three times, you can write it just once at the end of the trial instead (you also don’t have to use a Var element to check the value of a column, you can pass it directly to
test
):newTrial(row.condition, defaultText.center().print() , newText("prueba", "<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>") , newTimer("timer", 7000) , newScale("acceptability_checks", 7) .before(newText("<p style=font-family:lucilda margin-right:2em><i>completamente inaceptable</i></p>")) .after(newText("<p style=font-family:lucilda><i>completamente aceptable</i></p>")) .callback( getTimer("timer").stop() ) .button() .keys() .center() .print() .log("all") , getTimer("timer").start().wait() , clear() , getScale("acceptability_checks") .test.selected() .success( getScale("acceptability_checks").test.selected(row.check) .success( newText("<p style=font-family:helvetica;color:darkgreen padding-bottom: 25px>¡Correcto!</p>") ) .failure( newText("<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Incorrecto!</p>") ) ) .failure( newText("lento","<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Muy lento!</p>") ) , newText("<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>") , newKey(" ").wait() ) .log("group", row.group) .log("item", row.item) .log("condition", row.condition)
Jeremy
-
AuthorPosts
- You must be logged in to reply to this topic.