Schedules a learning module by tying a calendar event to a particular programme, course and module on a website, optionally for one cohort. One module can have many scheduled events, for example the same workshop run several times or run separately for each cohort, so there is one row per occurrence. The module is identified by the three codes rather than by a foreign key, and the timing lives entirely on the linked CalEvent, which is why the helpers here take the current date as an argument.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
calEventCalEventThe calendar event that carries the start and end times of this occurrence. All the timing helpers on this class read from it.
cohortOrganisationThe cohort this occurrence is run for, when the module is scheduled separately per cohort.
courseCodeStringCode of the course containing the scheduled module, which is the name of its directory in the website content. Never null.
idlongDatabase identifier for this scheduled event.
moduleCodeStringCode of the scheduled module. A module is a directory in the website content and this is the name of that directory, so it must be unique across the whole learning organisation and must not change once the module is published. Never null.
programCodeStringCode of the programme containing the scheduled module, which is the name of its directory in the website content. Never null.
websiteWebsiteThe website the scheduled module belongs to. The programme, course and module codes are resolved within this website. Never null.

Methods

getId() · setId(long id) · getWebsite() · setWebsite(Website website) · getProgramCode() · setProgramCode(String programCode) · getCourseCode() · setCourseCode(String courseCode) · getModuleCode() · setModuleCode(String moduleCode) · getCalEvent() · setCalEvent(CalEvent calEvent) · getCohort() · setCohort(Organisation cohort) · isStarted(Date now) · isFinished(Date now) · isInProgress(Date now) · isAboutToStart(Date now, int mins) · numSubmitted()

getId()

Returns: long

Database identifier for this scheduled event.

setId(long id)

Returns: void

Sets the database identifier. Normally only assigned by the persistence layer.

ParameterDescription
idthe primary key to assign

getWebsite()

Returns: Website

The website the scheduled module belongs to. The programme, course and module codes are resolved within this website. Never null.

setWebsite(Website website)

Returns: void

Sets the website the scheduled module belongs to. Required.

ParameterDescription
websitethe website the schedule belongs to

getProgramCode()

Returns: String

Code of the programme containing the scheduled module, which is the name of its directory in the website content. Never null.

setProgramCode(String programCode)

Returns: void

Sets the code of the programme containing the module. Required.

ParameterDescription
programCodethe programme code

getCourseCode()

Returns: String

Code of the course containing the scheduled module, which is the name of its directory in the website content. Never null.

setCourseCode(String courseCode)

Returns: void

Sets the code of the course containing the module. Required.

ParameterDescription
courseCodethe course code

getModuleCode()

Returns: String

Code of the scheduled module. A module is a directory in the website content and this is the name of that directory, so it must be unique across the whole learning organisation and must not change once the module is published. Never null.

setModuleCode(String moduleCode)

Returns: void

Sets the code of the scheduled module. Required, and it must match the module's directory name.

ParameterDescription
moduleCodethe module code

getCalEvent()

Returns: CalEvent

The calendar event that carries the start and end times of this occurrence. All the timing helpers on this class read from it.

setCalEvent(CalEvent calEvent)

Returns: void

Sets the calendar event holding the timing of this occurrence.

ParameterDescription
calEventthe calendar event to link

getCohort()

Returns: Organisation

The cohort this occurrence is run for, when the module is scheduled separately per cohort.

setCohort(Organisation cohort)

Returns: void

Sets the cohort this occurrence is run for.

ParameterDescription
cohortthe cohort organisation, or null if it applies to everyone

isStarted(Date now)

Returns: boolean

Whether the occurrence has started, that is its calendar event's start date is in the past. An event with no start date is never treated as started.

ParameterDescription
nowthe time to compare the start date against

isFinished(Date now)

Returns: boolean

Whether the occurrence has finished, that is its calendar event's end date is in the past. An event with no end date is never treated as finished, so it runs indefinitely.

ParameterDescription
nowthe time to compare the end date against

isInProgress(Date now)

Returns: boolean

Whether the occurrence has started and has not yet finished. An event with a start date but no end date counts as in progress once it has started.

ParameterDescription
nowthe time to test against

isAboutToStart(Date now, int mins)

Returns: boolean

Whether the occurrence starts within the next given number of minutes and has not started yet. Useful for sending reminders.

ParameterDescription
nowthe time to measure the window from
minshow many minutes ahead to look

numSubmitted()

Returns: long

Counts the module statuses submitted against this scheduled occurrence, using the current session. This runs a query, so avoid calling it in a loop.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.