ok

Mini Shell

Direktori : /home2/selectio/public_html/tnpsctestbatch.com/
Upload File :
Current File : /home2/selectio/public_html/tnpsctestbatch.com/mock-test-final-result.php

<?php include 'header.php';   
if(!isset($_SESSION['user_exam'])) {
    echo ("<script LANGUAGE='JavaScript'>
    window.alert('Please Login');
    window.location.href='login.php';
    </script>"); 
	exit;
}
?>


<style>
    body {
      font-family: Arial, sans-serif;
    }

    .quiz-container {
      max-width: 611px;
      background-color: #f4f4f4;
      padding: 20px;
      border-radius: 10px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    h1 {
        text-align: center;
        margin-bottom: 30px;
        color: #ccc100;
        font-size: 42px;
        font-weight: 700;
    }
 

    .question {
      font-size: 18px;
      margin-bottom: 20px;
    }

    .options label {
      display: block;
      margin-bottom: 10px;
    }

    .options input {
      margin-right: 5px;
    }

    .submit-btn {
      display: block;
      width: 100%;
      padding: 10px;
      font-size: 16px;
      text-align: center;
      background-color: #ccc100;
      color: #fff;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    .result {
      font-size: 20px;
      text-align: center;
      margin-top: 30px;
    }
  </style>
  
    <?php
        
        $uid="";
        $exam_type = $_GET['exam_ids'];
        
        $sql_mock_test = $pdo->prepare("SELECT * FROM tbl_mock_test WHERE mock_test_type=".$exam_type);
		$sql_mock_test->execute();
		$mock_result = $sql_mock_test->fetchAll(PDO::FETCH_ASSOC);
		$mock_total = $sql_mock_test->rowCount();
		$date = date('Y-m-d');
		
		if(isset($_SESSION['user_exam'])){
		    $uid = $_SESSION['user_exam']['id'];
		}
		
		
    ?>
<div class="section-full p-t120  p-b90 site-bg-white" style="transform: none;">
    <div class="container">
                    <div class="row">
                        <div class="col-lg-4 col-md-12 rightSidebar">
                            <div class="side-bar">
                                <div class="twm-s-info2-wrap mb-5">
                                    <div class="twm-s-info2">
                                        <ul class="twm-job-hilites2">
                                        <li>
                                            <div class="twm-s-info-inner">
                                                <div class="btn btn-primary" Onclick="reeaxm(<?=$uid?>,<?=$exam_type?>)"> Write Reexam </div>
                                            </div>
                                        </li>
                                        <li>
                                            <div class="twm-s-info-inner">
                                                <a href="test.php?exam_id=<?=$exam_type?>" class="btn btn-primary" >
                                                    Download
                                                </a>
                                            </div>
                                        </li>
                                        <!--<li>
                                            <div class="twm-s-info-inner">
                                                <i class="fas fa-user-tie"></i>
                                                <span class="twm-title">Job Title </span>
                                                <div class="twm-s-info-discription">Web Developer </div>
                                            </div>
                                        </li>-->
                                    </ul>
                                </div>    
                            </div>
                        </div>
                    </div>
                        <div class="col-lg-8 col-md-12">
                            <div class="twm-jobs-list-wrap">
                                <h1>Questions</h1>
                                <form>
                                    <?php
                                    $right = ''; 
                                    $style = ''; 
                                    $icons = ''; 
                                    $color =''; 
                                    $i = 0; 
                                    foreach ($mock_result as $mock_result_datas){ $i ++;
                                    

                                        $final_sql = $pdo->prepare("SELECT * FROM tbl_mock_test_result WHERE user_id=$uid AND date = '$date' AND type = $exam_type AND question_id =".$mock_result_datas['id']);
		                                $final_sql->execute();
		                                $final_result = $final_sql->fetchAll(PDO::FETCH_ASSOC);
		                                $final_total = $final_sql->rowCount();
		                              
		                                
		                                if($final_total>0){
		                                    
		                                    if($final_result[0]['select_option']==$mock_result_datas['correct_answer']){
		                                       //  Right code
		                                        $color = 'style="color:red;"';
		                                        $icons = '<i class="bi bi-check-lg" style="color: red;font-size: larger;font-weight: 900;"></i>';
		                                    }else{
		                                      //  wrong code
		                                        $color = 'style="color:green;"';
		                                        $icons = '<i class="bi bi-x" style="color: green;font-size: larger;font-weight: 900;"></i>';
		                                    }
		                                    
		                                }else{
		                                    $color = 'style="color:blue;"';
		                                    $icons = '<i class="bi bi-skip-end" style="color: blue;font-size: larger;font-weight: 900;"></i>';
		                                }
                                    
                                    ?>
                                    <div class="question">
                                        <p><?= $i ?> . <?=$mock_result_datas['question'] ?> <?= $icons ?> </p>
                                        <div class="options">
                                            <label>a) <?= $mock_result_datas['option_a'] ?></label>
                                            <label>b) <?= $mock_result_datas['option_b'] ?></label>
                                            <label>c) <?= $mock_result_datas['option_c'] ?></label>
                                            <label>d) <?= $mock_result_datas['option_d'] ?></label>
                                        </div>
                                    </div>
                                   <?php } ?>
                                </form>
                              </div>
                         </div>
                     </div>
                 </div>
</div>


<?php include 'footer.php'; ?>

<script>
        function reeaxm(user_id,exam_type){
            var result = confirm("Confirm want to Write a Re-exam");
            if (result){
                    $.ajax({
                    type: 'POST',
                    url: 'api/delete.php',
                    data: {type:'hard_delete',user_id:user_id,exam_type:exam_type,table_name:'tbl_mock_test_result'},                  
                    success: function(response) {
                        window.location.href="quiz/mock-exam.php?exam_id=<?=$exam_type?>";
                    }
                });
            }
        }
</script>

Zerion Mini Shell 1.0