...
As badge association is course based property and course object is stored inside Learning Platform. We can update the badge details in course object on every associate/dissociate request. The structure of badgeAssociatedInfo is as follows:-
content | |
---|---|
badgeAssociatedInfo | List<Map<text, text>> |
name | data type | Description | |
---|---|---|---|
1 | issuerId | String | Issues the badge |
2 | badgeId | String | Id of the badge |
3 | associationId | String | Uniquely identifies the association |
4 | badgeClassImage | String | badge image url |
5 | badgeClassName | String | name of the badge class |
6 | associatedTS | String | Timestamp at which badge is associated to the course |
7 | status | boolean | True → Batch created corresponding to the course will be imparted this badge. False → This badge is no longer associated with course. There will be at most one status flag of the map inside the badgeAssociatedinfo will be set true for particular course. |
For Association Request :- Iterate over all the badgeAssociatedInfo list from course object and check for status flag as true(if present). Will reset that particular flag to false, adding the new requested badge with status flag as true in course object and update it.
...
We can add badgeId in course_batch table.
name | dataType | description |
---|---|---|
badgeId | String | uniquely identifies the badge. |
Pros | Cons |
---|---|
Isolation of the course related info will be maintained with the |
LP. | We need to iterate over the list for every association/disassociation/batch-creation request. |
Proposed Solution 2:
We can store the badge association information in new table course_badge_association. The structure of the table will be :-
name | dataType | description |
---|---|---|
courseId | String | uniquely identifies the courseId |
badgeIId | String | uniquely identifies the badgeId |
issuerId | String | uniquely identifies the issuerId |
badgeClassImage | String | image url of the badge |
badgeClassName | String | name of the badge |
associatedTS | Timestamp | Timestamp at which the badge is associated with the courseId |
status | boolean | states badge is currently associated to the course or not. Needs to be indexed. |
updatedTS | TimeStamp | Timestamp at which badge association is updated. |
composite primary key :- (courseId, badgeId)
...
On batch creation:- Get the active badge from course_badge_association table based on (courseId, badgeId, status=true) and impart the corresponding badge information to course_batch table. We can store the badge information in course_batch similar way as we have in proposed solution 1.
Pros | Cons |
---|---|
We can directly access the current active badge associated with the course without any iteration. | Sunbird platform will have the course related information. Hence the isolation of course related info will be compromised. |