You are here

public function ShortAnswerResponse::getReportFormScore in Quiz 7

Same name and namespace in other branches
  1. 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerResponse::getReportFormScore()
  2. 7.4 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 466
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 && $this->question->correct_answer_evaluation == ShortAnswerQuestion::ANSWER_MANUAL) {
    return array(
      '#type' => 'textfield',
      '#default_value' => $score,
      '#size' => 3,
      '#maxlength' => 3,
      '#attributes' => array(
        'class' => 'quiz-report-score',
      ),
    );
  }
  else {
    return array(
      '#markup' => $score,
    );
  }
}