CavalryJim wrote in post #1033545:
> On Nov 24, 6:44am, "Guru R." <li...@ruby-forum.com> wrote:
>> I am new to ruby on rails.i need to create a page with a question and
>> multiple choice answers with radio button to answer .i ve stored the
>> database in a table with one column ha the question and the other four
>> with answers. i ve to populate the fifth column with the answer selected
>> with the radio button. is this way approprite for me to go and please to
>> guide how to create the radio buttons and how to populate the fifth
>> column with the selected answer.
>>
>> --
>> Posted viahttp://www.ruby-forum.com/.
>
> I do not think the structure you described will accomplish what you
> want.  Capturing the selected answer in the same table row as the
> question will mean the survey can only have one participant, as
> subsequent answer selections would overwrite the previous answer.  You
> will likely want to create a survey table, user table, and a
> user_survey table that captures each participant's selections.  The
> surveys will have many user through the user_survey relationship and
> the same for users if they can participate in multiple surveys.

hi calvin
 thank you for ur reply
 i ve changed my design such that the selected answer does not get saved 
in the database.i decided to compare the input from the radio button to 
the correct answer and store the scores in the session level varaible.
but i m  not able to read the radio buttons input with the 
params[:query] in the same view where the radio button is designed.where 
shold this params[:query] be used. if it has to be used in the 
controller how can it be  called. if there a special kind of form_tag 
for the radio buttons getting the input ion a session level [variable]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to