You are here

class QuizQuestionH5P in Quiz 7.4

Hierarchy

Expanded class hierarchy of QuizQuestionH5P

1 string reference to 'QuizQuestionH5P'
quiz_h5p_quiz_question_info in question_types/quiz_h5p/quiz_h5p.module
Implements hook_quiz_question_info().

File

question_types/quiz_h5p/QuizQuestionH5P.class.inc, line 2

View source
class QuizQuestionH5P extends QuizQuestion {
  public function getCreationForm(array &$form_state = NULL) {
    return array();
  }
  public function getMaximumScore() {
    return variable_get('h5p_quiz_question_max_score', 10);
  }
  public function saveNodeProperties($is_new = FALSE) {
  }
  public function validateNode(array &$form) {
  }
  public function getAnsweringForm(array $form_state = NULL, $result_id) {
    drupal_add_js(drupal_get_path('module', 'quiz_h5p') . '/quiz_h5p.js');
    return array(
      'tries' => array(
        '#type' => 'hidden',
        '#default_value' => 1,
        '#attributes' => array(
          'id' => 'quiz-h5p-result-key',
        ),
      ),
    );
  }
  public function getNodeForm(array &$form_state = NULL) {
    $form = parent::getNodeForm($form_state);
    unset($form['title']);
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QuizQuestion::$node public property The current node for this question.
QuizQuestion::$nodeProperties public property
QuizQuestion::autoUpdateMaxScore protected function This may be overridden in subclasses. If it returns true, it means the max_score is updated for all occurrences of this question in quizzes. 1
QuizQuestion::delete public function Delete question data from the database. 7
QuizQuestion::getBodyFieldTitle public function Allow question types to override the body field title 3
QuizQuestion::getFormat protected function Utility function that returns the format of the node body
QuizQuestion::getNodeProperties public function Getter function returning properties to be loaded when the node is loaded. 7
QuizQuestion::getNodeView public function Retrieve information relevant for viewing the node. 6
QuizQuestion::hasBeenAnswered public function Finds out if a question has been answered or not
QuizQuestion::save public function Responsible for handling insert/update of question-specific data. This is typically called from within the Node API, so there is no need to save the node.
QuizQuestion::saveRelationships function Handle the add to quiz part of the quiz_question_form
QuizQuestion::viewCanRevealCorrect public function Determines if the user can view the correct answers
QuizQuestion::__construct public function QuizQuestion constructor stores the node object. 2
QuizQuestionH5P::getAnsweringForm public function Get the form through which the user will answer the question. Overrides QuizQuestion::getAnsweringForm
QuizQuestionH5P::getCreationForm public function Get the form used to create a new question. Overrides QuizQuestion::getCreationForm
QuizQuestionH5P::getMaximumScore public function Get the maximum possible score for this question. Overrides QuizQuestion::getMaximumScore
QuizQuestionH5P::getNodeForm public function Returns a node form to quiz_question_form Overrides QuizQuestion::getNodeForm
QuizQuestionH5P::saveNodeProperties public function Save question type specific node properties Overrides QuizQuestion::saveNodeProperties
QuizQuestionH5P::validateNode public function Provides validation for question before it is created. Overrides QuizQuestion::validateNode