---
# System prepended metadata

title: '```'

---

1. learning activity
    endpoint: `GET api/v1/learning/activities`
    query Param: `start_at, end_at`
    Response:

```
{
  "title":"Learning Activity",
  "start_at":"2024-02-07T00:00:00.000Z",
  "end_at":"2024-02-07T00:00:00.000Z",
  "commentary": {
      "message":"",
      "background_color":"#sdfsd",
      "icon":"url"
  },
  "live_class_attendance": {
    "title":"",
    "icon":"",
    "background_color":"",
    "total_classes":50,
    "total_attended":20,
    "attendance_rate": 80.5,
    "histories": [
      {
        "date": "2024-02-07T00:00:00.000Z",
        "total_offered_live_classes": 5,
        "attended": 3,
        "background_color":"",
        "was_late":true
      },
      {
        "date": "2024-02-06T00:00:000Z",
        "total_offered_live_classes": 1,
        "attended": 1,
        "background_color":"",
        "was_late":true
      },
      {
        "date": "2024-02-05T00:00:000Z",
        "total_offered_live_classes": 2,
        "attended": 2,
        "background_color":"",
        "was_late":true
      }
    ]
  },
  "assignment": {
      "title":"",
      "icon":"",
      "background_color":"",
      "total_assignment": 10,
      "practiced_assignment": 3
  },
  "quiz": {
     "title":"",
      "icon":"",
      "background_color":"",
      "total_quiz_practiced":32
  },
  "quiz_correctness": {
      "title":"",
      "icon":"",
      "background_color":"",
      "total_quiz":50,
      "total_participated":32,
      "correctness_rate": 64.0,
  },
  "class_participation": {
      "title":"",
      "icon":"",
      "background_color":"",
      "total_class":50,
      "total_attended":20,
      "participation_rate":45.5
  
  }
}

```
2. Total learning time
    endpoint: `GET api/v1/learning/times`
    query Param: `with_details, start_at, end_at`
    Response:
    
```
{
  "title":"Learning Time",
  "start_at":"2024-02-07T00:00:00.000Z",
  "end_at":"2024-02-07T00:00:00.000Z",
  "total_learning_duration": 102030,
  "daily_learning": {
      "avg_duration": 300,
      "text": "প্রতিদিনের গড় সময়"
  },
  "total_offered_learning_duration": 500000,
  "histories": [
    {
      "level": "Jan 1-7",
      "total_duration": 400,
      "segments": [
        {
          "type": "live_class",
          "engaged_duration": 10
        },
        {
          "type": "exam",
          "engaged_duration": 10
        }
      ]
    },
    {
      "level": "Jan 1-7",
      "total_duration": 400,
      "segments": [
        {
          "type": "live_class",
          "engaged_duration": 30
        },
        {
          "type": "exam",
          "engaged_duration": 30
        }
      ]
    }
  ],
  "colors": {
      "live_class": "#fcfcfc",
      "exam": "#000fff"
  },
  "details": [
    {
      "title": "",
      "icon": "",
      "type": "live_class",
      "total_duration": 45645,
      "engaged_duration": 3543,
      "progress": 60.50
    },
    {
      "title": "",
      "icon": "",
      "type": "exam",
      "total_duration": 45645,
      "engaged_duration": 3543,
      "progress": 60.12
    }
  ]
}
```

3. Class Attendance API:
Endpoint: GET `api/v1/liveclass/attendance`
Query Params: `start_at, end_at`

```
{
  "title": "লাইভ ক্লাস উপস্থিতি",
  "start_at": "2024-02-07T00:00:00.000Z",
  "end_at": "2024-02-07T00:00:00.000Z",
  "commentery": {
    "message": "",
    "background_color": "#sdfsd",
    "icon": "url"
  },
  "summary": {
    "attendance_rate": 73.12
    "text": "উপস্থিতির হার"
    "data": [
      {
        "type": "total_offered_classes",
        "value": 15,
        "progress": 50.5,
      },
      {
        "type": "total_offered_classes",
        "value": 15,
        "progress": 50.5,
      },
    ]
  },
  "products": [
    {
      "title": "HSC 25 অনলাইন ব্যাচ (ফিজিক্স, কেমিস্ট্রি, ম্যাথ...",
      "catalog_product_id": 3,
      "attendance_rate": 50.12
    },
    {
      "title": "HSC 25 অনলাইন ব্যাচ (ফিজিক্স, কেমিস্ট্রি, ম্যাথ...",
      "catalog_product_id": 3,
      "attendance_rate": 50.12
    }
  ]
}
```

4. Class attendance Overview
endpoint: `GET api/v1/liveclass/attendance-overview`
Query Params: `start_at, end_at`
```
{
  "start_at": "2024-02-01T00:00:00.000Z",
  "end_at": "2024-02-01T00:00:00.000Z",
  "overview": [
    {
      "date": "2024-02-01T00:00:00.000Z",
      "total_offered": 4,
      "total_attended": 4,
      "total_absent": 0,
      "was_late": true,
      "is_sticky": true,
      "color": "#34543"
    }
  ]
}
```

5. Product attendance Detils:
Endpoints: `GET api/v1/liveclass/attendance/details`
Query Params: `start_at, end_at, catalog_product_id`

```
{
  "title": "লাইভ ক্লাস উপস্থিতি",
  "catalog_product_id": 12,
  "start_at": "2024-02-07T00:00:00.000Z",
  "end_at": "2024-02-08T00:00:00.000Z",
  "modules": [
    {
      "name": "পদার্থবিজ্ঞান ১ম পত্র",
      "attendance_rate": 50.5,
      "total_live_class": 15,
      "total_attended": 12,
      "total_late_entry": 0,
      "total_absent": 2
    }
  ]
}

```

6. Live class attendance details by date:
Endpoints: `GET api/v1/liveclass/attendance-overview/${date}`

```
"date":"2024-02-01T00:00:00Z",
live_classes:[
    {
        "product": {
            "id": 12,
            "name": "অনলাইন ব্যাচ ২৫"
        },
        "live_class_name":"অধ্যায় ৫: বুঝে পড়ি লিখতে শিখি",
        "start_at":"2024-02-01T00:00:00Z",
        "end_at":"2024-02-01T00:00:00Z",
        "is_absent": true,
        "was_late": true,
    }

]

```

7. Class activity Detils:
Endpoints: `GET api/v1/liveclass/details`
Query Params: `live_class_id`

```
{
    "class_details":{
  "title": "ক্লাস বিস্তারিত",
  "live_class": {
      "live_class_id":"",
      "name":"",
      "start_at":"",
      "end_at":"",
      "program":{
          "id": 34,
          "name": "অনলাইন ব্যাচ ২৫",
      },
      "rating_status": "done",
  },
  "attendance":{
      "was_present": true,
      "was_late": false,
      "total_live_class_duration" : 12988,
      "total_presence_duration": 9999,
      "total_absence_duration": 3000
      
  },
  "study_logs": [
      {
        "start_timestamp": "2024-02-01T06:30:000Z",
        "end_timestamp": "2024-02-01T06:35:000Z",
        "playhead_start_at": 0,
        "playhead_end_at": 35,
        "duration": 35
      },
      {
        "start_timestamp": "2024-02-01T06:30:000Z",
        "end_timestamp": "2024-02-01T06:35:000Z",
        "playhead_start_at": 75,
        "playhead_end_at": 135,
        "duration": 60
      },
      {
        "start_timestamp": "2024-02-01T06:30:000Z",
        "end_timestamp": "2024-02-01T06:35:000Z",
        "playhead_start_at": 175,
        "playhead_end_at": 205,
        "duration": 30
      },
      {
        "start_timestamp": "2024-02-01T06:30:000Z",
        "end_timestamp": "2024-02-01T06:35:000Z",
        "playhead_start_at": 230,
        "playhead_end_at": 900,
        "duration": 670
      },
  ]
}
}
```

8. Class Interaction API:
Endpoint: GET `api/v1/liveclass/interaction`
Query Params: `live_class_id`

```
{
    "title": "ক্লাস ইন্টারঅ্যাকশন",
    "class_participation_text": "ক্লাস পার্টিসিপেশন রেট",
    "class_participation_rate": 73.12
    "total_offered_quizes": 8,
    "total_correct_answer": 5,
    "totola_wrong_answer": 2,
    "total_unaswered": 1,
    "total_offered_polls": 8,
    "total_responded_polls": 5,
    "total_unresponded_polls": 2,
    "total_doubt_asked": 22,
    "total_doubt_resolved": 17,
    "total_doubt_unresolved": 5
}
```


```
---------------------------------------------------------------------------------
```
RABBIT_MQ:
exchange `tenlytics_topic_exchange`


Live Class => Tenlytics
Offer Live Class Data (On Live Class End)
routing key `liveclass.end`
```
{
  "event_name":"liveclass.end",
  "data":{
      "payload":{
          "live_class_id": "",
          "catalog_product_id": 1,
          "catalog_sku_id": 1,
          "program_id": 1,
          "course_id": 1,
          "platform": "k12",
          "start_at": "",
          "end_at": "",
          "duration": "",
          "avg_watch_time": 12,
          "total_comments": 123,
          "total_doubts": 1,
          "total_doubt_resolved": 1,
          "total_quiz": 2,
          "total_poll": 2,
          "total_participation": 2,
          "is_required": true
      }
  }
  
}

```

Live Class => Tenlytics
Offer Live Class Data (On Live Class End)
routing key `quiz`
```
{
  "event_name":"liveclass.quiz",
  "data":{
      "payload":{
          "identification_type":"",
          "identification_id":"",
          "catalog_product_id":"1",
          "catalog_sku_id":"1",
          "program_id": "1",
          "course_id": "1",
          "platform": "k12",
          "modality":"",
          "quiz_id":"24",
          "total_questions":1,
          "duration":1,
          "total_marks":1,
          "is_required":true,
          "timestamp":""
      }
  }
  
}

```

LiveClass => User Activity Service
Exchange: `stage_liveclass_exchange`
routing key: 'liveclass.end'
payload:
```
{
{
  "event_name":"liveclass.end",
  "data":{
      "payload":{
          "live_class_id": "",
          "platform": "k12",
          "start_at": "",
          "end_at": "",
          "duration": "",
          "is_required": true
      }
  }
  
}

}
```



LiveClass => Offered Exams
Exchange: `tenlytics_topic_exchange`
routing key: `exam.start`
payload:
```
{
  "event_name":"exam.start",
  "data":{
      "payload":{
          "exam_id": "",
          "day": "",
          "catalog_product_id": 1,
          "catalog_sku_id": 1,
          "program_id": 1,
          "course_id": 1,
          "platform": "k12",
          "type": "",
          "start_at": "",
          "end_at": "",
          "duration": 21324,
          "total_questions": 34,
          "total_marks": 32,
          "is_required": true
      }
  }
  
}

```

Exam Session End
Exachange: `stage_tracking_exchange`
Topic `exam.session`
Payload
```
{

 "event_name":"session.end"
 "data":{
     "payload":{
         "exam_id":"",
         "auth_user_id":"",
         "catalog_product_id":"",
         "catalog_sku_id":"",
         "program_id":"",
         "course_id":"",
         "platform":"",
         "type":"",
         "time_taken":3243,
         "total_answers":43,
         "total_correct_answers":45,
         "total_qustions":35,
         "total_score":344,
         "start_at":"",
         "end_at":"",
         "total_unique_questions_submitted":0,
         "total_unique_questions_corrected":0
     }
 }

}
```

On Quiz Response
Exachange: `stage_tracking_topic_exchange`
Topic `quiz.response`
payload
```
{

 "event_name":"quiz_response"
 "data":{
     "payload":{
         "auth_user_id":"",
         "catalog_product_id":"",
         "catalog_sku_id":"",
         "program_id":"",
         "course_id":"",
         "platform":"",
        "identification_id":"${live_class_id}",
        "identification_type":"live_class",
        "modality":"",
        "quiz_id":"",
        "is_correct":bool,
        "particiapte_at": 233433,
        "quiz_option_id": 120,
        "time_taken":1232
     }
 }

}

```

On User Leave From Live CLass

Exachange: `stage_tracking_topic_exchange`
Topic `live_class_user.activity`
payload
```
{

 "event_name":"live_class_user_leave"
 "data":{
     "payload":{
         "auth_user_id":"",
         "catalog_product_id":"",
         "catalog_sku_id":"",
         "program_id":"",
         "course_id":"",
         "platform":"",
        "identification_id":"",
        "identification_type":"",
        "media_type":"",
        "media_id":"",
        "playhead_start_at":132132,
        "playhead_end_at":32423,
        "duration":423
        
     }
 }

}

api/v1/liveclass/
```
