<cfsetting enablecfoutputonly=true>
<!---
	Name         : handlers/truefalse/display.cfm
	Author       : Raymond Camden 
	Created      : September 21, 2004
	Last Updated : April 10, 2006
	History      : New row for answers (rkc 10/7/05)
				 : Minor HTML mod (rkc 4/10/06)
	Purpose		 : Supports True/False, Yes/No
--->

<cfparam name="attributes.yesno" default="false">
<cfparam name="attributes.question">
<cfparam name="attributes.r_result" default="result">
<cfparam name="attributes.answer">
<cfparam name="attributes.step">

<cfset showForm = true>

<cfif isDefined("form.submit")>
	<cfif not isDefined("form.question#attributes.step#") and attributes.question.required>
		<cfset errors = "You must answer the question.">
	<cfelse>
		<!--- param for non required results --->
		<cfparam name="form.question#attributes.step#" default="">
		<cfset caller[attributes.r_result] = form["question#attributes.step#"]>
		<cfset attributes.answer = form["question#attributes.step#"]>
	</cfif>
</cfif>


<cfif isDefined("errors")>
	<cfoutput>
	<p class="error">#errors#</p>
	</cfoutput>
</cfif>
	
<cfoutput>
<div class="question">#attributes.step#) #attributes.question.question#</div>
<div class="answers">
<cfif attributes.yesno>
		<input type="radio" name="question#attributes.step#" value="yes" <cfif attributes.answer is "yes">checked</cfif>>Yes<br>
		<input type="radio" name="question#attributes.step#" value="no" <cfif attributes.answer is "no">checked</cfif>>No<br>
		<cfelse>
		<input type="radio" name="question#attributes.step#" value="true" <cfif attributes.answer is "true">checked</cfif>>True<br>
		<input type="radio" name="question#attributes.step#" value="false" <cfif attributes.answer is "false">checked</cfif>>False<br>		
  </cfif>
</div>
</cfoutput>
				
<cfsetting enablecfoutputonly=false>

<cfexit method="exittag">