online exam including time

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-31-2007
php.ajay@gmail.com
 
Posts: n/a
Default online exam including time

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

Reply With Quote
  #2 (permalink)  
Old 07-31-2007
Captain Paralytic
 
Posts: n/a
Default Re: online exam including time

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!


Reply With Quote
  #3 (permalink)  
Old 07-31-2007
ELINTPimp
 
Posts: n/a
Default Re: online exam including time

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

Reply With Quote
  #4 (permalink)  
Old 07-31-2007
nice.guy.nige
 
Posts: n/a
Default Re: online exam including time

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!"


Reply With Quote
  #5 (permalink)  
Old 07-31-2007
Rik
 
Posts: n/a
Default Re: online exam including time

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
Reply With Quote
  #6 (permalink)  
Old 08-01-2007
nice.guy.nige
 
Posts: n/a
Default Re: online exam including time

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!"


Reply With Quote
  #7 (permalink)  
Old 08-07-2007
pagadalarajesh@gmail.com
 
Posts: n/a
Default Re: online exam including time

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

Reply With Quote
  #8 (permalink)  
Old 08-07-2007
pagadalarajesh@gmail.com
 
Posts: n/a
Default Re: online exam including time

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:34 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0