Create error results from a custom exercise evaluator.

exercise_result_error() is the preferred way to create an error result.

exercise_result_empty() creates an exercise result representing an "empty" output.

exercise_result_timeout() is a short-hand version for the common problem of the R code timing out.

exercise_result(
  feedback,
  html_output,
  error_message,
  timeout_exceeded = FALSE,
  severity
)

exercise_result_error(
  error_message,
  severity = c("error", "warning", "info"),
  timeout_exceeded = FALSE
)

exercise_result_empty(severity)

exercise_result_timeout()

Arguments

feedback

a message to be displayed underneath the code chunk.

html_output

the HTML code to be inserted into the exercise's output container.

error_message

if present, severity is set to error and the error message is used as feedback.

timeout_exceeded

if TRUE, severity is set to error and the timeout error message is shown.

severity

can be one of error, warning, or info.

Details

The function exercise_result_timeout() uses the correct message configured for the exam (or code chunk).