Skip to content

Commit

Permalink
Fix cloze answer formats
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Dec 10, 2023
1 parent 9f5b834 commit b3cc1b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/answer.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ answer_shortanswer <- function(
sprintf(
"`{%i:SHORTANSWER%s:%s}`{=html}",
weight,
paste0("%", options/weight*100, "%", names(options), "#", feedback, collapse = "~"),
if(case_sensitive) "_C" else ""
if(case_sensitive) "_C" else "",
paste0("%", options/weight*100, "%", names(options), "#", feedback, collapse = "~")
)
}

Expand All @@ -19,6 +19,7 @@ answer_multichoice <- function(
feedback = ifelse(options == weight, "Correct", ifelse(options == 0, "Incorrect", "Partially correct")),
type = c("vertical", "horizontal"),
shuffle = FALSE) {
type <- match.arg(type)
sprintf(
"`{%i:MULTIRESPONSE%s%s%s:%s}`{=html}",
weight,
Expand All @@ -35,6 +36,7 @@ answer_singlechoice <- function(
feedback = ifelse(options == weight, "Correct", ifelse(options == 0, "Incorrect", "Partially correct")),
type = c("dropdown", "vertical", "horizontal"),
shuffle = FALSE) {
type <- match.arg(type)
sprintf(
"`{%i:MULTICHOICE%s%s:%s}`{=html}",
weight,
Expand Down

0 comments on commit b3cc1b0

Please sign in to comment.