Skip to content

General Items

Stefaan Ternier edited this page Dec 5, 2015 · 2 revisions

General item is an abstract class that defines metadata shared by various subclasses (Narrator Item, Multiple Choice Question, etc.)

The following json excerpt exemplifies this:

{
 "type": "org.celstec.arlearn2.beans.generalItem.NarratorItem",
 "gameId": 6196093,
 "deleted": false,
 "lastModificationDate": 1385042029518,
 "id": 6176098,
 "sortKey": 0,
 "scope": "user",
 "name": "Welcome",
 "description": "",
 "autoLaunch": false,
 "showCountDown": false,
 "roles": [],
 "richText": "<b>here comes</b> a rich text description <br> <img src="picture"/>"
}

Sub classes

Quite often new general items are being defined. Most used items (or messages) are:

  • Narrator item
  • Audio Object
  • Video Object
  • Multiple Choice
  • Single Choice

The following general items were defined to meet the goals of various projects in which ARLearn is used

API

Get General Items

This method enables retrieving all message given a game.

Parameters

  • gameId (mandatory): the identifier of the game for which items are retrieved
  • from (optional) : only items modified after this POSIX formatted datestamp will be returned
  • until (optional) : only items modified before this POSIX formatted datestamp will be

REST URL

GET /rest/generalItems/gameId/123?from=0&until=1366627645865

Example response returned from server:

{
 "type": "org.celstec.arlearn2.beans.generalItem.GeneralItemList",
 "serverTime": 1389088032608,
 "generalItems": [
    {
        "type": "org.celstec.arlearn2.beans.generalItem.NarratorItem",
        "gameId": 15516001,
        "deleted": false,
        "lastModificationDate": 1389086110351,
        "id": 15546001,
        "sortKey": 0,
        "scope": "user",
        "name": "Welcome",
        "description": "Welcome...",
        "dependsOn": {
            "type": "org.celstec.arlearn2.beans.dependencies.ActionDependency",
            "action": "startRun",
            "scope": 2
        },
        "autoLaunch": false,
        "showCountDown": false,
        "roles": [],
        "fileReferences": [],
        "richText": "Welcome..."
    },
    {
        "type": "org.celstec.arlearn2.beans.generalItem.AudioObject",
        "gameId": 15516001,
        "deleted": false,
        "lastModificationDate": 1385739363341,
        "id": 15556002,
        "sortKey": 0,
        "scope": "user",
        "name": "Audio",
        "description": "Listen to this ...",
        "dependsOn": {
            "type": "org.celstec.arlearn2.beans.dependencies.ActionDependency",
            "action": "read",
            "generalItemId": 15546001,
            "scope": 0
        },
        "autoLaunch": false,
        "showCountDown": false,
        "roles": [],
        "fileReferences": [],
        "richText": "Listen to this ...",
        "audioFeed": "https://dl.dropboxusercontent.com/u/1571790/listen.mp3",
        "autoPlay": false
    }
 ]
}

Clone this wiki locally