-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Intent: use a similar API to the grader project, as described in rstudio/gradethis#11
In a nutshell, you should be able to write:
initialcontains the initial valuepass_if()fail_if()
For both pass_if() and fail_if(), support:
- character vector, and pass if exact match
- function in the traditional form
function(x)... - function using formula form
~. == ...
```{r iris, echo=FALSE}
question_parsons(
initial = c(
"iris",
"mutate(...)",
"summarize(...)",
"print()"
),
pass_if(
c(
"iris",
"mutate(...)",
"summarize(...)"
)
),
pass_if(...),
fail_if(
~length(.) < 2,
message = "Include at least two answers"
),
fail_if(
function(x){"print()" %in% x},
message = "You should not include print() in your answer"
),
fail_if(
function(x){x[1] != "iris"},
message = "Your solution should start with 'iris'"
)
)
```
Metadata
Metadata
Assignees
Labels
No labels