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/aptitude-test/print_page.php
<?php

/**
 *
 * Title : Test Report
 * Developer : Rohit Kashyap
 * Date : 18 Mar,2020
 * Description : User test report and their sten score in print format with highchart.
 */
// ini_set('dsiplay_errors', 1);
// error_reporting(E_ALL);
include_once('../wp-config.php');

if (is_user_logged_in()) {
    $user_id = $current_user->ID;


    global $wpdb;
    $PSY_SP_QUESTION = $wpdb->prefix . PSY_SP_QUESTION;
    $PSY_EXAMS = $wpdb->prefix . PSY_EXAMS;
    $PSY_ABILITY = $wpdb->prefix . PSY_ABILITY;
    $PSY_ABILITY_CLASS = $wpdb->prefix . PSY_ABILITY_CLASS;
    $PSY_USERS_DETAILS = $wpdb->prefix . PSY_USERS_DETAILS;
    $PSY_ABILITY_RAW_SCORE = $wpdb->prefix . PSY_ABILITY_RAW_SCORE;
    $PSY_ABILITY_STEN_DESC = $wpdb->prefix . PSY_ABILITY_STEN_DESC;
    $PSY_TEST_GEN_TEST_TAKEN = $wpdb->prefix . PSY_TEST_GEN_TEST_TAKEN;
    $PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER = $wpdb->prefix . PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER;

    $testID = $_REQUEST['testId'];

    $curDate = date('Y-m-d H:i:s');

    if (is_numeric($testID) && strlen($eng_exam_id) <= 5) {

        $checkTest = $wpdb->get_var("SELECT count(test_taken_id) FROM $PSY_TEST_GEN_TEST_TAKEN where test_taken_id='$testID' and user_id='$user_id' and test_type='APT' and status='Y'");

        if ($checkTest != '0') {



            $userData = $wpdb->get_row("SELECT ud.first_name,ud.last_name,ud.date_of_birth,cl.class_name,ud.email_address,ud.mobile_number,ud.gender_id FROM $PSY_USERS_DETAILS as ud left join $PSY_ABILITY_CLASS as cl on cl.class_id=ud.current_education_level where user_id='$user_id'");

            $studentName = $userData->first_name . ' ' . $userData->last_name;
            $dob = date('d F, Y', strtotime($userData->date_of_birth));
            $class = $userData->class_name;
            $email = $userData->email_address;
            $mobile = $userData->mobile_number;
            $gender = $userData->gender_id;




            $getTestDetails = $wpdb->get_row("SELECT tt.total_questions,tt.class_id,tt.time_taken_in_seconds,tt.start_date,e.category_name,cl.class_name FROM $PSY_TEST_GEN_TEST_TAKEN as tt LEFT JOIN $PSY_EXAMS as e on e.exam_category_id=tt.exam_category_id LEFT JOIN $PSY_ABILITY_CLASS as cl on cl.class_id=tt.class_id where tt.test_taken_id='$testID' and tt.status='Y'");

            $class_id = $getTestDetails->class_id != '0' ? $getTestDetails->class_id : '9';
            $dateAttempt = date('d F, Y', strtotime($getTestDetails->start_date));
            $seconds = $getTestDetails->time_taken_in_seconds;
            $testDate = date('Y-m-d h:i:s', strtotime($getTestDetails->start_date));
            $date1 = str_replace('-', '/', $testDate);
            $tomorrow = date('Y-m-d H:i:s', strtotime($date1 . '+1 days'));

            $getsubject = $wpdb->get_results("SELECT e.category_name,e.exam_category_id from $PSY_EXAMS as e LEFT JOIN $PSY_ABILITY as ab on ab.ref_id=e.exam_category_id where e.parent_id='48282' order by e.display_order asc");


?>

            <link rel="stylesheet" href="css/bootstrap.min.css">


            <script src="js/jquery.min.js"></script>
            <script src="js/bootstrap.min.js"></script>
            <script src="js/highcharts.js"></script>
            <script src="js/highcharts-3d.js"></script>
            <style>
                body {
                    font-family: Verdana, Geneva, Tahoma, sans-serif;
                }

                .bold-txt {
                    font-weight: bold;
                    color: #000;
                }

                .col-md-2 {
                    width: 13.666667% !important;
                }

                /* MARGIN CSS */
                .mt-20 {
                    margin-top: 20px
                }

                .mb-20 {
                    margin-bottom: 20px
                }

                table {
                    border-collapse: collapse;
                    border-spacing: 0;
                    width: 100%;
                    border: 1px solid #ddd;
                }

                th,
                td {
                    text-align: left;
                    padding: 8px;
                }

                .header-logo {
                    width: 40%;
                    float: right;
                }

                .chart-header-box {
                    float: left;
                    width: 100%;
                    border-radius: 4px;
                    background: #fff;
                    padding: 10px;
                    border-bottom: 1px solid #cecece;
                }

                .chart-header-box h4 {
                    font-size: 16px;
                }

                .intro-box {
                    margin: 0;
                    padding-left: 14px;
                    background: #fff;
                    padding: 10px;

                    float: left;
                    width: 100%;
                }

                .intro-box h2 {
                    margin: 0;
                    color: #464646;
                    font-weight: 600;
                    font-size: 24px;
                    padding: 0 0 20px;
                }



                .one-circle-box {
                    border-radius: 50%;
                    text-align: center;
                    padding: 24px 0;
                    width: 140px;
                    margin: 0 auto;
                }

                .one-circle-box i {
                    font-size: 28px;
                }

                .chart-box {
                    border: 1px solid #cccccc;
                    box-shadow: 0 2px 4px 2px #c7c7c7;
                    margin: 2em 0;
                }

                #container {
                    /* height: 550px; */
                }

                .highcharts-data-table table {
                    font-family: Verdana, sans-serif;
                    border-collapse: collapse;
                    border: 1px solid #EBEBEB;
                    margin: 10px auto;
                    text-align: center;
                    width: 100%;
                    max-width: 500px;
                }

                .highcharts-data-table caption {
                    padding: 1em 0;
                    font-size: 1.2em;
                    color: #555;
                }

                .highcharts-data-table th {
                    font-weight: 600;
                    padding: 0.5em;
                }

                .highcharts-data-table td,
                .highcharts-data-table th,
                .highcharts-data-table caption {
                    padding: 0.5em;
                }

                .highcharts-data-table thead tr,
                .highcharts-data-table tr:nth-child(even) {
                    background: #f8f8f8;
                }

                .highcharts-data-table tr:hover {
                    background: #f1f7ff;
                }

                svg:not(:root) {
                    overflow: visible !important;
                }

                .highcharts-container {
                    overflow: visible !important;
                }

                .intro-box h5 {
                    margin: 0;
                    color: #fff;
                    font-size: 18px;
                    padding: 10px;
                    text-align: center;
                    background: #f1802b;
                }

                .ability-desc-box h2 {
                    margin: 0;
                    color: #464646;
                    font-weight: 600;
                    font-size: 20px;
                    padding: 30px 0 10px;
                }


                .intro-box p {
                    margin: 0;
                    font-size: 16px;
                }

                .ability-desc-box {
                    border-bottom: 1px solid #434348;
                    padding-bottom: 20px;
                }

                .sten-score {
                    border: 1px solid #b1b1b1;
                    box-shadow: 0 2px 4px 2px #9a9a9a;
                    padding: 10px;
                    margin-top: 1em;
                    /* background: #90ed7d; */
                }

                .sten-score h3 {
                    font-size: 18px;
                    margin: 0;
                    padding-bottom: 10px;
                }

                .description-ul {
                    padding: 20px;
                }

                .description-ul li {
                    list-style: decimal;
                    color: #000;
                    margin-bottom: 20px;
                    font-size: 15px;
                }

                .test-head {
                    font-size: 26px !important;
                    padding-bottom: 10px;
                }

                .chart-header-box h6 {
                    margin: 0;
                    font-size: 17px;
                    padding: 10px 0 30px;
                    line-height: 24px;
                    font-weight: 600;
                }

                .back-home-btn {
                    font-size: 14px;
                    background: #0085f7;
                    padding: 10px;
                    display: table;
                    margin: 0 auto;
                    color: #fff;
                    cursor: pointer;
                    border-radius: 4px;
                    font-weight: bold;
                }

                .print-view-box ul {
                    margin: 8px auto;
                }

                .print-view-box ul li {
                    font-size: 15px;
                    padding: 4px 0;
                    color: #000;
                    font-weight: 700;
                }

                .print-view-box h2 {
                    padding: 0 0 10px;
                    font-size: 18px;
                    color: #333;
                }

                .print-view-box p {
                    margin-bottom: 10px;
                }

                .disc-print {
                    font-style: italic;
                    font-size: 14px !important;
                    color: #000;
                    font-weight: 700;
                }

                #btnPrint {
                    float: right;
                    margin-bottom: 12px;
                    background: #154479;
                    border: none;
                    color: #fff;
                    padding: 4px 10px;
                    font-weight: 600;
                    border-radius: 4px;
                }

                .loading_image {
                    display: block;
                    position: fixed;
                    z-index: 1000;
                    top: 0;
                    left: 0;
                    height: 100%;
                    width: 100%;
                    background: rgba(255, 255, 255, .8) url('/wp-content/themes/psychometrics/images/loading_image.gif') 50% 50% no-repeat;
                }
            </style>
            <!-- TOP TABLE SECTION -->
            <section style="background: #f1f1f1;padding: 2em 0;" id="main">
                <div id="loading"></div>
                <div class="container">
                    <!----User details--->
                    <div class="row">
                        <div class="chart-header-box" style="margin-bottom: 2em;">
                            <div class="col-md-8">
                                <h4 class="test-head"><?php echo $getTestDetails->category_name; ?></h4>
                                <h4>Name : <span style="font-weight: bold;"> <?php echo $studentName; ?> </span>, <span> Class :</span> <span style="font-weight: bold;"><?php echo $class ?></span></h4>
                                <h4>Date : <span style="font-weight: bold;"><?php echo $dateAttempt; ?></span></h4>
                            </div>
                            <div class="col-md-4">
                                <img class="header-logo" src="https://selfanalyse.com/wp-content/themes/psychometrics/images/shine-logo.png" alt="">
                            </div>
                        </div>
                    </div>
                    <!----First Page Content--->
                    <div class="row">
                        <div class="intro-box print-view-box">
                            <form action="/aptitude-test/pdf.php" method="post">
                                <input type="hidden" name="test" value="<?php echo $testID; ?>">
                                <button id="btnPrint" type="submit">Save as PDF</button>
                            </form>
                            <div class="col-md-12">
                                <p>Psychometric tests are designed to assess the cognitive abilities and personality traits of an individual. Knowing one’s own abilities, helps in knowing our own strengths and weaknesses which in turn help us in choosing the career/course most suited for us.</p>
                                <p>Psychometric tests are of two types:
                                <ul>
                                    <li>Test for abilities or aptitude</li>
                                    <li>Test for personality</li>
                                </ul>
                                </p>
                                <p>The result of psychometric tests tells us a lot about our own selves. It is important specifically when we are at a stage where we have to choose a career, a course or a stream. These results help us to be 100% sure that the course or stream that we are choosing is something that we can do well.</p>
                                <p>Abilities or aptitude are some innate qualities that we are born with. For example, some people sing very well even without any particular training in music. We would say that their ‘ability’ to sing is high. Now that person can become a professional singer much more easily than a person who does not have that ability. Similarly, all of us have different levels of ability for numbers, for language, for reasoning and logic, for mechanics etc. These different abilities have a scope in different fields of career.</p>
                                <p>Personality is the combination of characteristics or qualities that form an individual's distinctive character. It also plays a major role in the shaping of our career. For example, a person who is an extrovert, who loves to interact with people will not do well in a job where he has to sit alone all day in a cabin and work. He would do well if he was a part of a team.</p>
                                <p>Interest also plays a major role in our career. As we all know, we are willing to work hard at a job that we find interesting. We do not want to do anything that we feel is boring.</p>
                                <p>These tests measure and quantify an individual’s abilities, interest and personality traits to figure out the best options in terms of field of study and career.</p>
                            </div>
                        </div>
                    </div>
                    <!-----Circles---->
                    <div class="row">
                        <div class="intro-box">

                            <?php
                            $data = array();
                            $string = array();
                            foreach ($getsubject as $sub) {
                                $subject = $sub->exam_category_id;


                                $abilityData = $wpdb->get_row("SELECT ability_id,instruction, color FROM $PSY_ABILITY where ref_id='$subject'");
                                $ability_id = $abilityData->ability_id;
                                $ability_desc = $abilityData->instruction;
                                $color = $abilityData->color;

                                $getTestSummary = $wpdb->get_row("SELECT count(case when ttqt.correct_answer=ttqat.answer then 1 end) as correctQn, count(case when ttqt.correct_answer!=ttqat.answer and ttqat.answer!=0 then 1 end) as inCorrectQn, count(case when ttqat.answer=0 then 1 end) as unAttemptQn from $PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER as ttqat Inner join $PSY_SP_QUESTION as ttqt on ttqt.question_id = ttqat.test_question_id where ttqat.test_taken_id='$testID' and ttqat.subject_id='$subject'");
                                $correctQn = (int) $getTestSummary->correctQn;
                                $inCorrectQn = $getTestSummary->inCorrectQn;
                                $unAttemptQn = $getTestSummary->unAttemptQn;

                                $rawScore = $wpdb->get_var("SELECT sten_score FROM $PSY_ABILITY_RAW_SCORE where $correctQn BETWEEN raw_score_start and raw_score_end and class_id='$class_id' and ability_id='$ability_id'");

                                $stenScore = (int) $rawScore;
                                //$stenScore;
                                $data[] = array("y" => $stenScore, "name" => $sub->category_name, "ability_id" => $ability_id, "topic_id" => $sub->exam_category_id, "color" => $color);

                                //color condition for raw score
                                if ($rawScore <= 3 && $rawScore >= 0) {
                                    $backColor = '#e4d354';
                                } else if ($rawScore <= 7 && $rawScore >= 4) {
                                    $backColor = '#f7a35c';
                                } else if ($rawScore <= 10 && $rawScore >= 8) {
                                    $backColor = '#90ed7d';
                                }

                                $percentage = ($stenScore / 10 * 100) . '%';

                                $showcategory = 'Current Ability - ' . $percentage;
                                $array = array("y" => $stenScore, "name" => $showcategory, "color" => $color);

                                $remainValue = 10 - $stenScore;
                                $remainPercent = ($remainValue / 10 * 100) . '%';
                                $remainText = 'Area of Improvement - ' . $remainPercent;
                            ?>
                                <div style="float:left; width:14%; border: 1px solid #ccc; margin-left: 3px;">
                                    <figure class="highcharts-figure">
                                        <div id="container_<?php echo $ability_id; ?>" style="height: 250px;"></div>
                                    </figure>
                                </div>
                                <script>
                                    // Load the fonts
                                    Highcharts.createElement('link', {
                                        href: 'https://fonts.googleapis.com/css?family=Ubuntu:400,700',
                                        rel: 'stylesheet',
                                        type: 'text/css'
                                    }, null, document.getElementsByTagName('head')[0]);
                                    // Add the background image to the container
                                    Highcharts.addEvent(Highcharts.Chart, 'afterGetContainer', function() {
                                        // eslint-disable-next-line no-invalid-this
                                        this.container.style.background =
                                            'url(https://www.highcharts.com/samples/graphics/sand.png)';
                                    });
                                    Highcharts.theme = {

                                        chart: {
                                            backgroundColor: null,
                                            style: {
                                                fontFamily: 'Ubuntu, sans-serif'
                                            }

                                        },
                                        title: {
                                            style: {
                                                color: 'black',
                                                fontSize: '16px',
                                                fontWeight: 'bold'
                                            }
                                        },
                                        subtitle: {
                                            style: {
                                                color: 'black'
                                            }
                                        },
                                        tooltip: {
                                            borderWidth: 0
                                        },
                                        labels: {
                                            style: {
                                                color: '#6e6e70'
                                            }
                                        },
                                        legend: {
                                            backgroundColor: '#E0E0E8',
                                            itemStyle: {
                                                fontWeight: 'bold',
                                                fontSize: '13px'
                                            }
                                        },
                                        xAxis: {
                                            labels: {
                                                style: {
                                                    color: '#6e6e70'
                                                }
                                            }
                                        },
                                        yAxis: {
                                            labels: {
                                                style: {
                                                    color: '#6e6e70'
                                                }
                                            }
                                        },
                                        plotOptions: {
                                            series: {
                                                shadow: true
                                            },
                                            candlestick: {
                                                lineColor: '#404048'
                                            },
                                            map: {
                                                shadow: false
                                            }
                                        },
                                        // Highstock specific
                                        navigator: {
                                            xAxis: {
                                                gridLineColor: '#D0D0D8'
                                            }
                                        },
                                        rangeSelector: {
                                            buttonTheme: {
                                                fill: 'white',
                                                stroke: '#C0C0C8',
                                                'stroke-width': 1,
                                                states: {
                                                    select: {
                                                        fill: '#D0D0D8'
                                                    }
                                                }
                                            }
                                        },
                                        scrollbar: {
                                            trackBorderColor: '#C0C0C8'
                                        }
                                    };


                                    // Apply the theme
                                    Highcharts.setOptions(Highcharts.theme);
                                    //pie chart
                                    var options = {
                                        chart: {
                                            plotBackgroundColor: null,
                                            plotBorderWidth: null,
                                            plotShadow: false,
                                            type: 'pie',
                                            options3d: {
                                                enabled: true,
                                                alpha: 45,
                                                beta: 0
                                            }
                                        },
                                        legend: {
                                            align: 'left',
                                            verticalAlign: 'bottom',
                                            floating: false,
                                            width: 150,
                                            layout: 'horizontal',
                                            itemStyle: '{ "word-wrap": "break-word" }',

                                        },
                                        title: {
                                            text: '<?php echo $sub->category_name ?>'
                                        },
                                        tooltip: {
                                            pointFormat: '{series.name}: <b>{point.y}</b>'
                                        },
                                        accessibility: {
                                            point: {
                                                valueSuffix: '%'
                                            }
                                        },
                                        plotOptions: {
                                            pie: {
                                                cursor: 'pointer',
                                                depth: 20,
                                                dataLabels: {
                                                    enabled: false,
                                                    format: '{point.name}'
                                                },
                                                showInLegend: true
                                            }
                                        },
                                        series: [{
                                            name: 'Sten Score',
                                            colorByPoint: true,
                                            data: [<?php echo json_encode($array); ?>, {
                                                "y": <?php echo $remainValue; ?>,
                                                "name": '<?php echo $remainText; ?>'
                                            }]
                                        }]
                                    }

                                    var chart = Highcharts.chart('container_<?php echo $ability_id; ?>', options);
                                </script>
                            <?php

                            }
                            ?>
                        </div>
                    </div>
                    <!----highcharts---->
                    <div class="row">
                        <div class="intro-box">
                            <div class="col-md-2"></div>
                            <div class="col-md-8">
                                <div class="chart-box">
                                    <figure class="highcharts-figure">
                                        <div id="container_bar_p" style="height: 370px;"></div>
                                    </figure>
                                </div>
                            </div>
                            <div class="col-md-2"></div>
                        </div>
                    </div>
                    <?php if ($class_id == '9' || $class_id == '10') { ?>
                        <div class="row">
                            <div class="intro-box">
                                <div class="col-md-12">
                                    <h3 style="text-align: center;">Stream Selection Refernce Chart (SSRC)</h3>
                                    <p>:- Steps to read and understand SSRC</p>
                                    <p>Step 1 : Check your aptitude scores from the graph and write on a piece of paper.</p>
                                    <p>Step 2: Now look at the stream or Row you are interested in, match your score with the criteria scores.</p>
                                    <p>Step 3: If your aptitude score matches with three or more criteria scores, there is a high probability of success in that stream in a given scenario that you will put in the amount of effort required to score well.</p>
                                </div>
                            </div>
                            <div class="intro-box">
                                <div class="col-md-2">
                                </div>
                                <div class="col-md-8">
                                    <table class="table table-bordered table-striped table-responsive">
                                        <thead class="thead-light">
                                            <tr>
                                                <th>Score</th>
                                                <th>Inference</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="danger">
                                                <td>1-3</td>
                                                <td>Below Average Ability</td>
                                            </tr>
                                            <tr class="info">
                                                <td>4-5</td>
                                                <td>Average Ability</td>
                                            </tr>
                                            <tr class="success">
                                                <td>6-7</td>
                                                <td>High Average Ability</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>8-10</td>
                                                <td>High Ability</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-2"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="intro-box">
                                <div class="col-md-12">
                                    <h4 style="font-size: 14px;color: #f00e0e;">Note :Given below is a matrix that can be used as a guide to help the student/parent/counselor. This is by no means a yardstick but is a general guideline. For better understanding and in-depth analysis, one-to-one counseling is recommended.</h4>
                                </div>
                            </div>
                            <div class="intro-box">
                                <div class="col-md-1"></div>
                                <div class="col-md-10">
                                    <table class="table table-bordered table-striped table-responsive">
                                        <thead class="thead-light">
                                            <tr>
                                                <th>S.No</th>
                                                <th>Stream</th>
                                                <th>RA</th>
                                                <th>NA</th>
                                                <th>MA</th>
                                                <th>SA</th>
                                                <th>CA</th>
                                                <th>VA</th>
                                                <th>CL</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="success">
                                                <td>1</td>
                                                <td>Science with Maths</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>Average</td>
                                                <td></td>
                                                <td>High Average to High</td>
                                                <td></td>
                                                <td>Average</td>
                                            </tr>
                                            <tr class="info">
                                                <td>2</td>
                                                <td>Science without Maths</td>
                                                <td>High Average to High</td>
                                                <td></td>
                                                <td>Average</td>
                                                <td>Average</td>
                                                <td>High Average to High</td>
                                                <td></td>
                                                <td>Average</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>3</td>
                                                <td>Commerce with Maths</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td>Average</td>
                                                <td>Average</td>
                                            </tr>
                                            <tr class="danger">
                                                <td>4</td>
                                                <td>Commerce without Maths</td>
                                                <td>Average</td>
                                                <td>Average</td>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td>Average</td>
                                                <td>Average</td>
                                            </tr>
                                            <tr class="success">
                                                <td>5</td>
                                                <td>Humanities with Maths</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td>High Average to High</td>
                                                <td>Average</td>
                                            </tr>
                                            <tr class="info">
                                                <td>6</td>
                                                <td>Humanities without Maths</td>
                                                <td>Average</td>
                                                <td></td>
                                                <td></td>
                                                <td>Average</td>
                                                <td></td>
                                                <td>High Average to High</td>
                                                <td>Average</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>7</td>
                                                <td>Computer Science</td>
                                                <td>High Average to High</td>
                                                <td>Average</td>
                                                <td></td>
                                                <td></td>
                                                <td>High Average to High</td>
                                                <td></td>
                                                <td></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-1"></div>
                            </div>
                        </div>
                    <?php } ?>
                    <?php if ($class_id == '11' || $class_id == '12') { ?>
                        <div class="row">
                            <div class="intro-box">
                                <div class="col-md-12">
                                    <h3 style="text-align: center;">Stream Selection Refernce Chart (SSRC)</h3>
                                    <p>:- Steps to read and understand SSRC</p>
                                    <p>Step 1 : Check your aptitude scores from the graph and write on a piece of paper.</p>
                                    <p>Step 2: Now look at the stream or Row you are interested in, match your score with the criteria scores.</p>
                                    <p>Step 3: If your aptitude score matches with three or more criteria scores, there is a high probability of success in that stream in a given scenario that you will put in the amount of effort required to score well.</p>
                                </div>
                            </div>
                            <div class="intro-box">
                                <div class="col-md-2">
                                </div>
                                <div class="col-md-8">
                                    <table class="table table-bordered table-striped table-responsive">
                                        <thead class="thead-light">
                                            <tr>
                                                <th>Score</th>
                                                <th>Inference</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="danger">
                                                <td>1-3</td>
                                                <td>Below Average Ability</td>
                                            </tr>
                                            <tr class="info">
                                                <td>4-5</td>
                                                <td>Average Ability</td>
                                            </tr>
                                            <tr class="success">
                                                <td>6-7</td>
                                                <td>High Average Ability</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>8-10</td>
                                                <td>High Ability</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-2"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="intro-box">
                                <div class="col-md-12">
                                    <h4 style="font-size: 14px;color: #f00e0e;">Note :Given below is a matrix that can be used as a guide to help the student/parent/counselor. This is by no means a yardstick but is a general guideline. For better understanding and in-depth analysis, one-to-one counseling is recommended.</h4>
                                </div>
                            </div>
                            <div class="intro-box">
                                <div class="col-md-1"></div>
                                <div class="col-md-10">
                                    <table class="table table-bordered table-striped table-responsive">
                                        <thead class="thead-light">
                                            <tr>
                                                <th>S. No</th>
                                                <th>Career</th>
                                                <th>RA</th>
                                                <th>NA</th>
                                                <th>MA</th>
                                                <th>SA</th>
                                                <th>CA</th>
                                                <th>VA</th>
                                                <th>CL</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="success">
                                                <td>1</td>
                                                <td>Design</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr class="info">
                                                <td>2</td>
                                                <td>Finance</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>Average to High Average</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>3</td>
                                                <td>Entrepreneurship</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>Average to High Average</td>
                                            </tr>
                                            <tr class="danger">
                                                <td>4</td>
                                                <td>Law</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>Average to High Average</td>
                                            </tr>
                                            <tr class="success">
                                                <td>5</td>
                                                <td>Research</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>Average to High Average</td>
                                            </tr>
                                            <tr class="info">
                                                <td>6</td>
                                                <td>AI/ML</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>Average to High Average</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>7</td>
                                                <td>Journalism</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr class="danger">
                                                <td>8</td>
                                                <td>Management</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr class="success">
                                                <td>9</td>
                                                <td>Engineering/Tech</td>
                                                <td>High Average to High</td>
                                                <td>High Average to High</td>
                                                <td>Average to High Average</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr class="info">
                                                <td>10</td>
                                                <td>Pilot</td>
                                                <td>Average to High Average</td>
                                                <td>Average to High Average</td>
                                                <td>Average to High Average</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr class="warning">
                                                <td>11</td>
                                                <td>Medicine</td>
                                                <td>High Average to High</td>
                                                <td>Average to High Average</td>
                                                <td>Average to High Average</td>
                                                <td>Average to High Average</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr class="danger">
                                                <td>12</td>
                                                <td>Education</td>
                                                <td>High Average to High</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td>High Average to High</td>
                                                <td>Average to High Average</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-1"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="intro-box">
                                <div class="col-md-12">
                                    <table class="table table-bordered table-striped table-responsive">
                                        <thead>
                                            <tr>
                                                <th colspan="6">Stream and Related Career Choices</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr class="success">
                                                <th>Science with Maths</th>
                                                <td>-Engineering<br />-Aviation (Pilot)<br />-Architecture<br />-Scientist/Research<br />-Education/Teaching<br />-Environment/Conservationist<br />-Finance related careers<br />-Indian administrative services Actuarial science Artificial Intelligence</td>
                                                <td>-Research<br />-Aeronautical engineer<br />-Air Traffic controller<br />-Archeologist<br />-Astronomy<br />-Audio engineer<br />-Climatologist <br />-Clinical scientist <br />-Energy Conservationist</td>
                                                <td>-Computing<br />-Forensic scientist<br />-Geologist<br />-Meteorology<br />-Marine engineering<br />-Nuclear scientist<br />-Oceanographer<br />-Space and remote sensing<br />-Water management<br />-Defense services<br /></td>
                                                <td>-Aeronautics Engineers <br />-Atmospheric Scientist <br />-Atomic Physicists <br />-Bio-Physicists <br />-Civil Engineers <br />-Computer Scientists <br />-Electrical Engineers <br />-Environmental Engineers <br />-Forensic scientist <br />-Geophysicists </td>
                                                <td>-Hydrologists <br />-Industrial Physicist <br />-Materials Scientist <br />-Mechanical Engineers <br />-Mineralogists <br />-Nuclear Physicists <br />-Oceanographers <br />-Power Engineers <br />-Research Scientist <br />-Science Writer <br />-Solar physicist <br />-Teaching &amp; Research </td>
                                            </tr>
                                            <tr class="info">
                                                <th>Science without Maths</th>
                                                <td>-Medicine Scientist/Research<br />-Education/Teaching<br />-Environment /Conservationist<br />-Indian administrative services</td>
                                                <td>-Agro-chemistry <br />-Analytical Chemistry <br />-Astro-chemistry <br />-Atmospheric Chemistry <br />-Biochemistry <br />-Biotechnology <br />-Ceramics Industry <br />-Chemical Engineering <br />-Chemical Information Specialist <br />-Chemist </td>
                                                <td>-Environmental Chemistry <br />-Environmental Law <br />-Ethno-botany <br />-Food Chemistry <br />-Forensic Science <br />-Geochemistry <br />-Hazardous Waste Management <br />-Inorganic Chemistry <br />-Materials Science <br />-Medicine </td>
                                                <td>-Medical doctor<br />-Veterinarian<br />-Nurse<br />-Physical therapist<br />-Radiologist<br />-Dentist<br />-Medical transcription<br />-Horticulturist<br />-Cardiologist<br />-Neurologist<br />-Paleontologist</td>
                                                <td>-<br />-Education and research<br />-Environmental <br />-Management and <br />-Conservation<br />-Museum curators<br />-Microbiologist<br />-Biochemist<br />-Medical pharmacist</td>
                                            </tr>
                                            <tr class="warning">
                                                <th>Commerce with Maths</th>
                                                <td>-Education and Research<br />-Actuarial science<br />-Banking and accounts<br />-Careers in finance<br />-Statistician<br />-Biomathematics</td>
                                                <td>-Chartered Accountant<br />-Company secretary<br />-Commercial lawyer<br />-Bank/branch manager<br />-Stock Broker<br />-Education<br />-Financial analyst/Policy analyst<br />-Tax auditor<br />-Actuaries</td>
                                                <td>-Database Integrator<br />-E-commerce Product manager<br />-Enterprise Architect<br />-Systems Administrator </td>
                                                <td>-Administrative services<br />-Law<br />-Mass communication<br />-Journalism<br />-Defense forces<br />-Education and Research<br />-Human resource Management<br />-Social development sector<br />-Psychologist/Counselors<br />-Service industry-Hotel, Travel and tourism<br /></td>
                                                <td>-Policy Analyst<br />-Wealth Management Expert<br />-Financial Analyst<br />-Economic Strategist<br />-Business Economist </td>
                                            </tr>
                                            <tr class="danger">
                                                <th>Commerce without Maths</th>
                                                <td>-Business Relationship Manager Law<br />-Mass communication<br />-Journalism<br />-Defense forces<br />-Education and Research</td>
                                                <td>-Administrative services<br />-Human resource Management<br />-Social development sector<br />-Psychologist/Counselors<br />-Service industry-Hotel, Travel and tourism</td>
                                                <td>-Chartered Accountant<br />-Company secretary<br />-Commercial lawyer<br />-Bank/branch manager<br />-Stock Broker<br />-Education<br />-Financial analyst/Policy analyst<br />-Tax auditor<br /></td>
                                                <td>-Administrative services<br />-Law<br />-Mass communication<br />-Journalism<br />-Defense forces<br />-Education and Research<br />-Human resource Management<br />-Social development sector<br />-Psychologist/Counselors<br />-Service industry-Hotel, Travel and tourism<br /></td>
                                                <td>-Policy Analyst<br />-Wealth Management Expert<br />-Financial Analyst<br />-Economic Strategist<br />-Business Economist </td>
                                            </tr>
                                            <tr class="success">
                                                <th>Humanities with Maths</th>
                                                <td>-Administrative services<br />-Law<br />-Mass communication<br />-Journalism<br />-Defense forces<br />-Education and Research<br />-Human resource Management<br />-Social development sector<br />-Psychologist/Counselors<br />-Service industry-Hotel, Travel and tourism<br /></td>
                                                <td>-Database Integrator<br />-E-commerce Product manager<br />-Enterprise Architect<br />-Systems Administrator </td>
                                                <td>-Policy Analyst<br />-Wealth Management Expert<br />-Financial Analyst<br />-Economic Strategist<br />-Business Economist </td>
                                                <td>-Database Integrator<br />-E-commerce Product manager<br />-Enterprise Architect<br />-Systems Administrator </td>
                                                <td>-Animation and Gaming Event management</td>
                                            </tr>
                                            <tr class="info">
                                                <th>Humanities without Maths</th>
                                                <td>-Hotel Management<br />-Travel &amp; Tourism<br />-Animation-graphics<br />-Sales &amp; marketing<br />-Web designing <br />-Blog writing</td>
                                                <td>-Beauty culture<br />-Physical fitness<br />-Translators<br />-Aviation industry<br />-Radio/Disc Jockey<br />-News Reading<br />-Entrepreneurship</td>
                                                <td>-Business Relationship Manger Law<br />-Mass communication<br />-Journalism<br />-Defense forces<br />-Education and Research</td>
                                                <td>-Administrative services<br />-Human resource Management<br />-Social development sector<br />-Psychologist/Counselors<br />-Service industry-Hotel, Travel and tourism</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    <?php } ?>
                    <!--All ability score desc---->
                    <div class="row">
                        <div class="intro-box ">
                            <?php
                            foreach ($getsubject as $sub) {
                                $subject = $sub->exam_category_id;


                                $abilityData = $wpdb->get_row("SELECT ability_id,instruction FROM $PSY_ABILITY where ref_id='$subject'");
                                $ability_id = $abilityData->ability_id;
                                $ability_desc = $abilityData->instruction;

                                $getTestSummary = $wpdb->get_row("SELECT count(case when ttqt.correct_answer=ttqat.answer then 1 end) as correctQn, count(case when ttqt.correct_answer!=ttqat.answer and ttqat.answer!=0 then 1 end) as inCorrectQn, count(case when ttqat.answer=0 then 1 end) as unAttemptQn from $PSY_TEST_GEN_TEST_TAKEN_QUESTION_ANSWER as ttqat Inner join $PSY_SP_QUESTION as ttqt on ttqt.question_id = ttqat.test_question_id where ttqat.test_taken_id='$testID' and ttqat.subject_id='$subject'");
                                $correctQn = (int) $getTestSummary->correctQn;
                                $inCorrectQn = $getTestSummary->inCorrectQn;
                                $unAttemptQn = $getTestSummary->unAttemptQn;

                                $rawScore = $wpdb->get_var("SELECT sten_score FROM $PSY_ABILITY_RAW_SCORE where $correctQn BETWEEN raw_score_start and raw_score_end and class_id='$class_id' and ability_id='$ability_id'");

                                $stenScore = (int) $rawScore;

                                $stenDesc = $wpdb->get_row("SELECT description from $PSY_ABILITY_STEN_DESC where ability_id='$ability_id' and FIND_IN_SET($stenScore,sten_scores)");

                            ?>
                                <div class="sten-score">
                                    <h3 class="display-3">Your STEN Score in <span style="color: #f15c80;"> <?php echo $sub->category_name; ?> </span> : <span style="color: #8085e9;font-weight: bold;"> <?php echo $stenScore; ?> </span></h3>
                                    <p><?php echo $stenDesc->description; ?></p>
                                </div>
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                    <!--All ability score---->
                    <div class="row">
                        <div class="intro-box print-view-box">
                            <?php
                            foreach ($getsubject as $sub) {
                                $subject = $sub->exam_category_id;


                                $abilityData = $wpdb->get_row("SELECT ability_id,description FROM $PSY_ABILITY where ref_id='$subject'");
                                $ability_id = $abilityData->ability_id;
                                $ability_desc = $abilityData->description;

                            ?>
                                <div>
                                    <h2 class="display-3"><?php echo $sub->category_name; ?></h2>
                                    <p style="margin-bottom: 25px;"><?php echo $ability_desc; ?></p>
                                </div>
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                    <!-----Disclaimer-------->
                    <div class="row">
                        <div class="intro-box">
                            <div class="col-md-12">
                                <p class="disc-print">Disclaimer: It is to be noted that these test scores do not provide any kind of diagnosis. The cognitive functioning is a result of “Nature and Nurture”. This means how an individual thinks is a result of his innate nature as well as his environment. The scores should be taken in the right perspective. These scores indicate an individual’s ability to perform a particular task right now (at the moment of taking the test). Adding extra skill or training in that area may improve the scores.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </section>

            <!-- END TOP TABLE SECTION -->


            <script>
                // Load the fonts
                Highcharts.createElement('link', {
                    href: 'https://fonts.googleapis.com/css?family=Ubuntu:400,700',
                    rel: 'stylesheet',
                    type: 'text/css'
                }, null, document.getElementsByTagName('head')[0]);
                // Add the background image to the container
                Highcharts.addEvent(Highcharts.Chart, 'afterGetContainer', function() {
                    // eslint-disable-next-line no-invalid-this
                    this.container.style.background =
                        'url(https://www.highcharts.com/samples/graphics/sand.png)';
                });
                Highcharts.theme = {

                    chart: {
                        backgroundColor: null,
                        style: {
                            fontFamily: 'Ubuntu, sans-serif'
                        }
                    },
                    title: {
                        style: {
                            color: 'black',
                            fontSize: '16px',
                            fontWeight: 'bold'
                        }
                    },
                    subtitle: {
                        style: {
                            color: 'black'
                        }
                    },
                    tooltip: {
                        borderWidth: 0
                    },
                    labels: {
                        style: {
                            color: '#6e6e70'
                        }
                    },
                    legend: {
                        backgroundColor: '#E0E0E8',
                        itemStyle: {
                            fontWeight: 'bold',
                            fontSize: '13px'
                        }
                    },
                    xAxis: {
                        labels: {
                            style: {
                                color: '#6e6e70'
                            }
                        }
                    },
                    yAxis: {
                        labels: {
                            style: {
                                color: '#6e6e70'
                            }
                        },
                        max: 10,
                        min: 0,
                        tickInterval: 1
                    },
                    plotOptions: {
                        series: {
                            shadow: true
                        },
                        candlestick: {
                            lineColor: '#404048'
                        },
                        map: {
                            shadow: false
                        }
                    },
                    // Highstock specific
                    navigator: {
                        xAxis: {
                            gridLineColor: '#D0D0D8'
                        }
                    },
                    rangeSelector: {
                        buttonTheme: {
                            fill: 'white',
                            stroke: '#C0C0C8',
                            'stroke-width': 1,
                            states: {
                                select: {
                                    fill: '#D0D0D8'
                                }
                            }
                        }
                    },
                    scrollbar: {
                        trackBorderColor: '#C0C0C8'
                    }
                };
                // Apply the theme
                Highcharts.setOptions(Highcharts.theme);

                //bar chart
                Highcharts.chart('container_bar_p', {
                    chart: {
                        type: 'column'
                    },
                    title: {
                        text: 'Aptitude<br>Test'
                    },
                    xAxis: {
                        type: 'category',
                        title: {
                            text: ''
                        },
                    },
                    tooltip: {
                        pointFormat: '{series.name}: <b>{point.y}</b>'
                    },
                    accessibility: {
                        point: {
                            valueSuffix: '%'
                        }
                    },
                    plotOptions: {
                        series: {
                            cursor: 'pointer',
                            colorByPoint: true,
                        }
                    },
                    series: [{
                        name: 'Score',
                        data: <?php echo json_encode($data); ?>,
                        pointStart: 1,

                    }]
                });
                jQuery(document).on('click', '#btnPrint', function() {
                    jQuery("#loading").addClass("loading_image");
                });
            </script>
            <div style="display: none;">
                <?php
                $path = '/var/www/selfanalyse/aptitude-test/pdf-html/pdf-' . $testID . '.html';
                //if (file_exists($path)) {
                echo "";
                //} else {
                ob_start();
                include_once('pdf_content.php');
                $html = ob_get_contents();
                file_put_contents('/var/www/selfanalyse/aptitude-test/pdf-html/pdf-' . $testID . '.html', $html);
                ob_flush();
                //}

                ?>
            </div>
<?php
        } else {
            echo "Error : No test id found.";
        }
    } else {
        echo "Error : Invalid Test Id.";
    }
} else {
    echo "Error : Please login to view report.";
}
?>