You are here

public function QuizQuestionResponse::getReportForm in Quiz 8.4

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 call to QuizQuestionResponse::getReportForm()
ClozeResponse::getReportForm in question_types/cloze/lib/Drupal/cloze/ClozeResponse.php
Implementation of getReportForm()
1 method overrides QuizQuestionResponse::getReportForm()
ClozeResponse::getReportForm in question_types/cloze/lib/Drupal/cloze/ClozeResponse.php
Implementation of getReportForm()

File

question_types/quiz_question/lib/Drupal/quiz_question/QuizQuestionResponse.php, line 196

Class

QuizQuestionResponse

Namespace

Drupal\quiz_question

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
      ->id(),
  );
  $form['vid'] = array(
    '#type' => 'value',
    '#value' => $this->question
      ->getRevisionId(),
  );
  $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;
}