-
Notifications
You must be signed in to change notification settings - Fork 285
Properties Schema Examples v1.0.0
Tom Taylor edited this page Feb 3, 2023
·
7 revisions
Following on from the property schema dissection, lets take a look at some examples of the differing types of schemas that can be used in v1.0.0 Authoring Tool schema.
"title": {
"type": "string",
"title": "Title",
"default": "Untitled",
"_adapt": {
"translatable": true
}
},
"body": {
"type": "string",
"title": "Body",
"default": "",
"_adapt": {
"translatable": true
},
"_backboneForms": "TextArea"
},
"_left": {
"type": "number",
"title": "Pin horizontal position (%)",
"description": "",
"default": 0
},
"_isMobileTextBelowImage": {
"type": "boolean",
"title": "Move text area below image on mobile",
"description": "If enabled, on mobile, the text area drops below the image instead of being behind the strapline button",
"default": false,
"_adapt": {
"isSetting": true
}
},
"src": {
"type": "string",
"isObjectId": true,
"title": "Source",
"description": "This is the image that appears behind the pins",
"_backboneForms": {
"type": "Asset",
"media": "image"
}
},
"_setCompletionOn": {
"type": "string",
"title": "Completion criteria",
"description": "Whether completion is based on the learner having viewed all the narrative items - or just having viewed the component",
"default": "allItems",
"enum": [
"inview",
"allItems"
],
"_backboneForms": "Select"
},
"_graphic": {
"type": "object",
"title": "Graphic",
"default": {},
"required": [
"src"
],
"properties": {
...
}
}
"_items": {
"type": "array",
"title": "Items",
"items": {
...
}
}
The _adapt
keyword is used to group schema properties which are non-standard to the JSON schema specification and related to various Adapt-specific features.
"_adapt": {
"editorOnly": true,
"isSetting": true,
"translatable": true
}
Property | Type | Description |
---|---|---|
editorOnly |
Boolean |
Determines whether the attribute should be included in output JSON |
isSetting |
Boolean |
Attribute will appear in the ‘Settings’ section of the form |
translatable |
Boolean |
Whether the attribute is a language-specific string for translation |
Backbone Forms is the library used to render forms from the input schemas. The _backboneForms
keyword is used to group schema properties which are non-standard to the JSON schema specification and related to various Backbone Forms specific features.
_backboneForms": {
"type": "Asset",
"showInUi": false,
"media": "image"
"editorAttrs": {}
}
In most cases, it is only necessary to specify the type. In this case, the _backboneForms
property also can also be a string value, e.g.
"_backboneForms": "Select"
Property | Type | Description |
---|---|---|
type |
String |
Override the type of Backbone Forms input to be used (by default, the type will be inferred from the schema property's type value). Accepted types: Asset , Text , Number , Password , TextArea , Checkbox , Checkboxes , Select , Radio , Object , Date , DateTime , List . See the Backbone Forms docs for more information. |
showInUi |
Boolean |
Determines whether the attribute will be rendered in forms |
media |
String |
When using a type of Asset , you can also restrict the AAT UI to only show assets of a specific type. The AAT stores the asset type based in its MIME type (e.g. files with a MIME type of image/png and image/jpeg would both have a type of image ). |
editorAttrs |
Object |
Extra options passed to the Backbone Forms input. See the Backbone Forms docs for more information. |