Text Area text extraction

admin

Administrator
Staff member
I am creating an Online Quiz in which questions are loaded dynamically. I have to store the answers on the browser till the end of the quiz. My Quiz consists of multiple choice and Essay type answers. Essay type answers have to be entered into a Text area. <br />
My question is: Is there a way to access the data in this text area on the browser. Something like a getText() method. I have to store the response for the question into an array.<br />
<br />
Any hints or suggestions???<br />
<br />
Thanx<!--content-->praveeng, <br />
<br />
The easiest way would be to use cookies. If this isn't practical, do you have any server-side languages at your disposal? The best way I can think of is to include a number of hidden input fields in your form (one for each question, and just to pass the answers from page to page, storing them in these input fields. This is easily done with something like PHP, but a bit more tricky with javascript... You can then construct you array from the input fields.<br />
<br />
Cookies is definitely your best bet though if you can use them. <br />
<br />
Hope that helps.<!--content-->not sure why you want to store the answers in the code, but you can use JS variables/ hidden text fields to store the answers. <br />
<br />
This is really a bad idea, all someone has to do is look at the source to pass your test. If your creating this dynamically, then you have some server side capability... and therefore *could* do it the correct way.<!--content-->I am using an XML page for storing the questions and answers. The actual answers itself will not be in the HTML code. After each question is answered, I am storing the right answer and the answer returned by the test taker into an array. All the information so gathered will be displayed at the end of the test along with his/her score. <br />
<br />
I have a couple of questions:<br />
1. Do you still think some one can break into and find the answers?<br />
2. I know there are ways in which you can choose to have your HTML code be invisible, i.e, view source is deactivated. Are you aware of any such methods??<br />
<br />
Thanx for the suggestions. Had my brain cells humming.<!--content-->
 
Back
Top