What are you specifying for the value of the radio button? You will want to
use that to find the correct answer. Maybe something like this:

<input type="radio" name="#qid#" value="yes">
<input type="radio" name="#qid#" value="no">

Let's say that #qid# above evaluates to 5. When you process the form you
will have a form variable #form.5# that equals yes or no depending on what
the testee selected. In your query you would do something like:

<cfquery name="tryAns" datasource="datasource">
        SELECT COUNT (*)
        WHERE qID = 5
        AND answer = '#form.5#'
</cfquery>

<cfif tryAns.recordCount>
        User got it right!
</cfif>

I'm not sure if I understood the question correctly, but there's a guess at
an answer for you.

Jason

----
Jason Aden
Allaire Certified Developer
[EMAIL PROTECTED]
www.wwstudios.com

> -----Original Message-----
> From: Jeffrey Thomas [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 30, 2001 2:56 PM
> To: CF-Talk
> Subject: Problems with Dynamic Form.variables
>
>
> I am trying to create a dynamic quiz and I am having problems
> with the form
> variables. I create questions and possible answers using a form which asks
> for the question and if it is true/false or multiple choice. When I select
> true/false it presents me with the option of  selecting true or
> false as the
> correct answer.  If I select multiple choice it presents me with a form to
> input the multiple possible answers and radio buttone for marking the
> correct answer for grading later. This all works fine and I can list the
> questions and select options (weather it be true, false or the multiple
> choice possible answers depending on the type of question. All of the
> possible answers have a radio button for selecting it as the
> correct answer
> and the input fields are named #qid# or question id number. The
> problem I am
> having is that when the selections are made and the form is submitted for
> grading I cannot figure how to identify the #form.???# that is holding the
> value of the selected answer. If the qids are 1 through 10 for
> example, how
> do I set up my query to find the correct answer using WHERE
> qid=#form.???# ?
>
> Any help will be appreciated,
> Jeff Thomas
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to