I have a problem in figuring out the best approach for creating a lecture and quiz for an education platform.
First of all I have two models :
class Course < ApplicationRecord
accepts_nested_attributes_for :sections, reject_if: :all_blank, allow_destroy: true
class Section < ApplicationRecord
class Lesson < ApplicationRecord
class Lecture < Lesson
class Quiz < Lesson
First, decide the best data model and ignore the presentation. After that, focus on how you want to present the data.
I would recommend using a "has a" relationship rather than STI - in other words the approach you recommend in your "update 1". The reason is that the lecture and the quiz seem very different so they don't seem like good candidates for STI. You could go with a polymorphic "lesson_content" relation between the Lesson and Quiz/Lecture objects, but I would start with a plain has_one/ has_many.
Once you have that implemented you can use Cocoon or roll your own dynamic forms. I found the (excellent) Railscast outdated and wrote up a blog post that might be of use here: Dynamic forms with Rails 4