TEL:400-8793-956
当前位置:程序、服务器

在线测试的倒数计时器

提问者: 近期获赞: 浏览人数: 发布时间:2021-01-03 15:45:03

 问:countdown timer for online test

how can i add timer to my online test which allows me to
-1 time your testing
2-if the countdown is finish the form will submit
3- after submit i need to give score the questions that he has already answered it
and give zero for the questions he didn't answer it
4- if the examine try to refresh the page or go to another page the form will submit
5-you can not submit empty form
i hope you can help me guys because i will need this
 
<html>
    <head>
        <title> </title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        
    </head>
   
    
    <div id="container">
        
        <div id="header">
        <center>
          <p style="font-size:20pt; color: blue;"> </p>
         </center>
         <div id="paper_header">
         <div style="float:right; margin-left:30px; padding-right:40px;"> : <p><?php echo $_SESSION['examinee_name'];?></p></div>
         <div style="float:right;margin-left:10px;margin-right:40px;"> : <p><?php echo $_GET['lang'];?></p></div> 
          <div style="float:right;margin-right:40px;">:<p><?php echo $_GET['test_name'];?></p></div> 
         </div>
         
              
        </div>
        
            <div id="content">
            
            <?php 
            
               include ("mysql_connect.php");
                $test_id = $_GET['test_id'];
                $sql ="Select * from question where test_id='$test_id'";
                $res = mysqli_query($connection, $sql);
                $noq = mysqli_num_rows($res);
                        
                
            
                        ?>
           
    
                <form action="test_evaluation.php" method="post">
                
            <legend> </legend>
                            
                            <center><p><label> :</label>
                            <?php echo  mysqli_num_rows($res);?>
                            
                            </p></center>
                            
                                <?php   
                                   $i = 0;
                                   $j = 0;
                                   $question_id = array();
                                    
                                    while ($row = mysqli_fetch_array($res)){
                                    
                                        $i = $i + 1;
                                        $qtext = $row['question_text'];
                                        $qid = $row['question_id'];
                                        $question_id[] = $qid;
                                        
                                         
                                        echo "<label>  #".$i."</label><br>";
                                        echo "<textarea readonly name='"."q".$i."' rows='10' cols='50'>".$qtext."</textarea><br>";
                                        echo '<label style="margin:15px;"> :</label><br>';
                                        
                                        $query="select * from answers where question_id ='$qid'";
                                        $result = mysqli_query($connection, $query);
                                         
                                        
                                    
                                        while($rec = mysqli_fetch_array($result)){
                                             
                                            $j = $j +1;
                                            
                                            $ans = $rec['answer_text'];
                                            $ansid = $rec['answer_id'];
                                            
                                              echo '<input readonly class="choice" type="text" name="'.'choice'.$i.$j.'" value="'.$ans.'" id="choice'.$i.$j.'" />';
                                              echo '<input class="correct" type="radio"  checked name="'.'correct'.$i.'" value="correct'.$i.$j.'"/><br>';
                                        }
                                        echo "<br><br>";
                                        $j=0;
                                    }
                                    $_SESSION['num_of_questions'] =  $noq;
                                    $_SESSION['test_id'] = $test_id;
                                    $_SESSION['q_ids']= $question_id;
                                    
                                ?>
                                                            
                    
                                
                                    
                                    <center><input style="color:blue; font-size:14pt; width:100;"type="submit"  value=" "/></center>
                            
                </form>
            </div>
            <div id="footer" dir="rtl">
                <p>         &copy;2014  </p>
            </div>
        </div>
        
        
    </body>
</html>
 
 
答:我刚浏览了您的帖子,而您正在尝试建立倒计时。您可以使用简单的jquery建立倒计时,但是一段时间后它会变慢。我想向您推荐一个可以满足您要求的jquery插件。该插件是付费的,但您可以搜索它的一个破解。
上一篇: 如何通过单个按钮点击广告和我的链接
下一篇: 使用C#推送通知