- Issue created by @berdir
- Status changed to Needs review
over 1 year ago 7:00am 25 August 2023 - Status changed to RTBC
7 months ago 11:09am 4 June 2024 - πΈπͺSweden johnzzon Gothenburg πΈπͺ
We encountered this and I spent a couple of hours debugging it today.
I came to the same conclusions as you, I just wish I found this issue earlier. I only looked in the opigno_lms issue queue.
My fix was a condition on finished, as you discuss. But a sort will effectively do the same.
The original issue seems to stem from that when you restart a learning path, it finishes the unfinished LP statuses first, and then finishes unfinished module statuses. However, the finalize logic in LPStatus::setFinished will not finalize if there are unfinished modules.
I know too little of the code base to determine whether it would be better to finish unfinished modules before finishing unfinished LP statuses, but I think that would also solve the issue, because the previous LP status would be finalized.