timesea05 / gpa-calc-ucas Goto Github PK
View Code? Open in Web Editor NEWReal Time GPA Calculator for Undergraduate Students in UCAS
Real Time GPA Calculator for Undergraduate Students in UCAS
当出现低于60的分数是实时GPA显示为NaN
教务网址已由jwxkts2.ucas.ac.cn更改为xkcts.ucas.ac.cn
之前有人提到过如果没有参加过评估的话,那么可以在GPA查询页面后面加个.json就能找到。我试了一下这个方法已经失效了,因为一门课程的成绩储存在json文件中的score属性中(不清楚“属性”一词用对没有),但是如果这门课程没参加评估的话score属性会显示null。
回到标题中提出的问题,个人认为一种解决方法只能是跳过未参加评估的学科,使之不参与GPA和加权平均分的计算。虽然这样并不会得到准确的结果,但是也可以得到一个近似的结果,且总比实时GPA显示NaN强。同时我上学期只有形测忘了评估,本来也不影响GPA和加权平均,所以对我来说没啥问题hhh
我的解决方案如下:在原代码第40行后加一行if (Number(scoreTable.rows[i].cells[4].innerHTML) == 0) continue;
。
原理:只有在未参加评估的情况下score的值是null,而null转换为Number之后会得到0。当然如果有人真的是0分的话那我暂时也没有办法。此外我的js水平也非常烂,如果安佬有什么更好的办法也可以试试,我去复习了Orz
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.