generate_question_body: Generate the question body

View source: R/format_questions.R

generate_question_bodyR Documentation

Generate the question body

Description

Creates the body of the question based on its type and additional parameters such as feedback and orientation.

Usage

generate_question_body(
  type,
  answer,
  a_values,
  fb_correct,
  fb_incorrect,
  fb_partially,
  orientation,
  fb_answer,
  fb_a_values,
  image,
  image_alt,
  fraction
)

Arguments

type

A string, the question type.

answer

A string or vector, the correct answer(s) for the question.

a_values

A vector, additional answers for the question.

fb_correct

A string, feedback for correct answers.

fb_incorrect

A string, feedback for incorrect answers.

fb_partially

A string, feedback for partially correct answers.

orientation

A string, 'v' or 'h'.

fb_answer

A string, answer feedback.

fb_a_values

A vector, rest of answer feedback.

image

Path to an image file associated with the question.

image_alt

Alternative text describing the image for accessibility.

fraction

A number between 0 and 1.

Value

A string containing the question body in XML format.


moodef documentation built on April 12, 2025, 1:42 a.m.