如何在在线考试中实施超时概念 [英] how to implement timeout concept in online Exam

查看:65
本文介绍了如何在在线考试中实施超时概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在进行在线考试申请....因为它显示的时间在减少,并且在达到"1"分钟后会发出警报,然后它会关闭...请帮助我

Iam doing Online Exam Application....In that it will shows decreasing time and after reaching the "1" minute it will gives alert and after that it will be closed...please help me

推荐答案

这是一个利用javascript管理超时的小模型.在实现此项目时,我将使用jQuery扩展javascript功能并易于使用.不过,作为概念的简单证明就足够了:

This is a small mockup utilizing javascript to manage the time out. When realizing this project I''d use jQuery for extended javascript functionality and ease of use. Nevertheless as a simple proof of concept it suffices:

<html>
<head>
    <script type="text/javascript">
        function hideQuestions()
        {
            // Hide the questions
            document.getElementById("answerBlock").style.display = "none";
            // Show the message that the questions timed out
            document.getElementById("quicker").style.display = "block";
        }

        function checkTime()
        {
            secondsLeft = secondsLeft - 1;
            if(secondsLeft <= 0)

            {

                hideQuestions();

                //alert("Time is up!");

                document.getElementById("secondsLeft").style.color = "red";

                window.clearInterval(myTimer);

                writeTime("Timed out!");

                // Here you'd probably want to do a redirect to another page

            }

            else

            {

                writeTime(secondsLeft + "s");

            }

        }



        function writeTime(msg)

        {

            document.getElementById("secondsLeft").innerHTML = msg;

        }

    </script>
</head>
<body onload="">
<h1>Timeout Exam Question: <span id="secondsLeft"></span></h1>
<div id="answerBlock">
<input id="answer1" name="answer1" type="text" /><br/>
<input id="answer2" name="answer1" type="text" /><br/>
<input id="answer3" name="answer1" type="text" /><br/>
<input id="answer4" name="answer1" type="text" /><br/>
<input type="button" name="submit" value="Answer Questions"/>
</div>
<div id="quicker" style="display:none;">
You must answer more quickly next time!
</div>
</body>
<script>
    var secondsLeft = 10;
    writeTime(secondsLeft + "s");
    var myTimer = window.setInterval(checkTime, 1000);
</script>
</html>



最好的问候,

--MRB



Best Regards,

--MRB


ajax计时器最适合您的项目.尝试一下,看看有什么用.
ajax timer is the best fit for your project.Try it and see how much it is helpful.


一分钟?嗯那么,一个旁注:没有人需要使用这种测试来测试知识"吗?什么,你在训练猴子吗?


万一有人不理解:基于变体选择进行测试是将学生教育"成白痴的方式;有些已经受过教育".我不在乎这是一个要求":在集中营杀害囚犯的人也确实满足了要求".基于这种测试的教育系统是一种集中营和种族灭绝.现在,随心所欲地投票.

—SA
One minute? Hm. One side note then: nobody needs the "knowledge" tested using such kind of tests? What, are you training monkeys?


In case somebody did not understand it: testing based on choice of variants is the way to "educate" students into idiots; some are already "educated". I don''t care this is a "requirement": people who killed prisoners in concentration camps also did to meet the "requirements". Education system based on such tests is a kind of concentration camps and genocide. Now, down-vote as much as you want.

—SA


这篇关于如何在在线考试中实施超时概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆