public function QuizQuestionResponse::getScore in Quiz 7.5
Same name and namespace in other branches
- 6.6 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
- 6.3 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
- 6.4 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
- 6.5 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
- 7.6 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
- 7 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
- 7.4 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getScore()
Get the score of this question response.
Parameters
bool $weight_adjusted: If the score should be scaled based on the Quiz question max score.
Return value
int The max score of this question response.
6 calls to QuizQuestionResponse::getScore()
- LongAnswerResponse::getFeedbackValues in question_types/
long_answer/ long_answer.classes.inc - Implementation of getFeedbackValues().
- QuizQuestionResponse::getReport in question_types/
quiz_question/ quiz_question.core.inc - Get data suitable for reporting a user's score on the question.
- QuizQuestionResponse::getReportFormScore in question_types/
quiz_question/ quiz_question.core.inc - Implementation of getReportFormScore().
- QuizQuestionResponse::isCorrect in question_types/
quiz_question/ quiz_question.core.inc - Check to see if the answer is marked as correct.
- QuizQuestionResponse::toBareObject in question_types/
quiz_question/ quiz_question.core.inc - Represent the response as a stdClass object.
File
- question_types/
quiz_question/ quiz_question.core.inc, line 602 - 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 getScore($weight_adjusted = TRUE) {
if ($weight_adjusted) {
$ratio = $this
->getWeightedRatio();
return $this
->score() * $ratio;
}
return $this
->score();
}