You are here

function qformat_xml::get_qtype in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/question/format/xml/format.php \qformat_xml::get_qtype()

Turn the internal question code into a human readable form (The code used to be numeric, but this remains as some of the names don't match the new internal format)

Parameters

mixed type_id Internal code:

Return value

string question type string

1 call to qformat_xml::get_qtype()
qformat_xml::writequestion in includes/moodle/question/format/xml/format.php
Turns question into an xml segment

File

includes/moodle/question/format/xml/format.php, line 603

Class

qformat_xml

Code

function get_qtype($type_id) {
  switch ($type_id) {
    case TRUEFALSE:
      $name = 'truefalse';
      break;
    case MULTICHOICE:
      $name = 'multichoice';
      break;
    case SHORTANSWER:
      $name = 'shortanswer';
      break;
    case NUMERICAL:
      $name = 'numerical';
      break;
    case MATCH:
      $name = 'matching';
      break;
    case DESCRIPTION:
      $name = 'description';
      break;
    case MULTIANSWER:
      $name = 'cloze';
      break;
    case ESSAY:
      $name = 'essay';
      break;
    case CALCULATED:
      $name = 'calculated';
      break;
    default:
      $name = false;
  }
  return $name;
}