webwriter-app / webwriter

Authoring tool for interactive content
https://webwriter.app
Other
16 stars 1 forks source link

ID System (Widgets, Explorables) #19

Closed salmenf closed 1 year ago

salmenf commented 1 year ago

Allowing widgets to be addressed with an ID would enable some useful features:

URL-based approach

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.