-
Notifications
You must be signed in to change notification settings - Fork 1
/
graphicalResult.php
73 lines (71 loc) · 2.48 KB
/
graphicalResult.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php session_start();
include 'header.php';?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Progress</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript">
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer",
{
title:{
text: "",
fontFamily: "arial black"
},
animationEnabled: true,
legend: {
verticalAlign: "bottom",
horizontalAlign: "center"
},
theme: "theme1",
data: [
{
type: "pie",
indexLabelFontFamily: "Garamond",
indexLabelFontSize: 20,
indexLabelFontWeight: "bold",
startAngle:0,
indexLabelFontColor: "MistyRo",
indexLabelLineColor: "darkgrey",
indexLabelPlacement: "inside",
toolTipContent: "{name}: {y}score",
showInLegend: true,
indexLabel: "#percent%",
dataPoints: [
{ y: <?php echo $_SESSION['totalQuestions']-$_SESSION['totalScore'] ?>, name: "Incorrect Answers", legendMarkerType: "triangle"},
{ y: <?php echo $_SESSION['totalScore'] ?>, name: "Correct Answers", legendMarkerType: "square"},
]
}
]
});
chart.render();
}
</script>
<script type="text/javascript" src="canvasjs.min.js"></script>
</head>
<body>
<div class="container">
<h2>PERFORMANCE ANALYSIS</h2>
<p></p>
<br>
<br>
<div class="progress">
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo ($_SESSION['totalQuestions']-$_SESSION['totalScore'])/($_SESSION['totalQuestions'])*100 ?>%">
<?php echo round(($_SESSION['totalQuestions']-$_SESSION['totalScore'])/($_SESSION['totalQuestions']),2)*100 ?>%
</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo ($_SESSION['totalScore'])/($_SESSION['totalQuestions'])*100 ?>%">
<?php echo round(($_SESSION['totalScore'])/($_SESSION['totalQuestions']),2)*100 ?>%
</div>
</div>
</div>
<br>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
</body>
</html>