Forum Replies Created
-
AuthorPosts
-
Jeremy
KeymasterHi,
I can’t imagine how a local installment of the Ibex Farm could produce the results file that you report: there’s one line missing in the middle, but all the lines are sent at once to the server, and they should all be written to the results file as a block
Jeremy
Jeremy
KeymasterHi,
See this message (don’t mind the warning in bold, it doesn’t concern you since you’re running the experiment on farm.pcibex.net)
Jeremy
September 23, 2022 at 3:20 pm in reply to: code doesn't get updated despite the 'saved' message #8536Jeremy
KeymasterHi,
I am sorry you are experiencing this problem. The workaround actually shouldn’t require copying the whole project: re-creating the file that displays the problem (after saving a backup copy and deleting it from the project) should fix the issue, at least momentarily, which is less dangerous than duplicating the whole project and then deleting the original one
Jeremy
September 23, 2022 at 10:32 am in reply to: How to add page breaks in between randomized items? #8530Jeremy
KeymasterJeremy
KeymasterHi,
If you don’t want your scale to be a slider, but a likert scale, don’t use
slider
:newScale("Echelle_Comm", 10) // changed 100 to 10 .center() // .slider() // this line commented out .css({"margin-top" : "50px", "max-width" : "unset", "width" : "400px", "height":"10px"}) .print() .log()
Jeremy
September 22, 2022 at 11:14 am in reply to: How to add page breaks in between randomized items? #8517Jeremy
KeymasterHi Lily,
it also gives me a break after my final item, which is the 10th audio file in my current situation.
You can change the definition of
sepWithN
to handle that situation. Add, dropLast
to the functions’ arguments, and prefixnewArray.push(sep[j]);
with a conditional on whether there remain any items inmain
. Concretely, replace the respective lines with:function SepWithN(sep, main, n, dropLast) { // ... if (main.length>0||dropLast==undefined) newArray.push(sep[j]); // ... function sepWithN(sep, main, n, dropLast) { return new SepWithN(sep, main, n, dropLast); }
Then you can
sepWithN
to not add the last break like this:sepWithN( "break", randomize("experiment"), 5, "dropLast")
However, with my script below, I have something that kind of looks like reaction time in my results. The reaction time-like thingy appears in the column of my rating results, that is the “value” column. Do you know what may have happened here?
Scale elements will log which button was selected, and when it was selected. You should see a value from 1 to 7 in one column (the selected button) and a 13-digit number in another (the timestamp). You’ll also have a timestamp for when the audio stopped playing in an earlier line: subtract the end-of-playback timestamp from the scale-choice timestamp and you’ll get your response time
I was trying to add space in between by using the code: newCanvas(“empty canvas”, 1, 40).print(), but it only works between elements (texts, buttons), not the page bottom
It does work at the bottom of the page, but if you’re printing the Canvas element after the “Agree” button was clicked (ie. after its
wait
command) then you’ll just never see it. But this would work:newButton("Agree").print() , newCanvas("empty canvas", 1, 40).print() , getButton("Agree").wait()
I saw that you suggested in another post to upload a zip file to avoid this problem. But what I don’t understand is where I could host the zip file. I know that cloud services like Dropbox and Google Drive don’t work, what about GitHub? Or any suggestion on this issue?
GitHub does not provide that service: in order for the experiment to run, it needs to download the zip file in the background, but by default background downloads from other domains (ie. from outside the farm) are blocked by browsers, unless the distant server explicitly gives permission for the operation, which you can do with some services, but not with GitHub
One such service you could look into is Amazon S3, which is included in the 12-month AWS Free Tier offer. See this post for more information
Jeremy
September 21, 2022 at 12:34 pm in reply to: How to add page breaks in between randomized items? #8514Jeremy
KeymasterHi Lily,
The function
sepWithN
is not a native function to Ibex or PCIbex: what definition do you use? Using this definition, your code (with5
) works perfectly for me:function SepWithN(sep, main, n) { this.args = [sep,main]; this.run = function(arrays) { assert(arrays.length == 2, "Wrong number of arguments (or bad argument) to SepWithN"); assert(parseInt(n) > 0, "N must be a positive number"); let sep = arrays[0]; let main = arrays[1]; if (main.length <= 1) return main; else { let newArray = []; while (main.length){ for (let i = 0; i < n && main.length>0; i++) newArray.push(main.shift()); for (let j = 0; j < sep.length; ++j) newArray.push(sep[j]); } return newArray; } }; } function sepWithN(sep, main, n) { return new SepWithN(sep, main, n); }
NB: since you have
PennController.ResetPrefix(null)
at the top of your script, you don't need to have thePennController.
prefix on any of the commands below, ie you can replacePennController.Sequence
withSequence
,PennController.CheckPreloaded
withCheckPreloaded
, and so onJeremy
Jeremy
KeymasterHi,
You can’t control the cursor’s position, as that would pose serious security issues. You could, in theory, center the image at the cursor’s coordinates, but that’s not how I wrote the DragDrop element. What you could do to modify the behavior of the DragDrop element is upload PennElement_dragdrop.js to your project’s Modules folder, and look for these lines in the file:
start = {x: ev.clientX, y: ev.clientY, top: rect.top, left: rect.left, old_top: ev.target.style.top, old_left: ev.target.style.left, old_position: ev.target.style.position}; $(ev.target).css({position: 'fixed', top: rect.top, left: rect.left});
and replace them with:
const newtop = ev.clientY - rect.height/2, newleft = ev.clientX - rect.width/2; start = {x: ev.clientX, y: ev.clientY, top: newtop, left: newleft, old_top: ev.target.style.top, old_left: ev.target.style.left, old_position: ev.target.style.position}; $(ev.target).css({position: 'fixed', top: newtop, left: newleft});
You’ll get a warning that the element type DragDrop is defined more than once when test-running the experiment, but other than that it should work as expected
Jeremy
Jeremy
KeymasterHi Jones,
Do you get a warning when you download your results file saying that some rows might be missing?
I don’t see any issues with your code and am unable to reproduce the problem
Jeremy
Jeremy
KeymasterHi,
Just pass the label of the trial you want to jump to in
jump
:newTrial("Page3", defaultText.css("font-size", "1.2em").center().print() , newText(" hello world ") , newButton("come back") .center() .callback( jump("Page2") , end() ) .print() , newButton("testtt", "Continue") .center() .css({"margin-top" : "50px"}) .print() .wait() ) newTrial("Page4", defaultText.css("font-size", "1.2em").center().print() , newText(" hello world 2.0 ") , newButton("come back") .center() .callback( jump("Page3") , end() ) .print() , newButton("testtt", "Continue") .center() .css({"margin-top" : "50px"}) .print() .wait() )
Jeremy
Jeremy
KeymasterHi Susanne,
Delete or comment out this line in PennController.css in the Aesthetics folder:
width: 40em !important;
Jeremy
Jeremy
KeymasterHi,
You could add these three lines at the end of your script to get the coordinates of the visual elements at the end of the trial:
newVar("manXY").log().set(v=> JSON.stringify(getImage("man")._element.jQueryElement[0].getBoundingClientRect()).replace(/[,"{}]/g,'') ), newVar("boyXY").log().set(v=> JSON.stringify(getImage("boy")._element.jQueryElement[0].getBoundingClientRect()).replace(/[,"{}]/g,'') ), newVar("figlistXY").log().set(v=> JSON.stringify(getCanvas("figlist")._element.jQueryElement[0].getBoundingClientRect()).replace(/[,"{}]/g,'') )
Jeremy
Jeremy
KeymasterThank you for identifying and reporting this bug! As I’ve said in your other topic, I will work on fixing it for the next release of PennController
Jeremy
September 19, 2022 at 5:49 pm in reply to: Running into JS error with MouseTracker when trials have different names #8422Jeremy
KeymasterHi,
Thank you for identifying this nasty bug! I’ll make sure it doesn’t happen in the next version of PennController. In the meantime, you should create the MouseTracker element at the beginning of your trial (
newMouseTacker
) and only start it later, possibly afterend()
, usinggetMouseTracker
to refer back to itJeremy
Jeremy
KeymasterHello,
PCIbex itself has no such limits, but browsers only support a limited range of video file formats (as listed on the page you referenced) and might have limits on the size of the video files, but that last point will depend on specific configuration points (in general, the limits on size are large enough that they will never be a problem for an experiment)
If your 20+ videos of 4-6s each total to over 1GB, the problem won’t necessarily be the size limit of the browser, but rather how long it takes to download them. With a 720p resolution using the H264 (MP4) compression, a 5s video file shouldn’t be more than 2MB so a total of, say, 30 such videos should represent ~60MB max
I personally wouldn’t participate in a study if I knew it means I have to download more than a few 100MB of resources (and much less if I’m paying for data pro rata)
Jeremy
-
AuthorPosts