Skip to content

Releases: rstudio/gradethis

Version 0.2.14

27 Jun 03:08
Compare
Choose a tag to compare
  • grade_code() no longer fails if .envir_result or .envir_solution is missing (#355).
  • detect_mistakes() now keeps a version of standardized user and solution code with and without default arguments added. Missing arguments are detected by comparing the user code with defaults to the solution code without defaults. Surplus arguments are detected by comparing the user code without defaults to the solution code with defaults (#356).
    • This helps avoid spurious feedback when comparing code that involves S3 methods. If the user's code differs from the solution code in a way that means a different S3 method is used, the standardized code may gain different default arguments. This could result in feedback about missing or surplus arguments that were added by code standardization rather than by the student, which is not actionable feedback. By no longer looking for default arguments that are missing or surplus in the user code, we ensure that students receive more actionable feedback, likely about the incorrect argument that resulted in the use of a different S3 method.
  • The gradethis_equal.list() method is now only used if both x and y are bare lists (as defined by rlang::is_bare_list()) (#357).
    • This fixes a bug where a list could be marked as equal to another object with the same contents but a different class, e.g. list(a = 1, b = 2) and c(a = 1, b = 2) or data.frame(a = 1, b = 2).
  • Fix bug where call_standardise_formals() would fail when given a purrr::map() function where .f is an index rather than a function (#359).

Version 0.2.13

17 May 22:11
cab4b64
Compare
Choose a tag to compare
  • code_feedback() now standardizes arguments to functions defined within student and solution code before comparing code. It also now successfully standardizes arguments passed through ... by mapping functions into functions defined by setup code (#349).
  • gradethis_equal() now has a method for objects of class list. If two lists are not identical() and their lengths are the same, gradethis_equal() is applied to each element pairwise. This allows special logic for specific classes to be used for list elements of that class (#351).
  • call_standardise_formals() now applies ggplot2::standardise_aes_names() to all arguments of ggplot2 functions. This means it no longer detects inconsequential differences between, e.g., color = and colour = (#353).
  • When an exercise without an -error-check chunk returns an error, the default feedback now includes both the error message and code feedback if fail.hint = TRUE. Previously the error message was only shown when fail.hint = FALSE and code feedback was only shown when fail.hint = TRUE (#352).

Version 0.2.12.9005

13 May 02:24
712fcfa
Compare
Choose a tag to compare
  • gradethis_equal() now has default arguments of x = .result and y = .solution (#347).
    • gradethis_equal.default() now has a default argument of tolerance = sqrt(.Machine$double.eps).

Version 0.2.12.9004

08 May 19:08
1ecb441
Compare
Choose a tag to compare
  • Add fail_if_not_equal() (#346).
  • pass_if_equal(), fail_if_equal(), and fail_if_not_equal() now call gradethis_equal(), an S3 generic which calls waldo::compare() by default. This allows other methods for gradethis_equal() to handle special cases (#346).

Version 0.2.12.9003

03 May 16:52
e9fb77e
Compare
Choose a tag to compare
  • call_standardise_formals() now attempts to standardize arguments passed through ... in mapping functions like lapply() or purrr::map() (#344).

Version 0.2.12.9002

13 Apr 23:30
35dbf6a
Compare
Choose a tag to compare
  • call_standardise_formals() now attempts to standardize the arguments of calls to S3 generics (#339).
  • pass_if() and fail_if() now produce more informative error messages if their cond argument is invalid (#341).

Version 0.2.12.9000

24 Mar 01:52
2ef6caa
Compare
Choose a tag to compare
  • New functions: user_object_get(), user_object_exists() and user_object_list() can be used to interact with objects created by the student's code. solution_object_get(), solution_object_exists() and solution_object_list() do the same for objects created by the solution code (#333).
  • New function: with_exercise() allows you to evaluate an expression as if it were run inside grade_this() with an associated exercise. It can be used alongside mock_this_exercise() for testing grading code outside the context of a learnr tutorial (#333).
  • .envir_solution is now included in the grade_this() check environment alongside .envir_prep and .envir_result. .envir_solution contains the state of the environment used to execute solution code, just as .envir_result does for student code (#333).