You are here

function quiz_get_questions_type in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 quiz.module \quiz_get_questions_type()

File

./quiz.module, line 2740
Quiz Module

Code

function quiz_get_questions_type($op = 'enabled') {
  $quiz_questions_types = array(
    'matching' => 'matching',
    'multichoice' => 'multichoice',
    'quiz_directions' => 'quiz_directions',
    'quiz_question' => 'quiz_question',
    'short_answer' => 'short_answer',
    'long_answer' => 'long_answer',
  );
  switch ($op) {
    case 'all':
      $list = $quiz_questions_types;
      break;
    case 'enabled':
      $list = array_intersect($quiz_questions_types, module_list());
      break;
    case 'disabled':
      $list = array_diff($quiz_questions_types, module_list());
      break;
  }
  if (in_array('quiz_question', $list)) {
    $list['quiz_question'] = 'true_false';
  }
  return $list;
}