Well, if you are no good at code yourself, you need to find a friend who is, and buy them a copy of Moodle 1.9 Extension Development. The example in the section on how to create a new course format is something similar to what you are asking, only involving the forum module, not a quiz.
Courses and course formats
New course format with quiz section?
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.