ActivityService

public interface ActivityService

Service interface for managing activity records. These are used for managing activities for single user/patient and serve as enrollment records and quiz score records. These can be used to report activity for a user or course as well as track progress in the course curriculum.

Methods

createActivity

ActivityRecord createActivity(ActivityRecord activityRecord)

Adds activity for a user (identified by externalId field in the record).

Parameters:
  • activityRecord – activity to record
Returns:

activity record from the operation

deleteActivity

void deleteActivity(long activityRecordId)

Deletes the activity by the record id.

Parameters:
  • activityRecordId – activity record id to delete

deleteAllActivityForUser

void deleteAllActivityForUser(String externalId)

Deletes all activity for a user with the given externalId (intended for data cleanups).

Parameters:
  • externalId – Id of the user

getActivityById

ActivityRecord getActivityById(long activityId)

Gets an activity by the Id.

Parameters:
  • activityId – Id of the user
Returns:

activity record with id

getAllActivityForUser

List<ActivityRecord> getAllActivityForUser(String externalId)

Gets a list of all activity for a user with the given externalId.

Parameters:
  • externalId – Id of the user
Returns:

list of activity records

getCompletedActivityForUser

List<ActivityRecord> getCompletedActivityForUser(String externalId)

Gets all completed activity for user identified by the external id (decided by whether completion time has been set on the record).

Parameters:
  • externalId – external id of the user
Returns:

list of activity records

updateActivity

ActivityRecord updateActivity(ActivityRecord activityRecord)

Updates the activity for a user (set completion time, etc).

Parameters:
  • activityRecord – activity record to update
Returns:

updated activity record