This function allows users to define an extended question, including metadata, feedback and optional image data.
define_extended_question(
qc,
category,
type,
fraction,
id,
name,
author,
fb_general,
fb_correct,
fb_partially,
fb_incorrect,
question,
image,
image_alt,
answer,
a_1,
a_2,
a_3,
a_4,
a_5,
a_6,
a_7,
fb_answer,
fb_a_1,
fb_a_2,
fb_a_3,
fb_a_4,
fb_a_5,
fb_a_6,
fb_a_7,
tag_1,
tag_2,
tag_3,
tag_4,
tag_5,
tag_6,
tag_7,
tag_8,
tag_9
)# S3 method for question_category
define_extended_question(
qc,
category = "",
type = "",
fraction = 0,
id = "",
name = "",
author = "",
fb_general = "",
fb_correct = "",
fb_partially = "",
fb_incorrect = "",
question = "",
image = "",
image_alt = "",
answer = "",
a_1 = "",
a_2 = "",
a_3 = "",
a_4 = "",
a_5 = "",
a_6 = "",
a_7 = "",
fb_answer = "",
fb_a_1 = "",
fb_a_2 = "",
fb_a_3 = "",
fb_a_4 = "",
fb_a_5 = "",
fb_a_6 = "",
fb_a_7 = "",
tag_1 = "",
tag_2 = "",
tag_3 = "",
tag_4 = "",
tag_5 = "",
tag_6 = "",
tag_7 = "",
tag_8 = "",
tag_9 = ""
)
Returns the updated question category object.
A question category object. It should have a questions
data frame
where new questions will be added.
A character string specifying the category of the question.
A character string indicating the type of the question.
A number between 0 and 1.
A unique identifier for the question.
A character string representing the name of the question.
The name of the author of the question.
General feedback for the question.
Feedback displayed when the correct answer is selected.
Feedback displayed for partially correct answers.
Feedback displayed for incorrect answers.
The text of the question.
Path to an image file associated with the question.
Alternative text describing the image for accessibility. Required if an image is provided.
The correct answer to the question.
Additional possible answer.
Additional possible answer.
Additional possible answer.
Additional possible answer.
Additional possible answer.
Additional possible answer.
Additional possible answer.
Feedback for the correct answer.
Feedback for additional answer.
Feedback for additional answer.
Feedback for additional answer.
Feedback for additional answer.
Feedback for additional answer.
Feedback for additional answer.
Feedback for additional answer.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Tag to categorize the question.
Parameter values that are not defined are taken from the category definition, if they are defined there.
The fraction
attribute is used in various question types to determine how a
specific answer impacts the question's score. Specifically, for incorrect answers
in the multichoice
and truefalse
types, the value calculated by dividing
fraction
by the number of incorrect answers available is considered as the
amount deducted in case of an incorrect response.
In the example provided, we have intentionally used the same structure as in
the define_question()
function to demonstrate that any parameters not needed
do not need to be explicitly defined.
Other question definition functions:
define_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_extended_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.'
)
Run the code above in your browser using DataLab