Coder Social home page Coder Social logo

gpa-calc-ucas's People

Contributors

daiyongxuan avatar timesea05 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gpa-calc-ucas's Issues

关于“未参加评估”导致实时GPA显示NaN的问题及一个暴力的解决方法

之前有人提到过如果没有参加过评估的话,那么可以在GPA查询页面后面加个.json就能找到。我试了一下这个方法已经失效了,因为一门课程的成绩储存在json文件中的score属性中(不清楚“属性”一词用对没有),但是如果这门课程没参加评估的话score属性会显示null。

gpa-calc-ucas

回到标题中提出的问题,个人认为一种解决方法只能是跳过未参加评估的学科,使之不参与GPA和加权平均分的计算。虽然这样并不会得到准确的结果,但是也可以得到一个近似的结果,且总比实时GPA显示NaN强。同时我上学期只有形测忘了评估,本来也不影响GPA和加权平均,所以对我来说没啥问题hhh

我的解决方案如下:在原代码第40行后加一行if (Number(scoreTable.rows[i].cells[4].innerHTML) == 0) continue;

gpa-calc-ucas-2

原理:只有在未参加评估的情况下score的值是null,而null转换为Number之后会得到0。当然如果有人真的是0分的话那我暂时也没有办法。此外我的js水平也非常烂,如果安佬有什么更好的办法也可以试试,我去复习了Orz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.