PennController.SendResults()
(since PennController 1.1)
or PennController.SendResults( "label" )
(since PennController 1.1)
Since PennController 1.7, SendResults
can be used in three different environments:
- On its own, it creates a trial whose sole function will be to send the results to the server when it is run. You can give a label to the trial by passing a string as an argument to
SendResults
and then refer to it inSequence
in order to send the results early. - Alternatively, you can use it directly inside
Sequence
in place of a reference to a label, with the same effect as above (but lifting the need to come up with a dedicated label) SendResults()
can also be used as a command inside a trial: when it is run, it will send the results to the server. This is useful if you want to allow your participants to send their results early for some reason.
Sending the results early is useful if you want your participants to see a confirmation screen at the end.
Examples:
[js try=”data” highlight=1]Sequence( “hello” , “world” , SendResults() , “bye” )
newTrial( “hello” ,
newButton(“Hello”)
.settings.log()
.print()
.wait()
)
newTrial( “world” ,
newButton(“Send & quit now”)
.settings.callback(
getButton(“World”)
.remove()
,
SendResults()
)
.print( 10 , 10 )
,
newButton(“World”)
.settings.log()
.print()
.wait()
)
newTrial( “bye” ,
newText(“thanks”, “Thank your for participating in this experiment.”)
.print()
,
newText(“link”, “Click here to confirm your participation.“)
.print()
,
newTimer(“forever”, 1)
.wait() // Timer never started: will wait forever
)
.setOption(“countsForProgressBar”,false)
[/js]