====== Differences ====== This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
api2:data:event [2017/10/13 17:50] maries |
api2:data:event [2018/07/31 16:50] (current) maries |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ===Object resources=== | ===Object resources=== | ||
| ^ Property ^ Type ^ Description ^ | ^ Property ^ Type ^ Description ^ | ||
| - | | type | Text | The type of this Event object. “EventResult”, “EventRead” or “EventReview”| | + | | id | Integer | identifier for the database of Domoscio's API | |
| + | | event_type | Text | The type of this Event object. “EventResult”, “EventRead” or “EventReview”| | ||
| | student_id | Integer | Student identifier | | | student_id | Integer | Student identifier | | ||
| | content_id | Integer | The content identifier | | | content_id | Integer | The content identifier | | ||
| - | | content_uid | String | The content identifier for your database | | + | | return_recommendation | Boolean | If true, the system computes and sends backs recommendations, otherwise computes and does not send | |
| - | | return | Boolean | If true, the system computes and sends backs recommendations, otherwise computes and does not send | | + | |
| | generated_at | DateTime | Time at which the event has been done | | | generated_at | DateTime | Time at which the event has been done | | ||
| |payload | Text | The payload of this event indicates the sucess or fail of the student for this event | | |payload | Text | The payload of this event indicates the sucess or fail of the student for this event | | ||
| | standard | String | standard used to declare the payload | | | standard | String | standard used to declare the payload | | ||
| + | | created_at | DateTime | Date of creation of the object | | ||
| + | | updated_at | DateTime | Last time the object has been modified | | ||
| ==Note concerning the payload== | ==Note concerning the payload== | ||
| Line 22: | Line 24: | ||
| - the second is the xAPI norm. In that case, the standard is "xAPI", and the payload has the following form: | - the second is the xAPI norm. In that case, the standard is "xAPI", and the payload has the following form: | ||
| <code> | <code> | ||
| - | IL FAUT ECRIRE QQC ICI | + | { |
| + | "actor"=>{"objectType"=>"Agent", "name"=>"Evan Friburg", "mbox"=>"mailto:test@mail.com", "account"=>{"name"=>"32", "homePage"=>"https://stats-engine.domoscio.com/v2/instances/1/students/32"}}, | ||
| + | "verb"=>{"id"=>"http://adlnet.gov/expapi/verbs/scored"}, | ||
| + | "object"=>{"id"=>"cell_tests/28", "definition"=>{"name"=>{"en-US"=>"test 1"}, "description"=>{"en-US"=>"<p>Que représente pour vous ce mnemos ? pessimisme</p>\r\n<p><img src=\"https://pure-mesa-4658.s3.amazonaws.com/uploads/ckeditor/pictures/31/content_cote_obscur.png\" alt=\"\" width=\"469\" height=\"552\" /></p>"}, "type"=>"http://adlnet.gov/expapi/activities/question"}}, | ||
| + | "result"=>{"score"=>{"scaled"=>0}}, | ||
| + | "timestamp"=>"2017-10-05T16:28:26+00:00", | ||
| + | "id"=>"2aa13d13-671e-408a-a0f7-d85ebfcc9835", | ||
| + | "version"=>"1.0.1" | ||
| + | } | ||
| </code> | </code> | ||
| + | |||
| + | ==Note concerning the event_type== | ||
| + | |||
| + | An EventResult is created when the learner answers a question in a learning objective, as opposed to an EventReview, where the learner answers a question in a reviewing objective. An EventRead is created when the learner interacted with a "Learning"-tagged content in order to learn a new concept. | ||
| + | If you are in any of these cases, you can use an EventBlank. | ||
| ===Create (POST)=== | ===Create (POST)=== | ||
| ^ Method | POST | | ^ Method | POST | | ||
| - | ^ URL | /knowledge_graphs | | + | ^ URL | /events | |
| ==Parameters (*Requiered parameters)== | ==Parameters (*Requiered parameters)== | ||
| ^ Property ^ Type ^ Description ^ | ^ Property ^ Type ^ Description ^ | ||
| - | | name | String | Custom data | | + | | event_type* | Text | The type of this Event object. “EventResult”, “EventRead” or “EventReview”| |
| + | | student_id or student_uid * | Integer | Student identifier | | ||
| + | | content_id or content_uid * | Integer | The content identifier | | ||
| + | | return_recommendation | Boolean | If true, the system computes and sends backs recommendations, otherwise computes and does not send | | ||
| + | | generated_at | DateTime | Time at which the event has been done. If empty, it is replaced by the Time of creation | | ||
| + | | payload* | Text | The payload of this event indicates the sucess or fail of the student for this event | | ||
| + | | standard* | String | standard used to declare the payload | | ||
| ==Send the request (JSON input example)== | ==Send the request (JSON input example)== | ||
| + | <code> | ||
| + | { | ||
| + | "student_id": 379, | ||
| + | "content_id": 2749, | ||
| + | "payload": 100, | ||
| + | "standard": "score", | ||
| + | "return_recommendation": "false", | ||
| + | "event_type": "EventResult", | ||
| + | "generated_at": "2017-11-27T11:17:57+00:00" | ||
| + | } | ||
| + | </code> | ||
| ==Get the response (JSON output example)== | ==Get the response (JSON output example)== | ||
| + | |||
| + | <code> | ||
| + | { | ||
| + | "id": 559, | ||
| + | "event_type": "EventResult", | ||
| + | "payload": 100, | ||
| + | "created_at": "2017-11-27T13:34:18.977Z", | ||
| + | "updated_at": "2017-11-27T13:34:18.977Z", | ||
| + | "student_id": 379, | ||
| + | "content_id": 2749, | ||
| + | "content_uid": "question1", | ||
| + | "generated_at": "2017-11-27T11:17:57.000Z", | ||
| + | "return": true, | ||
| + | "standard": "score" | ||
| + | } | ||
| + | </code> | ||
| + | |||
| ===Fetch (GET)=== | ===Fetch (GET)=== | ||
| ^ Method | GET| | ^ Method | GET| | ||
| - | ^ URL | /knowledge_graphs | | + | ^ URL | /events | |
| + | |||
| + | If no event_id is provided it will fetch all the Events for your instance. You can choose to add the parameters student_id, content_id, knowledge_node_id, event_type, date_start (all the events after that date), date_end (all the event before that date), or event_type. | ||
| ==Get the response (JSON output example)== | ==Get the response (JSON output example)== | ||
| Line 50: | Line 101: | ||
| <code> | <code> | ||
| + | { | ||
| + | "id": 560, | ||
| + | "event_type": "EventResult", | ||
| + | "payload": 100, | ||
| + | "created_at": "2017-11-27T13:36:39.601Z", | ||
| + | "updated_at": "2017-11-27T13:36:39.689Z", | ||
| + | "student_id": 379, | ||
| + | "content_id": 2749, | ||
| + | "content_uid": "question1", | ||
| + | "generated_at": "2017-11-27T11:17:57.000Z", | ||
| + | "return": true, | ||
| + | "standard": "score" | ||
| + | } | ||
| </code> | </code> | ||
| Line 56: | Line 119: | ||
| **Without ID provided**\\ | **Without ID provided**\\ | ||
| <code> | <code> | ||
| + | [ | ||
| + | { | ||
| + | "id": 447, | ||
| + | "event_type": "EventReview", | ||
| + | "payload": 100, | ||
| + | "created_at": "2017-09-20T14:35:45.143Z", | ||
| + | "updated_at": "2017-09-20T14:35:45.149Z", | ||
| + | "student_id": 267, | ||
| + | "content_id": 710, | ||
| + | "content_uid": null, | ||
| + | "generated_at": "2017-09-20T14:35:45.143Z", | ||
| + | "return": null, | ||
| + | "standard": null | ||
| + | }, | ||
| + | { | ||
| + | "id": 448, | ||
| + | "event_type": "EventReview", | ||
| + | "payload": 0, | ||
| + | "created_at": "2017-09-20T14:35:45.181Z", | ||
| + | "updated_at": "2017-09-20T14:35:45.189Z", | ||
| + | "student_id": 267, | ||
| + | "content_id": 709, | ||
| + | "content_uid": null, | ||
| + | "generated_at": "2017-09-20T14:35:45.181Z", | ||
| + | "return": null, | ||
| + | "standard": null | ||
| + | } | ||
| + | ] | ||
| </code> | </code> | ||
| + | ===Fetch Events by Student (GET)=== | ||
| - | ===EDIT (PUT)=== | + | Instead of using event_id to retrieve related data, you can fetch all Events for a given Student. |
| - | ^ Method | PUT | | + | ^ Method | GET | |
| - | ^ URL | /knowledge_graphs/{knowledge_graph_id} | | + | ^ URL | students/{student_id}/events | |
| - | ==Editable parameters== | ||
| - | |||
| - | ^ Property ^ Type ^ Description/expected values | | ||
| - | | | | | | ||
| - | |||
| - | ==Send the request (JSON input example)== | ||
| - | |||
| - | <code> | ||
| - | { | ||
| - | name : « No more Corporate Finance » | ||
| - | } | ||
| - | </code> | ||
| - | |||
| - | ==Get the response (JSON output example)== | ||
| - | |||
| - | <code> | ||
| - | { | ||
| - | id: 1, | ||
| - | name: « No more Corporate Finance », | ||
| - | instance_id: 1 | ||
| - | } | ||
| - | </code> | ||