Global options for exercise chunks. Each of these options can be overwritten in the individual exercise chunks by specifying the exercise.xyz chunk option (xyz is one of the parameter names below).

exercise_options(
  title,
  button,
  timeout,
  lines,
  autocomplete,
  df_print,
  points,
  setup,
  solution,
  checker,
  label
)

Arguments

title

title of the exercise. Default: exercise.panelTitle from status_messages().

button

label of the run exercise button. Default: exercise.buttonLabel from status_messages().

timeout

time limit for the code to run (in seconds). Default: 5.

lines

the minimum number of lines in the code editor. Default: 5.

autocomplete

enable or disable auto-completion in the code editor. Note that this sends many requests to the server and could pose performance issues if many users access the exam at the same time. Default: FALSE.

df_print

method used for printing data frames created by the user code. Default to use the same as the R-markdown document, but can be changed if needed. See argument df_print in html_document() for details.

points

the default number of points an exercise is worth. Default: 1.

setup

the name of an R code chunk which is evaluated before the user code.

solution

the name of an R code chunk which gives the solution to the exercise code chunk. This really only makes sense if set on a per-chunk basis.

checker

a function (or the name of a function) which checks the R code in the exercise chunk.

label

a label to help screen readers describe the purpose of the input element. Default: exercise.label from status_messages().

See also

Other exercise configuration: exercise_evaluator