Forum Replies Created
-
AuthorPosts
-
Jeremy
KeymasterHi Yasmin,
You
center
the Scale but not the Text element, which is why the two do not appear aligned togetherJeremy
June 8, 2022 at 12:35 pm in reply to: html layout/event times/selector vs. scale/ compatibility #8226Jeremy
KeymasterHi,
The more often you update the values of the Var elements, the less likely it is that participants see a message due to an outdated, empty Var element, so that reasoning would suggest to lower the value of 10. However, it’s quite unlikely that a participant would type any text and validate their answer in less than 10ms
It could be that execution is slowed down and the Timer is not actually run every 10ms but much less frequently. You could try using the javascript function
window.requestAnimationFrame
instead, which is optimized to execute loops:Template("ansa_template.csv", row => newTrial("ansa", ...[...new Array(20)].map( (v,i) => newVar("ansa_"+Number(i+1),"").global() ) , newFunction( ()=>{ const currentPennController = document.querySelector(".PennController-PennController"); const checkBlanks = () => { document.querySelectorAll("textarea[name^='blank']") .forEach( (v,i) => getVar("ansa_"+Number(i+1)).set(v.value)._runPromises() ); if (currentPennController == document.querySelector(".PennController-PennController")) window.requestAnimationFrame( checkBlanks ); }; checkBlanks(); }).call()
Did you also double-check your
test
s on the Var element, and whether what the participant typed in the boxes is indeed supposed to satisfy those tests when they see the messages?Jeremy
Jeremy
KeymasterHi,
All PennController results lines include an EventTime column, and by default all PennController trials report a results line for when the trial started: you can use the value of the EventTime column from those lines to sort the trial by running order (note that the lines int the results file should already be sorted using the values from that column)
Another option would be to do something like that:
Header( newVar("runningOrder", 0).global().set(v=>v+1) ) .log("runningOrder", getVar("runningOrder"))
Jeremy
Jeremy
KeymasterHi Shamim,
This won’t be possible, because
new*
PennController commands are executed immediately, that is, before participants can interact with the page. So it’s not possible to reference a value to be set later (the participant’s ID) in the arguments ofnewMediaRecorder
What you can do is generate and store a unique ID in a javascript variable and reference that variable in
newMediaRecorder
and inlog
, for exampleJeremy
Jeremy
KeymasterHi,
How
sepWith
works is explained in the Ibex manual. IfUploadRecordings("sendAsync", "noblock")
is commented out with//
, and assuming there is no other trial labeledsendAsync
defined in the code, then any reference tosendAsync
in the sequence will have no effect, since there will be no trial with a matching label to include. Note, however, that you mentionsepWith("Async", randomize(experiment))
(I assume the code hassepWith
, which is the Ibex function to use in a sequence, rather thanSepWith
): the reference here isAsync
, notsendAsync
, so you need to look for a trial labeledAsync
in the code, which does not correspond toUploadRecordings("sendAsync", "noblock")
, so it’s not relevant whether that line is commented out or notRe. how to match the files, here’s a made-up sample of selected lines from a results file:
1612992170,SUBMISSION1,PennController,28,0,experiment,NULL,MediaRecorder,filler1,Filename,filler1.webm,1612991498311,NULL 1612992170,SUBMISSION1,PennController,30,0,experiment,NULL,PennController,UploadRecordings,Filename,12345678-abcd-efgh-ijkl-901234567890.zip,1612991504982,async 1612992170,SUBMISSION1,PennController,29,0,experiment,NULL,MediaRecorder,filler2,Filename,filler2.webm,1612991501417,NULL 1612992170,SUBMISSION1,PennController,31,0,experiment,NULL,PennController,UploadRecordings,Filename,90123456-mnop-qrst-uvwx-789012345678.zip,1612991505176,sync 1612993451,SUBMISSION2,PennController,28,0,experiment,NULL,MediaRecorder,filler1,Filename,filler1.webm,1612991506231,NULL 1612993451,SUBMISSION2,PennController,30,0,experiment,NULL,PennController,UploadRecordings,Filename,abcdefgh-1234-5678-9012-ijklmnopqrst.zip,1612991507023,async 1612993451,SUBMISSION2,PennController,29,0,experiment,NULL,MediaRecorder,filler2,Filename,filler2.webm,1612991507189,NULL 1612993451,SUBMISSION2,PennController,31,0,experiment,NULL,PennController,UploadRecordings,Filename,uvwxyzab-3456-7890-1234-cdefghijklmn.zip,1612991508309,sync
Here, you can see that two zip files correspond to SUBMISSION1:
12345678-abcd-efgh-ijkl-901234567890.zip
and90123456-mnop-qrst-uvwx-789012345678.zip
. The recordingsfiller1.webm
andfiller2.webm
reported in the lines above for SUBMISSION1 will be included in those zip files (they might both be in just one of the two, or one in each, depending on how upload went)Then two zip files correspond to SUBMISSION2:
abcdefgh-1234-5678-9012-ijklmnopqrst.zip
anduvwxyzab-3456-7890-1234-cdefghijklmn.zip
. Likewise, you will find the recordingsfiller1.webm
andfiller2.webm
from SUBMISSION1 in those zip filesJeremy
Jeremy
KeymasterHi Henrik,
The name of the Scale element is reported in the results file, here’s a sample from a test run of mine:
1653659265 EDITED PennController 0 0 trials NULL Scale scale_1 Choice small 1653659258865 NULL 1653659265 EDITED PennController 0 0 trials NULL Scale scale_2 Choice tiny 1653659259777 NULL 1653659265 EDITED PennController 0 0 trials NULL Scale scale_3 Choice tall 1653659261098 NULL 1653659265 EDITED PennController 0 0 trials NULL Scale scale_4 Choice tiny 1653659261951 NULL 1653659265 EDITED PennController 0 0 trials NULL Scale scale_5 Choice gigantic 1653659263569 NULL
As you can see, the first line reports
scale_1
and the last one reportsscale_5
Jeremy
Jeremy
KeymasterHi Yasmin,
It depends how exactly you mean to add labels, but one option would be to do this:
newTrial( newText(`<span style='width: 2em; text-align: left;'>0</span> <span style='width: 2em; text-align: center;'>25</span> <span style='width: 2em; text-align: center;'>50</span> <span style='width: 2em; text-align: center;'>75</span> <span style='width: 2em; text-align: right;'>100</span>`) .css({display: 'flex', 'justify-content': 'space-between', width: '20em'}) .print() , newScale("answer", 100) .slider() .css({'max-width':'unset', width: '20em'}) .print() .log() .wait() )
Note that using CSS rules in the code like that is not ideal, so you might want to consider adding rules to the project’s CSS files instead
Jeremy
Jeremy
KeymasterHi,
1) As long as (all)
UploadRecordings
complete(s) beforeSendResults
(eg. because you insertedUploadRecordings("upload")
beforeSendResults()
— no second argument inUploadRecordings
, because otherwise it would be non-blocking and would therefore likely complete *after*SendResults
) you will have a line for each uploaded zip file in your results file, which you can use to pair zip files with submissions. The recorded audio files are named after the MediaRecorder element that produced them. More details in this post2) Unfortunately that is not currently supported, since all major browsers support only webm/opus when recording via the MediaRecorder API, which PennController uses in its own MediaRecorder element type. The webm files can easily be converted to wav files though, eg. using ffmpeg:
ffmpeg -i "file.webm" -vn "file.wav"
Jeremy
Jeremy
KeymasterHi,
How do you reference the image in the HTML file? It should look like
<img src="http://localhost:3000/server.py?resource=logo.png">
NB: I cannot see the screenshot at the ImgBB link from your message
Jeremy
Jeremy
KeymasterHi,
Do you still have any non-HTML, non-CSV file in chunk_includes with an extension that you didn’t list in an
endsWith
command as illustrated above (note that this is case-sensitive, so make sure all your extensions are lower case)? That would produce the error you reportJeremy
Jeremy
KeymasterHi Mieke,
Even though that probably won’t fit an actual data collection scenario, let me note that the debugger has a button “Next screen” in the “Log” tab and a button “Reach” in the “Sequence” tab
You could add
newKey("Q").callback( end() )
as the very first command innewTrial
to make a press on that key immediately end the trialJeremy
Jeremy
KeymasterHi Nadine,
Page 10 in the advanced tutorial also says:
PennController uses an internal counter to counterbalance group assignment. By default, the counter increases by one at the end of an experiment, which rotates which experimental item group is run.
11 and 13 of your participants opened the link to your experiment when the counter had a value whose modulo 7 was 1 or 4, respectively
You could use
SetCounter
to insert a trial at the very beginning of your experiment to increase the counter at the very beginning instead, but that won’t ensure that your participants start with a different counter value (eg. if multiple people click the link at the same time) or that participants with a different counter value will complete your experiment (anyone can decide to leave before finishing)The most certain way to collect an even number of participants is to collect your data in batches, circulating a link with
?withsquare=0
, one with?withsquare=1
, one with?withsquare=2
, etc. and run more participants for each link as needed after you check your results fileJeremy
May 16, 2022 at 3:33 pm in reply to: Show different pictures/videos when an image is selected in the selector #8191Jeremy
KeymasterHi,
Use
.test.selected
:newSelector("answer") .add(getImage("pic1"),getImage("pic2")) .shuffle() .keys("F","J") .frame("solid 5px purple") .log() .once() .wait() .test.selected( getImage("pic1") ) .success( newImage(row.gif1).print() ) .failure( newImage(row.gif2).print() ) , getCanvas("myCanvas").remove()
Jeremy
Jeremy
KeymasterHi,
You’re missing quotations marks on lines 156 (opening) and 197 (closing). Add them back in and that error will go away
Jeremy
May 16, 2022 at 11:10 am in reply to: Issues playing audio files – project works in Firefox but not Chrome #8185Jeremy
KeymasterHi Aiden,
I don’t see trials_2.1 or trials_2.2 in your experiment because it contains no tables named SS_Trials_2.1.csv or SS_Trials_2.2.csv
That being said, the error you report is consistent with some audio files being corrupt, or some lines in a table referencing an invalid filename
Jeremy
-
AuthorPosts