twoOptDfdPage: Create an HTML Page to Display and Play a Decisions From...

Description Usage Arguments Details Value Functions

View source: R/n_opt_dfd_page.R

Description

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.

Usage

 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
)

Arguments

ctrlValsList

list of reactive values. Controls the flow through the Experiment. Can be created with createCtrlList.

containerOb

list. Contains the gambles. Can be created by calling multiOptsDfdPage.

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.

Details

These functions are called from within multiOptsDfdPage because this also handles the appropriate custom message. So when you need this function just call multiOptsDfdPage.

Value

An html page that can be displayed by a shiny app.

Functions


ndphillips/ShinyPsych documentation built on Feb. 14, 2022, 5:53 p.m.