|
Posted by MS on 10/01/06 14:36
> I see this working from a list of some sort (array?), just think of
> programming LI tags you go deeper based on response.
>
> Here is a crude structrure
>
> Do you have hair, havehair
> -havehair?yes
> --What Color is it, haircolor
> --How Long is it, hairlength
> How tall are you, height
> -height?>0
> etc.
>
> You would have extra data like question ID, or indicator of question or
> conditional result, etc. table would be something like participant_ID,
> survey_question_id, survey_answer.
>
> As for premade programs, check out phpsurveyor, though if you have lots
> of questions it could be rather tedious to enter it in as well as do
> the survey through it.
>
> Larry
>
Thanks Larry
I saw a similar structure, and i am about to try out the following...
3 tables
Table (Question)
q_id
q_type (selection box, text, radio,checkbox)
q_order
q_question
Table(Answer)
a_id
a_qid (question q_id)
a_user_id
a_answer
Table (condition)
c_id
c_qid (question q_id)
c_pqid (a previous question id)
c_condition (this contains the condition that a_answer must be true to
display this question)
so the crude pseudo would be...
----------------------
get question records sorted on order
do while not end of questions
if question has not been answered{
get condtion records where c_qid = q_id
do while not end of conditions and condition_result != false
condition_result equals the test of the condition
end do conditions
if conditions are ok{
output this question and await an answer
}
}
end do questions
---------------------
If anyone has any thoughts on this please let me know.
MS
Navigation:
[Reply to this message]
|