public function LongAnswerResponse::getReportFormScore in Quiz 8.4
Implementation of getReportFormScore
Overrides QuizQuestionResponse::getReportFormScore
See also
QuizQuestionResponse#getReportFormScore($showpoints, $showfeedback, $allow_scoring)
File
- question_types/
long_answer/ lib/ Drupal/ long_answer/ LongAnswerResponse.php, line 223
Class
- LongAnswerResponse
- Extension of QuizQuestionResponse
Namespace
Drupal\long_answerCode
public function getReportFormScore($showfeedback = TRUE, $showpoints = TRUE, $allow_scoring = FALSE) {
// The score will be shown as a questionmark if the question haven't been scored already
$score = $this
->isEvaluated() ? $this
->getScore() : '?';
// We show a textfield if the quiz shall be scored. Markup otherwise
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,
);
}
}