online test

Hello Experts,

I have been working on a really small project in since a while now, due to the pressure at work I have made it live although I know its not working quite right.

Its like a doing a online test, user will have 45 mins to complete the test of 30 random questions out of total 50.

Most of the things are working OK i guess but the timer which i have done in javascript does not actually redirect to endtest.aspx page if the time is up .. and few more little things like this due to my poor web programming.

please can someone help me here?

many thanks for your time and help

Who is Participating?
snowalpsConnect With a Mentor Commented:
which version of IE are you using? can you try to test it in firefox? or else,
try window.location.href ="EndTest.aspx", though it shouldnt make a difference.
you can also give a try to window.navigate.
tell me if it works.
will help if you post your code where you are facing the problem with the timer. also mention how it presently behaves.
learningnetAuthor Commented:
thanks for your comment
at the moment its simply stopping at 00:00:01 and not redirecting to the endtest.aspx page

please can you advise?


<script type="text/javascript">
        var hiddenControl = '<%= txtClock.ClientID %>';
        var today;
        function StartTime()
            today.setSeconds(today.getSeconds() - 1)
            var h=today.getHours();
            var m=today.getMinutes();
            var s=today.getSeconds();
            // add a zero in front of numbers<10
            if ((h == "00") && (m == "00") && (s == "01"))            
                window.location = "EndTest.aspx"
        function Init()
            document.getElementById(hiddenControl).value ='<%= SessionData.RemainingTime %>';
            time = document.getElementById("txtClock").value.split(":")
            today = new Date()
            today.setHours(time[0], time[1], time[2])
        function CheckTime(i)
            if (i<10)
              i="0" + i;
            return i;

Open in new window

learningnetAuthor Commented:
ok will try, thanks for your response

please can you have a look at this

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.