Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
rinorman #1
Timed quiz
I've created an online quiz . Two things can happen-
1) the person finishes anwering all the questions and sends the results to an
action page via send button which grades the test and displays % correct.
2) the test times out- but the results at timeout still need to go to the
action page to get graded (it would say "you answered x questions out of x".
A simple html redirect?
rinorman Guest
-
Timed Submit
Is there a way to have a form automatically submit after a certain period of time? i.e if a person is filling out a form (or assessment) and does... -
ProFTP timed out
Hi, I have problems with a server running proftpd 1.2.8 behind a firewall (1-to-1 NAT). I want to send from different clients (ncftp on linux,... -
The operation has timed-out.
I am building a Windows Forms application to consume Webservices provided by the jboss server. I used hte Windows WSDL.exe tool to generate the... -
The Operation has timed-out
The Operation has timed-out Description: An unhandled exception occurred during the execution of the current web request. Exception Details:... -
Quiz Quiz Quiz but how to customise??
Hi all, I am having a bit of a blonde moment here. I need a quiz quickly and have got a source file from ... -
PaulH #2
Re: Timed quiz
i suppose it depends on how your timing out your test. are you timing out & submitting or doing a refresh?
PaulH Guest
-
rinorman #3
Re: Timed quiz
The action page scores and times the quiz- so the auto time-out would need to
send the current info to the action page as if the quiz-taker had submitted
manually.
Also, while I'm at it- if any of these questions could be answered, it would
be a big help-
Some quiz questions are yes/no true/false, most are multiple choice but some
have 4 choices and others have 6.
Because each question has at least 2 choices, I tried to display the questions
dynamically with:
<ol start="a" type="a">
<li><input type="Radio" name="ans" value="ans_a"> #ans_a#<br>
<li><input type="Radio" name="ans" value="ans_b"> #ans_b#<br>
<cfif #ans_c# IS NOT ""><li><input type="Radio" name="ans"
value="ans_c"> #ans_c#</li></cfif>
<cfif #ans_d# IS NOT ""><li><input type="Radio" name="ans"
value="ans_d"> #ans_d#</li></cfif>
<cfif #ans_e# IS NOT ""><li><input type="Radio" name="ans"
value="ans_e"> #ans_e#</li></cfif>
<cfif #ans_f# IS NOT ""><li><input type="Radio" name="ans"
value="ans_f"> #ans_f#</li></cfif>
<cfif #ans_g# IS NOT ""><li><input type="Radio" name="ans"
value="ans_g"> #ans_g#</li></cfif></ol>
But the radio buttons don't stay ticked. So now I am starting a new query for
each question on the quiz page, and on the action page, using this code block
for each qustion:
<CFSET num_correct =0>
<cfoutput>
<cfif #ans_02# eq #ans_02_correct#>
<CFSET num_correct = num_correct +1>
<cfelse><CFSET num_correct = num_correct +0>
</cfif></cfoutput>
I bet there's an easier way!
Also, how would I be able to display the quiz questions in random order?
Right now, each qustion is set up this way:
<cfquery name="disp10" datasource="some data.mdb" dbtype="ODBC">
SELECT quest_ID, quest_text, ans_a, ans_b, ans_correct
FROM test001_guest_main
WHERE quest_ID = 10
</cfquery>
<cfoutput query="disp10">
<tr>
<td width="800" align="left" valign="top">
<p>#quest_ID#) #quest_text#</p>
<ol start="a" type="a">
<li><input type="radio" name="ans_10" value="ans_a"> #ans_a#<br>
<li><input type="radio" name="ans_10" value="ans_b"> #ans_b#<br>
</ol>
</ol>
</td>
</tr>
<input type="hidden" name="quest_ID" value="#quest_ID#">
<input type="hidden" name="ans_10_correct" value="#ans_correct#">
</cfoutput>
THANKS!
rinorman Guest
-
PaulH #4
Re: Timed quiz
are you asking how to timeout and submit the form? if so i guess you can use some and the [url]http://www.devguru.com/Technologies/ecmascript/quickref/win_settimeout.html[/url] function.
PaulH Guest
-
rinorman #5
Re: Timed quiz
The problem: If the testee does not finish the quiz in time, several questions
will not be answred. The way the action page is set up- if all questions do not
have a coice selected, there will be an error message.
On the test page, each qustion has its own query. For instance, question 2::
<cfquery name="disp02" datasource="quiz_data.mdb" dbtype="ODBC">
SELECT quest_ID, quest_text, ans_a, ans_b, ans_c, ans_d, ans_correct
FROM test001_guest_main
WHERE quest_ID = 2
</cfquery>
<cfoutput query="disp02">
<tr>
<td width="800" align="left" valign="top">
<font face="Verdana, Helvetica, sans-serif" size="2">
<p>#quest_ID#) #quest_text#</p>
<ol start="a" type="a">
<li><input type="radio" name="ans_02" value="ans_a"> #ans_a#</li>
<li><input type="radio" name="ans_02" value="ans_b"> #ans_b#</li>
<li><input type="radio" name="ans_02" value="ans_c"> #ans_c#</li>
<li><input type="radio" name="ans_02" value="ans_d"> #ans_d#</li>
</ol>
</td>
</tr>
<input type="hidden" name="quest_ID" value="#quest_ID#">
<input type="hidden" name="ans_02_correct" value="#ans_correct#">
</cfoutput>
Then, each answer is checked on the action page:
<cfoutput>
<cfif #ans_02# eq #ans_02_correct#>
<CFSET num_correct = num_correct +1>
<cfelse><CFSET num_correct = num_correct +0>
</cfif></cfoutput>
Because of this design, unanswered questions will cause an error-I'm sure
there's an easier way to
1) display each question
2) tally correctly answered questions
3) prevent error messages for unanswered qustions
4) display questions in random order yet have them numbered in sequence on the
test-
THANKS AGAIN
rinorman Guest
-
PaulH #6
Re: Timed quiz
the quick and dirty way is to use cfparam on your action page:
<cfparam name="form.someFormName" default="defaultNoAnswerValue">
PaulH Guest



Reply With Quote

