cmusv / pysheetgrader-core

PySheetGrader -- grading spreadsheet assignments made easy!
Other
2 stars 2 forks source link

Colelloa/score double bug #36

Closed colelloa closed 1 year ago

colelloa commented 1 year ago

Hey @erdogmush,

I spent some time with the following bug:

Screen Shot 2023-01-16 at 7 39 35 PM copy

It appears that this score was doubling due to the loop in formula.py

The given rubric had an alt cell that was equivalent to the original answer (e.g. C42 and B39 are the same formula), so the loop was adding the score twice.

My logic for the fix is to not add to the score if the answer was already marked correct. I couldn't find any regressions from introducing this - I'm curious what you think of it and why it wasn't like this before / whether we could think about redoing how this loop works a bit to follow some of the same pattern, as I see it is attempting to sum scores together the same way in a few places.

Thanks Andrew

erdogmush commented 1 year ago

Thanks Andrew. Yes once the answer is correct, the remaining alt_cells, if any, need not be checked - one can just exit the loop. The reason why this bug was not found and fixed before is that it had not been really tested until I added a bunch of test-mode tests systematically going through the different features.

erdogmush commented 1 year ago

Looking at the code, it looks kludgy, the result of different students adding to it when new cases arose to scratch their own itch. The way negative grading is handled and all that. You're right, too much branching logic. This may indeed deserve rethinking. Let's proceed with the fix though for now if there aren't any regressions.