You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the tutorials I write I often have essay questions. I have a custom question type for this purpose. But I realize that the current question_text() will support essays: it's just a matter of calling it with the right arguments, e.g.
```{r essay-14}
question_text("What do you think about this?",
answer("nice", correct=TRUE), allow_retry=TRUE, incorrect=NULL,
try_again_button = "Edit answer.", options=list(nrows=6))
```
I realize that this is not what question_text() was originally intended for, but it works fine and the change is very simple: change textInput to textAreaInput and perhaps allow the number of rows to be set via the question options.
question_ui_initialize.learnr_text <- function(question, value, ...) {
textAreaInput(
question$ids$answer,
label = question$question,
placeholder = question$options$placeholder,
value = value,
rows = question$options$nrows %||% 1 # Keep it small for backward compatibility
)
}
The text was updated successfully, but these errors were encountered:
In the tutorials I write I often have essay questions. I have a custom question type for this purpose. But I realize that the current
question_text()
will support essays: it's just a matter of calling it with the right arguments, e.g.I realize that this is not what
question_text()
was originally intended for, but it works fine and the change is very simple: changetextInput
totextAreaInput
and perhaps allow the number of rows to be set via the question options.The text was updated successfully, but these errors were encountered: