Each row in the Excel file is interpreted as a question. We only have to define the columns that we are going to use, the rest of the columns are taken by default.
Usage
define_questions_from_excel(qc, file, sheet_index, sheet_name)
# S3 method for question_category
define_questions_from_excel(qc, file, sheet_index = NULL, sheet_name = NULL)
Arguments
- qc
A
question_category
object.- file
A string, name of an Excel file.
- sheet_index
A number, sheet index in the workbook.
- sheet_name
A string, sheet name.
Details
In addition to the file, we can indicate the sheet by its name or index. If we do not indicate anything, it considers the first sheet.
For answers where a vector is required, "<|>" is used as a separator of the vector elements.
See also
Other question definition:
define_question()
,
define_questions_from_csv()
,
define_questions_from_data_frame()
,
generate_xml()
,
generate_xml_file()
,
question_category()
Examples
# \donttest{
file <- system.file("extdata", "questions.xlsx", package = "moodef")
qc <-
question_category(category = 'Initial test', adapt_images = TRUE) |>
define_questions_from_excel(file = file)
# }