Skip to content

Commit 2bd08ef

Browse files
committed
update
1 parent 2d9bb43 commit 2bd08ef

File tree

2 files changed

+122
-122
lines changed

2 files changed

+122
-122
lines changed

R/check_question.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ check_question <- function(answer,
9393

9494
answer <- if(!is.null(answer)){answer |> as.character() |> unique()}
9595

96-
if(class(options) == "list" & random_answer_order){
96+
if(inherits(options, "list") & random_answer_order){
9797
old_options <- options
9898
options <- sample(options)
9999
answer <- which(options %in% old_options[as.double(answer)])
@@ -124,7 +124,7 @@ check_question <- function(answer,
124124
htmltools::tags$input(type = type,
125125
name = glue::glue("answer_{q_id}"),
126126
id = glue::glue("answer_{q_id}_{i}"),
127-
value = ifelse(class(options[i]) == "list", i, options[i])),
127+
value = ifelse(inherits(options[i], "list"), i, options[i])),
128128
htmltools::tags$label(options[i]),
129129
if(alignment == "vertical"){htmltools::tags$br()})
130130
})
@@ -135,7 +135,7 @@ check_question <- function(answer,
135135
htmltools::tagList(
136136
htmltools::tags$input(type = type,
137137
id = glue::glue("answer_{q_id}_{i}"),
138-
value = ifelse(class(options[i]) == "list", i, options[i])),
138+
value = ifelse(inherits(options[i], "list"), i, options[i])),
139139
htmltools::tags$label(options[i]),
140140
if(alignment == "vertical"){htmltools::tags$br()})
141141
})
@@ -238,7 +238,7 @@ check_question <- function(answer,
238238

239239
condition <- lapply(seq_along(options), function(i){
240240

241-
if(class(options[i]) == "list"){
241+
if(inherits(options[i], "list")){
242242
condition_value <- tolower(i %in% answer)
243243
} else{
244244
condition_value <- tolower(options[i] %in% answer)

0 commit comments

Comments
 (0)