Moodle can do 99% of what you want to do right out of the box... no coding required. In fact, the Learn.Moodle.net site does it for thousands of students each time they offer the free MOOC (twice a year).
The only part that it does not have is for the students to create their own course. Allowing students to create their own course could go out of control.
What they will do instead is to use the Moodle Request a Course feature where a student submits a request which includes the course a name, short name, summary and reason for wanting this course. The request is then approved by someone with that ability or administrators. The student then receives a notification that their course has been created.
The student will then be able to build and customize the course as they see fit. They will be able to add any type of Moodle activity or resource available to them into their course. They will also have control over enrolment methods.
To enable the Course Request feature, go to Home > Site Administration > Courses > Course request. Here is a video that will show you how to do it:
You may also find the following plugin to be of interest through it is not available for Moodle 3.0+ yet.
Additional relevant information that you may need:
Hope you find some of this information useful.