function quiz_generate_form_submit in Quiz 8.5
Same name and namespace in other branches
- 8.6 quiz.devel.inc \quiz_generate_form_submit()
- 7.6 quiz.devel.inc \quiz_generate_form_submit()
- 7.5 quiz.devel.inc \quiz_generate_form_submit()
- 6.x quiz.devel.inc \quiz_generate_form_submit()
Submit callback for devel_generate support.
File
- ./
quiz.devel.inc, line 69
Code
function quiz_generate_form_submit($form, &$form_state) {
module_load_include('inc', 'devel_generate', 'devel_generate.fields');
module_load_include('inc', 'devel_generate', 'devel_generate');
$quiz_types = array_filter($form_state['values']['quiz_types']);
$quiz_limit = $form_state['values']['quiz_limit'];
$question_types = array_filter($form_state['values']['quiz_question_types']);
$question_limit = $form_state['values']['quiz_question_limit'];
$quiz_results = $form_state['values']['quiz_results'];
for ($i = 1; $i <= $quiz_limit; $i++) {
quiz_generate($quiz_type = array_rand($quiz_types), $question_types, $question_limit, $quiz_results);
}
}