I have a dilema. I have an HTML form which is in a test format, and the
form has multiple questions, and each question has multiple radio
buttons. I need a way to distinguish which question each set of radio
buttons belongs to, and I can't think of a way to do this.
This is basically what the form looks like:
Question #1
<input name="survey_results[answer]" type="radio" value="1" />
<input name="survey_results[answer]" type="radio" value="2" />
<input name="survey_results[answer]" type="radio" value="3" />
Question #2
<input name="survey_results[answer]" type="radio" value="1" />
<input name="survey_results[answer]" type="radio" value="2" />
<input name="survey_results[answer]" type="radio" value="3" />
And this is the database table the test results are being saved to:
survey_results
id : int
student_id : int
question_id : int
answer : int
Is there a way to somehow hardcode what the value of the question_id
field for each question should be? What can I do?