kwan said:
It is possible to send the questions and answers to the browser, and
the users have to choose the answer in each question, then the answers
have to compare to the correct answer in the database.
I still consider not secure, because the users could copy the
questions and answers in the html code form that easy accessable via
the view source code; furthermore,by storing the questions and answers
which users could access, it is possible for bad guys who can write a
program to copy all the questions and answer while taking the exam.
This is getting silly, and is nothing to do with perl. Let's try once
more: maybe different words will help since I realise that English is
not your first language.
(1) If you send information about the correct answer down with the
question then anyone who knows how can find it in the HTML. I know you
know that.
(2) Therefore the correct answer has to stay at the server until the
student has made her choice.
(3) Once the student has made her choice you have to tell her whether or
not it's right (you tell us): and if you allow the student to have more
than one go at the question then she can copy all the questions and the
correct answers. There is nothing you can do about that: it's a
fundamental part of the algorithm: tell the student anything,
information leaks out. And nothing to do with the choice of language,
Perl or otherwise.
(4) You could make it a bit harder for an individual student by only
letting her have one go at the question, and when she's wrong not
telling her which answer was right; by logging all quiz interactions;
and by not offering an option to take the quiz a second time. But
information still leaks each time the student interacts with the system.