PennController for IBEX › Forums › Support › Force response?
- This topic has 9 replies, 2 voices, and was last updated 4 years, 4 months ago by
Jeremy.
-
AuthorPosts
-
April 14, 2020 at 7:11 pm #5040
suphasiree
ParticipantHi Jeremy,
I have another question please!
I am programming a reading experiment which will show a question after every sentence, and ask subjects to type a response in the TextInput box.
Here is a snippet of the experimental trials:
///// Actual experiment PennController.Template("myTable_exp", variable => newTrial( "experiment" , newTimer(500) .start() .wait() , defaultText .print() .center() .css("line-height", "1.5em") , newText("sentence", variable.sentence) .css("margin-top", "5em") , newText("pressspace", "Press the spacebar to continue.") .css("margin-top", "2em") // same as adding 3 line breaks before the text .italic() , newKey(" ") .wait() , getText("sentence").remove(), getText("pressspace").remove() , newText("question", variable.question) .css("margin-top", "5em") .css("margin-bottom", "2em") .css("font-weight", "bold") , newTextInput("inputanswer") .css("width", "200px") .center() .print() .log() , newText("submit", "Press Enter to submit your answer.") .css("margin-bottom", "2em") .italic() , getTextInput("inputanswer") .wait() , getText("sentence").remove(), getText("question").remove(), getText("submit").remove(), getTextInput("inputanswer").remove() , newText("nextsentence", "When you're ready, press the spacebar to see the next sentence.") .css("margin-top", "10em") .italic() , newKey(" ") .wait() , newVar("inputanswer") .global() .set( getTextInput("inputanswer") ) ) .log( "SubjID" , getVar("ID") .log( "item" , variable.item ) .log( "list" , variable.Group ) .log( "question" , variable.question ) ) )
This is my question: Qualtrics has the option of “force response”, which prevents participants from skipping the question. If the subjects don’t type any response, they will see an error message telling them to respond, and they won’t be able to go onto the next trial.
Is there a way to implement this in PC Ibex?
April 14, 2020 at 7:27 pm #5041suphasiree
ParticipantI have another unrelated question:
Is there also a way to check the device that participants are using?
I’d like to ask subjects to use a computer/laptop, and not a mobile device. It’d be great if there was a way I could verify this.
Thanks for taking the time to answer the forum questions, I appreciate it!
April 14, 2020 at 8:12 pm #5042Jeremy
KeymasterHi,
Sure, adding an error message is actually pretty easy:
newText("emptyinput", "Please type your answer in the field above").color("red").bold() , getTextInput("inputanswer") .wait( // Using a regular expression here: at least one non-empty character getTextInput("inputanswer").test.text(/[^\s]/) .failure( getText("emptyinput").print() ) ) , getText("emptyinput").remove()
There currently is no straightforward way to check your participants’ devices, but you can inject some javascript using the Function element. This page for example describes one method, we could incorporate it into pcibex like this:
newTrial( newFunction( () => navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) ) .testNot.is(null) .success( newText("We are sorry but this experiment was not designed for mobile devices. Please try again with a non-mobile device. Thank you.").print() , newTimer(1).wait() ) , newButton("Start the experiment").print().wait() )
Note that this is definitely not 100% reliable, but any tech-savvy enough person who wants to fool your experiment will be able to anwyay
Also note that some platforms, like Prolific, do not accept this kind of filtering after your participants have enrolled for your experiment on the platform
Jeremy
April 15, 2020 at 12:10 pm #5045suphasiree
ParticipantHi Jeremy,
Thanks so much for your help, I’ll try it out!
April 15, 2020 at 12:54 pm #5046suphasiree
ParticipantJeremy, I tried adding that Force Response code that you gave me, but now it won’t let me advance to the next page.
Where in the code should I add those lines to make the conditional error message work properly?
April 15, 2020 at 1:24 pm #5047Jeremy
KeymasterHi,
My code (the first one) should replace these two lines from the script you posted:
getTextInput("inputanswer") .wait()
Let me know if you did not get the code to work
Jeremy
April 15, 2020 at 1:30 pm #5048suphasiree
ParticipantThank you Jeremy, I did get it to work!!
April 15, 2020 at 3:12 pm #5052suphasiree
ParticipantHi Jeremy!
I am trying to figure out how to get my Reaction Time data. I’d like to measure the time it takes participants to respond to the question (from the start of the “Question” page of the trial to the onset of the first letter typed).
I see in the results file that there is a “First” timestamp on each TextInput, and I know I need to subtract that number from the time the Question is shown.
I think the results file has the timestamp of when the whole trial started (when the sentence is shown), but is there a way to get the timestamp of when participants first see the question ?
April 15, 2020 at 3:16 pm #5053suphasiree
ParticipantTo add to that: I can also see timestamps for “Header” in each trial… is that relevant?
April 15, 2020 at 4:44 pm #5056Jeremy
KeymasterHi again,
Unfortunately unless you .logged the relevant element, your results file will not contain the timestamp you are looking for. Do you happen to have the timestamp of any event occurring between the participant’s pressing the space key and when they start typing the first letter in the TextInput? If you’ll be collecting more data with your script, just add .log() to the Key element preceding your TextInput.
Header effectively creates a trial that gets executed at the beginning of every single trial, that’s why you also get the start and end timestamps of the Header trials in the results file, but they won’t be of much help to you in this case I’m afraid
Jeremy
-
AuthorPosts
- You must be logged in to reply to this topic.