Forum Replies Created
-
AuthorPosts
-
Jeremy
KeymasterHi Ana,
The
PicturePrime
cell of most rows in your table does not point to an image file (eg. at row 30 it points to an html file: https://etc.usf.edu/clipart/77700/77731/77731_sock.htm — which itself does not load either, but that’s an unrelated point). In that same row, however, the column after that does reference an image filename (sock.png) and that seems to be the case for most (maybe all) rows wherePicturePrime
references a URLThere are other issues with your CSV table that will cause problems when generating trials and running your experiment. For example, row 19 (line 20) only defines four columns, and opens the fourth one with a double-quote but finishes before closing it. Then row 20 (line 21) starts with what must be the closing double-quote, and continues with empty cells (
",,,,,,
). This will generate problematic trials (invalid filename for the former row because of the double-quote sign, empty cells for the latter)
You also seem to be adding unnecessary columns: your header row and all subsequent rows have a series of commas. I presume that you were working using a spreadsheet editor and, somehow, typed an email address in the tenth column of the first row (judging from the header row), thus creating a 10-column table. Maybe this is how you ended up with a URL in thePicturePrime
cell and an actual image filename in the next (unnamed) cell for most rowsOnce you fix the issues with your table, PennController should be able to find the referenced pictures (assuming all the filenames are properly listed in the right column and match the files in your project’s Resources folder)
Jeremy
Jeremy
KeymasterHi,
If you already know the number of trials you will have (say, 240), you could use the
pick
function mentioned in those messages:xptrials = seq("mainexp") Sequence("consent","setcounter","participants","instructions", "practice_session","start_experiment", pick(xptrials,120),"break",pick(xptrials,120), SendResults(),"end");
Note that your table stim.csv has two headers rows: you should delete one of the first two rows (the second one, I presume). It also has a row that only contains
list
at line 243, which you should also deleteJeremy
March 3, 2022 at 3:44 pm in reply to: Questions about eyetracking experiment stuck in the interface #7827Jeremy
KeymasterOops, you should also replace line 437 with
sendLine(keys[k], this.counts[keys[k]].join('.'));
— as you can see the times, which are the data points handled at line 433 that you edited, are now correctly reported, so modifying line 437 along the same lines should solve the issue once and for allJeremy
Jeremy
KeymasterHi Marc,
I think mixing in other trials inside the “GreetingsTrial” is incompatible with the
modifyRunningOrder
function we discussed in our email exchange. So you would be better off using a custom shuffle sequence function instead of usingmodifyRunningOrder
:function KeepOneInGroupAfter(x,sep='_') { this.args = [x]; this.run = function(arrays) { const ret = [] const sources = {}; arrays[0].forEach( r=> { let type = r[0].type.split(sep); type.shift(); type = type.join(sep); sources[type] = [...(sources[type]||[]),r]; }); for (let k in sources){ fisherYates(sources[k]) // Randomize trials in the group ret.push(sources[k][0]) // Add first trial in the group } return ret; } } function keepOneInGroupAfter(x,sep) { return new KeepOneInGroupAfter(x,sep); }
Then you can do this:
Sequence("consent", "practice", rshuffle(keepOneInGroupAfter(startsWith("GreetingsTrial")), "other"), "send", "final")
Jeremy
March 2, 2022 at 5:23 pm in reply to: Questions about eyetracking experiment stuck in the interface #7822Jeremy
KeymasterHi Tian,
Unfortunately I haven’t identified the cause of the gibberish eye-tracking data files. What you could try to do is download PennElement_eyetracker.js and replace line 433 with
sendLine('times', this.counts.times.join('.'));
, then upload that file to your project’s Modules (or js_includes) folder. You’ll get a warning/error that the EyeTracker element is defined twice, but I think it should still work. Then, in your PHP script, you could replace$dictionary[$param][$trial] = explode('.', lzw_decode( $value ) );
with$dictionary[$param][$trial] = explode('.', $value );
and see if that works. The eye-tracking data files will be bigger, but they shouldn’t be insanely big, and hopefully no longer contain gibberishJeremy
Jeremy
KeymasterHi Elise,
Feel free to replace your project’s PennController.js with the one for 2.1 beta: https://github.com/PennController/penncontroller/blob/master/dist/PennController.js (you can always overwrite it back with PennController 2.0 later if you experience any issues: https://github.com/PennController/penncontroller/blob/master/releases/2.0/PennController.js )
But if you have many resources, and since you are already running your experiment on a dedicated webserver, I would suggest you just consolidate some (or all of) your resource files into (one) zip archive(s). This way you won’t have to send one request per resource file
Jeremy
March 2, 2022 at 4:20 pm in reply to: Questions about eyetracking experiment stuck in the interface #7817Jeremy
KeymasterHi,
The link in your message points to a copy of the Empty project. I don’t see anything wrong with the code you posted, but since the context is missing, there could still be issues I cannot identify. For example, maybe the code of your trial never creates an Audio element named “test,” or maybe it just never starts playing it so the script hangs on the
wait
command. Feel free to share a link to your projectJeremy
Jeremy
KeymasterHi Marisol,
You name the TextInput element in your project
"PA"
, so you need to replace"textarea.PennController-myInput"
with"textarea.PennController-PA"
. Also, your code is currently not usingcall
on the Function element, so its content won’t be executed: you need to add back.call()
for it to work. Then any keypress onS
will fail to add that character in the input boxJeremy
Jeremy
KeymasterHi,
If you need to place your elements at negative coordinates, you would be better off expanding the size of your Canvas element
Passing
"center at 75%"
as the X coordinate means that the elements you are adding will be positioned so that their horizontal center will be placed 75% off the left edge of the Canvas element (that is, 75% of its width). Passing"middle at 50%"
as the Y coordinate means that their vertical center will be placed 50% off the top edge of the Canvas element (that is, 50% of its height = vertical middle). To take your example, where you Canvas element is 1400*600px, if you placed an image of 200*200px on that Canvas element at"center at 75%" , "middle at 50%"
then its left edge would end up 0.75*1400-(200/2)=950px off the left edge of the Canvas element, and its top edge would end up 0.5*600-(200/2)=200px off the top edge of the Canvas element. If you then printed the Canvas element at the perfect center of the page (.print("center at 50vw", "middle at 50vh")
) then the left edge of your image would effectively appear 950-(1400/2)=250px to the left of the horizontal center of the page, and its top edge would effectively appear 200-(600/2)=-100px from the vertical center of the page, ie. your 200px high image would be vertically centered on the page (because you would be both vertically centering the image on the Canvas element, and centering the Canvas element on the page itself)The EyeTracker template project prints one Canvas element at each “corner” of the page: one is
print
ed at"center at 25vw" , "middle at 25vh"
, one isprint
ed at"center at 25vw" , "middle at 75vh"
, one isprint
ed at"center at 75vw" , "middle at 25vh"
and one isprint
ed at"center at 75vw" , "middle at 75vh"
. Because1vw
represents 1% of the page’s width and1vh
represents 1% of the page’s height, each Canvas element is centered on a different quarter of the pageInside each of those Canvas elements are printed two images side by side, vertically centered: one is horizontally centered at 25% of the Canvas element’s width, the other one at 75%. Because all Image elements are sized at 20vh*20vh in that trial (
defaultImage.size("20vh", "20vh")
), and the Canvas elements at 40vh*40vh, the result is that the two images stand perfectly next to each other and fill the horizontal surface of their Canvas elementSince PennController 1.9, you can use the command
.scaling("page")
to stretch any element (and its content) so that if fits the page. So if you wanted to make your Canvas element “visualWorld” occupy all (or, rather, as much as possible of) the page area, you could do this:newCanvas("visualWorld", 1700, 700) .add( 0, 0, getImage("TL")) .add( 0, 360, getImage("BL")) .add(1000, 0, getImage("TR")) .add(1000, 360, getImage("BR")) .scaling("page") .print("center at 50vw","middle at 50vh")
But I suspect that what you want is closer to something like this (I arbitrarily chose margins of 50px):
newCanvas("visualWorld", 1700, 700) .add( "left at 50px" , "top at 50px" , getImage("TL")) .add( "left at 50px" , "bottom at 650px" , getImage("BL")) .add( "right at 1650px" , "top at 50px" , getImage("TR")) .add( "right at 1650px" , "bottom at 650px" , getImage("BR")) .scaling("page") .print("center at 50vw","middle at 50vh")
Let me know if you have questions
Jeremy
February 24, 2022 at 7:57 pm in reply to: Prevent participants from continuing if resources weren't downloaded #7809Jeremy
KeymasterHi Irene,
If you experience issues with preloading zip files, I suggest you try using PennController 2.1 beta, on which I am still currently working, where I revise the way zip files are downloaded
Then if you still need to detect failure to download the zip file, you could add a file named AA.js to your Modules folder (you want the filename to come before PennController.js in an alphanumeric order) with a content like this:
const zipError = ()=>{ const pe = document.querySelector(".PennController-PennController"); const parent = pe.parentElement; pe.remove(); const warning = document.createElement("P"); warning.innerHTML = "There was a problem loading resources for this experiment. Please reload this page to try again."; parent.append(warning); }; const oldFetch = window.fetch; window.fetch = function(...args){ const r = oldFetch.apply(this, args); if (typeof(args[0])=="string" && args[0].match(/\.zip$/i)) r.catch(zipError); return r; }
And to fully capture all the errors in the download process, also add this at the top of your project’s main.js script:
PennController._AddElementType("dummyelementname", function(PennEngine) { const olderror = PennEngine.debug.error; PennEngine.debug.error = function(...args) { if (typeof(args[0])=="string" && args[0].match(/Error downloading .+zip/)) zipError(); return olderror.apply(this, args); } })
Let me know if you have questions
Jeremy
Jeremy
KeymasterJust to make sure, we are talking about the data-collection (published) set of results, correct? Because there indeed is a single submission for the demonstration (unpublished) set of results
Jeremy
Jeremy
KeymasterThank you for the detailed feedback, Monica, it will be greatly helpful to users who face the same issue in the future!
I will look into the particularities of video files obtained from Elan
Jeremy
Jeremy
KeymasterHey Monica,
I’m curious: how do you determine whether you’re watching new or old versions of the videos? When I take your experiment, I get “preloading” messages, but that goes away when I upload PennController 2.1 beta in a copy of your project. Then, preloading happens fast enough that I don’t even see the “preloading” messages anymore when I get to the first training trial, and everything goes smoothly. But, of course, not having seen the old videos, I can’t tell whether I’m watching the new ones or not
In my case, I manually download the zip file by entering its URL in the address bar of my browser, and then I can compare with what I see when I take the experiment. I haven’t seemed to notice any difference so far (except there are more video files in the zip files that actually used in the experiment)
Jeremy
Jeremy
KeymasterHi,
I see 9 submissions associated with that project, all from different browsers, so I presume they do not all correspond to your own pilot data. They were all received/added to the database today between 18:40GMT and 18:59GMT, that is, less than 30min ago at the time I’m posting this message. Are the 8 submissions you mentioned still missing from the results file if you refresh your project’s page and try downloading the file again?
Jeremy
Jeremy
KeymasterHi Monica,
1) You cannot sync projects with https://github.com/PennController/penncontroller/ because that repository does not consist in a (PC)Ibex project’s directory structure. If you’d like to try out 2.1 beta, you should simply download it from here directly and upload it to your project’s Modules folder to overwrite the existing PennController.js file. Keep in mind that 2.1 beta is work in progress: I haven’t released it yet, so the version currently on the repo is susceptible to change any time (so if you download it today and download it again in, say, 2 months, you might get two different versions, if I made edits in the meantime)
2) I think the issue you’re describing has to do with the farm sometimes internally creating multiple copies of the same file (eg. main.js) and, as a result, it alternates which copy it saves your edits into, and which copy it serves while running the experiment, so your latest edit aren’t always reflected when running the experiment. I am working on fixing this bug, but in the meantime, if that happens, select all the text in the editor, copy it and paste it somewhere safe, then delete the file from your project (the farm will delete all internal copies with the same name), then recreate it, and paste the content you copied earlier. This way, your project will internally have a single copy of the file again, and the problem should go away. Repeat the procedure if it starts happening again
Regarding the files you need to preload: it could be that you experience the same issue when editing your CSV file, in which case your latest modifications to it might not be reflected when taking the experiment. If that’s the case, follow the procedure I just described. It could also be that, if you uploaded a new version of the zip file to your webserver, your browser still reuses an older version it kept in cache. If that’s the case, a full refresh should make sure your browser fetches the most recent version of the zip file
Let me know if problems persist
Jeremy
-
AuthorPosts