PennController for IBEX › Forums › Support › Neutral answer on test.selected
- This topic has 3 replies, 2 voices, and was last updated 2 years, 11 months ago by Jeremy.
-
AuthorPosts
-
January 24, 2022 at 6:40 am #7688mschrumpfParticipant
Hello everyone.
Is there a way to accept the neutral answer on a scale element as a valid answer when usingtest.selected()
?I’m working on an experiment in which participants are presented with a stimulus and asked to rate how well-formed and how original it is on two scales with a length of 100. It is crucial to the experiment that participants give a rating for each element, so I’m using
test.selected()
on the “continue” button to prevent them from continuing without answering on both scales.The problem is that the test command will not detect whether a selection has been made on the scale. It will only test if the selected value is different from 50 (the half-way point or neutral answer).
I want my participants to be able to give a neutral answer, but I also want them to have to interact with both scale elements before they can move on. As things are, they are being dissuaded from giving a neutral answer by the experimental design.
Is there any way to work around this?My code for the slide I’m talking about is included below. The demo link is the following:
https://farm.pcibex.net/r/oRSHir/Thanks everyone
Matthias
Template( GetTable("stimuli_punkt_neu.csv") //.filter( row => row.Item = "non-creative" ) .setGroupColumn( "Group" ) , row => newTrial( "Trial" , //Zeigt nacheinander fuer jede Zeile der angegebenen Tabelle eine Folie an newKey("Enter", "Enter") .callback( getButton("Weiter").click() ) , newText("Prompt", row.Prompt) .settings.css({ "align": "center", "text-align": "center", "font-size": "large", "width": "100%" }) .print() .log() , newText("Fortsetzung", row.Fortsetzung) .settings.css({ "align": "center", "text-align": "center", "font-size": "large", "width": "100%" }) .settings.cssContainer({ "background-color": "lightgrey", "border-radius": "5px", //"margin": "auto", "align": "center", "padding": "5px", }) .print() .log() , newText("Wie <b>gelungen</b> ist diese Fortsetzung?") .center() .print() , newScale("Gelungen", 100) .slider() .settings.css({ "width": "100%", "margin": "auto", "align": "center", "text-align": "center" }) .before(newText("gar nicht ")) .after(newText(" perfekt")) .label( 10 , "gar nicht" ) .label( 90 , "sehr" ) .labelsPosition("bottom") .center() .print() .log() , newText("Line", "<hr>") .settings.css({ "width": "100%", "margin": "auto", }) .print() , newText("Wie <b>originell</b> ist diese Fortsetzung?") .center() .print() , newScale("Originell", 100) .slider() .settings.css({ "width": "100%", "margin": "auto", "align": "center", "text-align": "center" }) .before(newText("gar nicht ")) .after(newText(" perfekt")) .label( 10 , "gar nicht" ) .label( 90 , "sehr" ) .labelsPosition("bottom") .center() .print() .log() , newText("Warnung2", "Bitte geben Sie eine Beurteilung ab.") .color("red") .italic() .center() .hidden() .print() , newButton("Weiter") .center() .print() .wait( getScale("Gelungen").test.selected() .and(getScale("Originell").test.selected() ) .failure( getText("Warnung2") .hidden() , newTimer(100) .start() .wait() , getText("Warnung2").visible() ) ) ) //.setOption("countsForProgressBar", false) //.setOption("hideProgressBar", true) .log("Gelungen") .log("Originell") //Eingaben aufzeichnen .log("ProdHash", row.ProdHash) .log("VPNummer", row.VPNummer) .log("VerbNo", row.VerbNo) .log("Item", row.Item) .log("Verb", row.Verb) .log("GenderNP1", row.GenderNP1) .log("GenderNP2", row.GenderNP2) .log("Block", row.Block) .log("Condition", row.Condition) .log("ProdList", row.ProdList) .log("Connective", row.Connective) .log("Prompt", row.Prompt) .log("Fortsetzung", row.Fortsetzung) .log("Zufallsreihenfolge", row.Zufallsreihenfolge) .log("Group", row.Group) //Angaben aus Stimuli-Tabelle uebernehmen: //"VerbNo","Item","Verb","GenderNP1","GenderNP2","Block","Condition","ProdList","Connective","Prompt","Fortsetzung","Group" )
January 24, 2022 at 12:15 pm #7689JeremyKeymasterHello Matthias,
You are right, this is a problem I should fix. You can technically validate a score of 50 but you need to set the cursor to a different value first and release the mouse button, then select the value of 50 again
As a workaround, you can use Function elements and variables to keep track of whether the scale was clicked. Here is a minimal example you can adapt to your case:
newTrial( newScale("test", 100).size("75vw").slider().print() , newFunction(function(){ getScale("test")._element.jQueryElement.click(()=>this.scaleClicked=true) }).call() , newButton("Validate") .print() .wait( newFunction(function(){return this.scaleClicked;}).test.is(true) ) )
Let me know if you have questions
Jeremy
January 26, 2022 at 12:10 pm #7697mschrumpfParticipantThank you very much, Jeremy.
This solution works for one scale, but I would like to check both scales that are used in my experiment for input.
Is there a way to do that?
BestMatthias
January 26, 2022 at 1:38 pm #7700JeremyKeymasterHi,
You can use the same approach, with minimal tweaks:
newTrial( newFunction(function(){ this.scales = []; $("body").click(e=>e.target.type=="range"&&this.scales.push(e.target.parentElement.classList[1].replace(/PennController-/,''))); }).call() , newScale("test1", 100).size("75vw").slider().print() , newScale("test2", 100).size("75vw").slider().print() , newButton("Validate") .print() .wait( newFunction(function(){return ["test1","test2"].filter(v=>!this.scales.includes(v)).length}).test.is(0) ) )
You just need to list all the names of the Scale elements you want to validate as an array in place of
["test1","test2"]
Jeremy
-
AuthorPosts
- You must be logged in to reply to this topic.