Skip to contents

Creates a question_category object.

Usage

question_category(
  category = "Default category",
  first_question_number = 1,
  copyright = "",
  license = "",
  correct_feedback = "Correct.",
  partially_correct_feedback = "Partially correct.",
  incorrect_feedback = "Incorrect.",
  adapt_images = FALSE,
  width = 800,
  height = 600,
  author = "",
  fraction = 0
)

Arguments

category

A string, category name.

first_question_number

An integer, first number to compose the question names.

A string, copyright text to be included in each question that is defined.

license

A string, license text to be included in each question that is defined.

correct_feedback

A string, feedback on correct answers to each question.

partially_correct_feedback

A string, feedback on partially correct answers to each question.

incorrect_feedback

A string, feedback on incorrect answers to each question.

adapt_images

A boolean, adapt the images so that they are a similar size.

width

A integer, width of each image.

height

A integer, height of each image.

author

A string, author name to be included in each question that is defined.

fraction

A number between 0 and 1.

Value

A question_category object.

Details

Defines a category of questions to be included in the Moodle question bank.

It allows us to define the name of the category, the copyright and license literals that will be added to each question, and the feedback literals for correct, partially correct and incorrect questions.

Each question can include an image after the text. We can also configure if we want to automatically transform the images so that they have a standard size that we can also indicate.

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.

Examples


qc <- question_category(category = 'Initial test')