-
Notifications
You must be signed in to change notification settings - Fork 291
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
}
},
![Screenshot 2023-01-16 at 17 06 30](https://user-images.githubusercontent.com/11569678/212891159-e73fbe91-0169-429e-86c7-3f8231617b3b.png)
"body": {
"type": "string",
"title": "Body",
"default": "",
"_adapt": {
"translatable": true
},
"_backboneForms": "TextArea"
},
![Screenshot 2023-01-16 at 17 07 11](https://user-images.githubusercontent.com/11569678/212891179-f7477a54-3be5-4c39-aa60-7df67d86b7d2.png)
"_left": {
"type": "number",
"title": "Pin horizontal position (%)",
"description": "",
"default": 0
},
![Screenshot 2023-01-16 at 17 10 50](https://user-images.githubusercontent.com/11569678/212891200-f9968fe2-8882-4248-8bb2-d6b2f8151e56.png)
"_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
}
},
![Screenshot 2023-01-16 at 17 29 09](https://user-images.githubusercontent.com/11569678/212891377-4c3e130d-5f2a-4de5-b1e2-b1747ed2da0e.png)
"src": {
"type": "string",
"isObjectId": true,
"title": "Source",
"description": "This is the image that appears behind the pins",
"_backboneForms": {
"type": "Asset",
"media": "image"
}
},
![Screenshot 2023-01-16 at 17 29 41](https://user-images.githubusercontent.com/11569678/212891422-c240c248-1bfd-4c2d-af63-a01aa281ba45.png)
"_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"
},
![Screenshot 2023-01-16 at 17 31 00](https://user-images.githubusercontent.com/11569678/212891453-5c482ea5-ef4f-425f-9756-cdb5b71d7e69.png)
"_graphic": {
"type": "object",
"title": "Graphic",
"default": {},
"required": [
"src"
],
"properties": {
...
}
}
![Screenshot 2023-01-16 at 17 33 08](https://user-images.githubusercontent.com/11569678/212891476-fab8198d-2dca-4ce5-af0b-4f07729780f4.png)
"_items": {
"type": "array",
"title": "Items",
"items": {
...
}
}
![Screenshot 2023-01-16 at 17 33 43](https://user-images.githubusercontent.com/11569678/212891491-b6102f17-7631-4ef3-b3cc-1c0dadfd3522.png)
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. |