You are here

public function ShortAnswerResponse::getReportFormScore in Quiz 7.4

Same name and namespace in other branches
  1. 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::getReportFormScore()
  2. 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::getReportFormScore()

Implementation of getReportFormScore

Overrides QuizQuestionResponse::getReportFormScore

See also

QuizQuestionResponse#getReportFormScore($showpoints, $showfeedback, $allow_scoring)

File

question_types/short_answer/short_answer.classes.inc, line 490
The main classes for the short answer question type.

Class

ShortAnswerResponse
Extension of QuizQuestionResponse

Code

public function getReportFormScore($showfeedback = TRUE, $showpoints = TRUE, $allow_scoring = FALSE) {
  $score = $this
    ->isEvaluated() ? $this
    ->getScore() : '?';
  if (quiz_access_to_score() && $allow_scoring) {
    return array(
      '#type' => 'textfield',
      '#default_value' => $score,
      '#size' => 3,
      '#maxlength' => 3,
      '#attributes' => array(
        'class' => array(
          'quiz-report-score',
        ),
      ),
    );
  }
  else {
    return array(
      '#markup' => $score,
    );
  }
}