function ajax_quiz_instruction in Quiz 7.6
Same name and namespace in other branches
- 8.4 modules/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
- 6.6 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
- 6.4 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
- 7 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
- 7.4 includes/ajax_quiz/ajax_quiz.admin.inc \ajax_quiz_instruction()
@todo Please document this function.
See also
1 string reference to 'ajax_quiz_instruction'
- ajax_quiz_menu in modules/
ajax_quiz/ ajax_quiz.module - Implements hook_menu().
File
- modules/
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;
}
}