Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

online test

Posted on 2008-11-12
4
Medium Priority
?
266 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:learningnet
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:snowalps
ID: 22940755
will help if you post your code where you are facing the problem with the timer. also mention how it presently behaves.
0
 

Author Comment

by:learningnet
ID: 22942496
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
 
LVL 3

Accepted Solution

by:
snowalps earned 2000 total points
ID: 22945278
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
 

Author Comment

by:learningnet
ID: 22945368
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

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question