Forum Replies Created
-
AuthorPosts
-
May 5, 2021 at 6:48 pm in reply to: Ensuring subjects who take the experiment multiple times see different data. #6929
Jeremy
KeymasterHi,
Unfortunately there’s no straightforward way to do that in PCIbex, as it would require keeping track of information across runs. The only thing close to that is the internal counter, which increases with each new submission, and which can be used to automatically assign different groups to participants, but it doesn’t keep track of every single participant specifically
You would need to set up your own solution to keep track of each participant’s submissions and communicate with your PCIbex experiment to run the desired set of stimuli. I have never tried to do something like that before, but it surely isn’t a trivial task. I’m happy to answer any questions though
Jeremy
Jeremy
KeymasterHi Iris,
As you found out, Ibex does not detect any “required” field, but looks up an “obligatory” class instead. HTML elements can have more than one class, you just need to separate the classes with space characters, e.g
<input type="checkbox" class="largerCheckbox obligatory">
Alternatively, you could also do it exclusively using PennController commands: https://farm.pcibex.net/r/yqrvtr/ (don’t mind the “already part of Selector” errors—it’s a non-fatal bug I need to fix in PennController)
The code isn’t super concise but it’s still readable and works pretty wellLet me know if you have questions
Jeremy
-
This reply was modified 4 years, 2 months ago by
Jeremy.
Jeremy
KeymasterHi,
It does not look to me like you want to implement the same kind of “exit” button: what Diane and Nickolas wanted was a button that was visible on every single trial of the experiment, which would let participants end the experiment prematurely whenever they like
Unless I am misunderstanding what you are trying to do, it looks like you simply want to give that option once to your participants, namely on the consent form page. This is a standard case of linear execution, you could do this for example:
newTrial("Consent", newHtml("Consent", "consent.html") .center() .print() , newText("I have read this informed consent document and the material contained \ in it has been explained to me verbally. All my questions have been answered, \ and I freely and voluntarily choose to participate.") .print() , newScale("agree", "I want to participate in this study.", "I do not wish to participate in this study.") .size("10em","auto") .button() .print() .wait() .test.selected("I do not wish to participate in this study.") .success( clear() , SendResults() , newButton().wait() ) )
Note that the string in
test.selected
was missing the final period (the strings must correspond exactly) and I addednewButton().wait()
to prevent the experiment from moving to the next trial anyway after executingSendResults
Jeremy
Jeremy
KeymasterHi,
As I said in this message:
I don’t know if you have more commands in your trial after that last
wait
command, but if you don’t, then you should not hear the audioThe experiment at the link you shared works exactly as expected: the audio file is properly preloaded from the zip file, the first trial is instantaneous (the
play
command is executed but the trial ends immediately so it moves on to the second one) and the second trial waits for a click on the button to execute theplay
command but once again the trial ends immediatelyIf I add
getAudio("py55").wait("first")
at the end of your second trial I do hear the audio play backJeremy
Jeremy
KeymasterHi,
Your zip file is not publicly accessible at all: if I try to open its URL in my browser manually, I get an “Access Denied” error
You need to expose your file, which means that your bucket should not block all public access, and your object should be readable by the public, as on this image for example:
Jeremy
Jeremy
KeymasterHi Ana,
I’m sorry, I seem to have missed your previous post. By default, group assignment in (PC)Ibex experiments relies on an internal counter, which is increased whenever a submission is complete. Two people starting your experiment before anyone has completed it will be assigned the same group. You can change that behavior by using
SetCounter
, for example.Regarding how to read the results lines, here’s an example:
1619789055,744afe76cfc47b2a84daec2adc3d2d3b,PennController,0,0,unlabeled,NULL,PennController,0,_Trial_,Start,1619789053581,NULL 1619789055,744afe76cfc47b2a84daec2adc3d2d3b,PennController,0,0,unlabeled,NULL,Button,Start reading,Click,Click,1619789054361,NULL 1619789055,744afe76cfc47b2a84daec2adc3d2d3b,PennController,0,0,unlabeled,NULL,Controller-DashedSentence,DashedSentence,1,hello,1619789055108,230,false,hello world,Any addtional parameters were appended as additional columns 1619789055,744afe76cfc47b2a84daec2adc3d2d3b,PennController,0,0,unlabeled,NULL,Controller-DashedSentence,DashedSentence,2,world,1619789055108,237,false,hello world,Any addtional parameters were appended as additional columns 1619789055,744afe76cfc47b2a84daec2adc3d2d3b,PennController,0,0,unlabeled,NULL,Button,Finish,Click,Click,1619789055629,NULL 1619789055,744afe76cfc47b2a84daec2adc3d2d3b,PennController,0,0,unlabeled,NULL,PennController,0,_Trial_,End,1619789055635,NULL
The very beginning of the trial happened at timestamp
1619789053581
, then I clicked the “Start reading” button at timestamp1619789054361
(780ms later). I finished reading the DahsedSentence controller at timestamp1619789055108
(747ms after I clicked the button) and finally clicked the “Finish” button at timestamp1619789055629
. The trial ended at timestamp1619789055635
(it took 4ms for the engine to wrap things up).Now, I spent 230ms reading the word “hello” and 237ms reading the word “world,” so I could calculate their display timestamps by subtracting those numbers to the DashedSentence controller’s timestamp, which would give
1619789055108-237=1619789054871
for “world” and1619789054871-230=1619789054632
for “hello”Jeremy
Jeremy
KeymasterThe problem seems to have to do with how Safari requests audio and video files, and how the PCIbex Farm responds to those requests. I might be able to fix the issue, but I’d need to update the farm, which I don’t want to do too often (it comes with the risk of making the servers, and so data-collection, temporarily unavailable)
If you have access to an alternative storage space (eg. an s3 bucket, or a webserver) where you can host your audio files, I’d suggest you do that, and hopefully the problem should go away
Apologies for the inconvenience
Jeremy
Jeremy
KeymasterOK, I’ll try to find an iphone to try it out myself
Are you using the PCIbex Farm at https://farm.pcibex.net? There is a “Share” option in the project’s right menu, then you can copy-paste the project’s demonstration link
Jeremy
Jeremy
KeymasterOK, if you want to allow replay, then the
callback
method is indeed the appropriate one. If you don’t want the bar to appear, just don’t print it at all, as in the linear code. You would get:newButton("click") .callback(newAudio("py22.wav").play()) .print() .wait() , // additional code waiting for a selection
Does you experience the original problem (the audio not playing) only with an iPhone/iPad, or do you also experience it with, say, Android smartphones? Feel free to share your project with me so I can troubleshoot the issue
Jeremy
Jeremy
KeymasterHi,
It does play the sound file on my Android phone. Did you try it on an iPhone?
Also, I don’t know if you have more commands in your trial after that last
wait
command, but if you don’t, then you should not hear the audio: in that case, the behavior on your phone/ipad would turn out to be the correct one.I’m not sure why you print and then immediately remove the Audio element, and then make it play as a callback. Wouldn’t this purely linear code achieve what you need?
newButton("click") .print() .wait() .remove() , newAudio("py22","py22.wav") .play() .wait()
Jeremy
Jeremy
KeymasterHi,
You can hide the default button by adding a CSS rule to PennController.css:
.MediaRecorder-record { display: none; }
Then you can code the buttons yourself:
newMediaRecorder("audio").print(), newButton("Enregistrer") .callback( getMediaRecorder("audio").record(), getButton("Enregistrer").remove(), getButton("Continuer").remove(), getButton("Arrêter").print() ) .print() , newButton("Arrêter") .callback( getMediaRecorder("audio").stop(), getButton("Arrêter").remove(), getButton("Enregistrer").print(), getButton("Continuer").print() ) , newButton("Continuer") .wait()
Here’s a live example: https://farm.pcibex.net/r/aqHqaG/
Jeremy
Jeremy
KeymasterHi Zara,
There is no documentation about it, but it’s a matter of adding columns to each Selector row that will report the position and filename of the selected image. There are many ways of doing this, one option using the
dplyr
package is (assuming you have loaded your results file in a variable namedresults
using the functionread.pcibex
):library("dplyr") results$Value<-as.character(results$Value) results$picture1<-as.character(results$picture1) results$picture2<-as.character(results$picture2) results$picture3<-as.character(results$picture3) results$picture4<-as.character(results$picture4) getImage <- function(value,p1,p2,p3,p4){ c(picture1=p1,picture2=p2,picture3=p3,picture4=p4)[value] } getPosition <- function(value,comments){ c("top-left","top-right","bottom-left","bottom-right")[ which(strsplit(as.character(comments), ";")[[1]] == value) ] } choices <- results %>% filter(PennElementType=="Selector") %>% rowwise() %>% mutate(ChosenPosition=getPosition(Value,Comments)) %>% mutate(ChosenImage=getImage(Value,picture1,picture2,picture3,picture4))
The
choices
variable will contain a tibble with two additional columns, ChosenPosition and ChosenImageLet me know if you have questions
Jeremy
Jeremy
KeymasterHi Adam,
I fixed the problem with the Controller element in PennController 2.0.alpha, so you no longer need the
run
workaround. I have updated the project from my previous message, if you want to take a lookThis line
getButton("launch-practice-trial").print()
is the one that prints the “Redo” buttonJeremy
Jeremy
KeymasterDear Ana-Maria,
You should use version 2.0.alpha of PennController. I was assuming that you were using the (new) PCIbex Farm, where PennController 2.0.alpha comes with new projects by default. You will need to download the file PennController.js from the linked github page and upload it to your project—note that if you previously git-synced PennController.js, you might not be able to overwrite it, unless you git-sync it again from elsewhere (for example, you could create a git repo for your project)
Right now your experiment seems to be using version 1.8-dev, and I don’t see the error message that you report. Were you able to make things work in the end?
Jeremy
Jeremy
KeymasterRight, it’s working for me now. Did you clear your browser’s cache? Or just check your experiment with a different browser altogether
Jeremy
-
This reply was modified 4 years, 2 months ago by
-
AuthorPosts