SUNBIRD LERN BOOTCAMP, March 2023 #84
Jayaprakash8887
started this conversation in
Contribution
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context:
This document helps in understanding the local setup, for one of the key microservice of the Sunbird Lern Building Block. This will enable the participants of the bootcamp to choose and work on the problem statements given below.
It has the details about setting up the batch-service from the scratch on your local machine.
Prerequisite
Java 11
Maven – Latest
Docker – Latest
Cassandra 3.11.6
ES 6.8.11
IntelliJ Editor
Postman
GIT
Validate Prerequisites
Prepare your machine
Create a folder structure to organize the data
Setup Cassandra
Seed data to Cassandra
Setup Elasticsearch
Setup Redis
Batch Service Setup
Please fork the repository to use and make modifications. Below are the steps to fork and clone the repository.
🗒️ Note: Please uncheck the “Copy the main branch only”. This will copy all the branches to the fork.
Problem Statements:
Use case 1: LR-374 Compute the number of days to start the batch
Each batch has the metadata to explain the start date, end date, enrollment end date. Please introduce a new property in the batch read API to explain how many days are left for the users to consume the course.
Compute the duration in days.
The new property name should be “daysToGo”
The value should be a string.
If the start date is a future date, “x days to go”.
If the start date is today, “the batch started today”.
If the start date is old, “started x days ago”.
Use case 2: LR-375 Limit enrolments for the batch
There is no limitation on the number of enrolments in a batch. Enhance the enrolment feature to control the number of enrolments.
Define the limit for the batch
Option 1: Create a default configuration to control the number of enrolments for the batches.
Option 2: Create a new attribute (update the batch table) and accept the limit for each batch as part of create or update API.
Compute the number of enrolments and control.
Each successful enrolment should update the predefined counter.
Use the predefined counter and the configuration from the first step to limit the enrolments.
Enrolment API response.
When the enrolment limit exceeds, the API should return HTTP 406 Not Acceptable as response with proper error details.
Use case 3: LR-376 Control enrolment for a specific type of users
For a batch, any user of the sunbird instance can enrol and consume the course. Please enhance the enrolment capability to allow users with specific role or tagging.
The course has “audience” attribute to understand the targeted users. Please consider using the value of the audience (teacher) and map it with the user's metadata (userType) to allow the enrolment.
Accept the enrolment if the audience (from the course) and userType from the enrolling user metadata matches.
Use the auth token to extract the user identifier.
Make the user read API call to fetch the metadata of the user.
If the enrolment is for an invalid user, the API should return an error code with a message.
Beta Was this translation helpful? Give feedback.
All reactions