====== 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/16 10:33] 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 ^ | ||
+ | | id | Integer | identifier for the database of Domoscio's API | | ||
| event_type | Text | The type of this Event object. “EventResult”, “EventRead” or “EventReview”| | | 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 36: | Line 38: | ||
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. | 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)=== | ||
Line 48: | Line 51: | ||
| student_id or student_uid * | Integer | Student identifier | | | student_id or student_uid * | Integer | Student identifier | | ||
| content_id or content_uid * | Integer | The content identifier | | | content_id or content_uid * | Integer | The content identifier | | ||
- | | return | Boolean | If true, the system computes and sends backs recommendations, otherwise computes and does not send | | + | | 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 | | + | | 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 | | | 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 | | ||
Line 56: | Line 59: | ||
<code> | <code> | ||
- | { | + | { |
- | content_uid: "15", | + | "student_id": 379, |
- | student_uid: "17", | + | "content_id": 2749, |
- | type: “EventResult”, | + | "payload": 100, |
- | payload: “100”, | + | "standard": "score", |
- | standard: "score", | + | "return_recommendation": "false", |
- | return: false | + | "event_type": "EventResult", |
+ | "generated_at": "2017-11-27T11:17:57+00:00" | ||
} | } | ||
</code> | </code> | ||
Line 70: | Line 74: | ||
<code> | <code> | ||
{ | { | ||
- | content_ id: 35, | + | "id": 559, |
- | student_id: 19, | + | "event_type": "EventResult", |
- | type: “EventResult”, | + | "payload": 100, |
- | payload: “100”, | + | "created_at": "2017-11-27T13:34:18.977Z", |
- | standard: "score", | + | "updated_at": "2017-11-27T13:34:18.977Z", |
- | generated_at: "2017-03-01T10:06:24.371Z", | + | "student_id": 379, |
- | return: false | + | "content_id": 2749, |
+ | "content_uid": "question1", | ||
+ | "generated_at": "2017-11-27T11:17:57.000Z", | ||
+ | "return": true, | ||
+ | "standard": "score" | ||
} | } | ||
</code> | </code> | ||
Line 86: | Line 94: | ||
^ URL | /events | | ^ URL | /events | | ||
- | If no event_id is provided it will fetch all the Events for your instance. | + | 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 94: | Line 102: | ||
<code> | <code> | ||
{ | { | ||
- | content_ id: 35, | + | "id": 560, |
- | student_id: 19, | + | "event_type": "EventResult", |
- | type: “EventResult”, | + | "payload": 100, |
- | payload: “100”, | + | "created_at": "2017-11-27T13:36:39.601Z", |
- | standard: "score", | + | "updated_at": "2017-11-27T13:36:39.689Z", |
- | generated_at: "2017-03-01T10:06:24.371Z", | + | "student_id": 379, |
- | return: false | + | "content_id": 2749, |
+ | "content_uid": "question1", | ||
+ | "generated_at": "2017-11-27T11:17:57.000Z", | ||
+ | "return": true, | ||
+ | "standard": "score" | ||
} | } | ||
</code> | </code> | ||
Line 107: | Line 119: | ||
**Without ID provided**\\ | **Without ID provided**\\ | ||
<code> | <code> | ||
- | [{ | + | [ |
- | content_ id: 35, | + | { |
- | student_id: 19, | + | "id": 447, |
- | type: “EventResult”, | + | "event_type": "EventReview", |
- | payload: “100”, | + | "payload": 100, |
- | standard: "score", | + | "created_at": "2017-09-20T14:35:45.143Z", |
- | generated_at: "2017-03-01T10:06:24.371Z", | + | "updated_at": "2017-09-20T14:35:45.149Z", |
- | return: false | + | "student_id": 267, |
- | }, | + | "content_id": 710, |
- | { | + | "content_uid": null, |
- | content_ id: 35, | + | "generated_at": "2017-09-20T14:35:45.143Z", |
- | student_id: 20, | + | "return": null, |
- | type: “EventReview”, | + | "standard": null |
- | payload: “0”, | + | }, |
- | standard: "score", | + | { |
- | generated_at: "2017-03-01T10:09:17.371Z", | + | "id": 448, |
- | return: null | + | "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> | ||