public function ClozeResponse::getReportFormResponse in Cloze 6
Same name and namespace in other branches
- 7 cloze.classes.inc \ClozeResponse::getReportFormResponse()
Implementation of getReportFormResponse
See also
QuizQuestionResponse#getReportFormResponse($showpoints, $showfeedback, $allow_scoring)
File
- ./
cloze.classes.inc, line 305 - The main classes for the short answer question type.
Class
- ClozeResponse
- Extension of QuizQuestionResponse
Code
public function getReportFormResponse($showpoints = TRUE, $showfeedback = TRUE, $allow_scoring = FALSE) {
$form = array();
$form['#theme'] = 'cloze_response_form';
if ($this->question && !empty($this->question->answers)) {
$answer = (object) current($this->question->answers);
}
else {
return $form;
}
$question = $this->question->body;
$correct_answer = _cloze_get_correct_answer($question);
$user_answer = _cloze_get_user_answer($question, $this->answer);
$form['answer'] = array(
'#type' => 'markup',
'#value' => theme('cloze_user_answer', $user_answer, $correct_answer),
);
return $form;
}