Hi
I have a survey where the questions to be asked vary with the age of the pupil completing the survey.
So when a pupil logs in, I get their age and use it to change the set of questions I ask.
Now for the fun part, the answers to these questions is a choice of 4 radio buttons, all from a table.
BUT when we have the questions for the younger kids, there are only 3 answers and they are from a different table.
How can I change the source table for the radio buttons, depending on the length of the variable stored in
$_SESSION["yg"]
so far I have used this
If(2==strlen($_SESSION["yg"]))
$question_table="v_q1";
else
$question_table="v_q1_ks3";
because the split for the questions is at the end of year 9.
The two tables for the answers are
v_ratings and v_ratings_ks3
so I was looking at something like
If(2==strlen($_SESSION["yg"]))
$choices_table="v_ratings";
else
$choices_table="v_ratings_ks3";
but how do I base the radio button source on the session variable?
Any ideas please anyone?