Overview:
Sunbird batch unenroll API is built to facilitate user to unenroll from an active open batch As of now open batch is allowing user to do the enrollment , but there is no option for un-enrollment.
Problem Statement:
How to empower Allow user to unenroll from an active open batch by their owndo the un-enrollment from open batch , if batch is not closed or user haven't completed it.
Proposed Solution 1 :
We need to construct Provide a new API for the same. This API needs the user to provide valid userid, batchid and courseid to un-enroll them. In this proposed solution, we will add a new column namely 'isunenrollmentallowed' (boolean) in the table sunbird.course_batch to indicate if unenrollment from a given batch is allowed or not.
...
- Name and value of the column is self-explanatory and readable.
- Can use the value in a code directly. No need for extra processing.
...
- As the batch related permissions become more granular in future, we must need to add new columns.
Proposed Solution 2:
In this proposed solution, we can add a new column called 'permissions' (bitmap) for different permissions applicable on the batch for any course. Based on that permission, we can decide to unenroll the particular user from that batch.
...
- The permissions field can be used to incorporate any other new permission added in the future.
...
- Need extra efforts to process the value retrieved from database. We need to iterate through each bit.
Batch Unenroll API:
Method: POST
URL: /v1/user/courses/unenroll
Headers: Authorization, X-Authenticated-User-Token
Request Body:
Code Block |
---|
{ "params": { },
"request": {
“userid” : “string”,
“batchid” : “string”,
“courseid”: ”string”
}
} |
...
api for un-enrollment of open batch. This api call will be allowed for open batch only. Api request structure will be as follow.
Url : /api/course/v1/unenroll
{
"request": {
"userId": "string",
"batchId": "string",
"courseId": "string"
}
}
Solution 2 :Once user will un-enroll his/her data will be mark as deleted and won't be visible.
Sunbird will provide a new api for un-enrollment for course batch. It will support un-enrollment for open batch and invite only batch both. Participant removal will be decided based on
batch type.
Request structure will be as follow.
Url : /api/course/v1/unenroll
{
"request": {
"userIds": ["user1", "user2"],
"batchId": "batch identifier",
"courseId": "course identifier"
}
}
Accepted solution:
solution 1 is accepted and dev team is going to implement it.
Task Ref : Jira Legacy server System JIRA serverId 2207a759-5bc8-39c5-9cd2-aa9ccc1f65dd key SB-7024
Jira Legacy server System JIRA serverId 2207a759-5bc8-39c5-9cd2-aa9ccc1f65dd key SB-2204