Conversation
|
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
e48cd1c to
95cb031
Compare
95cb031 to
107cc8e
Compare
| local grades = {} | ||
| for grade, _ in pairs(self.db) do | ||
| table.insert(grades, grade) | ||
| end | ||
| table.sort(grades) | ||
|
|
||
| local roster = {} | ||
| for _, grade in pairs(self.db) do | ||
| for _, student in ipairs(grade) do | ||
| for _, grade in ipairs(grades) do | ||
| for _, student in ipairs(self.db[grade]) do | ||
| table.insert(roster, student) | ||
| end | ||
| end |
There was a problem hiding this comment.
The previous solution could fail if pairs didn't iterate over self.db in the right order (which isn't guaranteed). This addresses an intermittent failure related to sensitivity in the iteration order by guaranteeing that we will always iterate over all grades in ascending order.
| return { aliquot_sum = aliquot_sum, classify = classify } | ||
| return { classify = classify } |
There was a problem hiding this comment.
The tests no longer test aliquot_sum directly
Closes #626