Skip to content

[Superseded] Please use grade_this() mixed with pass(), pass_if_equal(), fail(), and/or fail_if_equal(). Can also use eval_gradethis().

Evaluates the condition() object to return a graded() value.

Usage

evaluate_condition(condition, ..., last_value, env)

Arguments

condition

a condition() object

...

ignored

last_value

The last value from evaluating the user's exercise submission.

env

environment to evaluate the condition

Value

a graded() value if condi$x is TRUE or NULL if condi$x is FALSE

Examples

condi_formula_t <- condition(
  ~ identical(.result, 5),
  message = "my correct message",
  correct = TRUE
)
evaluate_condition(
  condi_formula_t,
  last_value = 5,
  env = new.env()
)
#> <gradethis_graded: [Correct] my correct message>