Skip to content

Commit

Permalink
rename functions per rstudio#65 update docs and tests (rstudio#72)
Browse files Browse the repository at this point in the history
* Use roxygen markdown for comments, using roxygen2md::roxygen2md()

* Use @inheritParams instead of @template, for cleaner documentation and less duplication

* Convert remaining documentation entries to roxygen markdown; Reflow docs; Minor fixes.

* rename functions per rstudio#65 update docs and tests

* grader -> gradethis in badges in reademe

* fix missed conflict block

* fix things after rebase

* Remove period in title

* fix link

* add parens

* magrittr pipe link

* magrittr pipe link

* put back grade_conditions examples and regenerate docs
  • Loading branch information
chendaniely authored Aug 23, 2019
1 parent 5ec1144 commit 9083fc8
Show file tree
Hide file tree
Showing 28 changed files with 213 additions and 234 deletions.
8 changes: 4 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Generated by roxygen2: do not edit by hand

export(check_code)
export(check_result)
export(condition)
export(evaluate_condition)
export(fail_if)
export(grade_code)
export(grade_conditions)
export(grade_learnr)
export(grade_result)
export(graded)
export(grading_demo)
export(gradethis_demo)
export(pass_if)
export(random_encourage)
export(random_praise)
export(test_result)
importFrom(rlang,"%||%")
importFrom(utils,browseURL)
2 changes: 1 addition & 1 deletion R/condition.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' @export
#'
#' @examples
#' \dontrun{grading_demo()}
#' \dontrun{gradethis_demo()}
#'
#' condition(~ identical(x = .result, 5), message = "Correct", correct = TRUE)
condition <- function(x, message, correct) {
Expand Down
2 changes: 1 addition & 1 deletion R/evaluate_condition.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ evaluate_condition <- function(condition, grader_args, learnr_args) {
res <- !all(is.na(res)) && all(res, na.rm = TRUE)
}

# implement when we add a `exec`/`expect` api to check_result
# implement when we add a `exec`/`expect` api to grade_result
# will account for function returns
# if (inherits(res, 'grader_graded')) {return(res)} # nolint
if (is.null(res)) return(NULL)
Expand Down
2 changes: 1 addition & 1 deletion R/get_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Helper methods around [rlang::eval_tidy()]
#' to extract user code and solution code.
#'
#' @seealso [check_result()], [test_result()], and [check_code()]
#' @seealso [grade_result()], [grade_conditions()], and [grade_code()]
#' @param user,solution,expr An expression or quosure to evaluate.
#' @param name Name to print if a `NULL` expression is provided.
#'
Expand Down
26 changes: 13 additions & 13 deletions R/check_code.R → R/grade_code.R
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#' Check code against a solution
#' Grade code against a solution
#'
#' Checks the code expression or the code result against a solution.
#'
#' `check_code()` compares student code to a solution (i.e. model code) and
#' `grade_code()` compares student code to a solution (i.e. model code) and
#' describes the first way that the student code differs. If the student code
#' exactly matches the solution, `check_code()` returns a customizable success
#' exactly matches the solution, `grade_code()` returns a customizable success
#' message (`correct`). If the student code does not match the solution, a
#' customizable incorrect message (`incorrect`) can also be provided.
#'
#' `check_code()` provides a *strict* check in that the student code must
#' `grade_code()` provides a *strict* check in that the student code must
#' exactly match the solution. It is not enough for the student code to be
#' equivalent to the solution code (e.g. to return the same result as the
#' solution).
#'
#' You can provide solution code for `check_code()` to use in two ways:
#' You can provide solution code for `grade_code()` to use in two ways:
#'
#' 1. Pass code as a character string or a quoted expression to the solution
#' argument of `check_code()`
#' argument of `grade_code()`
#'
#' 2. Make a "-solution" code chunk for the exercise to be checked in a learnr
#' document. There is no need to supply a solution argument for `check_code()`
#' document. There is no need to supply a solution argument for `grade_code()`
#' if you call it from the "-check" chunk of the same exercise. Likewise, there
#' is no need to supply a student submitted code argument when you call
#' `check_code()` from a learnr document (learnr will provide the code that the
#' student submits when it runs `check_code()`.
#' `grade_code()` from a learnr document (learnr will provide the code that the
#' student submits when it runs `grade_code()`.
#'
#' For best results, name all arguments provided in the solution code.
#'
Expand Down Expand Up @@ -61,16 +61,16 @@
#' that the answer differs, the message will be the content of the `glue_pipe`
#' argument.
#'
#' @seealso [check_code()], [check_result()], and [test_result()]
#' @seealso [grade_code()], [grade_result()], and [grade_conditions()]
#' @export
#' @examples
#' \dontrun{grading_demo()}
#' \dontrun{gradethis_demo()}
#'
#' # This is a manual example, see grading demo for `learnr` tutorial usage
#' y <- quote(sqrt(log(2)))
#' z <- quote(sqrt(log(1)))
#' check_code(grader_args = list(user_quo = y, solution_quo = z))
check_code <- function(
#' grade_code(grader_args = list(user_quo = y, solution_quo = z))
grade_code <- function(
correct = NULL,
incorrect = NULL,
grader_args = list(),
Expand Down
17 changes: 11 additions & 6 deletions R/test_result.R → R/grade_conditions.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#' Test the result of exercise code
#' Grade all specified conditions
#'
#' Executes tests against the final result of the user code. If
#' a test throws an error, the test fails and the submitted answer will be
#' marked incorrect.
#'
#' @inheritParams check_code
#' Executes tests against the final result of the user code. If
#' a test throws an error, the test fails and the submitted answer will be
#' marked incorrect.
#'
#' @inheritParams grade_code
#'
#' @param correct A character string to display if all tests pass. This
#' character string will be run through [glue::glue_data] with:
Expand Down Expand Up @@ -32,25 +36,26 @@
#' @seealso `test`
#' @export
#' @examples
#' \dontrun{grading_demo()}
#' \dontrun{gradethis_demo()}
#'
#' example_function <- function(x){
#' return(x + 1)
#' }
#' test_result(
#' grade_conditions(
#' pass_if(~ .result(3) == 4),
#' pass_if(~ .result(10) == 11),
#' grader_args = list(),
#' learnr_args = list(last_value = example_function, envir_prep = new.env())
#' )
#'
#' test_result(
#' grade_conditions(
#' pass_if(~ .result(3) == 4),
#' fail_if(~ .result(10) == 11),
#' grader_args = list(),
#' learnr_args = list(last_value = example_function, envir_prep = new.env())
#' )
test_result <- function(
#'
grade_conditions <- function(
...,
correct = NULL,
incorrect = NULL,
Expand Down
4 changes: 2 additions & 2 deletions R/grade_learnr.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' `tutorial_options(exercise.checker = grade_learnr)` in the setup chunk
#' of your tutorial.
#'
#' Run `grading_demo()` to see an example learnr document that uses
#' Run `gradethis_demo()` to see an example learnr document that uses
#' `grade_learnr()`.
#'
#' @param label Label for exercise chunk
Expand All @@ -34,7 +34,7 @@
#' @export
#'
#' @examples
#' \dontrun{grading_demo()}
#' \dontrun{gradethis_demo()}
grade_learnr <- function(label = NULL,
solution_code = NULL,
user_code = NULL,
Expand Down
12 changes: 6 additions & 6 deletions R/check_result.R → R/grade_result.R
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#' Check result of exercise code.
#' Grade result of exercise code
#'
#' Compares the final result of the student code to known [pass_if()] and
#' [fail_if()] [condition()]s. If the student result exactly matches a known
#' case, returns the matching message value.
#'
#' @inheritParams check_code
#' @inheritParams grade_code
#'
#' @param ... [pass_if()] or [fail_if()] [condition()]s to check
#'
#' @return a [graded()] object from either [pass_if()] or [fail_if()] containing
#' a formatted `correct` or `incorrect` message and whether or not a match was
#' found.
#'
#' @seealso [check_code()], [check_result()], and [test_result()]
#' @seealso [grade_code()], [grade_result()], and [grade_conditions()]
#' @export
#' @examples
#' \dontrun{grading_demo()}
#' \dontrun{gradethis_demo()}
#'
#' @template check_result_examples
check_result <- function(
#' @template grade_result_examples
grade_result <- function(
...,
correct = NULL,
incorrect = NULL,
Expand Down
13 changes: 7 additions & 6 deletions R/grading_demo.R → R/gradethis_demo.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Grading Demo
#'
#' If you are using the RStudio IDE, `grading_demo()` opens an example learnr
#' If you are using the RStudio IDE, `gradethis_demo()` opens an example learnr
#' file that demonstrates how to use the grader package to check student code.
#'
#' The tutorial sets the learnr `exercise.checker` option to
#' `grade_learnr()` in the document's setup chunk.
#'
#' It then uses three different exercise checking methods:
#' [check_result()], [test_result()], and [check_code()].
#' [grade_result()], [grade_conditions()], and [grade_code()].
#'
#' To use a checking method, follow the exercise chunk with a chunk whose label
#' matches the label of the exercise chunk (ex: `myexercise`) but includes the suffix
Expand All @@ -21,11 +21,12 @@
#'
#' @export
#' @importFrom utils browseURL
grading_demo <- function() {
grading_demo_path <- system.file("tutorials", "grading-demo/grading-demo.Rmd", package = "grader")
gradethis_demo <- function() {
gradethis_demo_path <- system.file("tutorials", "grading-demo/grading-demo.Rmd",
package = "grader")
if (rstudioapi::isAvailable()) {
rstudioapi::navigateToFile(grading_demo_path)
rstudioapi::navigateToFile(gradethis_demo_path)
} else {
browseURL(paste0("file://", grading_demo_path))
browseURL(paste0("file://", gradethis_demo_path))
}
}
8 changes: 4 additions & 4 deletions R/insert_exercise_check_code.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
insert_exercise_check_code <- function() {
insert_exercise_grade_code <- function() {
random_chunk_label <- generate_random_chunk_label()

# nolint start
Expand All @@ -25,13 +25,13 @@ ____
```{r <<random_chunk_label>>-check}
# check code
gradethis::check_code()
gradethis::grade_code()
```
" , .open = "<<", .close = ">>"))
# nolint end
}

insert_exercise_check_result <- function() {
insert_exercise_grade_result <- function() {
random_chunk_label <- generate_random_chunk_label()

# nolint start
Expand All @@ -52,7 +52,7 @@ ____
```
```{r <<random_chunk_label>>-check}
gradethis::check_result(
gradethis::grade_result(
gradethis::pass_if(~ identical(.result, 1), \"YAY!\"),
gradethis::fail_if(~ identical(.result, 2), \"Try Again.\")
)
Expand Down
2 changes: 1 addition & 1 deletion R/pass_fail_if.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' a condition that if matched means the student provided result is correct
#'
#' @export
#' @template check_result_examples
#' @template grade_result_examples
pass_if <- function(x, message = NULL) {
condition(x, message, correct = TRUE)
}
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
# grader
# gradethis

<!-- badges: start -->
[![Travis build status](https://travis-ci.org/rstudio-education/grader.svg?branch=master)](https://travis-ci.org/rstudio-education/grader)
[![Codecov test coverage](https://codecov.io/gh/rstudio-education/grader/branch/master/graph/badge.svg)](https://codecov.io/gh/rstudio-education/grader?branch=master)
[![CRAN version](http://www.r-pkg.org/badges/version/grader)](https://cran.r-project.org/package=grader)
[![grader downloads per month](http://cranlogs.r-pkg.org/badges/grader)](http://www.rpackages.io/package/grader)
[![Travis build status](https://travis-ci.org/rstudio-education/gradethis.svg?branch=master)](https://travis-ci.org/rstudio-education/gradethis)
[![Codecov test coverage](https://codecov.io/gh/rstudio-education/gradethis/branch/master/graph/badge.svg)](https://codecov.io/gh/rstudio-education/gradethis?branch=master)
[![CRAN version](http://www.r-pkg.org/badges/version/gradethis)](https://cran.r-project.org/package=gradethis)
[![gradethis downloads per month](http://cranlogs.r-pkg.org/badges/gradethis)](http://www.rpackages.io/package/gradethis)
[![DOI](https://zenodo.org/badge/126734088.svg)](https://zenodo.org/badge/latestdoi/126734088)
<!-- badges: end -->

[![RStudio Community: Teaching](https://img.shields.io/badge/Community%20Support-Teaching-75aadb.svg?style=popout&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIyLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDYyNS45IDYyNS45IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA2MjUuOSA2MjUuOTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM3NUFBREI7fQoJLnN0MXtmaWxsOiM0RDRENEQ7fQoJLnN0MntmaWxsOiNGRkZGRkY7fQoJLnN0M3tmaWxsOnVybCgjU1ZHSURfMV8pO30KCS5zdDR7ZmlsbDp1cmwoI1NW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hpdGVfTGV0dGVycyI+CjwvZz4KPGcgaWQ9IlJfQmFsbCI+CjwvZz4KPC9zdmc+)](https://community.rstudio.com/new-topic?title=&category_id=13&tags=grader&body=%0A%0A%0A%20%20--------%0A%20%20%0A%20%20%3Csup%3EReferred%20here%20by%20%60grader%60%27s%20README%3C/sup%3E%0A&u=barret)
[![RStudio Ask a question: gradethis](https://img.shields.io/badge/Ask%20a%20question-gradethis-75aadb.svg?style=popout&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNjI1LjkgNjI1LjkiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDYyNS45IDYyNS45OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6Izc1QUFEQjt9Cgkuc3Qxe2ZpbGw6IzRENEQ0RDt9Cgkuc3Qye2ZpbGw6I0ZGRkZGRjt9Cgkuc3Qze2ZpbGw6dXJsKCNTVkdJRF8xXyk7fQoJLnN0NHtmaWxsOnVybCgjU1ZHSURfMl8pO30KCS5zdDV7ZmlsbDp1cmwoI1NWR0lEXzNfKTt9Cgkuc3Q2e2ZpbGw6dXJsKCNTVkdJRF80Xyk7fQoJLnN0N3tmaWxsOnVybCgjU1ZHSURfNV8pO30KCS5zdDh7ZmlsbDp1cmwoI1NWR0lEXzZfKTt9Cgkuc3Q5e2ZpbGw6dXJsKCNTVkdJRF83Xyk7fQoJLnN0MTB7ZmlsbDp1cmwoI1NWR0lEXzhfKTt9Cgkuc3QxMXtmaWxsOnVybCgjU1ZHSURfOV8pO30KCS5zdDEye2ZpbGw6dXJsKCNTVkdJRF8xMF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0A%20%20%0A%20%20%3Csup%3EReferred%20here%20by%20%60gradethis%60%27s%20README%3C/sup%3E%0A&u=barret)

Pairing with the `learnr` R package, `grader` provides multiple methods to grade `learnr` exercises. To learn more about `learnr` tutorials, please visit [https://rstudio.github.io/learnr/](https://rstudio.github.io/learnr/).
Pairing with the `learnr` R package, `gradethis` provides multiple methods to grade `learnr` exercises. To learn more about `learnr` tutorials, please visit [https://rstudio.github.io/learnr/](https://rstudio.github.io/learnr/).

## Installation

You can install the released version of grader from [CRAN](https://CRAN.R-project.org) with:
You can install the released version of gradethis from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("gradethis")
```

The development version of `gradethis` can be installed from GitHub with:

```r
remotes::install_github("rstudio-education/gradethis")
```

## Grading Demo <img src="man/figures/missing_sqrt.png" style="border: 1px solid black; box-shadow: 5px 5px 5px #eee; float: right;" width="50%">

To view the latest grading demo of the different checking methods:

``` r
library(gradethis)
gradethis::grading_demo()
gradethis::gradethis_demo())
```
8 changes: 4 additions & 4 deletions inst/rstudio/addins.dcf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Name: Insert exercise: check code
Name: Insert exercise: grade code
Description: Inserts code chunks to do code checking at the cursor position.
Binding: insert_exercise_check_code
Binding: insert_exercise_grade_code
Interactive: false

Name: Insert exercise: check result
Name: Insert exercise: grade result/conditions
Description: Inserts code chunks to do result checking at the cursor position.
Binding: insert_exercise_check_result
Binding: insert_exercise_grade_result_conditions
Interactive: false
Loading

0 comments on commit 9083fc8

Please sign in to comment.