Define a question and the possible answers. The type of question is deduced.
Usage
define_question(qc, type, question, image, image_alt, answer, ...)
# S3 method for question_category
define_question(
qc,
type = "",
question = "",
image = "",
image_alt = "",
answer = "",
...
)
Arguments
- qc
A
question_category
object.- 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.
Details
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.
See also
Other question definition:
define_questions_from_csv()
,
define_questions_from_data_frame()
,
define_questions_from_excel()
,
generate_xml()
,
generate_xml_file()
,
question_category()
Examples
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.'
)