Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

To organize the any order of tractable collection w.r.t user’s last access date and time on the user enrollment list . We have two solution approach.

Referenced ticket: https://project-sunbird.atlassian.net/browse/SB-26283

Pre-requisites:

  1. User is a logged in user and has enrolled into atleast one trackable collection

Solutions:

  1. Adding new metadata to User’s enrollment

  2. Re-using last access time from User content consumption

Adding new metadata to User’s enrollment :

Adding a metadata to User’s enrollment component as last access timestamp. This metadata needs to updated while updating last accessed content id for a user. Also for the old records for this metadata requires a migration.

Steps to follow

  1. Add new column to user_enrolments table

ALTER TABLE sunbird_courses.user_enrolments  ADD last_content_access_time timestamp

2. Update the metadata by user enroll Api for last read content id

3. Migration on old user_enrolments records data migration for new column needed using user_content_comsumption table

4. Order the records for list enrolment api to get the expected response

Re-using last access time from User content consumption:

While fetch list of user enrollments join user content consumption by the last access content id to get the last access timestamp filter by the user id, course id, batch id and last access content id and formulate the response accordingly. This approach would not require the migration steps

Steps to follow:

  1. List enrolment Api for a given user id , make a new DB call for user_content_comsumption based on user id, batch id, course id and last content id lastreadcontentid from each records of user_enrolments

  2. Merge the response with user_content_comsumption.last_access_time. Order the records


  • No labels