You are here

function qformat_qti2::get_qti_interaction_type in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/qti2/format.php \qformat_qti2::get_qti_interaction_type()

maps a moodle question type to a qti 2.0 question type

Parameters

int type_id - the moodle question type:

Return value

string qti 2.0 question type

1 call to qformat_qti2::get_qti_interaction_type()
qformat_qti2::add_qti_info in includes/moodle/question/format/qti2/format.php
adds qti metadata properties to the questions

File

includes/moodle/question/format/qti2/format.php, line 857

Class

qformat_qti2

Code

function get_qti_interaction_type($type_id) {
  switch ($type_id) {
    case TRUEFALSE:
      $name = 'choiceInteraction';
      break;
    case MULTICHOICE:
      $name = 'choiceInteraction';
      break;
    case SHORTANSWER:
      $name = 'textInteraction';
      break;
    case NUMERICAL:
      $name = 'textInteraction';
      break;
    case MATCH:
      $name = 'matchInteraction';
      break;
    case DESCRIPTION:
      $name = 'extendedTextInteraction';
      break;
    case MULTIANSWER:
      $name = 'textInteraction';
      break;
    default:
      $name = 'textInteraction';
  }
  return $name;
}