online test

Hello Experts,

I have been working on a really small project in ASP.net 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

regards
kay
learningnetAsked:
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.
0
 
snowalpsCommented:
will help if you post your code where you are facing the problem with the timer. also mention how it presently behaves.
0
 
learningnetAuthor Commented:
hello,
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?

thanks

<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
            m=CheckTime(m);
            s=CheckTime(s);
            if ((h == "00") && (m == "00") && (s == "01"))            
            {                
                window.location = "EndTest.aspx"
            }  
            document.getElementById(hiddenControl).value="0"+h+":"+m+":"+s;
            t=setTimeout('StartTime()',1000);
        }
        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])
            StartTime()
        }
 
        function CheckTime(i)
        {
            if (i<10)
              {
              i="0" + i;
              }
            return i;
        }
    </script>

Open in new window

0
 
learningnetAuthor Commented:
ok will try, thanks for your response

please can you have a look at this

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23899456.html

thanks
0
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.