You are here

function _tidy_question in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/questionlib.php \_tidy_question()

Private function to factor common code out of get_question_options().


object $question the question to tidy.:

Return value

boolean true if successful, else false.

1 call to _tidy_question()
get_question_options in includes/moodle/lib/questionlib.php
Updates the question objects with question type specific information by calling {@link get_question_options()}


includes/moodle/lib/questionlib.php, line 759


function _tidy_question(&$question) {
  global $QTYPES;
  if (!array_key_exists($question->qtype, $QTYPES)) {
    $question->qtype = 'missingtype';
    $question->questiontext = '<p>' . get_string('warningmissingtype', 'quiz') . '</p>' . $question->questiontext;
  $question->name_prefix = question_make_name_prefix($question->id);
  return $QTYPES[$question->qtype]