hypothesis / lms

LTI app for integrating with learning management systems
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Allow instructors to configure a page range for a VitalSource assignment #5808

Closed robertknight closed 9 months ago

robertknight commented 10 months ago

Allow instructors to select multiple chapters or a page range for an assignment.

Image

robertknight commented 10 months ago

The original idea was to have the page range synchronized with the table. However I've encountered some issues with this:

  1. Missing end page data. The API we use to get the table of contents only returns the start page for an entry, not the end page. The end page for many entries could be inferred based on the start page of the next entry, but there are cases where this doesn't work: the last entry, entries that start or end in the middle of a page, entries with non-numeric page numbers.
  2. Page numbers that map to multiple entries. A single page number may map to multiple entries. If the user enters a page range, it is not certain which entries they intended to select. This physics book for example has a very fine-grained TOC which can have multiple entries per page.
  3. Non-numeric page ranges. Most page numbers are numeric, but within the same book there can be a mix of numbering schemes. For example this physics book which was used heavily in a previous course has a mix of roman numerals for the intro, ASCII digits for the main content and A-{i} for appendices. If the user enters a page number that isn't on a chapter boundary, this makes it more complicated to figure out which chapters include that number.

Despite these issues, there are cases where allowing specifying page ranges and not just selecting a range of TOC entries seems necessary:

Heart of Darkness TOC

Here for example the core text of the book is just one TOC entry, which is not very useful.

I think where this is leading is that the user needs to choose one of the two ways of specifying the content range, and the method used needs to be obvious when you look at the UI. For example, maybe specifying a content range via selection in the table could be the default, but if you enter values in the page range field, that takes precedence and the table display somehow reflects that.

robertknight commented 9 months ago

The "configure a page range" part of the original issue has been implemented. Selecting multiple entries in the TOC tree is not implemented yet. The reason is that the original mocks treated the TOC as a simple list, which is how we used to present it. However the TOC is really a tree, not a list, and it turns out that to support selection in a way that makes sense you really need to present it as a tree. We have made a minimal change to indicate the hierarchy level of items, but implementing proper multi-selection in the tree is involved, so has been deferred to a separate issue.