eyetracker.log

getEyeTracker(id).log() (since PennController 1.8) Tell the EyeTracker element to send the collected data points to the PHP script provided by at the end of the trial. If you do not call log on the EyeTracker element, your server will never receive the eye-tracking data.

eyetracker.callback

getEyeTracker(id).callback( function ) (since PennController 1.8) Tell the script to continuously execute the specified javascript function as long as an element is being looked at. The function takes is passed two arguments, the estimated X and Y coordinates. The keyword this in the callback function points to the PennElement instance corresponding to the looked-at element. …

eyetracker.add

getEyeTracker(id).add( element1 , element2, … ) (since PennController 1.8) Adds elements to be tracked. Any commands passed to will be executed on every cycle (or span of cycles) where the estimated looks fall on one of the specified elements. Once you add elements to the tracker and use , the tracker will report 1 (looked-at) …

eyetracker.train

getEyeTracker(id).train() (since PennController 1.8) or getEyeTracker(id).train(true) Starts using mouse movements and clicks to train the model that estimates looks. Pass true as a parameter to make the red dot visible. By default the model is only trained during the calibration phase, but you can train it further with this command. Use to stop training the …

eyetracker.stopTraining

getEyeTracker(id).stopTraining() (since PennController 1.8) Stops using mouse movements and clicks to train the model that estimates looks. By default the model is only trained during the calibration phase, but you can train it further with the command . Example: [js highlight=”15″ try=”data”]newTrial( newButton(“Start”).print().wait(newEyeTracker().test.ready()) ) newTrial( newEyeTracker(“tracker”) .calibrate(70) .train(true) , newButton(“Click here first”).print(“20vw”,”40vh”).wait().remove(), newButton(“Now Click here”).print(“60vw”,”40vh”).wait().remove() …

eyetracker.stop

getEyeTracker(id).stop() (since PennController 1.8) Stops tracking which element is being looked at. The EyeTracker element will stop collecting and sending data points to your PHP script after stop is executed. Example: [js highlight=”11″ try=”data”]newTrial( newButton(“Start”).print().wait(newEyeTracker().test.ready()) ) newTrial( newEyeTracker(“tracker”).calibrate(70) , newText(“Left”).css(“padding”,”20vw”).print(“20vw”, “40vh”), newText(“Right”).css(“padding”,”20vw”).print(“60vw”, “40vh”) , getEyeTracker(“tracker”).add( getText(“Left”) , getText(“Right”) ).showFeedback().start() , newTimer(1000).callback( getEyeTracker(“tracker”).stop() ).start() , newSelector().add( …

eyetracker.start

getEyeTracker(id).start() (since PennController 1.8) Starts tracking which element is being looked at. You should use first to tell the eye tracker which elements are to be tracked. The EyeTracker element will not collect any data points until start is executed. Use to stop tracking elements and sending data to your PHP script. Example: [js highlight=”9″ …

eyetracker.hideFeedback

getEyeTracker(id).hideFeedback() (since PennController 1.8) Hides the red dot estimating your looks. The red dot is hidden by default after calibration, but you can turn it back on using . Example: [js highlight=”11″ try=”data”]newTrial( newButton(“Start”).print().wait(newEyeTracker().test.ready()) ) newTrial( newEyeTracker(“tracker”).calibrate(70) , newText(“Left”).css(“padding”,”20vw”).print(“20vw”, “40vh”), newText(“Right”).css(“padding”,”20vw”).print(“60vw”, “40vh”) , getEyeTracker(“tracker”).add( getText(“Left”) , getText(“Right”) ).showFeedback().start() , newTimer(1000).callback( getEyeTracker(“tracker”).hideFeedback() ).start() , newSelector().add( getText(“Left”) …

scale.settings.label

getScale(id).settings.label(index,label) Sets the content of the index-th label (with index starting at 0). This will mostly be useful if you want to use something like an Image element as a label, which cannot be passed as a direct parameter when creating the new Scale. [js highlight=”2,3″ try=”true”] newScale(“score”, “Bad”, “So-so”, “Good”) .settings.label( 0 , newImage(“no.png”) …

eyetracker.calibrate

getEyeTracker(id).calibrate(threshold) (since PennController 1.8) or getEyeTracker(id).calibrate(threshold,attempts) Calibrates the eye-tracker so that threshold% of the estimated looks fall on the target. If the eye-tracker was calibrated before, this command will display a button at the center of the page: after clicking it, participants must fix it for 3s. If fewer than threshold% of the estimated looks …