Page 2 of 2
Re: how to do online exam scripting
Posted: Mon Jun 07, 2010 10:02 am
by Jonah Bron
You don't need to put a session into a form item. It persists by itself. Just call it on the result page.
Re: how to do online exam scripting
Posted: Tue Jun 08, 2010 2:03 am
by manojsemwal1
when i call the result page last lage value only displayed .
Re: how to do online exam scripting
Posted: Wed Jun 09, 2010 7:55 am
by internet-solution
In the results page you will have to read the last page's form values + session variables to have all the answers.
Re: how to do online exam scripting
Posted: Wed Jun 09, 2010 8:40 am
by manojsemwal1
Sorry to disturb u can u explain how to set session in radio button values. give some suiatable example.
thanks
Re: how to do online exam scripting
Posted: Wed Jun 09, 2010 10:06 am
by internet-solution
Please see the following codes:
In first page, the questions are listed - answers are in radio buttons -
Code: Select all
<input type="radio" name="q[$i]" value="1" />
You post this page to second page and store values in $_SESSION variable -
Code: Select all
$_SESSION['q'][$i]=$_POST['q'][$i];
//Then you list more question and answers
<input type="radio" name="q[$j]" value="1" />
Post second page to third page and so on
On the last page (results page)
Code: Select all
//you get the posted values from previous page
answers['q'][$i]=$_POST['q'][$i];
//and then get values from $_SESSION
answers['q'][$j]=$_SESSION['q'][$j];
I have just shown the main principles above. Obviously you will have to add for loops in the above codes to recurse through your questions numbers.