problem: 'problem' objects

Description Usage Arguments Details Value

Description

problem objects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
problem(text = "", answers = character(), solution = "", correct = 1L,
  first = 0L, last = 0L, randomizable = TRUE)

## S3 method for class 'problem'
format(x, shuffle_answers = FALSE, show_solutions = FALSE,
  tpl_problem = examiner_opts$tpl_problem,
  tpl_answerlist = examiner_opts$tpl_answerlist, counter = Counter(),
  cnt_problem_2 = NULL, cnt_problem_1 = 1L,
  format_cnt_problem_1 = identity, format_cnt_problem_2 = identity,
  format_cnt_problem_0 = identity, .debug = FALSE, ...)

Arguments

text

character vector with the prompt for the problem.

answers

A list of problem or problemset objects.

correct

Indices of answers which are correct.

first

Number of observations at the beginning of answers which will not be shuffled.

last

Number of observations at the end of answers which will not be shuffled.

solution

Text for the solution to the problem.

randomizable

Can the answers be shuffled?

x

The object

shuffle_answers

Shuffle answers?

show_solutions

Display the solutions to the answers?

tpl_problem

Whisker template to use when rendering the object.

tpl_answerlist

The template to use to render the object.

counter

A counter to keep track of the number of problems.

cnt_problem_1

A counter for the top level problem and problemset objects.

cnt_problem_2

NULL if the problem is not in a problemblock. Otherwise, the number within that problemblock.

format_cnt_problem_0

A function used to format cnt_problem_0.

format_cnt_problem_1

A function used to format cnt_problem_1.

format_cnt_problem_2

A function used to format cnt_problem_2.

.debug

Useful for debugging. Shows the data that is passed to the template.

...

Used by the template and passed to format.answerlist.

Details

The class "problem" is a "list" with elements,

text

"character". The text for the problem.

answers

"answerlist". Possible answers to the problem.

solution

"character". Text with discussion of the answer to problem.

randomizable

"logical". Whether the answers can be shuffled.

Value

An object of class problem.


jrnold/examiner documentation built on May 20, 2019, 1 a.m.