...
Get the assessment score from data aggregation API
Get course/assessment details using hierarchy API
Expose a method in CSL which uses the hierarchy response and replace the do_id of assessment with name
Code Block getFlatJson(aggregationData){ return [ { Name: Bala, Progress: 60, do_2129493337594429441162: 9 } { Name: Vinu, Progress: 97, do_2129493337594429441162: 9, } ] }
Code Block getDataForDashlets(hierarchyData, aggregationData): dashletData{ } // from aggreagate data replace the do_id with the name from hierarchy data hierarchyData: course details from hierarchy response aggregationData: agregation API response Return type Example: dashletData: { columnConfig : [ { title: "Name", data: "Name", searchable: true, orderable: true, autoWidth: true, visible: true }, { title: "ScoreProgress", data: "Progress", searchable: true, orderable: true, autoWidth: true, visible: true "Score}, { title: "Assessment1", searchabledata: true"Assessment1", orderable: true, autoWidth: true, visible: true }, { title: "Assessment1Assessment2", data: "Assessment1Assessment2", orderable: true, autoWidth: true, visible: true }, ] tableData: [ [ { "Name": "Bala", "ScoreProgress": 8860, "Assessment1": 129, // user has not taken Assessment2. data table will show it as NA }, { "Name": "BalakrishnaVinu", "ScoreProgress": 97, "Assessment1": 5, "Assessment2": 556 } ] }
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
Code Block <sb-dashlet [type]="string" [config]="config" [data]="data | IDataLocation" , [id]="string | uuid" [height]="string" [width]="string" (...anyOtherEvent)="eventListener($event)"> </sb-dashlet>
Name | Progress | Assessment1 | Assessment2 |
---|---|---|---|
Bala | 60 | 9 | NA |
Vinu | 97 | 5 | 6 |