This is a discussion on online exam including time within the PHP Language forums, part of the PHP Programming Forums category; Hi I have a great problem. I have successfully completed ONLINE EXAM project.But Finally client asked "I want ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
I have a great problem. I have successfully completed ONLINE EXAM project.But Finally client asked "I want to include time for my site."O.K I tried But every time when i click on next question time is also refreshed and it comes from starting time.Please help me.VERY URGENT Thank u |
|
|||
|
On 31 Jul, 11:05, php.a...@gmail.com wrote:
> Hi > I have a great problem. I have successfully completed > ONLINE EXAM project.But Finally client asked "I want to include time > for my site."O.K I tried But every time when i click on next question > time is also refreshed and it comes from starting time.Please help > me.VERY URGENT > Thank u Try explaining properly what you are wanting to do and you might get some help! |
|
|||
|
On Jul 31, 6:05 am, php.a...@gmail.com wrote:
> Hi > I have a great problem. I have successfully completed > ONLINE EXAM project.But Finally client asked "I want to include time > for my site."O.K I tried But every time when i click on next question > time is also refreshed and it comes from starting time.Please help > me.VERY URGENT > Thank u Sounds like you are doing a request for each question (one question in a <form>, hit submit, the data goes to some sort of persistent or superglobal storage, and go on to the next). AJAX might be a good solution to cut down on the overhead, but that's just a suggestion for a future version =). If my assumptions are correct about the way your system works, are you passing the value of the time remaining in your request and then using that as a starting point for your time? This is all based on assumption, of course....we would be able to help better if you posted some code =) Steve |
|
|||
|
While the city slept, php.ajay@gmail.com (php.ajay@gmail.com) feverishly
typed... > Hi > I have a great problem. I have successfully completed > ONLINE EXAM project.But Finally client asked "I want to include time > for my site."O.K I tried But every time when i click on next question > time is also refreshed and it comes from starting time.Please help > me.VERY URGENT > Thank u Assuming as other posters have said that this is a form with a question, and then onto the next page... maybe something like; q1.php ===== <form name="quiz1" action="q2.php" method="post"> <input type="hidden" value="<? echo time(); ?>" name="startTime"> What colour is blue? <input type="text" name="q1"> <input type="submit"> </form> q2.php ===== <? if($_POST["q1"] == "blue") { $score = 1; } else { $score = 0; } ?> <form name="quiz2" action="q3.php" method="post"> <input type="hidden" value="<? echo $_POST["startTime"]; ?>" name="startTime"> <input type="hidden" value="<? echo $score; ?>" name="score"> How many eggs in a dozen? <input type="text" name="q2"> <input type="submit"> </form> .... etc... end.php ====== <? $startTime = $_POST["startTime"]; $endTime = time(); $totalTime = $endTime - $startTime; $score = $_POST["score"]; ?> <p>Your score was <? echo $score; ?> and you took <? echo $totalTime; ?> to complete the quiz</p> .... This is all off the top of my head and not tested in anyway shape or form, but it may at least give you some ideas to work on. Hope that helps, Nige -- Nigel Moss http://www.nigenet.org.uk Mail address will bounce. nigel@DOG.nigenet.org.uk | Take the DOG. out! "Your mother ate my dog!", "Not all of him!" |
|
|||
|
On Tue, 31 Jul 2007 23:39:36 +0200, nice.guy.nige
<nigel_moss@deadspam.com> wrote: > While the city slept, php.ajay@gmail.com (php.ajay@gmail.com) feverishly > typed... > >> Hi >> I have a great problem. I have successfully completed >> ONLINE EXAM project.But Finally client asked "I want to include time >> for my site."O.K I tried But every time when i click on next question >> time is also refreshed and it comes from starting time.Please help >> me.VERY URGENT >> Thank u > > Assuming as other posters have said that this is a form with a question, > and > then onto the next page... maybe something like; > > q1.php > ===== > > <form name="quiz1" action="q2.php" method="post"> > <input type="hidden" value="<? echo time(); ?>" name="startTime"> > What colour is blue? <input type="text" name="q1"> > <input type="submit"> > </form> > > q2.php > ===== > > <? > if($_POST["q1"] == "blue") { > $score = 1; > } > else { > $score = 0; > } > ?> > > <form name="quiz2" action="q3.php" method="post"> > <input type="hidden" value="<? echo $_POST["startTime"]; ?>" > name="startTime"> > <input type="hidden" value="<? echo $score; ?>" name="score"> > How many eggs in a dozen? <input type="text" name="q2"> > <input type="submit"> > </form> > > ... etc... > > end.php > ====== > > <? > $startTime = $_POST["startTime"]; > $endTime = time(); > $totalTime = $endTime - $startTime; > $score = $_POST["score"]; > ?> > > <p>Your score was <? echo $score; ?> and you took <? echo $totalTime; ?> > to > complete the quiz</p> > > ... This is all off the top of my head and not tested in anyway shape or > form, but it may at least give you some ideas to work on. Then again, I can easily manipulate hidden post values to my liking, without to much trouble even (there are browser extentions that do this).. Want the data safe? Store in on the server, easiest would be in a session, and use that. -- Rik Wasmus |
|
|||
|
While the city slept, Rik (luiheidsgoeroe@hotmail.com) feverishly typed...
> Then again, I can easily manipulate hidden post values to my liking, > without to much trouble even (there are browser extentions that do > this). > > Want the data safe? Store in on the server, easiest would be in a > session, and use that. Now, session... why didn't I think of that? lol... much simpler... and thinking about it quite possibly definately the way to choose. Cheers, Nige -- Nigel Moss http://www.nigenet.org.uk Mail address will bounce. nigel@DOG.nigenet.org.uk | Take the DOG. out! "Your mother ate my dog!", "Not all of him!" |
|
|||
|
On Jul 31, 3:05 pm, php.a...@gmail.com wrote:
> Hi > I have a great problem. I have successfully completed > ONLINE EXAM project.But Finally client asked "I want to include time > for my site."O.K I tried But every time when i click on next question > time is also refreshed and it comes from starting time.Please help > me.VERY URGENT > Thank u use sessions or cookies to solve this problem |
|
|||
|
On Jul 31, 3:05 pm, php.a...@gmail.com wrote:
> Hi > I have a great problem. I have successfully completed > ONLINE EXAM project.But Finally client asked "I want to include time > for my site."O.K I tried But every time when i click on next question > time is also refreshed and it comes from starting time.Please help > me.VERY URGENT > Thank u other wise contact me i will help. ok mail id: pagadalarajesh@gmail.com |