|
-
Nov 21st, 2003, 10:47 AM
#1
Thread Starter
Fanatic Member
Timer in Form Question
I need to create a simple form that will give the user multiple choice questions...but the user only has so much time to complete the form..
Now here is where I am having a problem...I would need for the form at the end of the timer to intiate the SUBMIT button as if the user did it...this way it will capture the answers the user was able to complete..
Could someone assist me with getting this ball rolling? I am working within an INTRANET environment.
Thank you.
-
Nov 21st, 2003, 10:49 AM
#2
Frenzied Member
Well
I usually do it with JavaScript... Make a JS timer and use 'window.location' to compensate for the submit button(keep in mind you need to send the vars manually)
Cheers!
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Nov 21st, 2003, 11:30 AM
#3
-
Nov 21st, 2003, 02:04 PM
#4
Thread Starter
Fanatic Member
Acidic,
I looked at your quize, and I was curious...I could not see where the score of either the incorrect or correct answers were sent to the summary html page?
I would like to create somthing similar...I would like ( if possible) to have an html quize page and then on submit send the answers the user selected along with the correct answers and a score to another html page...
Maybe if I explain a little better...I have Managers who would like to quize their staff online, and then be able to view thier responses..I can not use CGI...I need a way for the Managers to go to an HTML page to see the results of the respect ive quizes...
Can this be done, if so how do I get the results to stay on the Summary HTML page?
-
Nov 21st, 2003, 02:20 PM
#5
Frenzied Member
on the first page:
Code:
...
location.href = "quiz2.html?points=1" //Go here, note the bit after the question mark, thats the query string
}
else
{
location.href = "quiz2.html?points=0" //If they were wrong go here, not the query string now too.
...
the "points=" bit is where the number of pionts is sent to the next page. On page 2 it is the same place but slightly more complex as it has to take into account what the user got for the first question.
BTW, this quiz could also be made all on one page, that would make it much easier to code as ou don't have to worry about query strings.
Just reply if you want it like that.
Have I helped you? Please Rate my posts. 
-
Nov 21st, 2003, 02:29 PM
#6
Thread Starter
Fanatic Member
Yea, I would have it all on one page since I will only be asking a gew multiple choice questions....
But what about the users answers, the correct answers and the overall score be placed on a seperate HTML page...and even further is it possible for this info to stay on the page so that the Managers can go there to see their staff's score?
If not what suggestions would you have?
Thank you very much!!
-
Nov 21st, 2003, 02:56 PM
#7
Frenzied Member
no, the results can't stay there. JavaScript cannot permanently change anything. you would need a server side language like ASP or PHP. intranets should do that but I can't do it.
I'll get onto making the script all on one page.
edit: Actually I'm having problems making the script, either some1 else can make it or I'll post you one I made earlier on monday (It's on the school network)
Last edited by Acidic; Nov 21st, 2003 at 03:20 PM.
Have I helped you? Please Rate my posts. 
-
Nov 21st, 2003, 06:04 PM
#8
Point out to the managers that employees can cheat by disabling JavaScript, which would give them infinite time. There are a few ways around this:
1) Use more Javascript, so that the quiz doesn't work at all if JS is disabled.
2) Watch the users while they do the test (pretty much ruins the online benefits though).
3) Add some server-side checking. The server records when the page is sent to the user (best done in the user database). When the page comes back, it records the time again. Just calculate the difference and check if the user took to long.
In a web environment it would be unfair for small timeframes because of possible page loading delay, but that's negligible in an intranet.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2003, 06:09 PM
#9
Frenzied Member
even with that it is possible to cheat:
eg. I could type:
javascript:document.getElementById('points').value = '500'
into the address bar and voila, I'm getting the next raise.
Have I helped you? Please Rate my posts. 
-
Nov 21st, 2003, 06:12 PM
#10
I didn't look at how this is implemented.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2003, 06:13 PM
#11
But if the score calculation is done client-side, it's extremly easy to cheat. For example I could write a miniscule "web browser" that simply sends a HTTP request for the results page to the server, passing a high score.
Or I could check the page source to find out which answers score highest.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 21st, 2003, 06:15 PM
#12
Frenzied Member
It hasn't been implemented yet. I haven't done the script. He wanted it all on one page. I tried, I got errors, I delayed. Until monday when I can get one I did earlier on school network.
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|