[Tutor] Timer on CGI
Christopher Arndt
chris.arndt at web.de
Mon Sep 19 23:29:55 CEST 2005
Adam Cripps schrieb:
> Some of my pupils at school are working through simple mathematic
> problems (multiplication tables) through my website. I basically show
> some tables, they enter the results and then get feedback on how they
> did.
>
> I have two questions - and my guess is that one will be easier than the other.
>
> 1. I want to store the results in a mySQL database - I've done this
> kind of thing before using PHP - are there any good tutorial resources
> for using mysql with python?
Don't know about that...
> 2. Today the children asked if they could be timed when they complete
> the problem. Is there any way of knowing how long they spent
> completing the task?
You'd have to use Cookies for that and (possibly) JavaScript for that.
The basic approach would be:
1) When they first request a task, send a session Cookie along with the page
and save it on the server side too.
2) provide a button on the page that says: "Start task". That button starts a
javascript timer.
3) Provide another Button that says "Finish / Send solution". This buttons
reads the timer value ans sends it along with the other request variables.
4) on the server read the request variables and the the cookie and match it to
the saved session ids, so you can determine which student this answer was for.
I hope I was able to convey the general idea. Please ask if you need to know more!
Chris
More information about the Tutor
mailing list