Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document covers the design and modifications needed to support events related use cases in Sunbird.

...

Code Block
 "schedule", 
      "type": //[recurring, non-recurring], 
      "value" :
  //recurring template -> 
      {
        repeatEvery:<N>, repeatEveryType:<days|weeks|months|years>, 
        //if weeks selected:
        repeatOnDays:[<day of week1>,..], //e.g. every Monday and Friday
        //if month selected:
        repeatOnWeek:<N>, repeatOnWeekday:<day of the week>, //e.g. Every Second Thursday of the month
        startTime: <startTime>,
        endTime: <endTime>
        //child events would be named with the <event set name>-<sequence>
      }
  //non-recurring template
      [{date:<date>,startTime:<startTime>,endTime:<endTime>,name:<name>,description:<description>}]

Note currently only non-recurring is supported.

...

  • Create Event (kp=>/event/v4/create) - Creates an event in Graph with status Live. The event can thereafter be enrolled.

  • Update Event (kp=>/event/v4/update/:identifier) - Updates an event in Graph.

  • Read Event (kp=>/event/v4/read/:identifier) - Reads an event from Graph.

  • Discard Event (cs=>/v1/event/discard/:identifier) - Checks if the event has enrollments, if not, deletes the event in Graph by using private KP API.

  • Retire Event (kp=>/event/v4/retire/:identifier) - Marks the status as Retired.

  • Search Events (kp=>/v3/search) - Search for event or event set in Graph.

  • Enroll Event (cs=>/v1/event/enroll) - Allows a user to enroll to an event. Maintains information in sunbird_courses.user_enrolments.

  • Unenroll Event (cs=>/v1/event/unenroll) - Allows a user to unenroll an event. Marks active=false in sunbird_courses.user_enrolments.

  • Get User Enrolled Events (cs=> /v1/user/event/list/:uid) - Gets enrolled events for a user from sunbird_courses.user_enrolments.

  • Get Participants for Event (cs=> /v1/event/participants/list) - Gets registered participant list for an event. Gets userids from sunbird_courses.user_enrolments based on batchId (see below note on batchId for events.)

  • Update user event status (cs=> /v1/user/event/state/update) - Updates user progress for an event into sunbird_courses.user_content_consumption.

  • Read user event status (cs=>/v1/user/event/state/read) - Gets user progress for an event from sunbird_courses.user_content_consumption.

  • Link Content to Event (work in progress)

  • Get Event Attendees (work in progress)

EVENT SET

  • Create Event Set (kp=> /eventset/v4/create) - Creates Event Set as well as child Event objects in Graph and links them.

  • Update Event Set (cs=> /v1/eventset/update) - Checks if the child events has any enrollments, if not, updates the event set in Graph by using private KP API. This deletes the older child events and recreates new ones. It is currently assumed that all the child events have metadata same as parent. If in future, if child events are vastly dissimilar to each other, then we can fix this by doing a detailed comparison for each child and no longer delete and recreate everything.

  • Get Event Set Hierarchy (kp=>/eventset/v4/hierarchy/:identifier) - Fetches the child Events of Event Set from graph.

  • Read Event Set (kp=>/eventset/v4/read/:identifier) - Gets Event Set details from the graph.

  • Discard Event Set (cs=>/v1/eventset/discard/:identifier) - Checks if the child events has enrollments, if not, deletes the event set & child events in Graph by using private KP API.

  • Retire Event Set (kp=>/eventset/v4/retire/:identifier) - Marks the status of event set and child events as Retired.

  • Enroll Event Set (cs=>/v1/eventset/enroll) - Enrolls user to all the child events under the event set.

  • Unenroll Event Set (cs=>/v1/eventset/enroll) - Unenrolls user to all the child events under the event set.

...