library(learnr) library(gradethis) library(tidyverse) library(reticulate) library(gradethispython) # exercise checker for R exercises tutorial_options(exercise.checker = gradethis::grade_learnr) d <- 2
```{python df} mpg = r.mpg
The expected answer is the `mpg` dataset from R. This exercise uses `gradethispython::py_grade_learnr` for checking solution. ```{python ex1, exercise=TRUE, exercise.setup = "df", exercise.checker = gradethispython::py_grade_learnr} mpg
```{python ex1-check} python_grade_result( python_pass_if(mpg, "You also got the mpg dataframe!"), python_fail_if(None, "Remember to return the right dataset!"), )
```{python ex1-solution} mpg
mpg
gradethis::grade_code( correct = "Good job!" )
mpg
gradethis::grade_result( pass_if(~ identical(.result, mpg), "You also got the mpg dataframe"), fail_if(~ TRUE, "Oops!") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.