Compare commits
11 Commits
semesterSe
...
summerHand
| Author | SHA1 | Date | |
|---|---|---|---|
| 50c7e0468b | |||
| 4f1efd12b1 | |||
| 15ad0417fc | |||
| 2363631674 | |||
| 5657a1be59 | |||
| cae0828bb4 | |||
|
|
c69dfcaf0d | ||
|
|
78f91df79f | ||
|
|
dd07762fa0 | ||
|
|
ee63bdfeb2 | ||
|
|
9a9b238214 |
@@ -1,4 +1,8 @@
|
|||||||
# Why is this a thing?
|
## How do I access the website?
|
||||||
|
|
||||||
|
https://derec4.github.io/ut-grade-distribution-viewer/
|
||||||
|
|
||||||
|
## Why is this a thing?
|
||||||
|
|
||||||
I'm sure you've all seen this before:
|
I'm sure you've all seen this before:
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<label for="dropdown">Semester (under construction):</label>
|
<label for="dropdown">Semester (under construction):</label>
|
||||||
<select id="semester" name="dropdown">
|
<select id="semester" name="dropdown">
|
||||||
<option value="f2022">Fall 2022</option>
|
<option value="f2022">Fall 2022</option>
|
||||||
<option value="s2022">Summer 2022</option>
|
<option value="sum2022">Summer 2022</option>
|
||||||
<option value="sp2022">Spring 2022</option>
|
<option value="sp2022">Spring 2022</option>
|
||||||
<option value="f2021">Fall 2021</option>
|
<option value="f2021">Fall 2021</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
40
main.js
40
main.js
@@ -7,7 +7,7 @@ if(chartDiv.getAttribute('value') == 'invisible'){
|
|||||||
}
|
}
|
||||||
var gradeChart;
|
var gradeChart;
|
||||||
const ctx = document.getElementById("gradeBar");
|
const ctx = document.getElementById("gradeBar");
|
||||||
|
const labels = ['A', 'A-', 'B+', 'B', 'B-', 'C+', 'C', 'C-', 'D+', 'D', 'D-', 'F'];
|
||||||
/*
|
/*
|
||||||
Parse the input form and class data
|
Parse the input form and class data
|
||||||
*/
|
*/
|
||||||
@@ -32,7 +32,7 @@ async function parseName() {
|
|||||||
alert("Invalid Department");
|
alert("Invalid Department");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(department, classNum.toString(), className.trim());
|
console.log(department, classNum.toString(), className.trim(), semester);
|
||||||
await PapaParse(department, classNum.toString(), className.trim(), semester);
|
await PapaParse(department, classNum.toString(), className.trim(), semester);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,17 +41,15 @@ async function parseName() {
|
|||||||
*/
|
*/
|
||||||
async function PapaParse(department, num, name, sem) {
|
async function PapaParse(department, num, name, sem) {
|
||||||
let cData = '';
|
let cData = '';
|
||||||
// console.log(sem);
|
|
||||||
let url = '';
|
let url = '';
|
||||||
switch (sem) {
|
switch (sem) {
|
||||||
case 'f2022':
|
case 'f2022':
|
||||||
url = 'https://derec4.github.io/ut-grade-data/2022%20Fall.json';
|
url = 'https://derec4.github.io/ut-grade-data/2022%20Fall.json';
|
||||||
break;
|
break;
|
||||||
case 's2022':
|
case 'sum2022':
|
||||||
url = 'https://derec4.github.io/ut-grade-data/2022%20Summer.json';
|
url = 'https://derec4.github.io/ut-grade-data/2022%20Summer.json';
|
||||||
break;
|
break;
|
||||||
case 'sp2022':
|
case 'sp2022':
|
||||||
// Temp, change when other data sets are added
|
|
||||||
url = 'https://derec4.github.io/ut-grade-data/2022%20Spring.json';
|
url = 'https://derec4.github.io/ut-grade-data/2022%20Spring.json';
|
||||||
break;
|
break;
|
||||||
case 'f2021':
|
case 'f2021':
|
||||||
@@ -70,13 +68,13 @@ async function PapaParse(department, num, name, sem) {
|
|||||||
.filter(cData => cData["Course Title"].includes(name));
|
.filter(cData => cData["Course Title"].includes(name));
|
||||||
if(selectedClass.length == 0) {
|
if(selectedClass.length == 0) {
|
||||||
// Possible that the class name was typed wrong; try again with just the course number
|
// Possible that the class name was typed wrong; try again with just the course number
|
||||||
console.log("Second Option");
|
console.log("Invalid name; trying again with just course number and prefix");
|
||||||
selectedClass = cData.filter(cData => cData["Course Prefix"].includes(department))
|
selectedClass = cData.filter(cData => cData["Course Prefix"].includes(department))
|
||||||
.filter(cData => cData["Course Number"] == num.toString().toUpperCase());
|
.filter(cData => cData["Course Number"] == num.toString().toUpperCase());
|
||||||
}
|
}
|
||||||
if(selectedClass.length == 0) {
|
if(selectedClass.length == 0) {
|
||||||
// Still can't find anything? Just exit without making a chart and alert that nothing could be found
|
// Still can't find anything? Just exit without making a chart and alert that nothing could be found
|
||||||
alert("No data found");
|
alert("No data found. Try again :(");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,19 +104,7 @@ async function PapaParse(department, num, name, sem) {
|
|||||||
console.log(gradeDist);
|
console.log(gradeDist);
|
||||||
if(gradeChart) {
|
if(gradeChart) {
|
||||||
gradeChart.config.data = {
|
gradeChart.config.data = {
|
||||||
labels: [
|
labels: labels,
|
||||||
'A',
|
|
||||||
'A-',
|
|
||||||
'B+',
|
|
||||||
'B',
|
|
||||||
'B-',
|
|
||||||
'C+',
|
|
||||||
'C',
|
|
||||||
'C-',
|
|
||||||
'D+',
|
|
||||||
'D',
|
|
||||||
'D-',
|
|
||||||
'F'],
|
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Grade distribution for \"' + selectedClass[0]["Course Title"] +"\"",
|
label: 'Grade distribution for \"' + selectedClass[0]["Course Title"] +"\"",
|
||||||
data: Object.values(gradeDist),
|
data: Object.values(gradeDist),
|
||||||
@@ -139,19 +125,7 @@ function loadChart(gradeDist, courseName) {
|
|||||||
gradeChart = new Chart(ctx, {
|
gradeChart = new Chart(ctx, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
labels: [
|
labels: labels,
|
||||||
'A',
|
|
||||||
'A-',
|
|
||||||
'B+',
|
|
||||||
'B',
|
|
||||||
'B-',
|
|
||||||
'C+',
|
|
||||||
'C',
|
|
||||||
'C-',
|
|
||||||
'D+',
|
|
||||||
'D',
|
|
||||||
'D-',
|
|
||||||
'F'],
|
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Grade distribution for \"' + courseName + "\"",
|
label: 'Grade distribution for \"' + courseName + "\"",
|
||||||
data: Object.values(gradeDist),
|
data: Object.values(gradeDist),
|
||||||
|
|||||||
13
sitemap.xml
Normal file
13
sitemap.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset
|
||||||
|
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
|
||||||
|
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
|
||||||
|
<url>
|
||||||
|
<loc>https://derec4.github.io/ut-grade-distribution-viewer/</loc>
|
||||||
|
<lastmod>2023-04-29T05:59:34+00:00</lastmod>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
</urlset>
|
||||||
BIN
tempbg.png
BIN
tempbg.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 MiB |
Reference in New Issue
Block a user