a tricky problem [message #2423] |
Mon, 15 July 2002 05:43 |
Giri
Messages: 12 Registered: March 2002
|
Junior Member |
|
|
hi,
im developing a examination module
which is int the style of the following
question (what is the copy key)
ans1(radiobutton1)ctrl+c
ans2(radiobutton2)ctrl+d
ans3(radiobutton3)ctrl+k
ans4(radiobutton4)ctrl+a
this is the model. i have declared a global variable
if the user chooses the right radio button
answer global variable increments
.ok
this works fine.
but when i navigate back and again click the right answer again my global variable increments.so please provide a solution so that if it's correct it does not incremant again
|
|
|
Re: a tricky problem [message #2432 is a reply to message #2423] |
Tue, 16 July 2002 03:54 |
koteswara rao p.
Messages: 10 Registered: June 2002
|
Junior Member |
|
|
hi
giri
dont use global variable.
use boolean array and set the array variable true
for correct answer and false for incorrect answer.
ex.
if your test has 20 questions.then
declare boolean array result[[20]]
if he select correct answer for question no 1
then set result[[1]]=true
else result[[1]]=false and so on for q2,q3 ...q20.
count the number of trues in the boolean array at
the end of the examination.
that is his marks.
ok
regards
koti
|
|
|