<?php session_start();
unset($_SESSION['StartTime']);
require_once 'config.php';
//require_once '../dompdf/autoload.inc.php'; 
require_once 'auth.php';
$PageName = "Scholarship Test";
$UserId = $_SESSION['User']['id'];
 ?>
<!doctype html>
<html lang="en" class="h-100">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="generator" content="">
    <title><?php echo $Proj_Title; ?></title>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <link rel="apple-touch-icon" href="img/favicon180.png" sizes="180x180">
    <link rel="icon" href="img/favicon32.png" sizes="32x32" type="image/png">
    <link rel="icon" href="img/favicon16.png" sizes="16x16" type="image/png">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&amp;display=swap" rel="stylesheet">
    <link href="vendor/swiper/css/swiper.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet" id="style">
</head>

<body class="body-scroll d-flex flex-column h-100 menu-overlay">
    <main class="flex-shrink-0 main">
        <?php include_once 'back-header.php'; ?> 
        <div class="main-container">
            <div class="container">
                <div class="card mb-4">
                  
                  <div class="card-body px-0 pt-0">
                        <div class="list-group list-group-flush border-top border-color">
                    
                     <?php 
                    $i=1;
                    $sql3 = "SELECT ta.*,ts.* FROM tbl_apply_scholarship ta
                     INNER JOIN tbl_scholarship ts ON ta.SchId=ts.id WHERE ta.UserId='$UserId'";
                     $rncnt2 = getRow($sql3);
                     if($rncnt2 > 0){
                    $res2 = getList($sql3);
                    foreach($res2 as $row){ 
                       $TestId = $row['id'];
              $sql = "SELECT * FROM tbl_sch_result WHERE TestId='$TestId' AND UserId='$UserId'";
              $rncnt = getRow($sql);

            ?>
                      
                      <div class="list-group-item list-group-item-action border-color">
                                <div class="row">
                                    <div class="col-auto">
                                        <div class="avatar avatar-50 bg-default-light text-default rounded">
                                     <?php if($result["Photo"] == '') {?>
                                      <img src="no_image.jpg" style="width: 50px;height: 50px;"> 
                                      <?php } else if(file_exists($UploadUrl.'/uploads/'.$result["Photo"])){?>
                                      <img src="<?php echo $UploadUrl;?>/uploads/<?php echo $result["Photo"];?>" style="width: 50px;height: 50px;">
                                      <?php }  else{?>
                                      <img src="no_image.jpg" style="width: 50px;height: 50px;"> 
                                      <?php } ?>
                                    
                                        </div>
                                    </div>
                                    <div class="col align-self-center pl-0">
                                        <h6 class="mb-1"> <?php echo $row['Title']; ?></h6>
                                    </div>
                                    <div class="col-auto" style="padding-top:10px;">
                                       <?php 
                                $FileUrl = $SiteUrl."app/".$FileUrl;
                if($rncnt > 0){?>
                  <a href="view-sch-result.php?testid=<?php echo $row['id']; ?>" class="btn btn-success btn-finish">View Result</a>
              <?php } else{?>
                 <a href="javascript:void(0)" class="btn btn-primary btn-finish" data-toggle="modal" data-target="#myModal<?php echo $row['id']; ?>" class="btn btn-primary btn-finish">Start Test</a>
              <?php } ?>
                                    </div>
                                </div>
                            </div>
                            

                             <div id="myModal<?php echo $row['id']; ?>" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>

      </div>
      <div class="modal-body">

                                <h4><strong><u>General Instructions:</u></strong></h4>
                                <ol><li>The clock will be set at the server. The countdown timer in the top right corner of screen will display the remaining time available for you to complete the examination. When the timer reaches zero, the examination will end by itself. You will not be required to end or submit your examination.</li>
                                    <li>
                                        The Questions Palette displayed on the right side of screen will show the status of each question using one of the following symbols:
                                        <ol>
                                            <li><img src="testcss/Logo1.png" /> You have not visited the question yet.<br /><br /></li>
                                            <li><img src="testcss/Logo2.png" /> You have not answered the question.<br /><br /></li>
                                            <li><img src="testcss/Logo3.png" /> You have answered the question.<br /><br /></li>
                                            <li><img src="testcss/Logo4.png" /> You have NOT answered the question, but have marked the question for review.<br /><br /></li>
                                            <li><img src="testcss/Logo5.png" /> The question(s) "Answered and Marked for Review" will be considered for evalution.<br /><br /></li>
                                        </ol>
                                    </li>
                                    <li>You can click on the "&gt;" arrow which apperes to the left of question palette to collapse the question palette thereby maximizing the question window. To view the question palette again, you can click on "&lt;" which appears on the right side of question window.</li>
                                    <li>You can click on your "Profile" image on top right corner of your screen to change the language during the exam for entire question paper. On clicking of Profile image you will get a drop-down to change the question content to the desired language.</li>
                                    <li>You can click on <img src="testcss/down.png" /> to navigate to the bottom and <img src="testcss/up.png" /> to navigate to top of the question are, without scrolling.</li>
                              </ol>
                                <h4><strong><u>Navigating to a Question:</u></strong></h4>
                                <ol start="6">
                                    <li>
                                        To answer a question, do the following:
                                        <ol type="a">
                                            <li>Click on the question number in the Question Palette at the right of your screen to go to that numbered question directly. Note that using this option does NOT save your answer to the current question.</li>
                                            <li>Click on <strong>Save & Next</strong> to save your answer for the current question and then go to the next question.</li>
                                            <li>Click on <strong>Mark for Review & Next</strong> to save your answer for the current question, mark it for review, and then go to the next question.</li>
                                        </ol>
                                    </li>
                                </ol>
                                <h4><strong><u>Answering a Question:</u></strong></h4>
                                <ol start="7">
                                    <li>
                                        Procedure for answering a multiple choice type question:
                                        <ol type="a">
                                            <li>To select you answer, click on the button of one of the options.</li>
                                            <li>To deselect your chosen answer, click on the button of the chosen option again or click on the <strong>Clear Response</strong> button</li>
                                            <li>To change your chosen answer, click on the button of another option</li>
                                            <li>To save your answer, you MUST click on the Save & Next button.</li>
                                            <li>To mark the question for review, click on the Mark for Review & Next button.</li>
                                        </ol>
                                    </li>
                                    <li>To change your answer to a question that has already been answered, first select that question for answering and then follow the procedure for answering that type of question.</li>
                                </ol>
                                <h4>&nbsp;</h4>
                                <hr>
                             
      </div>
      <div class="modal-footer">
        <a href="start-sch-test.php?testid=<?php echo $row['id']; ?>" class="btn btn-primary btn-finish">Start Test</a>
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>
                   
                    <?php $i++;}} else{?>
                        <h3 style="color:red;padding-left: 10px;font-size: 20px;">No Scholarship Test Found</h3>
                    <?php }  ?>
                    
                </div>
                       
                </div>
            </div>
        </div>
    </main>
 <?php include_once 'footer.php'; ?>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="vendor/swiper/js/swiper.min.js"></script>
<script src="js/main.js"></script>
<script src="js/color-scheme-demo.js"></script>
<script src="js/app.js"></script>
<script>
    function onDownloadFileFromUrl(url,filename){
        //alert(url);alert(filename);exit();
         Android.onDownloadFileFromUrl(''+url+'',''+filename+'');
    }
</script>
</body>
</html>
