Newportri,
"I think I got errors until I added the +0 thing"
- I can't see why this would be, unless by default
num_correct is a zero length string rather than 0.
"there is the problem of field validation- the code at
present fails if the user misses a question"
- I suggust using javascript and validating on the client
side. I'd just loop over the form elements and make sure each radio
set has at least one value checked. This is pretty easy to do and
doesn't require many lines of js code.
One thing I'll also mention is that it appears you are
running a separate query for each value you are updating. This is
way more overhead than you need. For instance the following two
queries should be written as one. Also note I've removed the
<cfoutput> tags since you don't need them inside a CFQUERY
tag. It automatically resolves variable values.
Also, I notice you are inserting the var "endtime" as a
string. I'm assuming this is a date,time or date/time value. I
wonder why you wouldn't make the test_taker_tm_end column in your
database a smalldatetime or datetime type. That way you can
actually query it as a date object rather than having to do string
comparisons on it.
Why don't you just email me ALL of your code and I'll look at
it and see what I can do to streamline/make it work.
email me at: mgrant at modus.bz
Cheers,