Closed (outdated)
Project:
Quiz
Version:
7.x-5.1
Component:
Code - Quiz core
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2017 at 20:19 UTC
Updated:
7 Aug 2024 at 20:56 UTC
Jump to comment: Most recent
I build custom code in my module to save a chosen answer in every question insert to quiz_node_results_answers table, i add new column 'option_answer'
function custom_quiz_form_alter(&$form,&$form_state,$form_id) {
//if ($form_id == 'quiz_question_answering_form') {
$quiz_forms = array(
'quiz_question_answering_form',
);
if (in_array($form_id, $quiz_forms)){
//form baru
$form['question']['option_answer'] = array(
'#title' => t('option'),
'#type' => 'select',
// '#submit' => array('custom_quiz_nextpage'),
//'#description' => 'Pilihan jawaban.',
'#options' => array(t('A'), t('B'), t('C'), t('D'),t('E')),
);
}
return $form;
}it appears in every question page during the quiz session, so how to save the select option form i made above insert to option_answer column in quiz_node_results_answers table ??
thanks
Comments
Comment #2
smustgrave commentedWith D7 approaching EOL soon I've started the process of triaging the D7 queue here. Since there hasn't been any movement on this going to close out.
If needed for 7.0.x (D10+) please reopen under there