Skip to content

Commit

Permalink
Restore backup. Make data static.
Browse files Browse the repository at this point in the history
  • Loading branch information
AgarwalPragy committed Mar 9, 2016
1 parent 88b29d7 commit 40f9854
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
11 changes: 10 additions & 1 deletion VisualizeMarks-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,20 @@ body {
}

.top-float {
font-size: 20px;
font-weight: bold;
text-align: center;
text-decoration: none;
color: gray;
}
#colleges {
font-size: 25px;
font-weight: bold;
text-align: center;
text-decoration: none;
color: #gray;
color: gray;
}

.top-tables th {
color: #696866;
font-size: 18px;
Expand Down
1 change: 1 addition & 0 deletions VisualizeMarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function calculate(){

var score = calculate_score(norm_marks);
$("#score").html(score);
$("#colleges").attr('href', 'ScoreToColleges.php?score=' + score);

for (var i = 0; i < set.students.length; i++) {
if(set.students[i].marks < mymarks){
Expand Down
35 changes: 7 additions & 28 deletions VisualizeMarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
</head>
<body>
<div align="center" id="top-float">
<a href="index.php" class="top-float">(Click here to view your marks)</a>
<hr/>
<table width="80%">
<tr>
<td><table class="top-tables">
<tr>
<th>My Marks</th>
<td>
<input type="text" style="width: 55%" id="my-marks" value="<?php if(isset($_GET["marks"])){echo $_GET["marks"];} ?>" oninput="calculate();">
</td>
</td> <br/>
</tr>
<tr><td colspan="2"><a href="index.php" class="top-float">(Click here to view your marks)</a></td></tr>
<tr>
<th>My Set</th>
<td>
Expand Down Expand Up @@ -64,6 +63,10 @@
</tr>
</table>
</div><hr />
<div align="center">
<a href="ScoreToColleges.php" id="colleges">Click to <b>View list of IITs and NITs. See which colleges you might get.</b></a>
</div>
<hr />
<div id="settings-box-container">
<div id="settings-box">
<table>
Expand Down Expand Up @@ -151,32 +154,8 @@

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="VisualizeMarks.js"></script>
<script src="raw_data.js"></script>
<script>
window.raw_data = "<?php
// $data = file_get_contents('ranks.txt');
$data = "";
require 'database.php';
$std_data = readmarks();
$len = count($std_data);
for($i = 0; $i < $len; $i++){
$id = "" . $std_data[$i]['id'];
$marks = "" .$std_data[$i]['marks'];
$data = $data . " " . $id . ": " . $marks . " ";
}
$patterns = array();
$replacements = array();

$patterns[0] = "/ID_CS16S([56])\d{7}: (-?\d*(\.\d\d)?)\d*/";
$replacements[0] = " ($1,$2) ";

$patterns[1] = "/ID_(?!CS16S\d)\w*: .*/";
$replacements[1] = "";

$patterns[2] = "/\n+/";
$replacements[2] = " ";

echo preg_replace($patterns, $replacements, $data);
?>";
window.raw_data = window.raw_data.split(/\s+/);
$("#radio<?php if(isset($_GET["set"])){echo $_GET["set"];}else{echo 1;}?>").prop("checked", true);
do_initialize();
Expand Down
6 changes: 6 additions & 0 deletions process.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ function get_uid(){
}

function log_marks(){
// No more logging user data.
// The game has ended :)
return;
var script_kiddie = "Find better things to do with your time buddy.. ";

// ===============================
if(/CS16S([56])\d{7}/.test(window.uid)){
$.post("logmymarks.php",
{id: window.uid, marks: window.final_marks.toFixed(2)},
Expand Down
1 change: 1 addition & 0 deletions raw_data.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions visualizeMarks-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,21 @@ body {
}

.top-float {
font-size: 20px;
font-weight: bold;
text-align: center;
text-decoration: none;
color: #aaa;
}

#colleges {
font-size: 25px;
font-weight: bold;
text-align: center;
text-decoration: none;
color: #aaa;
}

.top-tables th {
color: #a05;
font-size: 18px;
Expand Down

0 comments on commit 40f9854

Please sign in to comment.