Allowing widgets to be addressed with an ID would enable some useful features:
Anchor links to jump to the widget in the explorable
Identifying the widget in xAPI statements
Automatically linking/referencing sources when copy-pasting
URL-based approach
Explorable ID: The explorable itself is already defined by the URL, e.g. example.com/myexplorable.html. For HTTP/S, this can be expected to be unique. For local files, the username needs to be inserted into the file URL.
Widget ID: The widget ID must be unique across all elements in the document. The set of widget IDs should also be stable, meaning that inserting or removing a widget ID should not change the existing widget IDs.
Editing by teachers
The editor automatically assigns IDs when creating widgets. The ID is a Base 36 ASCII string encoded number, preceded by ww_. For example, the first widget ID would be ww_0, while "last" widget ID would be ww_2gosa7pa2gv, based on Number.MAX_SAFE_INTEGER.toString(36). On creation, possible widget IDs are checked one by one, until an unassigned one is found. This theoretically allows for a stable set of Number.MAX_SAFE_INTEGER widgets in the document, while checking for available IDs is performant.
Allowing widgets to be addressed with an ID would enable some useful features:
URL-based approach
example.com/myexplorable.html
. For HTTP/S, this can be expected to be unique. For local files, the username needs to be inserted into thefile
URL.Editing by teachers The editor automatically assigns IDs when creating widgets. The ID is a Base 36 ASCII string encoded number, preceded by
ww_
. For example, the first widget ID would beww_0
, while "last" widget ID would beww_2gosa7pa2gv
, based onNumber.MAX_SAFE_INTEGER.toString(36)
. On creation, possible widget IDs are checked one by one, until an unassigned one is found. This theoretically allows for a stable set ofNumber.MAX_SAFE_INTEGER
widgets in the document, while checking for available IDs is performant.