You are here

function qformat_qti2::get_qti_solution_available 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_solution_available()

returns whether or not a solution is available for a given question

The results are based on whether or not Moodle stores answers for the given question type

Parameters

object $question:

Return value

boolean

1 call to qformat_qti2::get_qti_solution_available()
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 829

Class

qformat_qti2

Code

function get_qti_solution_available($question) {
  switch ($question->qtype) {
    case TRUEFALSE:
      return 'true';
    case MULTICHOICE:
      return 'true';
    case SHORTANSWER:
      return 'true';
    case NUMERICAL:
      return 'true';
    case MATCH:
      return 'true';
    case DESCRIPTION:
      return 'false';
    case MULTIANSWER:
      return 'true';
    default:
      return 'true';
  }
}