Forum Replies Created
-
AuthorPosts
-
April 13, 2023 at 5:39 am in reply to: Cannot get the template function to loop over my experiment #10449
Jeremy
KeymasterHi Xiangyu,
You cannot use a javascript function in that
wait
command: documentation, source code. Since that’s not supported, you cannot assume thatthis.keys
will return a key that was pressedNeither Ibex nor PennController define a global JavaScript
log
function. PennController hasnewTrial().log
and element-specificlog
commandsIf you want to add a column to the rows of this trial that will report whether the pressed key was correct, you can use a global Var element:
newTrial( // ... newVar("Correct", 0).global(), // ... newKey("keypress", "FJ") .log() .wait() .test.pressed( variable.CorrectResponse ) // assuming that CorrectResponse in the table is either F or J .success( getVar("Correct").set(1) ) , // ... ) .log( "CorrectResponse" , getVar("Correct") )
Jeremy
April 12, 2023 at 7:32 am in reply to: TextInput not allowing 1-5 digits after Acceptability Judgement scale #10443Jeremy
KeymasterHi,
This is indeed a bug. One solution is to code the logic of the AcceptabilityJudgment controller using PennController commands instead:
newText("sentence").center().print() , newScale("AcceptabilityJudgment", 5) .before(newText("pas naturelle")).after(newText("très naturelle")) .button().center().log().print().keys().wait().remove() , newTimer(100).start().wait()
To make the visual rendering closer to the original controller, you can add these rules to global_main.css in your project’s Aesthetics folder:
.PennController-AcceptabilityJudgment .option { width: 1em; height: 1em; text-align: center; color: blue; margin: 0.33em; padding: 0.33em; border: solid 1px black; } .PennController-AcceptabilityJudgment .option label { width: 100%; } .PennController-AcceptabilityJudgment-container .PennController-before, .PennController-AcceptabilityJudgment-container .PennController-after { line-height: 2.5em; }
Jeremy
April 12, 2023 at 7:07 am in reply to: Cannot get the template function to loop over my experiment #10442Jeremy
KeymasterThis question was answered via email, but posting the suggested code here for the sake of future readers:
Template("sentences.csv",variable => newTrial("block"+variable.BlockNum, newTimer("break", 1000).start().wait() , newImage("im",variable.PictureFile).size(400, 400).print() , newTimer("image-item", 600).start().wait() , newText("ts", variable.TargetSentence).center().print() , newTimer("item", 2100).start().wait() , newText("response", variable.ResponseSentence1 + " or " + variable.ResponseSentence2).center().print() , newKey("keypress", "FJ").log().wait() ) ) // ... blocks = [randomize('block1'),randomize('block2'),randomize('block3'),randomize('block4')] fisherYates(blocks) // Ibex-internal function that shuffles an array Sequence("consent","welcome", "instructions", ...blocks, SendResults(), "goodbye")
Jeremy
Jeremy
KeymasterHi Ivan,
Whatever solution you choose, always make sure you back up the original copy of the results file. I don’t think there’s a clear preferred solution here, but if it were me, I would probably directly edit a copy of the file and look for the regular expression pattern
(,fillers,.+)(,[A-Z]\d+){2}
and then replace all occurrences with first match + second match ($1$2
in Visual Studio Code)Jeremy
April 12, 2023 at 6:13 am in reply to: Eyetracking experiment: Uploading and downloading material to server #10440Jeremy
KeymasterHi Sanghee,
The EyeTracker element tracks gazes on the elements that you’ve added to it. Since the elements you’ve added to it at the four quadrant Canvas elements, and since each is 50vw*50vh, those are the boundaries of the corresponding elements. If the tracker estimates a gaze to fall within the left 50% of the width of the screen and 50% of the height of the screen, then it will report
1
for _TopLeft, indeedJeremy
Jeremy
KeymasterHi,
The value of your Var element is numeric, it’s not a string, so I don’t expect the regular expression to test the value
If you want to test if the value is comprised between 7 and 9 included, use a function instead:
getVar("correct").test.is(v=>v>6&&v<10)
Jeremy
Jeremy
KeymasterHi Ari,
Yes, go to Aesthetics/global_main.css and edit the CSS rules. You may want to replace
margin-top: 5em;
with something likemargin-top: 3em;
in the group of rules targetingbody
Jeremy
April 3, 2023 at 12:14 pm in reply to: Eyetracking experiment: Uploading and downloading material to server #10431Jeremy
KeymasterHi Sanghee,
The size of the dots is 48*48px as of PennController 2.0. The calculation starts immediately when the middle dot shows up, and the score is proportional to the average distance from the center of the screen over the (X,Y) coordinates of the estimated gazes (
precision = 100 - (distance / halfWindowHeight * 100)
). As far as I remember, and as far as I can tell now, there is no default threshold value: if none is provided, then all calibrations will be successful. ReferenceThere is no set sampling rate: if memory serves, the WebGazer library will try to run at each update of the visual frame (look up
requestAnimationFrame
) which will happen more or less frequently depending on the performance of the participant’s browser at the time of the experiment.Regarding the Latin Square design, this is something you need to code yourself in your CSV. PennController picks one value from the ones listed in the “Group” or “List” column and subsets the table to all and only the rows containing that one value in that column, and generate the trials from those rows. If you want to cycle through conditions across items in Latin Square fashion, you need to design your table accordingly, as illustrated in the advanced tutorial
Jeremy
March 26, 2023 at 12:07 pm in reply to: Assign a truth value to the picture verification tasl #10421Jeremy
KeymasterHi Jun,
Use
.test.pressed()
on your Key element to test which key was pressed, instead of.test.selected()
on an unused Selector elementJeremy
March 23, 2023 at 1:35 pm in reply to: Eyetracking experiment: Uploading and downloading material to server #10419Jeremy
KeymasterHi Sanghee,
The “times” column reports how many milliseconds elapsed between when the EyeTracker element was started, and when the data in the corresponding row were collected (which is why the value in that cell is 0 on the very first row below the header: the first eye-tracking data were collected right when the tracker was started)
The columns starting with
_
are named after the elements you added to the EyeTracker element, and report 0 or 1, depending on whether the (X,Y) coordinates that were estimated by the tracker fell within the boundaries of the corresponding element at that time pointThe “trial” column reports the PennController trial’s ID number. If you only have PennController trials in your experiment, it will correspond to the 4th column in your results file (“Item number”) — more generally, it matches the value of the 9th column (PennElementName) for the rows in the results file that report “_Trial_,Start” or “_Trial_,End”
Jeremy
Jeremy
KeymasterHi,
Thank you for the report. This is a known issue that appeared with the latest release of Chromium, affecting both Chrome and Edge. It seems that Firefox isn’t affected so far, but I can’t guarantee it’ll stay that way. I’m looking into the issue
Apologies for the inconvenience,
JeremyJeremy
KeymasterThanks for the tip!
Jeremy
Jeremy
KeymasterHi Andrea,
That link is invalid. If you create a new project to share, make sure to do so while logged in, so it can be saved in your account; projects created while logged out are automatically deleted 30 minutes after their last edit
Jeremy
Jeremy
KeymasterHi,
Unless you explicitly tell it to do so, R will not modify the values in the EventTime column. Nor will the
read.pcibex
function provided in the documentation. That being said, there are preview methods that will alter how the values are displayedMaybe your code applies some transformation on the data somewhere else. Would you mind sharing it, so I can take a look?
Jeremy
Jeremy
KeymasterHi Andrea,
Would you mind sharing a link to your study? I cannot seem to reproduce the problem myself
Jeremy
-
AuthorPosts