Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Thanked 0 Times in 0 Posts

    Help optimizing javascript randomize pages code for eLearning assessment module


    Im using a authoring tool to develop an elearning test course. The course is composed of several HTML pages with Buttons for the multiple choice test. The setup of the course is that it will only ask 10 questions out of a pool of 30 questions.

    When the HTML & JS files are online, the test takes 20-40seconds to load. I believe it is related to the code that selects the 10 questions from the 30.

    I've singled out the code that does the select random pages... Is there any way to optimize the code?

    I've attached the HTML (in txt format) page where the javascript can be found.

    Looking forward to your replies!
    Attached Files Attached Files

  • #2
    Join Date
    Apr 2009
    Thanked 426 Times in 424 Posts
    Oh boy, that is one ugly piece of code. You could use Firebug's profiling tools to see what's actually causing the delay, or you could provide a live example, so we can see the thing in action. Short of that, I suspect you won't get any meaningful help without paying for it.
    .My new Javascript tutorial site: http://reallifejs.com/
    .Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
    .Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback


    Posting Permissions

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