You are here

public function ShortAnswerResponse::getReportFormScore in Quiz 8.4

Implementation of getReportFormScore

Overrides QuizQuestionResponse::getReportFormScore

See also

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

File

question_types/short_answer/lib/Drupal/short_answer/ShortAnswerResponse.php, line 244
The main classes for the short answer response.

Class

ShortAnswerResponse
Extension of QuizQuestionResponse

Namespace

Drupal\short_answer

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,
    );
  }
}