Ability to provide review comments to a content at the page level

Background:

Currently, Sunbird supports adding review comments by a content reviewer while rejecting a content. Comments can only be given at the content level.

Problem statement:

Ability to provide review comments to a content at the page level.

Proposed Solution:

To provide the ability to give review comment at page level we need to provide a new set of API to do CRUD operation. We need store and organize this comments in DB. Portal and Content framework should provide UI.



Backend changes:

Create two module using the Ext framework.

  1. Thread module
  2. Content review module

DataBase: 

Cassandra: We can use Cassandra to store and retrieve data as the read/write is relatively manageable. As this operation are not search heavy.

Pros: 

  1. Write faster
  2. We have Cassandra set up in the content/portal. 

Table structure: 

         1. Content review module

NameDefinitionExample
threadIdunique identifier - string(Primary Key)hash(contentId + version + context)
contentIdcontent identifier - stringdo_23hd453
versioncontent version - string5
contextdata to store extra details - object {"type": "ecml", "stageId": "1"}
userIdsunbird user id - stringejdugjjd649nvhf
userNamesunbird firstname + lastnameSourav Dey
userImagesunbird profile imagehttps://dev.open-sunbird.org/assets/images/sunbird_logo.png


         2. Thread module

NameDefinitionExample
commentIdunique Identifier - string (Primary Key)uuid
threadIdidentifierhash(contentId + version + context)
messageposted comments - stringThis is test
createdOncomments date - current timestamp2018-10-03 13:33:35:868+0000


Rest API's to be exposed:

NameDescriptionType
createThreadAPI to create a threadPOST

extractThreadList

API to get thread listPOST


Request body for creating a thread :

{
"request": {
"contextDetails": {
"contentId": "do_123",
"version": "2",

"contentType": "ecml",

"stageId":"1"
},
"message": "This is test",
"userId": "734re537281hdbkifm9",

"userName": "Ram",

"userAvatar": "http://www.free-icons-download.net/images/male-user-logo-icon-65890.png"

}
}


Request body for extracting a thread :

{
"request": {
"contextDetails": {
"contentId": "do_123",
"contentVer": "2",

"contentType": "ecml",

"stageId":"1"

}
}
}

If stageId is passed, then comments related to that stageId will be passed. If stageId is not present, all comments related that content will be returned.

Communication: 

We need to communicate between portal and content player to get current stageId.

  1. EkstepRendererAPI.getCurrentStageId(): We can use EkstepRendererAPI.getCurrentStageId() method to get current stage ID.

UI changes:

UI changes are required in both portal and content editor.

UI changes in Portal: 



UI changes in the content editor:


Limitation: 

Reviewer name and logo will be displayed same as when the reviewer commented. If the reviewer updates the name or logo it will not reflect in the old comments.