You are here

function ajax_quiz_instruction in Quiz 7

Same name and namespace in other branches
  1. 8.4 modules/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
  2. 6.6 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
  3. 6.4 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
  4. 7.6 modules/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
  5. 7.4 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'ajax_quiz_instruction'
ajax_quiz_menu in includes/ajax_quiz/ajax_quiz.module
Implements hook_menu().

File

includes/ajax_quiz/ajax_quiz.admin.inc, line 18

Code

function ajax_quiz_instruction($node) {

  // If this is an AJAX request, return the AJAX result.
  if (isset($_REQUEST['ajax_load_example']) && $_REQUEST['ajax_load_example']) {
    _ajax_quiz_get_questions($node);
  }
  else {
    drupal_add_js(drupal_get_path('module', 'ajax_quiz') . '/ajax_quiz.js');
    $output = '<div class="ajax-quiz-wrapper">';
    $output .= '<div class="ajax-quiz-description">' . $node->body . '</div>';
    $output .= '<div class="ajax-quiz-start">' . l(t('Start'), $_GET['q'], array(
      'attributes' => array(
        'class' => 'ajax-load-example',
      ),
    )) . '</div>';
    $output .= '</div>';
    return $output;
  }
}