SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quiz with Timer (Multiple Time Triggers)

    Hi there,

    I am about to start development on a web-based quiz and wanted to clarify some stuff to make sure it is possible.

    I am hoping to have a quiz where the questions are broken up into 4 categories, and you get a score for each one. Should be straight forward enough.

    The question I have is this:

    I know you can use timers to limit allowed response time for the questions. I was hoping to use a timer to change the score of the questions based on how long it took to answer.

    Ie:
    If answered in 4 seconds (add 3 points)
    If answered in 8 seconds (add 2 points)
    If answered in 12 seconds (add 1 point)
    If answered in 16+ seconds (add 0 points)

    I am wondering if this is feasible in Javascript, can you create a timer with multiple trigger times, with different effects?

    Thanks in advance,
    David

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by SphericalChicken View Post
    I am wondering if this is feasible in Javascript, can you create a timer with multiple trigger times, with different effects?
    Yes you can. You can record the time/date when the question was started, and when it was answered. The difference between the two is how long it took, and based on that length you can assign different points.
    Last edited by paul_wilkins; Sep 5, 2012 at 14:57.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Yes you can. You can record the time/date when the question was started, and when it was answered. The difference between the two is how long it took, and based on that length you can assign different points.
    Awesome! Thank you very much for your help.
    Last edited by paul_wilkins; Sep 5, 2012 at 14:57. Reason: fixed spelling in quote


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •