Click to See Complete Forum and Search --> : Timer in Form Question
Salvatore
Nov 21st, 2003, 09:47 AM
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.
vbNeo
Nov 21st, 2003, 09:49 AM
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!
Acidic
Nov 21st, 2003, 10:30 AM
By chance I wrote a quiz llast night for something else. It isn't exactly as you want it, but it is very easy to edit it. All you have to do is: if they have not entered anything as the timer runs out enter a letter which is wrong. then post the data like normally.
Salvatore
Nov 21st, 2003, 01:04 PM
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?
Acidic
Nov 21st, 2003, 01:20 PM
on the first page:
...
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.
Salvatore
Nov 21st, 2003, 01:29 PM
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!!:bigyello:
Acidic
Nov 21st, 2003, 01:56 PM
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)
CornedBee
Nov 21st, 2003, 05:04 PM
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.
Acidic
Nov 21st, 2003, 05:09 PM
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.
CornedBee
Nov 21st, 2003, 05:12 PM
I didn't look at how this is implemented.
CornedBee
Nov 21st, 2003, 05:13 PM
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.
Acidic
Nov 21st, 2003, 05:15 PM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.