nextPage: Go to Next Page

Description Usage Arguments Value

View source: R/next_page.R

Description

If all questions on a page are answered or the participant has read all the text, this function will (if properly set up, this has to be handled in the app) be called if the continue button is pressed. It is possible to have an id check to make sure a participant is allowed to participate.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
nextPage(
  pageId,
  ctrlVals,
  nextPageId,
  pageList,
  globId,
  checkAllowed = FALSE,
  checkAllowedPage = 1,
  checkIdVar = "workerid",
  checkLocation = "local",
  checkSep = ",",
  checkHeader = TRUE,
  checkDropDir = NULL,
  checkFileName = NULL,
  checkDroptoken = NULL,
  checkIdsVec = NULL,
  checkNotAllowedId = "not allowed",
  inputList = NULL
)

Arguments

pageId

string. Current page id.

ctrlVals

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

nextPageId

string. Id of the next page that should be displayed.

pageList

list. The one returned by createPageList or one of the same structure.

globId

string. The global id of the set of pages or questionnaire as specified in createCtrlList.

checkAllowed

logical. If TRUE (default is FALSE) an id check is done with checkId to make sure a participant is allowed to participate.

checkAllowedPage

integer. The page number of the set of pages with this pageId after which the id should be checked. Only needed if checkAllowed is TRUE.

checkIdVar

string or numeric. The user id to check.

checkLocation

string. Where to get the reference database from. Must be one of "local", "dropbox" or "vector". "local" will load a txt or rds file. "dropbox" will load a csv file from the indicated dropbox account and "vector" assumes that you gave a vector of ids as input to idsVec. Only needed if checkAllowed is TRUE.

checkSep

string. Passed to the read.table sep argument. Must match the separater used in the database file. Only needed if checkAllowed is TRUE.

checkHeader

logical. Passed to the read.table header argument. Only needed if checkAllowed is TRUE.

checkDropDir

string. The directory in the dropbox from which to read in the database. Must only be specified if checkLocation is set to "dropbox". Only needed if checkAllowed is TRUE.

checkFileName

string. The database file-name, including path. Must be specified if checkLocation is one of "dropbox" or "local".Only needed if checkAllowed is TRUE.

checkDroptoken

string. The name of the rds file containing the access tokens of the dropbox account from which the data should be loaded. If file is outside the app directory full directory must be included. Only needed if checkAllowed is TRUE.

checkIdsVec

string. Vector of ids that are no longer allowed to participate. Must only be specified if checkLocation is set to "vector". Only needed if checkAllowed is TRUE.

checkNotAllowedId

string. The name (default is "not allowed") of the page that should be displayed in case the given id is occurring in the database. Only needed if checkAllowed is TRUE.

inputList

The input object of the shiny app.

Value

Updated ctrlVals. Doesn't need to be assigned, since it is a reactive value.


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