Skip to content

An H5P widget that sets the value of the field to a UUID

License

Notifications You must be signed in to change notification settings

NDLANO/h5p-editor-uuid

Repository files navigation

h5p-editor-uuid

An H5P widget that sets the value of a field to a UUID. The widget does not render the input field.

How to use

This widget can be added to any field of type text. It will use H5P.createUUID to generate a new UUID and set it as the field's value if the field does not already have a value.

semantics.json:

{
  "label": "ID",
  "name": "id",
  "type": "text",
  "widget": "uuid"
}

It is not part of the H5P core, therefore it must be added as an editor dependency.

library.json:

{
  "editorDependencies": [
    {
      "machineName": "H5PEditor.UUIDWidget",
      "majorVersion": 1,
      "minorVersion": 0
    },
  ]
}