You are here

function quiz_start_quiz_button_form in Quiz 8.4

Same name and namespace in other branches
  1. 6.4 quiz.module \quiz_start_quiz_button_form()
  2. 7 quiz.module \quiz_start_quiz_button_form()
  3. 7.4 quiz.module \quiz_start_quiz_button_form()

Helper function for hook_view().

Returns a button to use as a link to start taking the quiz.

Parameters

$form_state: Form state array.

$node: The quiz node.

Return value

Form with a button linking to the take tab.

1 string reference to 'quiz_start_quiz_button_form'
quiz_node_view in ./quiz.module
Implements hook_node_view().

File

./quiz.module, line 1250
Quiz Module

Code

function quiz_start_quiz_button_form($form, &$form_state, EntityInterface $node) {
  $form = array();
  $form['#action'] = url("node/" . $node
    ->id() . "/take");
  $form['button'] = array(
    '#type' => 'button',
    '#value' => t('Start quiz'),
  );
  return $form;
}