View source: R/question_category.R
define_question | R Documentation |
Define a question and the possible answers. The type of question is deduced.
define_question(qc, type, question, image, image_alt, answer, ...)
## S3 method for class 'question_category'
define_question(
qc,
type = "",
question = "",
image = "",
image_alt = "",
answer = "",
...
)
qc |
A |
type |
A string, question type (if needed). |
question |
A string, statement of the question. |
image |
A string, optional, image file to include in the question. |
image_alt |
A string, description of the image to include in the question. |
answer |
A string, correct answer to the question. |
... |
A string, rest of the answers to the question. |
If we include an image in the question, we must also include text in the alt
field associated with it.
After the correct answer, we can indicate as many answers as we want, if we do not indicate all the parameters, we have to give each answer a parameter name different from the rest of the parameter names.
A question_category
.
Other question definition functions:
define_extended_question()
,
define_questions_from_csv()
,
define_questions_from_data_frame()
,
define_questions_from_excel()
,
generate_xml()
,
generate_xml_file()
,
question_category()
qc <- question_category(category = 'Initial test') |>
define_question(
question = 'What are the basic arithmetic operations?',
answer = 'Addition, subtraction, multiplication and division.',
a_1 = 'Addition and subtraction.',
a_2 = 'Addition, subtraction, multiplication, division and square root.'
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.