Absolutely, just what I was thinking. Due to corona our school has unfortunately cancelled every elective course, however I found a hack to kind of solve the problem.
I used the plugin Grouptool: https://moodle.org/plugins/mod_grouptool
With this tool users can join different groups and you can set how many users can be in a group. Then I'd create a moodle Course named "Elective Courses" and create a seperate group for every elective course that the teachers want to offer.
The students can then join these courses and you can set a min and max amount of courses students need to join.
This solution is quite work-intensive to set up but once it is running I think it should work. However as already said I won't be able to test it this year. Maybe next year I can test it and provide you with some first hand experience.
I used the plugin Grouptool: https://moodle.org/plugins/mod_grouptool
With this tool users can join different groups and you can set how many users can be in a group. Then I'd create a moodle Course named "Elective Courses" and create a seperate group for every elective course that the teachers want to offer.
The students can then join these courses and you can set a min and max amount of courses students need to join.
This solution is quite work-intensive to set up but once it is running I think it should work. However as already said I won't be able to test it this year. Maybe next year I can test it and provide you with some first hand experience.