Documentation

1 Login

Description

Login on the server

Request

POST http://domain.org/login_handler

with parameters:

login: your username
password: your password

2 Logout

Description

Logout from the server

Request

GET http://domain.org/logout

3 Get all scorm packages

Description

Get a list of all scorm packages present in the db

Request

GET http://domain.org/scorms

Response

{id_scorm:
    {'root_page': uri_to_root_page,
    'uri': None,
    'title': title_of_this_scorm_package}
}

Example
Request

GET http://domain.org/scorms

Response

{13:
    {'root_page': None,
    'uri': None,
    'title': u'TUVBO'}
}

4 Get Table of contents (TOC)

Description

Get TOC for scorm package with id id_scorm

Request

GET http://domain.org/scorms/{id_scorm}

Response

{id_item:
    {'title': title_for_this_item,
    'sequence': item_sequence_as_described_into_manifest}
}

Example
Request

GET http://domain.org/scorms/13

Response

{18:
    {'title': u'02 - uso dei thread',
    "sequence": 1},
19:
    {'title': u'01 - Introduzione alla programmazione concorrente',
    "sequence": 0}
}

5 Get resources connected to one item

Description

Get all resources connected to this item

Request

GET http://domain.org/items/{id_item}

Response

{id_resource:
    {'type': resource_type, //e.g.: css/video/html/sync
    'uri': uri_to_this_resource}
}

Example
Request

GET http://domain.org/items/18

Response

{64:
    {'type': u'css',
    'uri': u'scorm_root/13/learning objects/02-uso dei thread in Java/Slidy/slidy.css'},
65:
    {'type': u'video',
    'uri': u'scorm_root/13/../video.mp4'},
66:
    {'type': u'video',
    'uri': u'scorm_root/13/../video.mp4'},
67:
    {'type': u'sync',
    'uri': u'scorm_root/13/learning objects/02-uso dei thread in Java/LO2.sync'},
63:
    {'type': u'htm',
    'uri': u'scorm_root/13/learning objects/02-uso dei thread in Java/LO2.htm'}
}

6 Get the number of slides

Description

Get total number of slides for item id_item

Request

GET http://domain.org/slides/{id_item}

Response

{id_item:
    {'tot_slides': number of slides}
}

Example
Request

GET http://domain.org/slides/1

Response

{"1":
    {"tot_slides": 20}
}

7 Get one slide

Description

Get sequence_number-th slide for item id_item

Request

GET http://domain.org/slides/{id_item}/{sequence_number}

{sequence_number} in [0, n-1], with n the number of total slides

Response

{id_slide:
    {"slide_content": html_content_of_this_slide,
    "video_uri": uri_for_video_connected_to_this_slide,
    "video_start": start_time,
    "video_end": end_time //video start and end time connected to this slide
    "tot_slides": total_number_of_slides,
    }
}

Example
Request

GET http://domain.org/slides/18/1

Response

{"164":
    {"slide_content": "<div class=\"slide\"><h1>Thread in Java</h1><ul><li>Il linguaggio Java \u00e8 stato progettato per supportare direttamente l'esecuzione concorrente<ul><li>La macchina virtuale supporta la creazione di un numero arbitrario di thread (compatibilmente con la memoria disponibile) e coopera con il sistema operativo per gestirne l'esecuzione</li></ul><ul><li>Vengono messi a disposizione del programmatore costrutti sintattici e classi per supportare la sincronizzazione delle attivit\u00e0\u00a0</li></ul></li></div>",
    "video_start": "121"
    "video_end": "123",
    "video_uri": "scorm_root/13/video.mp4",
    "tot_slides": "20",
    }
}

8 Get the list of video-slide timing

Description

Get video timing for each slide (get the information in the "sync" file in json format) for item id_item

Request

GET http://domain.org/sync/{id_item}

Response

{id_slide:
    {"video_start": start_time,
    "video_end": end_time,
    "video_uri": total_number_of_slides,
    "sequence": slide_sequence_number}
}

Example
Request

GET http://domain.org/sync/18

Response

{"1":
    {"video_start": "123",
    "video_end": "123",
    "video_uri": "/scorm_root/13/video.mp4",
    "sequence": 1},
"2":     {"video_start": "123",
    "video_end": "123",
    "video_uri": "/scorm_root/13/video.mp4",
    "sequence": 2},
"3":     {"video_start": "123",
    "video_end": "123",
    "video_uri": "/scorm_root/13/video.mp4",
    "sequence": 3},
}

9 Get lesson (item) outline

Description

Get the outline for item id_item

Request

GET http://domain.org/outline/{id_item}

Response

{id_slide:
    {"sequence": slide_sequence_number,
    "title": slide_title}
}

Example
Request

GET http://domain.org/outline/18

Response

{"21":
    {"sequence": 0,
    "title": "Obbiettivi"},
"22":
    {"sequence": 1,
    "title": "Cos'\u00e8 la programmazione concorrente"},
"23":
    {"sequence": 2,
    "title": "Programmi sequenziali"},
"24":
    {"sequence": 3,
    "title": "Thread"},
"25":
    {"sequence": 4,
    "title": "Thread"}
}

10 Get comments

Description

Get comments from SCORM object, Lecture and Slide

Request

GET http://domain.org/comments/{type}/{id_type}

type
Response

{id_comment:
    {"date": when_wrote_comments,
    "user_name": who_wrote_comments,
    "value": what_about}
}

Example
Request

GET http://domain.org/comments/scorm/1

Response

{"2":
     {"date": "2011-02-14 16:34:42",
     "user_name": "admin",
     "value": "prova"},
"3":
     {"date": "2011-02-14 16:55:43",
     "user_name": "admin",
     "value": "prova"}
}

11 Post comments

Description

Write comments to SCORM Object, Lecture and Slide

Request

POST http://domain.org/comment/{type}/{id_type}

with parameter:

enrichment:value;

type
Please note

To avoid cross-domain problem, it works **only** if the call is in a SCORM Object already in the server. Only for a **test** step, you can perform post comments here.

AJAX call

$(function(){
     $.ajax({
     type: "POST",
     url: "/comment/{type}/{id_type}",
     data: "enrichment=...",
     success: function(msg){
         alert( "Msg: " + msg );
     }
    });
});

Example
Request

POST http://domain.org/comment/scorm/3

AJAX call

$(function(){
     $.ajax({
     type: "POST",
     url: "/comment/scorm/3",
     data: "enrichment='text'",
     success: function(msg){
         alert( "Msg: " + msg );
     }
    });
});