File: //proc/self/cwd/school-admin/aptitude-test-report.php
<?php
include_once('../wp-config.php');
global $wpdb;
$PSY_SP_QUESTION = $wpdb->prefix . PSY_SP_QUESTION;
$PSY_EXAMS = $wpdb->prefix . PSY_EXAMS;
$PSY_ABILITY = $wpdb->prefix . PSY_ABILITY;
$PSY_USERS_DETAILS = $wpdb->prefix . PSY_USERS_DETAILS;
$PSY_ABILITY_RAW_SCORE = $wpdb->prefix . PSY_ABILITY_RAW_SCORE;
$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'];
$user_id = $wpdb->get_var("select user_id from $PSY_TEST_GEN_TEST_TAKEN where test_taken_id='$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 first_name,last_name,date_of_birth FROM $PSY_USERS_DETAILS where user_id='$user_id'");
$studentName = $userData->first_name . ' ' . $userData->last_name;
$dob = date('d F, Y', strtotime($userData->date_of_birth));
$getTestDetails = $wpdb->get_row("SELECT tt.total_questions,tt.class_id,tt.time_taken_in_seconds,tt.start_date,e.category_name FROM $PSY_TEST_GEN_TEST_TAKEN as tt LEFT JOIN $PSY_EXAMS as e on e.exam_category_id=tt.exam_category_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.exam_category_id");
?>
<link rel="stylesheet" href="/aptitude-test/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css">
<script src="/aptitude-test/js/jquery.min.js"></script>
<script src="/aptitude-test/js/bootstrap.min.js"></script>
<script src="/aptitude-test/js/highcharts.js"></script>
<style>
.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;
}
</style>
<!-- TOP TABLE SECTION -->
<section style="background: #f1f1f1;padding: 2em 0;">
<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;">4th</span></h4>
<h4>Date Attempt : <span style="font-weight: bold;"><?php echo $dateAttempt; ?></span></h4>
</div>
<div class="col-md-4">
<img class="header-logo" src="http://sarkaripariksha.com/wp-content/themes/sp_theme_1/images/logo-wide.png" alt="">
</div>
</div>
</div>
<?php
//if ($curDate >= $tomorrow) {
?>
<button id="btnPrint" onClick="popOut('/aptitude-test/print_page.php?testId=<?php echo $testID; ?>','Aptitude Test Report', 1200, 650)">Print Preview</button>
<!-----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 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;
//$stenScore;
$data[] = array("y" => $stenScore, "name" => $sub->category_name, "ability_id" => $ability_id, "topic_id" => $sub->exam_category_id);
//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';
}
?>
<div class="col-md-2">
<div class="one-circle-box" style="border: 3px solid <?php echo $backColor; ?>;">
<i class="fa fa-chart-line" style="color: <?php echo $backColor; ?>;"></i>
<h4><?php echo $rawScore; ?></h4>
<span><?php echo $sub->category_name ?></span>
</div>
</div>
<?php
}
?>
</div>
</div>
<!----highcharts---->
<div class="row">
<div class="intro-box">
<div class="col-md-6">
<div class="chart-box">
<h5>Click on PIE chart topic to get more details.</h5>
<figure class="highcharts-figure">
<div id="container" style="height: 370px;"></div>
</figure>
</div>
</div>
<div class="col-md-6">
<div class="chart-box">
<h5>Click on Bar chart topic to get more details.</h5>
<figure class="highcharts-figure">
<div id="container_bar" style="height: 370px;"></div>
</figure>
</div>
</div>
<div class="col-md-12">
<div class="ability-desc-box" id="abilityDesc">
</div>
</div>
</div>
</div>
<!---Introduction------>
<div class="row">
<div class="intro-box">
<div class="col-md-12">
<h2>Interest Description</h2>
<p>The various fields of career can be divided into 10 broad areas. Different areas require different set of abilities to be able to do well and succeed. It is to be kept in mind that if one is focused and passionate about a particular field then with enough hard work and training it can be achieved.</p>
<ul class="description-ul">
<li> <span class="bold-txt"> MASS MEDIA AND JOURNALISM </span> – this field is vast and includes areas like Print Journalism (Newspapers, magazines, websites, blogs etc.), TV/Radio journalism, Advertising (has components of both print and electronic media), Publishing industry etc.
The various careers that come under this field are: journalist (newspaper/TV/radio), editor, reporter, anchor, content developer, announcer, film producer, film director etc.
The ability that ensures success in this field is “Verbal Ability”.</li>
<li>
<span class="bold-txt"> ARTISTICS AND DESIGNING </span> – this is a vast field which is suited for creatively inclined people. This field requires a lot of patience, perseverance and out of box thinking. To be successful in this area it is very important to have self-discipline, ability to work in teams, empathy and imagination. Some attributes like sketching, communicating ideas using an art form and a vibrant visual imagination are some pre-requisite for designers and artists.
Design is in itself a vast area which includes, graphic design, textile design, fashion design, communication design, industrial design, product design and so on. An emerging field is “Design and Innovation” which truly requires innovative thinking.
The various careers in this field include: interior designer, fashion designer, jewelry designer, musician, singer, dancer, choreographer, artist, sculptor, furniture designer, graphic designer, beautician etc.
The ability that ensures success in this field is “Closure Ability and Spatial Ability”.
</li>
<li>
<span class="bold-txt"> SCIENCE AND TECHNOLOGY </span> – this is the most popular field in India. To be successful in the field of science and technology (medicine, engineering, scientific research etc.) one needs to do well in Physics, Chemistry, Math and/or Biology. This field requires a natural affinity towards numbers, mechanical concepts, reasoning and logic.
The most popular careers in this area include: all fields of engineering, pharmaceuticals, microbiologist, food technologist, astronomist, mathematician, biochemist, architect, environmental scientist etc.
Anyone who has a high score in “Reasoning Ability, Numerical Ability and Mechanical Ability” will be naturally inclined towards this field.
</li>
<li>
<span class="bold-txt"> AGRICULTURE </span> – this field is not only about farming on the fields, growing crops as the name suggests. It includes, animal husbandry (keeping livestock-poultry, cattle etc.), fisheries, horticulture, dairy management, forestry. This is one of the most promising fields given the amount of incentives given by the government.
The careers in this field (apart from the common ones) include: fertilizer expert, soil specialist, mineral specialist, agriculture engineer, rural manager, food inspector etc.
The ability that is required to do well in this field is “Reasoning Ability and Clerical Ability”.
</li>
<li>
<span class="bold-txt"> COMMERCE AND MANAGEMENT </span> – this field focusses on business and commerce. It requires good command over numbers, clarity of thought, high reasoning and good organizational skills. All the careers associated with business, banking and entrepreneurship are included in this.
Jobs related to this field include: chartered accountant, company secretary, stock broker, customs broker, marketing manager, sales executive, bank officer, cashier, bank manager, personnel manager, personal secretary etc.
High ability in “Numerical and Clerical” helps to succeed in these areas.
</li>
<li>
<span class="bold-txt"> MEDICINE </span> – is a major field in India and abroad. It is considered one of the most popular and lucrative careers. This field requires dedication, perseverance and commitment of a very high level. This field includes, working health professionals like doctors, surgeons, physicians, nurses, physiotherapists, speech therapists, dentists etc. also, non-clinical professionals like, lab technicians, biochemists, microbiologists etc.
This field requires high “Reasoning Ability and Closure Ability”.
</li>
<li>
<span class="bold-txt"> DEFENSE </span> – this field is related to the armed forces (Army, Air Force and Navy), Central Armed Police Force (CRPF, ITBP, CISF, BSF, SSB, SPG, RPF) and the Paramilitary Forces (Assam Rifles, Indian Coast Guards). Entry into this field requires dedication and patriotism. Students from any stream can apply to enter the Defense Services. Different career opportunities are offered by our Defense Services such as doctors, engineers, pilots, sailors, accountants, IT experts, paramedics, administrative officers etc.
Physical fitness is of paramount importance along with good “Clerical (organizing) and Closure Abilities”.
</li>
<li>
<span class="bold-txt"> TOURISM AND HOSPITALITY </span> – this industry is part of the service sector industry. It provides jobs in businesses which deal with tourists like, accommodation, transportation, food and beverage, entertainment etc. Tourism and Hospitality plays an important role in any economy. Students from any stream can enter this industry. Jobs offered in this field are: Travel Agent, Tour Operator, Air Hostess (Cabin Crew), Hotel Manager, Food and Beverage Manager, House Keeper, Receptionist, Historian, Museum Curator etc. A passion for travelling along with working in the field, good people’s skill are some prerequisites for being successful in this field. High “Verbal Ability and Clerical Ability” are indicators of success in this area.
</li>
<li>
<span class="bold-txt"> LAW-ORDER AND ADMINISTRATIVE SERVICES </span> – this field is one of the most sought after in India. Most students want to try at least once to appear for these exams in order to become government officers. Students from any stream can appear for the Administrative Services exams (UPSC) but a degree in Law is required to appear for the Judicial Services. Being a part of good governance, belief in justice and fair play are important to being a good Judicial or Administrative Officer. The jobs in this field are: District Collector, Judge, Notary, IAS Officer, IFS Officer, Income tax Commissioner, Police Commissioner, CBI Officer, Political Leader etc.
This field requires high “Reasoning Ability, Verbal Ability and Clerical Ability”.
</li>
<li>
<span class="bold-txt"> ACADEMIA (EDUCATION) </span> – this field is the one which has a direct impact on the masses. Teachers are the building blocks of any society. Teaching is one of the largest professions in India. Teachers are required for Pre-Primary to College level. There is also a need for special educators, trainers, vocational teachers, art, music and dance teachers, sports teachers, librarians, career counsellors etc. If done right it is one of the most satisfying careers. Teachers/Lecturers/Professors have to be the epitome of patience and perseverance. “Never give up” attitude is a must. This field requires high “Verbal Ability and Closure Ability”.
</li>
</ul>
</div>
</div>
</div>
<?php
//} else {
?>
<!-- <div class="row">
<div class="chart-header-box" style="background: #d8e6f1;text-align: center;">
<h6>Thank you for taking the test. Your reports will be ready within 24 hrs on your dashboard after our experts have created your profile. You will be intimated through email.</h6>
<h3 class="back-home-btn"><i class="fas fa-angle-double-left"></i> Back to Home</h3>
</div>
</div> -->
<?php
//}
?>
</div>
</section>
<!-- END TOP TABLE SECTION -->
<script>
function popOut(pageURL, pageTitle,
popupWinWidth, popupWinHeight) {
var left = (screen.width - popupWinWidth) / 2;
var top = (screen.height - popupWinHeight) / 4;
var myWindow = window.open(pageURL, pageTitle,
'resizable=yes, width=' + popupWinWidth +
', height=' + popupWinHeight + ', top=' +
top + ', left=' + left);
}
//pie chart
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Aptitude Test'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y}</b>'
},
accessibility: {
point: {
valueSuffix: '%'
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.y}'
}
},
series: {
cursor: 'pointer',
colorByPoint: true,
point: {
events: {
click: function() {
// alert(this.options.ability_id);
$.ajax({
type: "POST",
url: "/aptitude-test/test_ability_description.php",
dataType: 'html',
data: {
"ability_id": this.options.ability_id,
"score": this.options.y,
"topic_name": this.options.name
},
success: function(data) {
$("#abilityDesc").html(data);
}
});
}
}
}
}
},
series: [{
name: 'Sten Score',
colorByPoint: true,
data: <?php echo json_encode($data); ?>
}]
});
//bar chart
Highcharts.chart('container_bar', {
chart: {
type: 'column'
},
title: {
text: 'Aptitude<br>Test',
align: 'center',
y: 60
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Sten Score'
},
max: 10,
min: 0
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y}</b>'
},
accessibility: {
point: {
valueSuffix: '%'
}
},
plotOptions: {
series: {
cursor: 'pointer',
colorByPoint: true,
point: {
events: {
click: function() {
// alert(this.options.ability_id);
$.ajax({
type: "POST",
url: "/aptitude-test/test_ability_description.php",
dataType: 'html',
data: {
"ability_id": this.options.ability_id,
"score": this.options.y,
"topic_name": this.options.name
},
success: function(data) {
$("#abilityDesc").html(data);
}
});
}
}
}
}
},
series: [{
name: 'Score',
data: <?php echo json_encode($data); ?>
}]
});
</script>
<?php
} else {
echo "Error : No test id found.";
}
} else {
echo "Error : Invalid Test Id.";
}