Wraps the program folders on a website's branch and provides lookups for programs, courses and modules by their codes. Built by LearningManager for a single website and branch, it is used from learning templates to resolve module titles, list a group's enrolments, and track which program, course and module are currently selected in the reporting UI via cookies.
Properties
| Property | Returns | Description |
|---|---|---|
| allPrograms | List<ProgramFolder> | All program folders available on this website's branch, regardless of the current user's access. |
| availPrograms | List<ProgramFolder> | Program folders from this website's branch that are available to the current user, lazily computed and cached for the lifetime of this model. |
| selectedCourse | CourseFolder | The course currently selected for reporting within the selected program, read from the "reportingCourse" cookie. |
| selectedCourses | List<CourseFolder> | The courses currently selected for reporting within the first selected program, read from the "reportingCourse" cookie. The cookie may hold a single course code or a JSON-style array of codes. |
| selectedModule | ModuleFolder | The module currently selected for reporting within the selected course, read from the "reportingModule" cookie. |
| selectedModules | List<ModuleFolder> | The modules currently selected for reporting within the first selected course, read from the "reportingModule" cookie. The cookie may hold a single module code or a JSON-style array of codes. |
| selectedProgram | ProgramFolder | The program currently selected for reporting, read from the "reportingProgram" cookie. |
| selectedPrograms | List<ProgramFolder> | The programs currently selected for reporting, read from the "reportingProgram" cookie. The cookie may hold a single program code or a JSON-style array of codes. |
Methods
getModuleTitle(ModuleStatus ms) · getModuleTitle(String progCode, String courseCode, String moduleName) · getModuleFolder(ModuleStatus ms) · getModuleFolder(String progCode, String courseCode, String moduleName) · enrolementsForGroup(Group g) · getAllPrograms() · getAvailPrograms() · getSelectedProgram() · getSelectedPrograms() · getSelectedCourse() · getCourseFolder(String progCode, String courseCode) · getSelectedCourses() · getSelectedModule() · getSelectedModules() · program(String name) · course(String program, String course) · getEnrolement(Group g, ProgramFolder p) · isSelected(Group g, ProgramFolder p) · notSelected(Group g, ProgramFolder p) · isCompletable(Group g, ProgramFolder p) · findModuleFolder(ModuleStatus ms)
getModuleTitle(ModuleStatus ms)
Returns: String
Resolves the display title of the module a module status refers to.
| Parameter | Description |
|---|---|
ms | the module status identifying the program, course and module |
getModuleTitle(String progCode, String courseCode, String moduleName)
Returns: String
Resolves the display title of a module identified by program, course and module code.
| Parameter | Description |
|---|---|
progCode | the program code |
courseCode | the course code |
moduleName | the module code |
getModuleFolder(ModuleStatus ms)
Returns: ModuleFolder
Finds the module folder that a module status refers to, looked up by the status's program, course and module codes.
| Parameter | Description |
|---|---|
ms | the module status identifying the program, course and module |
getModuleFolder(String progCode, String courseCode, String moduleName)
Returns: ModuleFolder
Finds the module folder identified by program, course and module code.
| Parameter | Description |
|---|---|
progCode | the program code |
courseCode | the course code |
moduleName | the module code |
enrolementsForGroup(Group g)
Returns: List<EnrolementModel>
Loads all learning enrolments recorded against a group, each paired with its resolved program folder. Queries the database, so this is not cheap.
| Parameter | Description |
|---|---|
g | the group whose enrolments are loaded |
getAllPrograms()
Returns: List<ProgramFolder>
All program folders available on this website's branch, regardless of the current user's access.
getAvailPrograms()
Returns: List<ProgramFolder>
Program folders from this website's branch that are available to the current user, lazily computed and cached for the lifetime of this model.
getSelectedProgram()
Returns: ProgramFolder
The program currently selected for reporting, read from the "reportingProgram" cookie.
getSelectedPrograms()
Returns: List<ProgramFolder>
The programs currently selected for reporting, read from the "reportingProgram" cookie. The cookie may hold a single program code or a JSON-style array of codes.
getSelectedCourse()
Returns: CourseFolder
The course currently selected for reporting within the selected program, read from the "reportingCourse" cookie.
getCourseFolder(String progCode, String courseCode)
Returns: CourseFolder
Finds the course folder identified by program and course code.
| Parameter | Description |
|---|---|
progCode | the program code |
courseCode | the course code |
getSelectedCourses()
Returns: List<CourseFolder>
The courses currently selected for reporting within the first selected program, read from the "reportingCourse" cookie. The cookie may hold a single course code or a JSON-style array of codes.
getSelectedModule()
Returns: ModuleFolder
The module currently selected for reporting within the selected course, read from the "reportingModule" cookie.
getSelectedModules()
Returns: List<ModuleFolder>
The modules currently selected for reporting within the first selected course, read from the "reportingModule" cookie. The cookie may hold a single module code or a JSON-style array of codes.
program(String name)
Returns: ProgramFolder
Finds a program folder by its name.
| Parameter | Description |
|---|---|
name | the program's name |
course(String program, String course)
Returns: CourseFolder
Finds a course folder by program name and course name.
| Parameter | Description |
|---|---|
program | the program's name |
course | the course's name |
getEnrolement(Group g, ProgramFolder p)
Returns: EnrolementModel
Finds the group's enrolment in a program, wrapped with the program folder for display.
| Parameter | Description |
|---|---|
g | the group to find the enrolment for |
p | the program to look for an enrolment in |
isSelected(Group g, ProgramFolder p)
Returns: boolean
Whether a group is enrolled in a program.
| Parameter | Description |
|---|---|
g | the group to check |
p | the program to check enrolment in |
notSelected(Group g, ProgramFolder p)
Returns: boolean
Whether a group is not enrolled in a program. The inverse of isSelected.
| Parameter | Description |
|---|---|
g | the group to check |
p | the program to check enrolment in |
isCompletable(Group g, ProgramFolder p)
Returns: boolean
Whether a group's enrolment in a program can be marked complete.
| Parameter | Description |
|---|---|
g | the group to check |
p | the program to check |
findModuleFolder(ModuleStatus ms)
Returns: ModuleFolder
Finds the module folder that a module status refers to, by walking from the program to the course to the module using the status's codes.
| Parameter | Description |
|---|---|
ms | the module status identifying the program, course and module |