javascript - How to disable browser features and shortcut keys to conduct fullscreen online Exam? -


i new oes (online exam system). want conduct online examination secure environment user not able cheat please this.

i using php codeigniter framework end , bootstrap, js , jquery user side or front end.

i have created exam module working fine straight way. want restrict users doing wrong ways tell me best way or suggest link can details about.

here assessment.php view file

    <?php     $temp = "";     $sr_no = 0;     $assessment = $response['assessment'];     $test_time = $this->session->userdata('test_time') * 60;     $questions = $response['questions'];     $total_que = count($questions);     $i = $que_no - 1;     $question = $questions[$i];     $sr_no++;     $temp.="<div class='form-group'><input  type='hidden' name='que_id' value='" . $question['que_id'] . "'>";     if ($total_que == $que_no) {         $i = $que_no - 1;         $temp.="<input  type='hidden' name='que_no' value='$i'>";     } else {         $temp.="<input  type='hidden' name='que_no' value='$que_no'>";     }     $temp.="<label class='col-md-2'>que. $que_no)</label>                         <label class='col-md-10'>" . $question['que_dscp'] . "</label>";     if ($question['que_type'] == "d") {         $temp.="<div class='col-lg-9 bottom'>";         if (isset($question['selected_options'])) {             $temp.="<textarea style='height: 100px;' disabled name='ans_" . $question['que_id'] . "[]'  class='form-control'>" . $question['selected_options'][0] . "</textarea>";         } else {             $temp.="<textarea style='height: 100px;' name='ans_" . $question['que_id'] . "[]'  class='form-control'></textarea>";         }         $temp.="</div>";     } else {         foreach ($question['options'] $option) {             $temp.="<div class='col-lg-9 bottom'>                         <div class='input-group'>                             <div class='input-group-addon'>";             if ($question['que_type'] == "ma") {                 if (isset($question['selected_options'])) {                     if (in_array($option['option_id'], $question['selected_options'])) {                         $temp.="<input type='checkbox' checked disabled >";                     } else {                         $temp.="<input type='checkbox' disabled >";                     }                 } else {                     $temp.="<input type='checkbox' name='ans_" . $question['que_id'] . "[]' value='" . $option['option_id'] . "'>";                 }             } else if ($question['que_type'] == "sa") {                 if (isset($question['selected_options'])) {                     if (in_array($option['option_id'], $question['selected_options'])) {                         $temp.="<input type='radio' checked disabled >";                     } else {                         $temp.="<input type='radio' disabled >";                     }                 } else {                     $temp.="<input type='radio' name='ans_" . $question['que_id'] . "[]' value='" . $option['option_id'] . "'>";                 }             }             $temp.="</div>                             <input type='text' readonly value='" . $option['option_dscp'] . "' class='form-control'>                         </div>                     </div>";         }     }     $temp.="</div>";     $temp1 = "";     $sr_no = 0;     foreach ($questions $question1) {         $sr_no++;         $temp1.="<a href='" . base_url() . "user/assessment/index/" . $assessment['test_id'] . "/$sr_no' class='btn btn-info'>$sr_no</a> ";     }     ?>     <script type="text/javascript" src="<?php echo base_url(); ?>resource/js/timecircles.js"></script>     <link href="<?php echo base_url(); ?>resource/css/timecircles.css" rel="stylesheet">          <div class="container">             <div class="page-header center">             <h1><?php echo $assessment['test_name']; ?> <small><?php echo $title; ?> </small></h1>         </div>         <?php $this->load->view('alert'); ?>         <div class="panel panel-default col-md-4" style="padding: 0;">             <!-- default panel contents -->             <div class="panel-heading">questions navigation</div>             <div class="panel-body" >                 <?php echo "$temp1"; ?>             </div>             <div id="test_time" data-timer="<?php echo "$test_time"; ?>"></div>         </div>         <div class="panel panel-default col-md-8" style="padding: 0;">             <!-- default panel contents -->             <div class="panel-heading">assessment questions</div>             <div class="panel-body" >                 <?php echo validation_errors(); ?>                 <form id="signupform" action="<?php echo base_url(); ?>user/assessment/submit" class="form-horizontal" method="post">                      <input type="hidden" name='test_id' value='<?php echo $assessment['test_id']; ?>'>                     <input type="hidden" name='user_id' value='<?php echo $this->session->userdata('user_id'); ?>'>                     <?php echo "$temp"; ?>                     <div class="form-group">                         <!-- button -->                          <div class="col-md-offset-6 col-md-6">                             <?php                             if ($que_no == 1) {                                 ?>                                 <a href="#" disabled class='btn btn-danger'>previous</a>                                 <?php                             } else {                                 ?>                                 <a href="<?php echo base_url(); ?>user/assessment/index/<?php echo $assessment['test_id']; ?>/<?php echo ($que_no - 1); ?>" class='btn btn-info'>previous</a>                                 <?php                             }                             if (isset($question['selected_options'])) {                                 ?>                                 <button id="btn-signup" disabled type="submit" class="btn btn-danger"><i class="icon-hand-right"></i> &nbsp save</button>                                 <?php                             } else {                                 ?>                                 <button id="btn-signup" type="submit" class="btn btn-info"><i class="icon-hand-right"></i> &nbsp save</button>                                 <?php                             }                             if ($total_que == $que_no) {                                 ?>                                 <a href="#" disabled class='btn btn-danger'>next</a>                                 <?php                             } else {                                 ?>                                 <a href="<?php echo base_url(); ?>user/assessment/index/<?php echo $assessment['test_id']; ?>/<?php echo ($que_no + 1); ?>" class='btn btn-info'>next</a>                                 <?php                             }                             ?>                         </div>                     </div>                     <input type="hidden" id="time_taken" name="time_taken" >                     <div id="countdown" style="width: 50%;"></div>                 </form>                 <a href="<?php echo base_url(); ?>user/assessment/solved/<?php echo $assessment['test_id']; ?>/<?php echo $this->session->userdata('user_id'); ?>" class='btn btn-info'>finish test</a>             </div>         </div>     </div>     <script>         $("#test_time").timecircles();         $("#countdown").timecircles({             "animation": "smooth",             "bg_width": 0.8,             "fg_width": 0.1,             "circle_bg_color": "#60686f",             "time": {                 "days": {                     "text": "days",                     "color": "#ffcc66",                     "show": false                 },                 "hours": {                     "text": "hours",                     "color": "#99ccff",                     "show": false                 },                 "minutes": {                     "text": "minutes",                     "color": "#bbffbb",                     "show": true                 },                 "seconds": {                     "text": "seconds",                     "color": "#ff9999",                     "show": true                 }             }         });          $("#btn-signup").click(function() {             $("#time_taken").val($("#countdown").timecircles().gettime());         });     </script>     <script type="text/javascript">         setinterval(ajaxcall, 1000); //300000 ms == 5 minutes         function ajaxcall() {             var test_time=$("#test_time").timecircles().gettime();             if(test_time >= 0){                 $.post("<?php echo base_url(); ?>user/assessment/set_test_time", { test_time : test_time }, function(data, status) {                     });             }else{                  $.get("<?php echo base_url(); ?>user/assessment/solved/<?php echo $assessment['test_id']; ?>/<?php echo $this->session->userdata('user_id'); ?>",function(data, status) {                        location.reload();                     });             }          }     </script>     <script type="text/javascript">         $(function () {           $(document).bind('contextmenu', function (e) {             e.preventdefault();           });         });         function disablef5(e) { if ((e.which || e.keycode) == 116 ||(e.which || e.keycode)==8) e.preventdefault(); };         $(document).on("keydown", disablef5);      </script> 

here home.php view file redirect user assessment.php

<?php $temp = ""; $sr_no = 0; foreach ($assessments $assessment) {     $solved = $assessment['solved'];     $test_id = $assessment['test_id'];     $test_name = $assessment['test_name'];     $status = $assessment['status'];     if ($status == "1") {         $status = "active";     } else {         $status = "inactive";     }     $sr_no++;     $temp.="<tr>                 <td></td>                 <td>$sr_no</td>                 <td>$test_name</td>                 <td>$status</td>";                  if($solved=="0"){                     $temp.="<td><a target='_blank' class='btn btn-info' onclick='return confirm(\"are sure want start assessment...!\");' href='javascript:window.open(\"".base_url()."user/assessment/index/$test_id\",\"user assessment\", \"titlebar=no,toolbar=no,menubar=no,width=screen.width,height=screen.height,fullscreen=yes\");' title='take test'>take test</a></td>";                       }else if($solved=="1"){                     $temp.="<td><a class='ml10' href='".base_url()."user/assessment/view/$test_id' title='view'>                     <i class='glyphicon glyphicon-search'></i></a></td>";                  }            $temp.="</tr>"; } ?> <link rel="stylesheet" href="<?php echo base_url(); ?>resource/css/bootstrap-table.css"> <div class="container">         <div class="page-header center">         <h1>user assessment system! user dashboard <small><?php echo $title; ?> </small></h1>     </div>     <?php $this->load->view('alert'); ?>     <div class="panel panel-default">         <!-- default panel contents -->         <div class="panel-heading">manage assessment</div>         <div class="panel-body" >             <!-- table -->             <table class="table" id="userstable" data-toggle="table" data-pagination="true"  data-show-refresh="true" data-export-types="{'pdf','xml','joson','png','excel'}" data-show-export="true" data-show-toggle="true" data-show-columns="true" data-search="true">                 <thead>                     <tr>                         <th data-field="state" data-checkbox="true"></th>                         <th>#</th>                         <th data-field="que_dscp" data-sortable="true">assessment name</th>                         <th data-field="status" class="text-center">status</th>                         <th data-field="ques" class="text-center">start/view test</th>                     </tr>                 </thead>                 <tbody>                     <?php echo "$temp"; ?>                 </tbody>             </table><br>         </div>     </div> </div> <script src="<?php echo base_url(); ?>resource/js/bootstrap-table.js"></script> <!-- put locale files after bootstrap-table.js --> <script src="<?php echo base_url(); ?>resource/js/bootstrap-table-en-us.js"></script> 

there absolutely no way restrict in location not controlled you.
no matter browser or operating system, can use second computer, or phone, or have book lying around, or sheet of paper, or friend knows stuff.

the way detect such thing camera filming user entire time.
in addition that, you'd have film screen - camera too, not via screen recorder, because otherwise might use virtual machine exam, in browser in full screen time, can alt-tab out of vm , whatever want, while screen recorder see inside of vm.

so cannot restrict user - thing can try surveil them.
require @ least 1 microphone , 2 cameras, more - 1 film screen (so can recognise afterwards) , rest film user , entire possible field of view (don't forget ceiling, there writing or something). microphone, of course, make sure user has no audible input during exam - implies must not wear headphones, otherwise might make use of sound-based interface.
example, imagine service which, upon activation hotkey, opens invisible browser window, captures keyboard input, conducts google search upon hitting return, lets navigate via arrow keys/return/tab/backspace/esc , reads text "select".
believe on os x, 1 need find way make windows invisible - activate voice over, set start page google , create service automator opens new browser window (invisibly), can assign hotkey.
also, recordings should transmitted in real time, otherwise user has chance tamper them.

now wrote realise more of question information security.


Comments