or getElement(id).settings.before( getElement(id) ) Adds some content to the left of the element. Example: [js highlight=”6,12″ try=”true”] newImage(“bad”, “no.png”) , newImage(“good”, “ya.png”) , newText(“left label”, “Bad”) .settings.before( getImage(“bad”) ) , newText(“right label”, “Good”) .settings.after( getImage(“good”) ) , newScale(“judgment”, 5) .settings.before( getText(“left label”) ) .settings.after( getText(“right label”) ) .print() .wait() [/js] Creates two image and two …
Wiki Category Archives:
standard.settings.after
getElement(id).settings.after( getElement(id) ) Adds some content to the right of the element. Example: [js highlight=”9,13″ try=”true”] newImage(“bad”, “no.png”) , newImage(“good”, “ya.png”) , newText(“left label”, “Bad”) .settings.before( getImage(“bad”) ) , newText(“right label”, “Good”) .settings.after( getImage(“good”) ) , newScale(“judgment”, 5) .settings.before( getText(“left label”) ) .settings.after( getText(“right label”) ) .print() .wait() [/js] Creates two image and two text …
standard.print
getElement(id).print() or getElement(id).print(x,y) (limited support in PennController 1.3, general since 1.4) or getElement(id).print(x,y,canvas) (limited support in PennController 1.3, general since 1.4) Adds the content of the element to the screen. This has no effect for non-visual elements such as the purely interactive . Since PennController 1.3, you can pass x and y values to print …
youtube.settings.once
getYoutube(id).settings.once() (since beta 0.3) Will disable the Youtube video after it has finished playing. Example: [js highlight=”2″ try=”true”]newYoutube(“myYoutube”, “aFPtc8BVdJk”) .settings.once() .print() .play() .wait() , newButton(“validate”, “Validate”) .print() .wait() [/js] Shows a video on the page and starts playing it. Playback will become disabled after it has finished.
youtube.settings.log
log getYoutube(id).settings.log() (since beta 0.3) or getYoutube(id).settings.log(“play”) (since beta 0.4) or getYoutube(id).settings.log(“end”) (since beta 0.4) or getYoutube(id).settings.log(“pause”) (since beta 0.4) or getYoutube(id).settings.log(“buffer”) (since beta 0.4) or getYoutube(id).settings.log(“play”, “buffer”, …) (since beta 0.4) or getYoutube(id).settings.log(“all”) (since beta 0.3) Note: since beta 0.4, blank parentheses default back “play”. In beta 0.3, they default back to “all”. Will …
youtube.wait
getYoutube(id).wait() or getYoutube(id).wait(“first”) or getYoutube(id).wait( test ) Waits until the video has ended before evaluating and executing the next commands. If you call wait(“first”), then if the video has already been fully played at least once by the time this command is evaluated, the next commands are evaluated and executed right away. If it was …
youtube.stop
getYoutube(id).stop() (since beta 0.3) Pauses the video and moves it back to the beginning (position = 0s). Example: [js highlight=”10″ try=”true”]newYoutube(“mcgurk”, “aFPtc8BVdJk”) .print() .play() , newTimer(“preview”, 2000) .start() .wait() , getYoutube(“mcgurk”) .stop() [/js] Starts playing a mind-blowing video demonstrating the McGurk effect, waits 2 seconds and stops the video. The video will start over from …
youtube.play
getYoutube(id).play() Starts playing the video. If you did not use print before, the video will not be visible on the screen but sound will start playing anyway. Example: [js try=”true” highlight=”3″]newYoutube(“mcgurk”, “aFPtc8BVdJk”) .print() .play() .wait() [/js] Plays a mind-blowing video demonstrating the McGurk effect.
voicerecorder.settings.once
The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).settings.once() Disables the button to record after the first recording. You can still record using the action command record. Example: [js highlight=”5″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .settings.once() .print() .wait() .play() .wait(“playback”) );[/js] Adds a recording and a playback button to the page, and when the recording …
voicerecorder.settings.log
The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).settings.log() Will add a line whenever a recording starts and whenever it stops. Note that a line with the filename of the recorded sample is always logged anyway even if you do not call .settings.log(), so you can identify it in the output archive. [js …