HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/selfanalyse/interest-test/test_instruction.php
<?php

/**
 * 
 * Title : Test Instruction Page
 * Developer : Gulfam Ali, Rohit Kashyap, Sumit Singh Rawat (Designer)
 * Date : 03 Mar,2020
 * Description : First page for instruction of test (Personality Test)
 * 
 */
?>
<!-- <body oncontextmenu="return false;"> -->

<body oncontextmenu="return false;">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <?php
    // ini_set('display_error', 1);
    // ini_set('display_startup_errors', 1);
    // error_reporting(E_ALL);
    ?>

    <?php
    include_once('../wp-config.php');
    global $wpdb;
    $PSY_EXAMS = $wpdb->prefix . PSY_EXAMS;
    $PSY_SUBSCRIPTION = $wpdb->prefix . PSY_SUBSCRIPTION;
    $PSY_TEST_GEN_TEST_TAKEN = $wpdb->prefix . PSY_TEST_GEN_TEST_TAKEN;

    $subscriptionId = $_POST['sID'];
    $class_id = $_POST['class_id'];
    $testType = 'new';
    $view = $_REQUEST['view'];
    $pending_test_id = $_REQUEST['pending_test_id'];

    global $current_user;
    if (is_user_logged_in()) {
        get_currentuserinfo();
        $user_id = $current_user->ID;  // print session USER_ID

        $validSubscription = $wpdb->get_row("SELECT subscription_id, exam_id, test_type FROM $PSY_SUBSCRIPTION where subscription_id='$subscriptionId'");
        if ($validSubscription > 0) {

            $examName = 'Interest Test';
            $exam_id = $validSubscription->exam_id;
            $totalTimeForExam = '20';
            $totalMinute = $totalTimeForExam;
            $DisplayTime = $totalTimeForExam;
            $dispHr = floor($DisplayTime / 60);
            $dispmins = $DisplayTime % 60;
            if ($dispmins > 0) {
                $dispmin = $dispmins . ' minutes';
            } else {
                $dispmin = "";
            }
            if ($dispHr > 1) {
                $DisptimeInHour = $dispHr . ' hours ' . $dispmin;
            } else {
                $DisptimeInHour = $dispHr . ' hour ' . $dispmin;
            }

            if ($testType == "new" && $testTakenId == 0) // if test is new test
            {
                $totalDONE = $wpdb->get_var("SELECT count(*) from $PSY_TEST_GEN_TEST_TAKEN where user_id='$user_id' and exam_category_id='$exam_id'");
                /*------------ set the timer -------------*/
                $dateFormat = "d F Y -- g:i a";
                $targetDate = time() + ($totalMinute * 60); //Change the $totalMinute to however many minutes you want to countdown
                $actualDate = time();
                $secondsDiff = $targetDate - $actualDate;
                $remainingDay     = floor($secondsDiff / 60 / 60 / 24);
                $remainingHour    = floor(($secondsDiff - ($remainingDay * 60 * 60 * 24)) / 60 / 60);
                $remainingMinutes = floor(($secondsDiff - ($remainingDay * 60 * 60 * 24) - ($remainingHour * 60 * 60)) / 60);
                $remainingSeconds = floor(($secondsDiff - ($remainingDay * 60 * 60 * 24) - ($remainingHour * 60 * 60)) - ($remainingMinutes * 60));
                $totalTimeSpent = 0;
            }

            $hours = floor($totalTimeForExam / 60);
            $minutes = $totalTimeForExam % 60;
            if ($minutes > 0) {
                $minute = $minutes . ' minutes';
            } else {
                $minute = "";
            }
            if ($hours > 1) {
                $timeInHour = $hours . ' hours ' . $minute;
            } else {
                $timeInHour = $hours . ' hour ' . $minute;
            }
            $typeExam = "Test";

    ?>
            <input type="hidden" value="<?php echo $remainingHour ?>" name="tt_hour" id="tt_hour" />
            <input type="hidden" value="<?php echo $remainingMinutes; ?>" name="tt_minute" id="tt_minute" />
            <input type="hidden" value="<?php echo $remainingSeconds; ?>" name="tt_second" id="tt_second" />
            <input type="hidden" value="<?php echo $totalTimeSpent; ?>" name="totalTimeSpent" id="totalTimeSpent" />
            <input type="hidden" name="subjectChoice" value="<?php echo $subjectChoice; ?>" id="subjectChoice">
            <input type="hidden" name="test_type" value="<?php echo $testType; ?>" id="test_type">
            <link rel="stylesheet" type="text/css" href="tet_assign_test.css?v=<?php echo date('dmyhis'); ?>">

            <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,900|Roboto:300,400,500,700,900&display=swap" title="default">

            <script src="/aptitude-test/js/jquery-1.12.4.js"></script>
            <script src="tet_assign_test.js?v=<?php echo date('dmyhis'); ?>"></script>
            <link rel="stylesheet" type="text/css" href="/aptitude-test/css/bootstrap.min.css">
            <script src="/aptitude-test/js/bootstrap.min.js"></script>
            <link rel="stylesheet" href="/aptitude-test/css/font-awesome.min.css">
            <link rel="stylesheet" type="" href="/aptitude-test/css/toastr.min.css">
            <script src="/aptitude-test/js/toastr.min.js"></script>

            <input type="hidden" value="<?php echo ROOT_LINK; ?>" name="siteUrl" id="siteUrl" />
            <input type="hidden" value="<?php echo $app_status; ?>" id="app_status" />

            <!-- INSTRUCTION PAGE SECTION -->

            <section>
                <div class="container">
                    <div class="center" id="center" style="display: block;">

                        <div class="col-md-12 col-sm-12 col-xs-12 exam_name">
                            <h4 class="exam_title_dash" id="xam1">Test Name :
                                <span style="font-weight: 500;" id="name_eng">
                                    <?php echo $examName; ?>
                                </span>
                            </h4>
                        </div>

                        <div id="tet_loading_img" style="display: none;margin-top: 125px;text-align: center;">
                            <img src="<?php echo get_bloginfo('url') . '/aptitude-test/fancybox_loading.gif'; ?>" /><br>
                            <?php echo 'Loading...'; ?>..
                        </div>

                        <div class="col-md-12 col-sm-12 col-xs-12" id="instruction_area1">
                            <div id="eng">
                                <h4 class="gen_ins">General Instructions </h4>
                                <ol>
                                    <li>There are multiple answer options for each questions. You can select as many professions as you like (even all 10).<br>
                                    </li>
                                    
                                    <li>There are three buttons / keys at the bottom.<br>
                                    </li>
                                    <li><button class="prv"> Previous </button> button will take you to the previous question.<br>
                                    </li>
                                    <li><button class="nxt"> Next </button> button will take you to the next question.<br>
                                    </li>
                                    <li><button class="sub">Finish & Exit</button> Finish the exam and your reports will be ready within 48 hrs after our experts have created your profile.<br>
                                    </li>
                                    <li>You can see the time clock on the top right corner of the exam page. There is no fixed time limit for this test, but it should not take you more than 20 minutes to complete this. DO NOT overthink. Just select the option that you find interesting and would like to pursue even at a later time in life.<br>
                                    </li>
                                </ol>

                                <h4 class="gen_ins">Test Specific Instructions</h4>

                                <ol>
                                    <li>This test is aimed at finding your field of interest. Interest plays a major role in choosing the right career. Once you know the area that interests you the most it will help you prepare yourself.</li>
									<li>In the test you will be given 10 options of different careers/professions. You have to select the professions that interest you the most. You can select as many professions as you like (even all 10). In case you don’t like any of the listed professions, then select the last option - “None”.
									</li>
									<li>If you do not know about any of the professions listed here, you can click on the ‘Glossary’ tab to find out about that profession. Once you have read about that profession and it interests you then you can select it or leave it as the case may be. Do not leave the option just because you don’t know about it.
									</li>
									<li>EXAMPLE:<br>
								Question: Select the profession(s) that you find interesting. (Select as many as you like)
									<br>a)	Doctor    <br>b)	Engineer      <br>c)	Lawyer  <br>d)	Judge  <br>e)	Teacher  <br>f)	Scientist <br>g)	Singer  <br>h)	Football player  <br>i)	Shopkeeper  <br>j)	Salesperson  <br>k)	None </li>
                                </ol>
                            </div>
                        </div>

                        <div class="col-md-12 col-sm-12 col-xs-12">
                            <div id="instruction_area2" style="display: none;" class="text-center">
                                <div style="text-align: center;padding-top: 95px;width: 100%;font-size: 14px;font-weight: bold">
                                    <?php echo 'Time to complete your test is ' . $timeInHour; ?><br>
                                    <?php echo "Please check the time clock." ?>
                                </div>

                                <div style="text-align: center;padding-top: 10px;width: 100%">
                                    <a id="start_test" class="button noe" style="cursor:pointer;">Start</a>
                                </div>
                            </div>
                        </div>

                        <div class="container-fluid" id="checkbox_disc">
                            <div class="row">
                                <div class="mock_test_footer">
                                    <div class="col-md-12">
                                        <span id="chkMsg" style="color:#cc0000; width: 100%; float: left; font-size:15px;"></span>
                                        <h4 class="int_ti"><input id="chk_accept" class="check" type="checkbox" name="chk_accept" value="1"> <span id="instructions_eng"> I have read all Instructions.</span> <br />
                                            <span id="instructions_hnd" class="hide"> मैंने सभी निर्देश पढ़ लिए है|</span> </h4>
                                    </div>
                                    <div class="col-md-12">
                                        <a id="show_area2" style="cursor:pointer;">
                                            <button class="start_test">
                                                <span id="srt_eng">Start Test</span>
                                            </button>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

            <!-- END INSTRUCTION PAGE SECTION -->


            <!-- QUESTION AND ANSWER PAGE SECTION -->

            <section>
                <div id="question_div" style="display: none">
                    <div id="tet_loading_img" style="display: block;margin-top: 125px;text-align: center;">
                        <img src="<?php echo get_bloginfo('url') . '/aptitude-test/fancybox_loading.gif'; ?>" /><br>
                        <?php echo 'Loading...'; ?>..
                    </div>
                    <input type="hidden" value="<?php echo $exam_id; ?>" name="exam_category_id" id="exam_category_id" />
                    <input type="hidden" name="class_id" id="class_id" value="<?php echo $class_id; ?>">
                    <input type="hidden" name="view" id="view" value="<?php echo $view; ?>">
                    <input type="hidden" name="pending_test_id" id="pending_test_id" value="<?php echo $pending_test_id; ?>">
                    <input type="hidden" name="test_view_type" id="test_view_type" value="<?php echo $validSubscription->test_type; ?>">
                    <input type="hidden" name="asign_ref_id" id="asign_ref_id" value="<?php echo $subscriptionId; ?>">
                </div>
            </section>

            <!-- QUESTION AND ANSWER PAGE SECTION -->


    <?php
        } // end of valid subscription if
        else {
            ?>
            <script>window.location.href='/test'</script>
            <?php
        }
    } // end of check login if
    else {
        echo "Login first to view this page";
    }
    ?>


</body>