multiple semesters working
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
font-size: x-large;
|
font-size: x-large;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
margin: 5px 0px 5px 0px;
|
margin: 5px 0px 5px 0px;
|
||||||
}
|
}
|
||||||
@@ -135,10 +135,12 @@
|
|||||||
transform: scale(0, 0);
|
transform: scale(0, 0);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
20% {
|
20% {
|
||||||
transform: scale(25, 25);
|
transform: scale(25, 25);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: scale(40, 40);
|
transform: scale(40, 40);
|
||||||
@@ -162,7 +164,8 @@
|
|||||||
left: 50%;
|
left: 50%;
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
}
|
}
|
||||||
.descriptionli{
|
|
||||||
|
.descriptionli {
|
||||||
padding: 0px 5px 5px 5px;
|
padding: 0px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,11 +175,14 @@
|
|||||||
animation: fadein 0.5s, fadeout 0.5s 2.5s;
|
animation: fadein 0.5s, fadeout 0.5s 2.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#semesters {}
|
||||||
|
|
||||||
@-webkit-keyframes fadein {
|
@-webkit-keyframes fadein {
|
||||||
from {
|
from {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -188,6 +194,7 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -199,6 +206,7 @@
|
|||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -210,6 +218,7 @@
|
|||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -108,6 +108,11 @@ $(function () {
|
|||||||
window.open(textbookLink);
|
window.open(textbookLink);
|
||||||
}, butdelay);
|
}, butdelay);
|
||||||
});
|
});
|
||||||
|
$("#semesters").on('change', function () {
|
||||||
|
var sem = $(this).val();
|
||||||
|
sem = sem == "Aggregate" ? undefined : sem;
|
||||||
|
getDistribution(sem);
|
||||||
|
});
|
||||||
$(document).keydown(function (e) {
|
$(document).keydown(function (e) {
|
||||||
/*Close Modal when hit escape*/
|
/*Close Modal when hit escape*/
|
||||||
if (e.keyCode == 27) {
|
if (e.keyCode == 27) {
|
||||||
@@ -341,15 +346,33 @@ function convertTime(time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Query the grades database*/
|
/*Query the grades database*/
|
||||||
function getDistribution() {
|
function getDistribution(sem) {
|
||||||
var query = "select * from agg";
|
var query;
|
||||||
|
if (!sem) {
|
||||||
|
query = "select * from agg";
|
||||||
|
} else {
|
||||||
|
query = "select * from grades";
|
||||||
|
}
|
||||||
query += " where dept like '%" + department + "%'";
|
query += " where dept like '%" + department + "%'";
|
||||||
query += " and prof like '%" + profname.replace(/'/g, "") + "%'";
|
query += " and prof like '%" + profname.replace(/'/g, "") + "%'";
|
||||||
query += " and course_nbr like '%" + course_nbr + "%'";
|
query += " and course_nbr like '%" + course_nbr + "%'";
|
||||||
|
if (sem) {
|
||||||
|
query += "and sem like '%" + sem + "%'";
|
||||||
|
}
|
||||||
query += "order by a1+a2+a3+b1+b2+b3+c1+c2+c3+d1+d2+d3+f desc";
|
query += "order by a1+a2+a3+b1+b2+b3+c1+c2+c3+d1+d2+d3+f desc";
|
||||||
var res = grades.exec(query)[0];
|
var res = grades.exec(query)[0];
|
||||||
var output = "";
|
var output = "";
|
||||||
openDialog(department, coursename, "aggregate", profname, res);
|
if (!sem) {
|
||||||
|
openDialog(department, coursename, "aggregate", profname, res);
|
||||||
|
} else {
|
||||||
|
var data;
|
||||||
|
if (typeof res == 'undefined' || profname == "") {
|
||||||
|
data = [];
|
||||||
|
} else {
|
||||||
|
data = res.values[0];
|
||||||
|
}
|
||||||
|
setChart(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Open the modal and show all the data*/
|
/*Open the modal and show all the data*/
|
||||||
@@ -375,10 +398,10 @@ function openDialog(dep, cls, sem, professor, res) {
|
|||||||
data = [];
|
data = [];
|
||||||
$("#semesters").append("<option>No Data</option>")
|
$("#semesters").append("<option>No Data</option>")
|
||||||
} else {
|
} else {
|
||||||
var semesters = res.values[0][18].split(",");
|
var semesters = res.values[0][18].split(",").reverse();
|
||||||
semesters.unshift('Aggregate');
|
semesters.unshift('Aggregate');
|
||||||
for (var i = 0; i < semesters.length; i++) {
|
for (var i = 0; i < semesters.length; i++) {
|
||||||
$("#semesters").append(`<option>${semesters[i]}</option>`)
|
$("#semesters").append(`<option value="${semesters[i]}">${semesters[i]}</option>`)
|
||||||
}
|
}
|
||||||
data = res.values[0];
|
data = res.values[0];
|
||||||
}
|
}
|
||||||
@@ -412,6 +435,19 @@ function openDialog(dep, cls, sem, professor, res) {
|
|||||||
$("#myModal").fadeOut(200);
|
$("#myModal").fadeOut(200);
|
||||||
$("#snackbar").attr("class", "");
|
$("#snackbar").attr("class", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setChart(data);
|
||||||
|
// When clicks anywhere outside of the modal, close it
|
||||||
|
window.onclick = function (event) {
|
||||||
|
if (event.target == modal) {
|
||||||
|
$("#myModal").fadeOut(fadetime);
|
||||||
|
$("#snackbar").attr("class", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setChart(data) {
|
||||||
//set up the chart
|
//set up the chart
|
||||||
chart = Highcharts.chart('chart', {
|
chart = Highcharts.chart('chart', {
|
||||||
chart: {
|
chart: {
|
||||||
@@ -534,13 +570,7 @@ function openDialog(dep, cls, sem, professor, res) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}); // When clicks anywhere outside of the modal, close it
|
});
|
||||||
window.onclick = function (event) {
|
|
||||||
if (event.target == modal) {
|
|
||||||
$("#myModal").fadeOut(fadetime);
|
|
||||||
$("#snackbar").attr("class", "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Format the title*/
|
/*Format the title*/
|
||||||
|
|||||||
Reference in New Issue
Block a user