function _quiz_results_mr_add_filter_fields in Quiz 8.4
Same name and namespace in other branches
- 6.4 quiz.admin.inc \_quiz_results_mr_add_filter_fields()
- 7 quiz.admin.inc \_quiz_results_mr_add_filter_fields()
- 7.4 quiz.admin.inc \_quiz_results_mr_add_filter_fields()
Adds form items for the filters to the browser form.
Parameters
$browser: FAPI form array
1 call to _quiz_results_mr_add_filter_fields()
- quiz_results_manage_results_form in ./
quiz.admin.inc - Form for searching after and manipulating results for a quiz
File
- ./
quiz.admin.inc, line 1958 - Administrator interface for Quiz module.
Code
function _quiz_results_mr_add_filter_fields(&$browser, $quiz) {
// Create options array for the changed filter
$browser['filters'] = array();
$filters =& $browser['filters'];
$filters['all'] = array(
'#type' => 'checkbox',
);
$pre = 'quiz_results_mr_';
$filters['name'] = array(
'#type' => 'textfield',
'#size' => 12,
'#default_value' => isset($_SESSION[$pre . 'name']) ? $_SESSION[$pre . 'name'] : '',
'#ajax' => array(
'callback' => 'quiz_browser_body_callback',
'effect' => 'slide',
'wrapper' => 'quiz-browser-body',
'method' => 'replace',
'event' => 'doneTyping',
),
);
$filters['started'] = array(
'#type' => 'select',
'#options' => _quiz_get_time_interval_options(),
'#default_value' => isset($_SESSION[$pre . 'started']) ? $_SESSION[$pre . 'started'] : '',
'#ajax' => array(
'callback' => 'quiz_browser_body_callback',
'effect' => 'slide',
'wrapper' => 'quiz-browser-body',
'method' => 'replace',
),
);
$filters['finished'] = array(
'#type' => 'select',
'#options' => _quiz_get_time_interval_options(),
'#default_value' => isset($_SESSION[$pre . 'finished']) ? $_SESSION[$pre . 'finished'] : '',
'#ajax' => array(
'callback' => 'quiz_browser_body_callback',
'effect' => 'slide',
'wrapper' => 'quiz-browser-body',
'method' => 'replace',
),
);
$filters['score'] = array(
'#type' => 'select',
'#options' => _quiz_get_score_options(),
'#default_value' => isset($_SESSION[$pre . 'score']) ? $_SESSION[$pre . 'score'] : '',
'#ajax' => array(
'callback' => 'quiz_browser_body_callback',
'effect' => 'slide',
'wrapper' => 'quiz-browser-body',
'method' => 'replace',
),
);
$filters['evaluated'] = array(
'#type' => 'select',
'#options' => array(
'def' => t('No filter'),
'1' => t('Yes'),
'0' => t('No'),
),
'#default_value' => isset($_SESSION[$pre . 'evaluated']) ? $_SESSION[$pre . 'evaluated'] : '',
'#ajax' => array(
'callback' => 'quiz_browser_body_callback',
'effect' => 'slide',
'wrapper' => 'quiz-browser-body',
'method' => 'replace',
),
);
}