public function QuizQuestionResponse::getReportForm in OG Quiz 7
Creates the report form for the admin pages, and for when a user gets feedback after answering questions.
The report is a form to allow editing scores and the likes while viewing the report form
Parameters
$showpoints:
$showfeedback:
$allow_scoring:
Return value
$form Drupal form array
File
- includes/
og_quiz_question.php, line 1000 - 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 getReportForm($showpoints = TRUE, $showfeedback = TRUE, $allow_scoring = FALSE) {
/*
* Add general data, and data from the question type implementation
*/
$form = array();
$form['nid'] = array(
'#type' => 'value',
'#value' => $this->question->nid,
);
$form['vid'] = array(
'#type' => 'value',
'#value' => $this->question->vid,
);
$form['rid'] = array(
'#type' => 'value',
'#value' => $this->rid,
);
if ($submit = $this
->getReportFormSubmit($showpoints, $showfeedback, $allow_scoring)) {
$form['submit'] = array(
'#type' => 'value',
'#value' => $submit,
);
}
if ($validate = $this
->getReportFormValidate($showpoints, $showfeedback, $allow_scoring)) {
$form['validate'] = array(
'#type' => 'value',
'#value' => $validate,
);
}
$form['question'] = $this
->getReportFormQuestion($showpoints, $showfeedback);
$form['score'] = $this
->getReportFormScore($showpoints, $showfeedback, $allow_scoring);
$form['answer_feedback'] = $this
->getReportFormAnswerFeedback($showpoints, $showfeedback, $allow_scoring);
$form['max_score'] = array(
'#type' => 'value',
'#value' => $this
->getMaxScore(),
);
$form['response'] = $this
->getReportFormResponse($showpoints, $showfeedback, $allow_scoring);
$form['#theme'] = $this
->getReportFormTheme($showpoints, $showfeedback);
$form['#is_correct'] = $this
->isCorrect();
$form['#is_evaluated'] = $this
->isEvaluated();
$form['#is_skipped'] = $this->is_skipped;
$form['#is_doubtful'] = $this->is_doubtful;
return $form;
}