solymosi / npu

Neptun PowerUp! - Felturbózza a Neptun-odat
MIT License
274 stars 47 forks source link

Exam classification not working on ExamList page #26

Closed Levivig closed 6 years ago

Levivig commented 6 years ago

Not sure if this is a universal issue, but on this version the classification is not working, because the grade names are different. Jeles (5); Jó (4); etc. instead of Jeles; Jó; etc. . I quickly fixed it for myself like this:

if (grade.indexOf("(") > 0) {
    grade = grade.substr(0, grade.indexOf("("));
}

If it looks good I can make a PR.

Build: 452 (2017.11.08.) P20171221

image

solymosi commented 6 years ago

At Corvinus the same build is used but the grade names do not include the grade number, so this must be a local configuration change at your university. I will think of a robust way of handling this.

solymosi commented 6 years ago

@Levivig Can you please test this new version? https://github.com/solymosi/npu/raw/60d136219b8cc0ceafadd1cd83c1ba21070579d7/npu.user.js PR: #27

Levivig commented 6 years ago

Works fine for me.

whisperity commented 6 years ago

Yeah, unfortunately this happens when your only option is to parse HTML without an API. 😦


Off-topic suggestion: AI which learns which are passing grades. Or asking the students at first login "Is this a passing grade" and saving it as configuration variable. (This way, people who want a pristine semester can say that a Good (4) is not enough, consider it a failing grade!)

solymosi commented 6 years ago

I would not go down the AI route for complexity reasons, but I like the idea of a little bit more configurability regarding the grade detection. My only concern is that it would be a feature barely used by anyone, but could cause backwards compatibility headaches for us down the road - i.e. if we allow users to customize passing and failing grade strings, we have to honor their custom configuration even if we later develop a new, better detection mechanism. This very PR (relaxing the matching rules from exact match to substring match) would be too dangerous if we already had users with custom strings configured (what if they added a passing string that is the substring of a failing string?)

For now, we could do the following instead: whenever the script finds a grade string it cannot recognize as passing or failing, it would report that grade string (and nothing else) back to us. This way we could add missing grade strings in later updates.

solymosi commented 6 years ago

Version 1.52.3 has been released with the fix 🎉 Thanks for reporting this bug!