Sylrelo / 42Tools

Tools for 42 School students (stats, ranking, calculator, RNCP progression...)
https://42tools.slopez.dev
30 stars 0 forks source link

[BUG] XP calculator has an improper formula for Internship and other such special projects #51

Open rgilles42 opened 3 hours ago

rgilles42 commented 3 hours ago

Hi, First, for the duration of the internship, the number of business days is collected, despite the variable being called contractHours. I'll be calling it contractDays from now on.

The current formula for calculating XP for professional experience projects is as such:

gainedXp = ((1.25 videoMark + 2.0 midEvalMark + 4.0 finalEvalMark) contractDays * projectExperience) / 90000

which is equivalent to

gainedXp = (1.25 videoMark% + 2.0 midEvalMark% + 4.0 finalEvalMark%) contractDays / 900 * projectExperience

In order to be a real coefficient, the first term has to be divided by 7 somehow. But in order to be a coefficient too, the 2d factor needs to be an amount of hours, and not days.

In the typical french contract, the weekly business hours volume is of 35h, which means a business day contains 7 business hours on average. That's the reason the formula works for french contracts, because it goes like so gainedXp = (1.25 videoMark% + 2.0 midEvalMark% + 4.0 finalEvalMark%)/7 7contractDays/ 900 projectExperience

That's why I have ground to believe that this formula is oversimplified because it assumes a weekly hour volume of 35h, or 7h per day. It stops working as soon as the contract assumes a different volume of hours per day, because it hardcodes a relationship of 1 to 7, while, in the typical german 40h/week for instance, there has to be a relationship of 1 to 8.

A more accurate formula would then be gainedXP = contractHours / 900 1/700(1.25 videoMark + 2.0 midEvalMark + 4.0 finalEvalMark) projectExperience (with contractHours an actual amount of hours, which could be either promped directly or as contractDays * weeklyHoursVolume / amountDaysPerWeek)

rgilles42 commented 2 hours ago

A more accurate formula would then be gainedXP = contractHours / 900 1/700(1.25 videoMark + 2.0 midEvalMark + 4.0 finalEvalMark) projectExperience (with contractHours an actual amount of hours, which could be either promped directly or as contractDays * weeklyHoursVolume / amountDaysPerWeek)

I'd recommend asking directly for the amount of worked hours since the Companies intra webpage doesn't give the amount of business days (but total calendar days instead), but does give the amount of business hours (by hovering on amount of Hours per Week)