Description Usage Arguments Details Value See Also Examples
Add a timeout to a stage
1 |
stage |
A Stage object, or a function |
timeout |
timeout length in seconds |
on_timeout |
a function to be called if a subject times out. |
Returns a Stage which contains the original stage
.
If a subject times out, 'NEXT' is returned and 'on_timeout' is called with
arguments '(id, period)'.
Timed stages are implemented using http refresh. This is not a standard part of the HTTP specification, so use with caution if you do not control which browsers your subjects will be running.
A Stage object of class Timed
Other stages: NEXT
, WAIT
,
stage
; checkpoint
;
form_stage
; period
;
program
; text_stage
1 2 3 4 5 6 | s1 <- form_stage(c(header(), "Enter something",
"<form action='' method='POST'><input name='foo'></form>", footer()),
fields=list(foo=has_value()), data_frame="mydf")
# set a default value:
s1_timed <- timed(s1, 60, on_timeout=function(id, period)
mydf$foo[mydf$id==id & mydf$period==period] <<- "Default value"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.