<?php include ("../../controller/session/session-checker-teacher-student-admin-parents.php"); ?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="../img/favicon/<?php echo $Favicon; ?>">
    <title>Dashboad | <?php echo $PrimaryName.' '.$SecondaryName; ?></title>
    <!-- Bootstrap Core CSS -->
    <link href="../library/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!--This page css - Morris CSS -->
    
    <link rel="stylesheet" href="../library/plugins/morrisjs/morris.css">
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
    
    <!-- Custom CSS -->
    <link href="../css/style-student.php" rel="stylesheet">
     <link href="../css/blueStudent.php" id="theme" rel="stylesheet">
    <!-- You can change the theme colors from here -->
  
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->


<style>
            .dot {
            height: 15px;
            width: 15px;
            background-color: #55ce63;
            Opacity: 0.8;
            border-radius: 50%;
            display: inline-block;
            }
            .dott {
            height: 15px;
            width: 15px;
            background-color: #2f3d4a;
            Opacity: 0.8;
            border-radius: 50%;
            display: inline-block;
            }
            .dottt {
            height: 15px;
            width: 15px;
            background-color: #009efb;
            Opacity: 0.8;
            border-radius: 50%;
            display: inline-block;
            }

</style>
</head>

<body class="fix-header card-no-border logo-center">
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
    <div class="preloader">
        <svg class="circular" viewBox="25 25 50 50">
            <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" /> </svg>
    </div>
    <!-- ============================================================== -->
    <!-- Main wrapper - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <div id="main-wrapper">
        <!-- ============================================================== -->
        <!-- Topbar header - style you can find in pages.scss -->
        <!-- ============================================================== -->
        <header class="topbar chimaPrimaryColor">
        <?php include ('../includes/header-student.php'); ?>
        </header>
        <!-- ============================================================== -->
        <!-- End Topbar header -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
                <!-- Sidebar navigation-->
                <aside class="left-sidebar">
                               
                    <?php include ('../includes/menu-student.php'); ?>
                 </aside>
                <!-- End Sidebar navigation -->
        <!-- ============================================================== -->
        <!-- End Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page wrapper  -->
        <!-- ============================================================== -->
            <!-- Page wrapper  -->
        <!-- ============================================================== -->
        <div class="page-wrapper" >
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
           
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid">
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                
                        <div class="row" style="height: 100%; width: 100%; margin-top: 10px;">
                            
                            <div class="col-sm-12" style="height: 100%; width: 100%;">
                                <div class="card">
                                    <div class="card-body" style="background-color: rgb(255, 255, 255); height: 100%; width: 100%; box-shadow: 1px 3px 10px #C4DDEB;">
                                        <div class="row">
                                        <?php

                                   $cbtid = $_GET['cbt_id'];
                                        $UserID = $_GET['UserID'];
                                        

                                                $Select = "SELECT * FROM  `cbtsetquestionssettings` 
                                                            WHERE  cbtsetquestionssettings.cbtsetquestionssettingsID = '$cbtid'";
                                                $selectQuery = mysqli_query($link, $Select);


                                                while($fetch = mysqli_fetch_array($selectQuery))
                                                {

                                                    $subject =  $fetch['SubjectOrCourseID'];

                                                    $Select1 = "SELECT * FROM  `subjectorcourse` WHERE  SubjectOrCourseID = '$subject'";
                                                    $selectQuery1 = mysqli_query($link, $Select1);

                                                    $fetch2 = mysqli_fetch_array($selectQuery1);

                                                    $subjectName = $fetch2['SubjectOrCourseTitle'];

                                                    date_default_timezone_set("Africa/Lagos");

                                                    $date = $fetch['AssesementDate'];
                                                    $time1 = $fetch['AssesementStartTime'];
                                                    $time2  =  $fetch['AssesementEndTime'];
                                                    $difference = strtotime($time2)- strtotime($time1);

                                                    if($difference / 3600 > 0){
                                                        $hour = $difference / 3600;
                                                        $hour = (int)$hour;
                                                   
                                                        $difference = $difference - ($hour * 3600);
                                                   
                                                     }else{
                                                        $hour = "00";
                                                     }

                                                     if($difference / 60 > 0){
                                                        $min = $difference / 60;
                                                 
                                                        $difference = $difference - ($min * 60);
                                                 
                                                     }else{
                                                         $min = "00";
                                                     }

                                                ?> 
                                            
                                            <div class="col-sm-9">
                                                <h1 style="font-style: italic; margin-top: 50px; color: black;"><?php echo $subjectName; ?> QUIZ/EXAM</h1>                                      
                                            </div>
                                            <div class="col-sm-3">
                                                <h2 align="center">Time Left</h2>
            
                                                <div class="row">
                                                    <div class="col-sm-2 col-xs-2 col-md-2">
                                                        
                                                    </div>
                                                    
                                                   <div class="col-sm-3 col-xs-3 col-md-3">
                                                        <h4><?php echo $hour;?></h4>
                                                        <small align="center">hour</small>
                                                    </div>

                                                    <div class="col-sm-3 col-xs-3 col-md-3">
                                                        <h4><?php echo $min;?></h4>
                                                        <small>Mins</small>
                                                    </div>
                                                   <!-- <div class="col-sm-3 col-xs-3 col-md-3">
                                                        <h4>35</h4>
                                                        <small>Sec</small>
                                                    </div>-->
                                                    <div class="col-sm-1 col-xs-1 col-md-1">
                                                        
                                                    </div>
                                                
                                                </div>
            
                                            </div>
                                        </div>
                                      <?php
                                      }
                                      ?>
                                        <div class="myborder"></div>
            
                                        <div align="center" style="margin-top: 50px;">
                                            <p style="color: black;">Welcome to your online quiz. There are 40 questions to be answered, and you have 40mins to answer all questions
                                                <br>before the time runs out. Kindly choose the correct option using the mouse to select the answer to the question.<br>
                                                You can also select any question below to answer, By clicking on the number at the right side of the screen. 
                                                Don't forget <br>to click on the submit button when ever your are done answering your questions. So when you are ready to start your
                                                <br> quiz click on the start button to get started.
                                            </p>
                                        </div>
            
                                        <div align="center" style="margin-top: 50px;">
                                            <a href="cbtQuestionPage.php?cbt_id=<?php echo $cbtid;?>&&UserID=<?php echo $UserID;?>" type="button" class="btn waves-effect waves-light btn-lg btn-info">Start Quiz</a>
                                        </div>
            
                                        <a href="cbt.html" type="button" class="btn waves-effect btn-rounded waves-light btn-info" style="font-size: 15px; float: right; margin-top: 10%;">Back</a>
                                        
                                    </div>
                                </div>
                            </div>                             
                            
                           
                        </div>
                  
            
              
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
             <!-- footer -->
            <!-- ============================================================== -->
            <?php include ('../includes/footer.php'); ?>
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="../library/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="../library/plugins/bootstrap/js/popper.min.js"></script>

    <script src="../library/plugins/bootstrap/js/bootstrap.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="../js/jquery.slimscroll.js"></script>
    <!--Wave Effects -->
    <script src="../js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="../js/sidebarmenu.js"></script>
    <!--stickey kit -->
    <script src="../library/plugins/sticky-kit-master/dist/sticky-kit.min.js"></script>
    <script src="../library/plugins/sparkline/jquery.sparkline.min.js"></script>
    <!--Custom JavaScript -->
    <script src="../js/custom.min.js"></script>
    <!--morris JavaScript -->
    <script src="../library/plugins/raphael/raphael-min.js"></script>
    <script src="../library/plugins/morrisjs/morris.min.js"></script>
    <!-- sparkline chart -->
    <!-- Footable -->
    <script src="../library/plugins/footable/js/footable.all.min.js"></script>
    <script src="../library/plugins/bootstrap-select/bootstrap-select.min.js" type="text/javascript"></script>
    <!--FooTable init-->
    <script src="../js/footable-init.js"></script>

    <!-- Bootstrap tether Core JavaScript -->
    <!-- slimscrollbar scrollbar JavaScript -->
    <!--Wave Effects -->
    <!--Menu sidebar -->
    <!--stickey kit -->
    <!--Custom JavaScript -->
    <script src="../library/plugins/sparkline/jquery.charts-sparkline.js"></script>
    <!-- ============================================================== -->
    <!-- Style switcher -->
    <!-- ============================================================== -->
    



    <script src="../library/plugins/sparkline/jquery.sparkline.min.js"></script>
    <script src="../js/dashboard4.js"></script>
    <!-- ============================================================== -->
    <!-- Style switcher -->
    <!-- ============================================================== -->
    <script src="../library/plugins/styleswitcher/jQuery.style.switcher.js"></script>
    <script src="../library/plugins/datatables/jquery.dataTables.min.js"></script>
    <!-- start - This is for export functionality only -->
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.print.min.js"></script>

    

     
</body>

</html>
