how to do online exam scripting
Moderator: General Moderators
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: how to do online exam scripting
You don't need to put a session into a form item. It persists by itself. Just call it on the result page.
-
manojsemwal1
- Forum Contributor
- Posts: 217
- Joined: Mon Jun 29, 2009 4:13 am
- Location: India
Re: how to do online exam scripting
when i call the result page last lage value only displayed .
-
internet-solution
- Forum Contributor
- Posts: 220
- Joined: Thu May 27, 2010 6:27 am
- Location: UK
Re: how to do online exam scripting
In the results page you will have to read the last page's form values + session variables to have all the answers.
-
manojsemwal1
- Forum Contributor
- Posts: 217
- Joined: Mon Jun 29, 2009 4:13 am
- Location: India
Re: how to do online exam scripting
Sorry to disturb u can u explain how to set session in radio button values. give some suiatable example.
thanks
thanks
-
internet-solution
- Forum Contributor
- Posts: 220
- Joined: Thu May 27, 2010 6:27 am
- Location: UK
Re: how to do online exam scripting
Please see the following codes:
In first page, the questions are listed - answers are in radio buttons -
You post this page to second page and store values in $_SESSION variable -
Post second page to third page and so on
On the last page (results page)
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.
In first page, the questions are listed - answers are in radio buttons -
Code: Select all
<input type="radio" name="q[$i]" value="1" />
Code: Select all
$_SESSION['q'][$i]=$_POST['q'][$i];
//Then you list more question and answers
<input type="radio" name="q[$j]" value="1" />
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];