function quiz_result_form in Quiz 7.6
Same name and namespace in other branches
- 7.5 quiz.module \quiz_result_form()
Quiz result edit form.
File
- ./
quiz.module, line 3950 - quiz.module Main file for the Quiz module.
Code
function quiz_result_form($form, &$form_state, $quiz_result) {
field_attach_form('quiz_result', $quiz_result, $form, $form_state);
$quiz = node_load($quiz_result->nid, $quiz_result->vid);
if (!empty($quiz->build_on_last) && QuizResultController::findOldResult($quiz_result)) {
$form['build_on_last'] = array(
'#title' => t('Keep answers from last attempt?'),
'#type' => 'radios',
'#options' => array(
'' => t('No answers'),
'correct' => t('Only correct answers'),
'all' => t('All answers'),
),
'#default_value' => $quiz->build_on_last,
'#description' => t('You can choose to keep previous answers or start a new attempt.'),
'#access' => $quiz->build_on_last,
);
}
$form['actions'] = array(
'#type' => 'actions',
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Start @quiz', array(
'@quiz' => QUIZ_NAME,
)),
);
return $form;
}