Closed Syxton closed 2 years ago
@Syxton Nice idea! Will test and review soon.
@PhMemmel Thank you for the great feedback. I have used your advice and also restructured a some now that I understand a bit better on what is going on. Please look at the latest changes and tell me what you think.
Yes, code looks much cleaner now while being more stable, good job. There's just one point I directly added as review comment in the code which we should fix together with this newly added feature.
I just found by accident that there is a core function course_create_sections_if_missing($courseid, $sectionnum)
. We should definitely make use of this instead of counting and adding sections ourselves in case we are importing to same sections the modules originally had. This function however does not solve the things with the orphaned sections, so we still have to keep this part of the code
@PhMemmel Ok, I think I'm ready for another review. No rush.
Very nice improvement of the code, good job! I did not manually test every single case, but in general it seems to work, we also have good test coverage (gj BTW ;-)), so we should be good to go with this. Thanks a lot! Very nice feature addition and improvement of my initial code!
Mergeable from my side
@PhMemmel What do you think about this addition?