Events
Socratease gives you a variety of webhooks you can listen to, to notify your application that an event has occurred.
Currently, Socratease supports webhooks for events on assessments andunits. The events are mentioned below.
Unit Events
Emitted when a unit is created. The payload below gives you the details of the unit created.
{
"data": {
"int_id": 10,
"unit_id": "abc-def-ghi",
"title": "Python Quiz",
"type": "quiz", //can be 'quiz', 'lesson', 'question_bank', etc
"meta_data": {
"thumbnail": "https://cdn.socratease.co/abc.png"
},
"access_level": "logged_in", //must be logged in to attempt it
"settings": {
"randomize_options": true,
"disable_copy_paste": false
},
...
},
"event_type": "unit.created"
}Emitted when a unit is deleted. The payload below gives you the unit_id of the unit which has been deleted.
{
"data": {
"unit_id": "abc-def-ghi",
...
},
"event_type": "unit.deleted"
}Emitted when a user starts attempting a unit. The payload below gives you the details of the when the unit was started, and the user's details
{
"data": {
"unit_id": "abc-def-ghi",
"started_at": "2023-02-14T06:22:58+00:00",
"user": {
"email": "[email protected]",
"user_id": "aXsweqW",
"username": "[email protected]",
}
...
},
"event_type": "unit.started"
}Emitted when a user submits a unit. The payload below gives you the details of the assessment submission, and the user's details
{
"data": {
"unit_id": "abc-def-ghi",
"started_at": "2023-02-14T06:12:58+00:00",
"finished_at": "2023-02-14T06:14:35+00:00",
"points_aggregate": 70,
"percentage_decimal": 0.7,
"total_points": 100,
"grade_finalized": true,
"attempt_num": 1,
"unit_type": "quiz",
"user": {
"user_id": "aXsweqW",
"username": "[email protected]",
"email": "[email protected]",
}
...
},
"event_type": "unit.submitted"
}Assessment Events
Emitted when an assessment is created. The payload below gives you all the details of the assessment which is created and the units present within the assessment.
{
"data": {
"access_level": public,
"assessment_id": "kpu-nsg-hoi",
"event_type": "assessment.created"
"max_attempts": 1,
"meta_data": {"thumbnail_url": "https://image.com"},
"settings": {
"auto_submit":false,
},
"status": active
"title": "Your Assessment Title"
"units": [
{
"title":"Test 1",
"unit_id":"ntg-wtk-pfk",
"type":"quiz",
"meta_data":{
"thumbnail_url":"https://image2.com",
},
"weightage":10000
}
]
...
},
"event_type": "assessment.created"
}Emitted when an assessment is deleted. The payload below gives you assessment_id of the assessment which has been deleted.
{
"data": {
"assessment_id": "kpu-nsg-hoi",
...
},
"event_type": "assessment.deleted"
}Emitted when a user starts attempting an assessment. The payload below gives you the details of the when the assessment was started, and the user's details
{
"data": {
"assessment_id": "kpu-nsg-hoi",
"started_at": "2023-02-14T06:22:58+00:00",
"user": {
"email": "[email protected]",
"user_id": "aXsweqW",
"username": "[email protected]",
}
...
},
"event_type": "assessment.started"
}Emitted when a user submits an assessment. The payload below gives you the details of the assessment submission, and the user's details
{
"data": {
"assessment_id": "kpu-nsg-hoi",
"started_at": "2023-02-14T06:12:58+00:00",
"finished_at": "2023-02-14T06:14:35+00:00",
"overall_score": 7000,
"grade_finalized": true,
"attempt_num": 1,
"unit_results": [
{
"unit_id": "aGh-wWq-nJW",
"points_aggregate": 70",
"total_points": 100,
"percentage_decimal": 0.7
...
}
]
"user": {
"user_id": "aXsweqW",
"username": "[email protected]",
"email": "[email protected]",
}
...
},
"event_type": "assessment.submitted"
}