Global commands
Used outside of a trial.
table of contents
AddHost
syntax
AddHost(“URL”)
description
Specifies a host URL to use as a source file for when calling creating a new Audio
, Image
, or Video element. The "URL"
argument must end in "/"
.
example
click to expand
PennController.ResetPrefix(null)
AddHost("https://files.lab.florianschwarz.net/test/")
AddHost("http://spellout.net/ibexfarm/static/images/")
newTrial(
newImage("ibex", "ibex.jpg")
.print()
,
newImage("wait", "https://openclipart.org/image/300px/svg_to_png/23920/Anonymous-Sandglass.png")
.print()
,
newAudio("sentence", "test.mp3")
.play()
.wait()
)
Prints two images and plays one audio file.
-
When loading the
"ibex"
Image
element, PennController sends a request for the filehttps://files.lab.florianschwarz.net/test/ibex.png
.If no such file is found, it sends a request for the file
http://spellout.net/ibexfarm/static/images/ibex.png
. - When loading the
"wait"
image
element, PennController sends a request for the filehttps://openclipart.org/image/300px/svg_to_png/23920/Anonymous-Sandglass.png
. -
When loading the
"sentence"
Audio
element, PennController sends a request for the filehttps://files.lab.florianschwarz.net/test/test.mp3
.If no such file is found, it sends a request for the file
http://spellout.net/ibexfarm/static/images/test.mp3
.
AddTable
syntax
AddTable(“id”, csv_string)
description
Defines a table to use with PennController.Template
. As of PennController beta 0.4, you can directly upload a CSV file to the Resources or chunk_includes folders.
example
click to expand
AddTable( "myTable", // Name of the table
"Type,Sentence\n"+ // Column names (mind the \n)
"practice,Hello world!\n"+ // First row (mind the \n)
"test,Bye world!" // Second row
);
Template( "myTable" , row =>
newTrial(
newText("type", row.Type)
.print()
,
newButton("sentence", row.Sentence)
.print()
.wait()
)
);
CheckPreloaded
syntax
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
DebugOff
syntax
PennController.DebugOff()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
DownloadRecordingButton
EyeTrackerURL
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
FeedItems
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
Footer
GetTable
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
filter setGroupColumn
GetURLParameter
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
Header
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
InitiateRecorder
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
PreloadZip
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
PennController.ResetPrefix
syntax
PennController.ResetPrefix(null)
description
Removes the default global command prefix PennController.
example
click to expand
// example
optional parameters
-
PennController.ResetPrefix(“PREFIX”)
SendResults
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
Sequence
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
SetCounter
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
Template
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
UploadRecordings
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
newTrial
syntax
to be filled in
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example