status

teacher build exam (question and answer) and student take the exam

form build_pre_exam add data into pre_exam table

when form run ,
user(teacher ) have to insert question and four cooses then choose from list item which one i correct answer (to enable to check exam for student) ,after that i need to insert 1 an correct answer and 0 in wrong one (these is my problem)


for example if he select choose 1 (from list item) ,insert into answer1 = 1
for example if he select choose 2 (from list item),insert into answer2 = 1

could u help me ?

attach

build_pre_exam.fmb and pre_exam table

Thanks

you need to handled this in "WHEN-LIST-CHANGED"
EX:
table name A,field name :question
question: what is the result of 10+5?
1)25
2)35
3)15
4)45
you know that which is the answer for that question,right?
here answer is 3
So, you need to write code like
declare
var1 number;--(to store ques no)
var2 number;--(to store ans no)
var3 number;--(to store updated ans result)
cursor c1 is
select ques_no,ans from A
where ques_no = :A.ques_no;
begin
open c1;
fetch c1 into var1,var2;
close c1;

IF :A.ques_no = var1 then
if :A.ans = var2 then
var3:=1;
-- you just assign 0's to remaining options
end if;
end if;
--after this you just update the table with thease values or you can insert these into required fields.............

I hope this can help you to handle your requirement.......Otherwise
you can get some ideas by seeing this as per your requirement.....
If you get the solution by someother way means plesase send the solution for reference purpose....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.