Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subject dropdown to VisualizeMarks.php #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions VisualizeMarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,11 @@ function do_initialize(){
}
window._settings_box_collapsed = false;
toggle_settings_box();
}
function fill_subject_dropdown(){
$.getJSON("subjects.json", function(result){
$.each(result, function(i, field){
$("select#subjects").append( $('<option></option>').val(field).html(i) );
});
});
}
11 changes: 11 additions & 0 deletions VisualizeMarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
<div align="center" id="top-float">
<table width="80%">
<tr>
<td><table class="top-tables">
<tr>
<th>Subject</th>
<td>
<select style="width: 100%" name="subjects" id="subjects">

</select>
</td>
</tr>
</table></td>
<td><table class="top-tables">
<tr>
<th>My Marks</th>
Expand Down Expand Up @@ -159,6 +169,7 @@
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();
fill_subject_dropdown();
</script>
</body>
</html>
29 changes: 29 additions & 0 deletions subjects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Aerospace Engineering": "AE",
"Instrumentation Engineering":"IN",
"Agricultural Engineering": "AG",
"Mathematics":"MA",
"Architecture and Planning": "AR",
"Mechanical Engineering" :"ME",
"Biomedical": "BM",
"Mining Engineering" :"MN",
"Biotechnology" :"BT",
"Metallurgical Engineering" :"MT",
"Civil Engineering" :"CE",
"Petroleum Engineering" :"PE",
"Chemical Engineering" :"CH",
"Physics" :"PH",
"Computer Science and Information Technology" :"CS",
"Production and Industrial Engineering" :"PI",
"Chemistry" :"CY",
"Textile Engineering and Fiber Science" :"TF",
"Electronics and Communication Engineering" :"EC",
"Engineering Sciences": "XE*",
"Electrical Engineering" :"EE",
"Life Sciences" :"XL**",
"Environmental Science and Engineering" :"ES",
"Humanities and Social Sciences" :"XH***",
"Ecology and Evolution" :"EY",
"Statistics" :"ST[11]",
"Geology and Geophysics":"GG"
}