You are here

public function QuizQuestionResponse::getReportForm in Quiz 6.4

Same name and namespace in other branches
  1. 7.6 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportForm()
  2. 7 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportForm()
  3. 7.4 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportForm()
  4. 7.5 question_types/quiz_question/quiz_question.core.inc \QuizQuestionResponse::getReportForm()

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

1 method overrides QuizQuestionResponse::getReportForm()
QuizDirectionsResponse::getReportForm in question_types/quiz_directions/quiz_directions.classes.inc
Implementation of getReportForm

File

question_types/quiz_question/quiz_question.core.inc, line 808
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;
  return $form;
}