Brainstorming: Course/Library Unit-like References

Compatibility assumptions

  1. Can’t break backwards compatibility with the (horribly named) <vertical>, so we can’t nest in a new tag.

  2. Content exported from new instances should still work in old instances.

Idea: Upstream groups of components

So instead of just this:

<vertical upstream=""> <html /> <video /> <problem /> </vertical>

We can have something more like this:

<vertical> <component-group upstream="{unit_usage_key}" label="intro_to_openedx" /> <html component-group="intro_to_openedx" upstream="{usage_key}" /> <video component-group="intro_to_openedx" upstream="{usage_key}" /> <problem component-group="intro_to_openedx" upstream="{usage_key}" /> </vertical>

That gives us flexibility too (maybe too much?) in that we can splice together two Units, keep the upstream references for all the pieces, but also the upstreams for the unit as a whole.

We can’t do the equivalent at the vertical → sequential layer though, because I think the parsing code will error if it sees anything other than vertical as a child element.

Note that this only makes sense if we’re splicing from multiple source Units. Otherwise, it’s enough to just put the upstream indicator on the vertical itself.

An alternative approach that would be more backwards compatible for sequentials and other things that expect to have a specific set of child elements would be to create a new upstreams (plural) attribute that has name → usage key mapping. Or if we want to make it even less possible to write OLX validation, we can make dynamic upstream fields like upstream-intro-to-openedx.

Multiple inheritance is edge-case city though. We should probably just ignore default values altogether rather in that case, instead of trying to combine things.