Design document: Activity dashboard

This document will help us to implement the activity dash board for groups

 

Background

As per ticket https://project-sunbird.atlassian.net/browse/SB-24224 we need to show the activity dashboard to the admin of the group

Problem statement

How to use dashlets library for showing group specific activity report.

Solution


Aggregation API

https://project-sunbird.atlassian.net/wiki/spaces/SBDES/pages/2437251154

End point

POST: data/v1/group/activity/agg

Request body

{ "request": { "groupId": "b85d488d-637a-484d-9c2c-405d565dca55", "activityId": "do_2129767578773995521545", "activityType": "Course" } }

Response

{ "id": "api.group.activity.agg", "ver": "v1", "ts": "2021-05-17 04:08:40:926+0000", "params": { "resmsgid": null, "msgid": "a6a78ec6-7005-4089-b125-c32088ca4382", "err": null, "status": "success", "errmsg": null }, "responseCode": "OK", "result": { "activity": { "id": "do_2129767578773995521545", "type": "Course", "agg": [ { "metric": "enrolmentCount", "lastUpdatedOn": 1620813324281, "value": 2 } ] }, "groupId": "b85d488d-637a-484d-9c2c-405d565dca55", "members": [ { "agg": [ { "metric": "completedCount", "value": 2, "lastUpdatedOn": 1620813324281 }, { "metric": "score:do_2129493337594429441162", "value": 1, "lastUpdatedOn": 1620642987500 } ], "name": "Balakrishna M", "role": "member", "status": "active", "createdBy": "9d079666-ac84-41e7-bed1-343744548f90", "userId": "56bdaa45-0b81-4d46-81b3-a820b150ff63" }, { "agg": [ { "metric": "completedCount", "value": 2, "lastUpdatedOn": 1620813324224 }, { "metric": "score:do_2129493337594429441162", "value": 2, "lastUpdatedOn": 1620641871592 } ], "name": "Balakrishna M", "role": "admin", "status": "active", "createdBy": "9d079666-ac84-41e7-bed1-343744548f90", "userId": "9d079666-ac84-41e7-bed1-343744548f90" } ] } }

Hierarchy API

End point

Response

  1. Get page Config from form API

  2. Get the assessment score from data aggregation API

  3. Get course/assessment details using hierarchy API

  4. Expose a method in CSL which uses the hierarchy response and replace the do_id of assessment with name

     

  5. use the dash lets library to populate the table as per the documentation https://project-sunbird.atlassian.net/wiki/spaces/SBDES/pages/2312110137/Dashlets+Design+Doc?focusedCommentId=2394980376#comment-2394980376

Name

Progress

Assessment1

Assessment2

Name

Progress

Assessment1

Assessment2

Bala

60

9

NA

Vinu

97

5

6

Solution 2

Create a NPM package which can be used any where