Nested forms that are expandable (multiple levels)

I am struggling to find a good solution or good examples to this problem:

I have a table of elements that are hierarchical with tiered levels. (ex. Classes -> 3 courses -> each course has multiple lessons -> each lesson has multiple assignments)

A user will need to be able to bulk create classes and the tiers within it. Example use case: 1. user creates a class 2. user creates 3 courses under the class. 3. for each 3 courses, user can create multiple lessons under it (and so on)

The issue is that this becomes deeply nested and I don't have a good way to solve this problem. Currently, I have the forms nested in expandable panels, but realized the whole nesting panels in panels can be confusing. Can anyone suggest a better way in doing this?

enter image description here