Represents a single learning module within a course, exposed as a WebDAV/HTTP resource nested under a CourseFolder. Serves the module's content pages and quizzes to a learner, tracks that learner's progress through a ModuleStatus record, and handles quiz submission, marking the module complete, generating certificates and awarding CPD points. Also supports instructor led training (ILT) and assignment style modules by checking the learner's registration against ModuleCalEvent calendar bookings.

Group: Resources

Extends: DirectoryResource

Implements: PostableResource, CertificatesFolder, LevelResource, ModuleStatusResource, LearningResource


Properties

PropertyReturnsDescription
assignmentbooleanTrue if this module's configured instructor type is "ASSIGN", ie an assignment.
assignmentAvailableboolean
assignmentPastDuebooleanTrue if the current user is registered and acknowledged for one of this module's calendar events whose start date has already passed. Used for assignment style modules to flag an overdue submission.
awardedCpdPointsMap<String,Double>The CPD points actually awarded to the current user for this module, as a map of certificate name to points. If multiple CPD awards have been made for the same certificate their points are summed. Lazily built and cached on this instance.
briefStringA short summary of this module, taken from the body of its index page. Returns an empty string if the module has no index page, or null if the index page could not be read.
certificateFilesList<FileResource>The list of already-generated certificate files (ie PDFs) for the current user for this module. These can be used to generate download links. Returns an empty list if there is no current user.
certificateHrefsList<String>A list of hrefs to all certificates which the current user is entitled to for this module. These are always links which will generate the certificate on demand, rather than links to pre-generated files. Returns an empty list if there is no current user.
certificatesList<Certificate>The certificates configured to be generated when this module is completed, resolved from its "certificate" type completion actions.
completablebooleanTrue if the current user is enrolled in the parent course with an enrolment that allows this module to be completed.
completebooleanTrue if the current user has completed this module and is not currently within a renewal period. A completed module which has entered its renewal period (see the Frequency and expiry settings) is treated as not complete, so the learner is prompted to redo it.
completionMessageStringThe body content of this module's "finished.html" completion message page. Returns null if the page does not exist.
configuredCertificatesList<Certificate>The certificates configured to be generated when this module is completed, resolved from its "certificate" type completion actions. Currently duplicates the behaviour of getCertificates.
contentManagedPermissionsbooleanAlways false. A module's permissions are not managed as regular content permissions.
courseCodeStringThe code of the course this module belongs to, ie the name of this module's parent CourseFolder.
cpdPointsMap<String,Double>The CPD points configured to be awarded on completion of this module, as a map of certificate name to points, resolved from this module's "certificate" type completion actions.
currentLevelintThe level the current user is up to within this module's course. A user is within a level if they have completed all modules at lower levels but have not yet completed all modules at this level. Calculated once and cached on this instance.
currentPageStringThe name of the page the current user last viewed within this module, as recorded on their ModuleStatus. Null if the user has no ModuleStatus for this module.
currentPageNumIntegerThe zero-indexed position of the current user's current page amongst this module's ordered module and quiz pages. Returns null if the user has no ModuleStatus for this module.
expiryFrequencyFrequencyHow often this module's completion expires and needs to be renewed, taken from the "expiryFrequency" parameter. Returns null if not configured or if the stored value is not a recognised Frequency.
expiryMultiplesIntegerThe number of expiry frequency units after which this module's completion expires, taken from the "expiryMultiples" parameter. For example, with a frequency of MONTHLY and a multiple of 6, the module expires every 6 months. Returns null if not configured or the stored value cannot be parsed as an integer.
finalScorePercIntegerThe current user's score for this module as a percentage. The score is assigned when the module is completed. Returns null if the user has no ModuleStatus for this module.
firstAwardedCpdPointsDoubleThe first value from getAwardedCpdPoints, or null if none are present. This is for the usual case where there is only one certificate being awarded for the module.
highlightsStringThe body content of this module's optional "highlights.html" page, if one exists. Returns an empty string if the page does not exist or is not a recognised HTML resource type.
iltbooleanTrue if this module's configured instructor type is "ILT", ie instructor led training.
iltAboutToStartbooleanTrue if the current user is registered and acknowledged for one of this module's ILT calendar events which is about to start within 30 minutes.
iltStartedbooleanTrue if the current user is registered and acknowledged for one of this module's ILT calendar events which is currently in progress.
inProgressbooleanTrue if the current user has a ModuleStatus for this module which is not yet complete. False if the module has not been started, or has already been completed.
instructorTypeStringThe instructor type configured for this module, taken from the "instructorType" parameter on its index page, eg "ILT" for instructor led training or "ASSIGN" for an assignment. Null if not configured.
learningTimeMinsintThe estimated learning time for this module in minutes, taken from the "learningTimeMins" parameter on its index page. Returns 0 if the parameter is not set, blank, or cannot be parsed as an integer.
levelIntegerThis module's configured level within its course, taken from the "level" parameter. Levels group modules so that all modules at a level must be completed before the next level becomes startable.
moduleCalEventsList<ModuleCalEvent>All calendar events associated with this module, eg instructor led training sessions, for the module's website.
moduleCompletableboolean
moduleCompleteActionsList<ModuleCompleteAction>The list of things to do when this module is completed, such as generating certificates and awarding rewards. Read from the module's completeActions.xml file. Returns null if that file does not exist, or an empty list if it exists but cannot be parsed.
modulePagesResourceList<CommonResource>This module's content pages, ie its children which are of type "modulePage" or "quizPage", ordered by their configured "order" field. Lazily built and cached on first access.
moduleStatusModuleStatusThe learning record (ModuleStatus) for the current user for this module, if one exists. Returns null if the current user has not started the module and no autocreate has occurred.
moduleStatusFieldsMap<String,String>The current user's saved module status field values, keyed by field name. Lazily built and cached from the ModuleStatus fields on first access; returns an empty map if the user has no ModuleStatus for this module.
nextIltDateDateThe start date of the current user's next registered and acknowledged ILT calendar event which is about to start within 30 minutes.
nextModuleModuleFolderThe module immediately following this one within the parent course's module list, or null if this is the last module. Lazily resolved and cached on this instance.
numberCompletionslongThe number of learners on this module's website who have completed it.
numberIncompletelongThe number of learners on this module's website who have started this module but not yet completed it.
numberStartedlongThe number of learners on this module's website who have started it, regardless of whether they have completed it.
numModulePagesintThe number of module and quiz pages within this module.
orderIntegerThis module's display order within its course, taken from the "order" parameter.
orgModuleStatsOrgModulesStatsCompletion statistics for this module across the current user's primary organisation. Lazily built and cached on this instance; returns null if there is no current principal or the principal has no primary membership.
percentCompleteIntegerThe current user's completion percentage for this module. Returns the persisted percentage from the ModuleStatus if one has been recorded, otherwise falls back to calculating it on demand from the current page. Returns null if the user has no ModuleStatus for this module.
programCodeStringThe code of the learning program this module belongs to, ie the name of the grandparent folder (the program folder above this module's course folder).
publicbooleanAlways false. A module is never treated as a public resource; a learner must be enrolled and authenticated to access it.
rawThumbStringThe raw, unresolved value of the "thumb" parameter set on this module's index page, without the relative or absolute URL handling applied by getThumb. Null if the index page has no thumb parameter set.
registeredForIltbooleanTrue if the current user is registered and acknowledged for one of this module's ILT calendar events which is not yet finished.
rewardsList<Reward>The rewards configured to be awarded when this module is completed, resolved from its "reward" type completion actions.
scoreIntegerThe current user's final module score as a percentage, taken from their ModuleStatus. Calculated when the module is completed as the average of all quiz scores. Returns null if the user has no ModuleStatus for this module.
startablebooleanTrue if the current user has satisfied the requirements to begin this module. This requires the parent course to be startable, and the current user to have reached a course level at least as high as this module's configured level.
submittedbooleanTrue if the current user has submitted this module, ie their ModuleStatus has a submitted date recorded.
submittedDateDateThe date the current user submitted this module, if any. Null if the user has no ModuleStatus for this module, or has not submitted it.
thumbStringThe URL of this module's thumbnail image, taken from the "thumb" parameter on its index page. Absolute URLs and paths starting with a slash are returned as-is; a relative value is resolved against this module's path. Returns null if the index page has no thumb parameter set.
titleStringThe display title for this module, taken from the index page's title if set, falling back to the module's file name otherwise. The result is HTML-entity encoded ready for direct output.
unmetPrerequisitesList<ModuleFolder>The sibling modules at a lower level than this one which the current user has not yet completed. These are the outstanding prerequisites that must be finished before this module becomes startable.
upcomingModuleCalEventsList<ModuleCalEvent>This module's calendar events falling between now and 60 days from now.
userIltRegisteredbooleanTrue if the current user has registered for a calendar event representing an instance of instructor led training which is either in progress or about to start within 15 minutes.

Inherited from DirectoryResource

Properties

PropertyReturnsDescription
bodyStringBody content of this directory's index page, or an empty string if it has no index page.
branchBranchThe branch this directory belongs to, delegated to from its parent resource.
childrenResourceList<CommonResource>The child files and folders of this directory, including any browseable application pages registered by ApplicationManager. Built lazily on first access and cached for the lifetime of this resource.
dirbooleanWhether this resource is a directory. Always true.
directoryNodeDirectoryNodeThe underlying directory node for this resource in the versioned content repository, creating it from the parent node if it does not yet exist.
filesList<ContentResource>Files (not folders) that are direct children of this directory.
hashStringContent hash of this directory's underlying directory node, or null if the node has not been created.
indexRenderFileResourceThe index.html page of this directory, if one has already been created, otherwise null.
itemTypeStringThe "itemType" template parameter of this directory's index page, used to classify the folder for search.
paramNamesList<String>Names of the template parameters set on this directory's index page.
pathFromBranchPathThis directory's path relative to the root of its branch, built from its parent's path plus its own name.
searchCategoryStringThe "category" template parameter of this directory's index page, used to classify the folder for search.
searchTagsStringThe "tags" template parameter of this directory's index page, used to tag the folder for search.
subFoldersList<ContentDirectoryResource>Subfolders of this directory, excluding the reserved ".mil" metadata folder.

Methods

getChildren() · createDirectoryResource(String newName) · save() · isDir() · getDirectoryNode() · getIndex() · getHtmlPage(String name, boolean autocreate) · getBody() · getParam(String name) · getParamNames() · doSaveHtml() · getBranch() · getHash() · getSubFolders() · getFiles() · getItemType() · getSearchCategory() · getSearchTags() · getPathFromBranch()

getChildren()

Returns: ResourceList<CommonResource>

The child files and folders of this directory, including any browseable application pages registered by ApplicationManager. Built lazily on first access and cached for the lifetime of this resource.

createDirectoryResource(String newName)

Returns: DirectoryResource

Creates a new subdirectory of this directory with the given name and saves the change. Fails if a resource with that name already exists.

ParameterDescription
newNamethe name of the subdirectory to create

save()

Returns: void

Persists this directory by delegating to its parent's save method. Requires a logged-in user.

isDir()

Returns: boolean

Whether this resource is a directory. Always true.

getDirectoryNode()

Returns: DirectoryNode

The underlying directory node for this resource in the versioned content repository, creating it from the parent node if it does not yet exist.

getIndex()

Returns: RenderFileResource

The index.html page of this directory, if one has already been created, otherwise null.

getHtmlPage(String name, boolean autocreate)

Returns: RenderFileResource

Finds a named HTML page among this directory's children, parsing it for templating, or creates a new one if autocreate is true and no page with that name exists.

ParameterDescription
namethe name of the HTML page to find or create
autocreateif true, creates and returns a new page when none exists; otherwise returns null

getBody()

Returns: String

Body content of this directory's index page, or an empty string if it has no index page.

getParam(String name)

Returns: String

Reads a named template parameter from this directory's index page.

ParameterDescription
namethe name of the parameter to read

getParamNames()

Returns: List<String>

Names of the template parameters set on this directory's index page.

doSaveHtml()

Returns: void

Saves the index page if any of its title, body or parameters have been changed via this resource. Does nothing if nothing has been changed, or if there is no index page to save.

getBranch()

Returns: Branch

The branch this directory belongs to, delegated to from its parent resource.

getHash()

Returns: String

Content hash of this directory's underlying directory node, or null if the node has not been created.

getSubFolders()

Returns: List<ContentDirectoryResource>

Subfolders of this directory, excluding the reserved ".mil" metadata folder.

getFiles()

Returns: List<ContentResource>

Files (not folders) that are direct children of this directory.

getItemType()

Returns: String

The "itemType" template parameter of this directory's index page, used to classify the folder for search.

getSearchCategory()

Returns: String

The "category" template parameter of this directory's index page, used to classify the folder for search.

getSearchTags()

Returns: String

The "tags" template parameter of this directory's index page, used to tag the folder for search.

getPathFromBranch()

Returns: Path

This directory's path relative to the root of its branch, built from its parent's path plus its own name.


Methods

getTitle() · is(String type) · getModuleStatus() · getModuleStatus(boolean autocreate) · getCurrentPage() · getModuleStatusFields() · isInProgress() · isComplete() · isSubmitted() · getSubmittedDate() · generateCertificate(long certId, ModuleStatus ms) · calcPercentComplete(String cur) · getCurrentPageNum() · getPercentComplete() · getScore() · getBrief() · setBrief(String s) · getRawThumb() · getThumb() · getHighlights() · getLearningTimeMins() · getInstructorType() · getExpiryFrequency() · getExpiryMultiples() · setModuleCompleteActions(List<ModuleCompleteAction> list) · getModuleCompleteActions() · setCompletionMessage(String message) · getCompletionMessage() · isStartable() · getUnmetPrerequisites() · isCompletable() · isCompletable(Profile p) · getLevel() · getOrder() · getCurrentLevel() · getNumModulePages() · getModulePages() · quizAttempts(String quizName) · isQuizPassed(String quizName) · getActualAnswers(String quiz) · getQuizInfo(String quiz) · getRewards() · getCertificates() · getConfiguredCertificates() · getCpdPoints() · getAwardedCpdPoints() · getFirstAwardedCpdPoints() · certificate(long id) · getCertificateHrefs() · certificateHrefs(UserResource user) · certificateHrefs(ModuleStatus ms) · getCertificateFiles() · certificateFiles(UserResource user) · isPublic() · getProgramCode() · getCourseCode() · findModuleStatus(Profile profile) · getOrgModuleStats() · getNextModule() · getFinalScorePerc() · getNumberCompletions() · getNumberStarted() · getNumberIncomplete() · isContentManagedPermissions() · quizBatch(String quizName) · quizBatch(QuizInfo quizPage) · calcExpiryDate(Date lastRun) · getModuleCalEvents() · getUpcomingModuleCalEvents() · isIlt() · isAssignment() · isUserIltRegistered() · findAttendee(CalEvent ev, Profile curUser) · isRegisteredForIlt() · isIltStarted() · isIltAboutToStart() · getNextIltDate() · isAssignmentPastDue()

getTitle()

Returns: String

The display title for this module, taken from the index page's title if set, falling back to the module's file name otherwise. The result is HTML-entity encoded ready for direct output.

is(String type)

Returns: boolean

Checks whether this resource matches the given type name. Matches "module" and "physicalFolder" for any module whose name does not start with a dot, in addition to any type recognised by the superclass.

ParameterDescription
typethe type name to check against

getModuleStatus()

Returns: ModuleStatus

The learning record (ModuleStatus) for the current user for this module, if one exists. Returns null if the current user has not started the module and no autocreate has occurred.

getModuleStatus(boolean autocreate)

Returns: ModuleStatus

The learning record (ModuleStatus) for the current user for this module, optionally creating one if it does not already exist. Returns null if there is no current user.

ParameterDescription
autocreatetrue to create a new ModuleStatus for the current user if one does not already exist

getCurrentPage()

Returns: String

The name of the page the current user last viewed within this module, as recorded on their ModuleStatus. Null if the user has no ModuleStatus for this module.

getModuleStatusFields()

Returns: Map<String,String>

The current user's saved module status field values, keyed by field name. Lazily built and cached from the ModuleStatus fields on first access; returns an empty map if the user has no ModuleStatus for this module.

isInProgress()

Returns: boolean

True if the current user has a ModuleStatus for this module which is not yet complete. False if the module has not been started, or has already been completed.

isComplete()

Returns: boolean

True if the current user has completed this module and is not currently within a renewal period. A completed module which has entered its renewal period (see the Frequency and expiry settings) is treated as not complete, so the learner is prompted to redo it.

isSubmitted()

Returns: boolean

True if the current user has submitted this module, ie their ModuleStatus has a submitted date recorded.

getSubmittedDate()

Returns: Date

The date the current user submitted this module, if any. Null if the user has no ModuleStatus for this module, or has not submitted it.

generateCertificate(long certId, ModuleStatus ms)

Returns: CpdAward

Generates the certificate matching the given certificate id from this module's completion actions for the given learning record, creating and persisting a CpdAward for it. Returns null if no matching "certificate" completion action is configured for this module.

ParameterDescription
certIdthe id of the Certificate to generate, matched against this module's configured completion actions
msthe ModuleStatus (learning record) the certificate is generated for

calcPercentComplete(String cur)

Returns: Integer

Calculates the current user's completion percentage for this module as at the given page, by delegating to the LearningManager. This is an on-demand calculation, not simply a stored value.

ParameterDescription
curthe name of the page to calculate completion up to

getCurrentPageNum()

Returns: Integer

The zero-indexed position of the current user's current page amongst this module's ordered module and quiz pages. Returns null if the user has no ModuleStatus for this module.

getPercentComplete()

Returns: Integer

The current user's completion percentage for this module. Returns the persisted percentage from the ModuleStatus if one has been recorded, otherwise falls back to calculating it on demand from the current page. Returns null if the user has no ModuleStatus for this module.

getScore()

Returns: Integer

The current user's final module score as a percentage, taken from their ModuleStatus. Calculated when the module is completed as the average of all quiz scores. Returns null if the user has no ModuleStatus for this module.

getBrief()

Returns: String

A short summary of this module, taken from the body of its index page. Returns an empty string if the module has no index page, or null if the index page could not be read.

setBrief(String s)

Returns: void

Sets the body of this module's index page, creating the index page if it does not already exist.

ParameterDescription
sthe new body content for the index page

getRawThumb()

Returns: String

The raw, unresolved value of the "thumb" parameter set on this module's index page, without the relative or absolute URL handling applied by getThumb. Null if the index page has no thumb parameter set.

getThumb()

Returns: String

The URL of this module's thumbnail image, taken from the "thumb" parameter on its index page. Absolute URLs and paths starting with a slash are returned as-is; a relative value is resolved against this module's path. Returns null if the index page has no thumb parameter set.

getHighlights()

Returns: String

The body content of this module's optional "highlights.html" page, if one exists. Returns an empty string if the page does not exist or is not a recognised HTML resource type.

getLearningTimeMins()

Returns: int

The estimated learning time for this module in minutes, taken from the "learningTimeMins" parameter on its index page. Returns 0 if the parameter is not set, blank, or cannot be parsed as an integer.

getInstructorType()

Returns: String

The instructor type configured for this module, taken from the "instructorType" parameter on its index page, eg "ILT" for instructor led training or "ASSIGN" for an assignment. Null if not configured.

getExpiryFrequency()

Returns: Frequency

How often this module's completion expires and needs to be renewed, taken from the "expiryFrequency" parameter. Returns null if not configured or if the stored value is not a recognised Frequency.

getExpiryMultiples()

Returns: Integer

The number of expiry frequency units after which this module's completion expires, taken from the "expiryMultiples" parameter. For example, with a frequency of MONTHLY and a multiple of 6, the module expires every 6 months. Returns null if not configured or the stored value cannot be parsed as an integer.

setModuleCompleteActions(List<ModuleCompleteAction> list)

Returns: void

Replaces this module's list of completion actions, writing them out to the completeActions.xml file, creating it if it does not already exist.

ParameterDescription
listthe completion actions to save for this module

getModuleCompleteActions()

Returns: List<ModuleCompleteAction>

The list of things to do when this module is completed, such as generating certificates and awarding rewards. Read from the module's completeActions.xml file. Returns null if that file does not exist, or an empty list if it exists but cannot be parsed.

setCompletionMessage(String message)

Returns: void

Sets the body content of this module's "finished.html" completion message page, creating the page if it does not already exist. If the message is null or blank, a default title of "Completion message" is set on the page. Saves the underlying page resource, but does not save the parent module.

ParameterDescription
messagethe completion message body to set

getCompletionMessage()

Returns: String

The body content of this module's "finished.html" completion message page. Returns null if the page does not exist.

isStartable()

Returns: boolean

True if the current user has satisfied the requirements to begin this module. This requires the parent course to be startable, and the current user to have reached a course level at least as high as this module's configured level.

getUnmetPrerequisites()

Returns: List<ModuleFolder>

The sibling modules at a lower level than this one which the current user has not yet completed. These are the outstanding prerequisites that must be finished before this module becomes startable.

isCompletable()

Returns: boolean

True if the current user is enrolled in the parent course with an enrolment that allows this module to be completed.

isCompletable(Profile p)

Returns: boolean

Checks whether this module is completable for the given profile, by delegating to the parent course's enrolment check.

ParameterDescription
pthe profile to check

getLevel()

Returns: Integer

This module's configured level within its course, taken from the "level" parameter. Levels group modules so that all modules at a level must be completed before the next level becomes startable.

getOrder()

Returns: Integer

This module's display order within its course, taken from the "order" parameter.

getCurrentLevel()

Returns: int

The level the current user is up to within this module's course. A user is within a level if they have completed all modules at lower levels but have not yet completed all modules at this level. Calculated once and cached on this instance.

getNumModulePages()

Returns: int

The number of module and quiz pages within this module.

getModulePages()

Returns: ResourceList<CommonResource>

This module's content pages, ie its children which are of type "modulePage" or "quizPage", ordered by their configured "order" field. Lazily built and cached on first access.

quizAttempts(String quizName)

Returns: List<Date>

Gets the date/times of quiz attempts for the given quiz page, for the current user. Use this to find out how many quiz attempts there have been for this user of the given quiz.

ParameterDescription
quizNamethe file name of the quiz in this module to get attempts for

isQuizPassed(String quizName)

Returns: boolean

True if the current user has a passed QuizAttempt recorded for the given quiz page.

ParameterDescription
quizNamethe file name of the quiz page to check

getActualAnswers(String quiz)

Returns: Map<String,String>

The correct answers configured for the given quiz page, keyed by answer field name.

ParameterDescription
quizthe file name of the quiz page

getQuizInfo(String quiz)

Returns: QuizInfo

Parses and returns the QuizInfo for the given quiz page, ie its title, pass mark, maximum attempts, batching settings and configured answers. Lazily parsed from the quiz page's HTML on first access and cached for subsequent calls with the same name.

ParameterDescription
quizthe file name of the quiz page within this module

getRewards()

Returns: List<Reward>

The rewards configured to be awarded when this module is completed, resolved from its "reward" type completion actions.

getCertificates()

Returns: List<Certificate>

The certificates configured to be generated when this module is completed, resolved from its "certificate" type completion actions.

getConfiguredCertificates()

Returns: List<Certificate>

The certificates configured to be generated when this module is completed, resolved from its "certificate" type completion actions. Currently duplicates the behaviour of getCertificates.

getCpdPoints()

Returns: Map<String,Double>

The CPD points configured to be awarded on completion of this module, as a map of certificate name to points, resolved from this module's "certificate" type completion actions.

getAwardedCpdPoints()

Returns: Map<String,Double>

The CPD points actually awarded to the current user for this module, as a map of certificate name to points. If multiple CPD awards have been made for the same certificate their points are summed. Lazily built and cached on this instance.

getFirstAwardedCpdPoints()

Returns: Double

The first value from getAwardedCpdPoints, or null if none are present. This is for the usual case where there is only one certificate being awarded for the module.

certificate(long id)

Returns: Certificate

Finds this module's configured certificate matching the given id.

ParameterDescription
idthe id of the certificate to find

getCertificateHrefs()

Returns: List<String>

A list of hrefs to all certificates which the current user is entitled to for this module. These are always links which will generate the certificate on demand, rather than links to pre-generated files. Returns an empty list if there is no current user.

certificateHrefs(UserResource user)

Returns: List<String>

A list of hrefs to all certificates the given user is entitled to for this module, resolved from that user's ModuleStatus.

ParameterDescription
userthe user to look up certificate hrefs for

certificateHrefs(ModuleStatus ms)

Returns: List<String>

A list of hrefs to all certificates configured for this module, for the given learning record. Only returns hrefs if the given ModuleStatus is complete; each href points to a link which will generate the corresponding certificate on demand.

ParameterDescription
msthe learning record to check completion and generate certificate hrefs for

getCertificateFiles()

Returns: List<FileResource>

The list of already-generated certificate files (ie PDFs) for the current user for this module. These can be used to generate download links. Returns an empty list if there is no current user.

certificateFiles(UserResource user)

Returns: List<FileResource>

The list of already-generated certificate files (ie PDFs) for the given user for this module, matched by file name prefix and the user's ModuleStatus id suffix within their "certificates" repository.

ParameterDescription
userthe user to find generated certificate files for

isPublic()

Returns: boolean

Always false. A module is never treated as a public resource; a learner must be enrolled and authenticated to access it.

getProgramCode()

Returns: String

The code of the learning program this module belongs to, ie the name of the grandparent folder (the program folder above this module's course folder).

getCourseCode()

Returns: String

The code of the course this module belongs to, ie the name of this module's parent CourseFolder.

findModuleStatus(Profile profile)

Returns: ModuleStatus

Finds the given profile's ModuleStatus (learning record) for this module, without auto-creating one. This makes the module status available to the certificate generator.

ParameterDescription
profilethe profile to find the learning record for

getOrgModuleStats()

Returns: OrgModulesStats

Completion statistics for this module across the current user's primary organisation. Lazily built and cached on this instance; returns null if there is no current principal or the principal has no primary membership.

getNextModule()

Returns: ModuleFolder

The module immediately following this one within the parent course's module list, or null if this is the last module. Lazily resolved and cached on this instance.

getFinalScorePerc()

Returns: Integer

The current user's score for this module as a percentage. The score is assigned when the module is completed. Returns null if the user has no ModuleStatus for this module.

getNumberCompletions()

Returns: long

The number of learners on this module's website who have completed it.

getNumberStarted()

Returns: long

The number of learners on this module's website who have started it, regardless of whether they have completed it.

getNumberIncomplete()

Returns: long

The number of learners on this module's website who have started this module but not yet completed it.

isContentManagedPermissions()

Returns: boolean

Always false. A module's permissions are not managed as regular content permissions.

quizBatch(String quizName)

Returns: String

The batched HTML for the given quiz page for the current user, looking up its QuizInfo and delegating to quizBatch(QuizInfo). Returns null if the quiz page cannot be found.

ParameterDescription
quizNamethe file name of the quiz page within this module

quizBatch(QuizInfo quizPage)

Returns: String

Builds the HTML for a single batch of questions from the given quiz's full question set, based on the current user's prior attempt count, the quiz's configured batch mode and batch size. If the quiz has no batch mode configured, or an invalid batch size, the full quiz HTML is returned unchanged. A hidden input recording the selected answer keys is appended so the submission can be matched back to the batched questions.

ParameterDescription
quizPagethe parsed quiz info to build a batch from

calcExpiryDate(Date lastRun)

Returns: Date

Calculates the date this module's completion will expire and need renewing, based on the configured expiry frequency and multiples, by delegating to the LearningManager.

ParameterDescription
lastRunthe date completion was last recorded, used as the base for the calculation

getModuleCalEvents()

Returns: List<ModuleCalEvent>

All calendar events associated with this module, eg instructor led training sessions, for the module's website.

getUpcomingModuleCalEvents()

Returns: List<ModuleCalEvent>

This module's calendar events falling between now and 60 days from now.

isIlt()

Returns: boolean

True if this module's configured instructor type is "ILT", ie instructor led training.

isAssignment()

Returns: boolean

True if this module's configured instructor type is "ASSIGN", ie an assignment.

isUserIltRegistered()

Returns: boolean

True if the current user has registered for a calendar event representing an instance of instructor led training which is either in progress or about to start within 15 minutes.

findAttendee(CalEvent ev, Profile curUser)

Returns: AttendeeRequest

Finds the attendee request recording the given profile's registration for the given calendar event.

ParameterDescription
evthe calendar event to look up
curUserthe profile whose registration is looked up

isRegisteredForIlt()

Returns: boolean

True if the current user is registered and acknowledged for one of this module's ILT calendar events which is not yet finished.

isIltStarted()

Returns: boolean

True if the current user is registered and acknowledged for one of this module's ILT calendar events which is currently in progress.

isIltAboutToStart()

Returns: boolean

True if the current user is registered and acknowledged for one of this module's ILT calendar events which is about to start within 30 minutes.

getNextIltDate()

Returns: Date

The start date of the current user's next registered and acknowledged ILT calendar event which is about to start within 30 minutes.

isAssignmentPastDue()

Returns: boolean

True if the current user is registered and acknowledged for one of this module's calendar events whose start date has already passed. Used for assignment style modules to flag an overdue submission.

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