You are here

function quiz_questions_page in Quiz 7.5

Creates a form for quiz questions.

Handles the manage questions tab.

Parameters

$node: The quiz node we are managing questions for.

Return value

String containing the form.

1 string reference to 'quiz_questions_page'
quiz_menu in ./quiz.module
Implements hook_menu().

File

./quiz.admin.inc, line 339
Administrator interface for Quiz module.

Code

function quiz_questions_page($node) {
  if ($node->randomization < 3) {
    $mq_form = drupal_get_form('quiz_questions_form', $node);
    $manage_questions = drupal_render($mq_form);
    $question_bank = views_get_view('quiz_question_bank')
      ->preview();

    // Insert into vert tabs.
    $form['vert_tabs'] = array(
      '#type' => 'vertical_tabs',
      '#weight' => 0,
    );
    $form['vert_tabs']['question_admin'] = array(
      '#type' => 'fieldset',
      '#title' => t('Manage questions'),
      '#value' => $manage_questions,
    );
    $form['vert_tabs']['global_questions'] = array(
      '#type' => 'fieldset',
      '#title' => t('Question bank'),
      '#value' => $question_bank,
    );
  }
  else {
    $form = drupal_get_form('quiz_categorized_form', $node);
  }
  $variables = array(
    'node' => $node,
    'form' => $form,
  );
  return theme('quiz_questions_page', $variables);
}