Description Usage Arguments Details Value Functions
View source: R/n_opt_dfd_page.R
Create an html page and send information to javascript if an option is
clicked. Needs prepared lists of gambles created by
createDfdList
or of the same structure and control variables
created with createCtrlList
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | twoOptDfdPage(
ctrlValsList,
containerOb,
gambleTitle = "Gamble",
gambleTitlePractice = "Practice Gamble",
withPracticeGamble = TRUE,
displayTitle = TRUE,
nGambles = 10
)
threeOptDfdPage(
ctrlValsList,
containerOb,
gambleTitle = "Gamble",
gambleTitlePractice = "Practice Gamble",
withPracticeGamble = TRUE,
displayTitle = TRUE,
nGambles = 10
)
fourOptDfdPage(
ctrlValsList,
containerOb,
gambleTitle = "Gamble",
gambleTitlePractice = "Practice Gamble",
withPracticeGamble = TRUE,
displayTitle = TRUE,
nGambles = 10
)
|
ctrlValsList |
list of reactive values. Controls the flow through the
Experiment. Can be created with |
containerOb |
list. Contains the gambles. Can be created by calling
|
gambleTitle |
string. Is displayed as title of the trial, e.g. if it is set to "Gamble" the displayed title in game 2 of 10 will be "Gamble 2 of 10". |
gambleTitlePractice |
string. Is displayed as title of the practice gamble. |
withPracticeGamble |
logical. If TRUE (default) a practice gamble must be provided and is played. Only needed if displayTitle is TRUE. |
displayTitle |
logical. If TRUE (default) a title is displayed. |
nGambles |
integer. The number of gambles played WITHOUT the practice game. |
These functions are called from within multiOptsDfdPage
because this also handles the appropriate custom message. So when you need
this function just call multiOptsDfdPage
.
An html page that can be displayed by a shiny app.
threeOptDfdPage
: A three option gamble version
fourOptDfdPage
: A four option gamble version
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.