You are here

function qformat_gift::check_answer_count in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/gift/format.php \qformat_gift::check_answer_count()
1 call to qformat_gift::check_answer_count()
qformat_gift::readquestion in includes/moodle/question/format/gift/format.php
Given the data known to define a question in this format, this function converts it into a question object suitable for processing and insertion into Moodle.

File

includes/moodle/question/format/gift/format.php, line 103

Class

qformat_gift
@package questionbank @subpackage importexport

Code

function check_answer_count($min, $answers, $text) {
  $countanswers = count($answers);
  if ($countanswers < $min) {
    $importminerror = get_string('importminerror', 'quiz');
    $this
      ->error($importminerror, $text);
    return false;
  }
  return true;
}