You are here

function _multichoice_is_personality_question in Quiz 6.2

Same name and namespace in other branches
  1. 6.6 question_types/multichoice/multichoice.module \_multichoice_is_personality_question()
  2. 6.3 question_types/multichoice/multichoice.module \_multichoice_is_personality_question()
  3. 6.5 question_types/multichoice/multichoice.module \_multichoice_is_personality_question()

Find out if this question is a personality-style question.

Parameters

$node: A multichoice node.

Return value

boolean TRUE if this is a personality question, FALSE otherwise.

1 call to _multichoice_is_personality_question()
multichoice_form in ./multichoice.module
Implementation of hook_form(). Admin for create/update of a multichoice question.

File

./multichoice.module, line 894
Multiple choice question type for the Quiz module.

Code

function _multichoice_is_personality_question($node) {

  /*
   * We need some way to find this out. So far, the best candidate seems to be
   * this: Only personality questions appear to have result options.
   *
   * This does illustrate a defect in the whole personality implementation, though.
   * Personality questions are bound (via result_option) to the quiz in which they
   * were created. This stands in start contrast to other multichoice questions.
   */
  return $node->answers && count($node->answers) > 0 && $node->answers[0]['result_option'] > 0;
}