quiz_setup: Set up the quiz environment

Description Usage Arguments Value

View source: R/quiz_setup.R

Description

Everything the quiz needs to work is assigned to variables in the quiz environment. Quiz functions access these variables through the quiz environment that can be passed as an argument or set as a global option 'peRson.quiz'.

Usage

1
2
3
4
5
6
7
quiz_setup(
  questions,
  participants,
  presence = NULL,
  shuffle = TRUE,
  create_sheets = TRUE
)

Arguments

questions

A data frame with questions (see [demo_questions] for format).

participants

A data frame with participants (see [demo_participants] for format).

presence

Vector of present participants' names. If NULL, all participants from participants data frame (participants$name) will be deemed present.

shuffle

If TRUE, the order of answers and questions is randomly shuffled by [shuffle_answers()] and [shuffle_questions()] respectively.

create_sheets

If TRUE, a Google Sheet for answers is created for and shared with each participant, plus one summary sheet containing imported answer sheets (though the sheets need to be linked manually in the sheet before answers can be read from it).

Value

A quiz environment with the following variables.

presence

vector or present participants' names

css_file

path to css file used to style the HTML quiz files

all_questions

data frame with all the provided questions from the questions data frame (shuffled if shuffle is TRUE)

questions

data frame with questions that will be used in the quiz (only those whose askers are present)

participants

data frame with participants from the participants data frame (with added variables chose_color, dist, present and answer_sheet if create_sheets is TRUE)

summary_sheet_id

if create_sheets is TRUE character id of the created summary sheet

named_colors

vector of hex colors chosen by participants, named with their names, plus average color of chosen colors with "avg" name

question_colors

vector of hex colors for each question in questions based on the person who asked it

answers

empty list that will be filled with answers by [evaluate_answers()]


martina-starc/peRson documentation built on April 14, 2021, 3:48 p.m.