Closed robertknight closed 11 months ago
Slack discussion: https://hypothes-is.slack.com/archives/C1MA4E9B9/p1700226427293399
Some notes from https://hypothes-is.slack.com/archives/C1MA4E9B9/p1700226427293399:
Current VS assignments have URLs that look like this:
vitalsource://books/bookID/{book_id}/cfi/{cfi}
We'll extend this format with:
cfi/{cfi}
=> page/{page_num}
The current assumption is that VS assignments will always use a contiguous page range, so we could specify just an endpoint with end_page
or end_cfi
eg:
vitalsource://books/bookID/{book_id}/cfi/{cfi}?end_cfi={cfi}
vitalsource://books/bookID/{book_id}/page/{page}?end_page={end_page}
To keep the knowledge of how these URLs are constructed in one place in the code, we'll have the frontend call a new API to generate the document URL for a given configuration. These URLs are currently returned as part of the /api/vitalsource/toc
API, but that won't work when they need to specify a page number as a start point or an end point.
Implemented in https://github.com/hypothesis/lms/pull/5838.
VitalSource assignments currently just store a start point in their URL. To support https://github.com/hypothesis/lms/issues/5808 this needs to be expanded to allow for configuring a page range. I expect that this concept of specifying start and end points in the content for an assignment will be expanded to other sources in future, so we should design the feature with that in mind.