Simon-Initiative / course-digest

Tool to produce a summary or digest of OLI course package contents
MIT License
2 stars 0 forks source link

[FEATURE] materials and composite_activity element support #57

Closed darrensiegel closed 2 years ago

darrensiegel commented 2 years ago

materials tag support

This PR adds support to migrate element, which is used typically to display two things side-by-side. It migrates materials to a table that is configured to not show it's borders (which Torus doesn't yet support, but will). It handles both orientations that materials DTD element supports: "horizontal" and "vertical")

I found and fixed two other issues:

If a page contained more than one reference to the same image, only one of the references were properly being updated with the new full URL. Some page content was leading to generation of elements which contained a block element surrounded by two "text" elements that simply contained a single space. This wasn't breaking anything, as once ingested into Torus these spaces turn into paragraphs. But it was adding unnecesary whitespace. This specific case is now identified and the extra spaces are removed.

composite_activity element support

This PR also adds support for the <composite_activity> element. It migrates this element to the Torus group construct. Some work was needed to be done here to allow activity placeholder elements to be replaced with activity references when those placeholders exist at a level deeper than the top-level of the content model array. This change does not add full recursive support, only support for seeing groups at the top-level and processing their children. That should be all that we need.