You are here

public function QuizQuestionResponse::getReportFormScore in Quiz 7.6

Same name and namespace in other branches
  1. 6.4 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportFormScore()
  2. 7 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportFormScore()
  3. 7.4 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportFormScore()
  4. 7.5 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportFormScore()

Implementation of getReportFormScore

See also

QuizQuestionResponse#getReportFormScore()

1 call to QuizQuestionResponse::getReportFormScore()
QuizQuestionResponse::getReportForm in question_types/quiz_question/quiz_question.core.inc
Creates the report form for the admin pages, and for when a user gets feedback after answering questions.

File

question_types/quiz_question/quiz_question.core.inc, line 863
Classes used in the Quiz Question module.

Class

QuizQuestionResponse
Each question type must store its own response data and be able to calculate a score for that data.

Code

public function getReportFormScore() {
  $score = $this
    ->isEvaluated() ? $this
    ->getScore() : '';
  return array(
    '#title' => 'Enter score',
    '#type' => 'textfield',
    '#default_value' => $score,
    '#size' => 3,
    '#maxlength' => 3,
    '#attributes' => array(
      'class' => array(
        'quiz-report-score',
      ),
    ),
    '#element_validate' => array(
      'element_validate_integer',
    ),
    '#required' => TRUE,
    '#field_suffix' => '/ ' . $this
      ->getMaxScore(),
  );
}