Simon-Initiative / course-digest

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

`objective` ids are not globally unique #31

Closed darrensiegel closed 2 years ago

darrensiegel commented 2 years ago

While the top-level id in an objectives resource is globally unique within a course, the individual ids of the objective elements are not. The digest tool assumes that they are. This will be problematic in courses that define learning objectives with ids that match the ids of other resources, such as workbook pages.

The pcard course does exactly this. There is a learning objective whose id is ga_transactions1, which conflicts with a workbook page of the same id.

One approach to handle:

  1. Change the ids of all generate objectives to the id of the objective concatenated with the id of the parent objectives element. This gives us global uniqueness.
  2. Make two post processing passes across the generated JSON files, first to find all objectives and build an index of the original objective id to the newly concatenated ones. Second pass: update all objective references found within workbook page "objectives" keys to replace the short (not-global) id with the full, global id.