Class AiccManifest
java.lang.Object
dev.jcputney.elearning.parser.input.aicc.AiccManifest
- All Implemented Interfaces:
PackageManifest,Serializable
Represents the AICC manifest for a course.
This class is used to parse the AICC manifest file and extract information about the course, assignable units, descriptors, and course structures.
It also provides methods to retrieve the title, description, launch URL, identifier, version, and duration of the course.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the AiccManifest class.AiccManifest(AiccCourse course, List<AssignableUnit> assignableUnits, List<Descriptor> descriptors, List<CourseStructure> courseStructures) Constructs an AiccManifest object that maps the relationship between the AICC course, its assignable units, descriptors, and course structures, and derives the launch URL of the root assignable unit. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the list of assignable units.Retrieves the course object associated with this instance.Retrieves the list of course structures.Retrieves the description of the course.Retrieves the list of descriptors.Retrieves the duration associated with this instance.Retrieves the identifier of the course.Retrieves the launch URL.Retrieves the objectives relation table.Retrieves the prerequisites table containing a list of maps where each map represents a set of prerequisite details with key-value pairs.getTitle()Retrieves the title of the course.Retrieves the version information of the course.inthashCode()static DoublenormalizeMasteryScore(String rawMastery) Normalizes a raw mastery score string into a standardizedDoubleformat.voidsetAssignableUnits(List<AssignableUnit> assignableUnits) Sets the list of assignable units.voidsetCourse(AiccCourse course) Sets the course for the current instance.voidsetCourseStructures(List<CourseStructure> courseStructures) Sets the list of course structures.voidsetDescriptors(List<Descriptor> descriptors) Sets the list of descriptors.voidsetLaunchUrl(String launchUrl) Sets the launch URL for this object.voidsetObjectivesRelationTable(List<Map<String, String>> objectivesRelationTable) Sets the objectives relation table with the provided list of mappings.voidsetPrerequisitesTable(List<Map<String, String>> prerequisitesTable) Sets the prerequisites table with the provided list of maps containing prerequisite details.
-
Constructor Details
-
AiccManifest
public AiccManifest()Default constructor for the AiccManifest class. This constructor is primarily used by frameworks and test methods that require an instance of the AiccManifest class without additional initialization or configuration logic. -
AiccManifest
public AiccManifest(AiccCourse course, List<AssignableUnit> assignableUnits, List<Descriptor> descriptors, List<CourseStructure> courseStructures) throws ModuleParsingException Constructs an AiccManifest object that maps the relationship between the AICC course, its assignable units, descriptors, and course structures, and derives the launch URL of the root assignable unit.- Parameters:
course- the AICC course to which the manifest correspondsassignableUnits- a list of assignable units associated with the coursedescriptors- a list of descriptors providing metadata for assignable unitscourseStructures- a list of course structures defining the hierarchical relationships and structure of the course- Throws:
ModuleParsingException- if the root assignable unit or its ID cannot be determined, or if there is inconsistent data in the manifest mappings
-
-
Method Details
-
normalizeMasteryScore
Normalizes a raw mastery score string into a standardizedDoubleformat. The raw input can be in various formats, such as a percentage (e.g., "85%") or a decimal (e.g., "0.85"). This method strips any unnecessary characters like '%' and adjusts the value appropriately if it appears to be a percentage.- Parameters:
rawMastery- The raw mastery score as aString. It can include optional percentage symbols and may contain extraneous whitespace. If null or blank, the method returnsnull.- Returns:
- The normalized mastery score as a
Double. Returnsnullif the input is invalid or cannot be parsed as a number. If the input is a valid percentage greater than 1, the result is scaled to a decimal (e.g., "85%" becomes 0.85). For valid decimals less than or equal to 1, the same value is returned unchanged.
-
getTitle
Retrieves the title of the course.- Specified by:
getTitlein interfacePackageManifest- Returns:
- the title of the course as a String.
-
getDescription
Retrieves the description of the course.Follows this priority order:
- Root AU descriptor description (from .des file)
- Course description (from .crs file [Course_Description] section)
Most AICC authoring tools (including Articulate Storyline) store the primary description in the descriptor file (.des), which can contain multi-line text. The [Course_Description] section in the .crs file is often less detailed or may be parsed incorrectly when it contains special characters like colons.
- Specified by:
getDescriptionin interfacePackageManifest- Returns:
- the course description as a string
-
getIdentifier
Retrieves the identifier of the course.- Specified by:
getIdentifierin interfacePackageManifest- Returns:
- the course identifier as a String
-
getVersion
Retrieves the version information of the course.- Specified by:
getVersionin interfacePackageManifest- Returns:
- the version of the course as a string.
-
getDuration
Retrieves the duration associated with this instance.- Specified by:
getDurationin interfacePackageManifest- Returns:
- a
Durationobject representing the duration, which will always returnDuration.ZERO.
-
getCourse
Retrieves the course object associated with this instance.- Returns:
- an AiccCourse object representing the course.
-
setCourse
Sets the course for the current instance.- Parameters:
course- the AICC course to be set
-
getAssignableUnits
Retrieves the list of assignable units.- Returns:
- a list of AssignableUnit objects representing the assignable units.
-
setAssignableUnits
Sets the list of assignable units.- Parameters:
assignableUnits- the list ofAssignableUnitobjects to be assigned
-
getDescriptors
Retrieves the list of descriptors.- Returns:
- a list of Descriptor objects representing the stored descriptors.
-
setDescriptors
Sets the list of descriptors.- Parameters:
descriptors- the list of Descriptor objects to be set
-
getCourseStructures
Retrieves the list of course structures.- Returns:
- a list of CourseStructure objects representing the course structures.
-
setCourseStructures
Sets the list of course structures.- Parameters:
courseStructures- the list of CourseStructure objects to be assigned
-
getLaunchUrl
Retrieves the launch URL.- Specified by:
getLaunchUrlin interfacePackageManifest- Returns:
- the launch URL as a String
-
setLaunchUrl
Sets the launch URL for this object.- Parameters:
launchUrl- the URL to be set as the launch URL
-
getPrerequisitesTable
Retrieves the prerequisites table containing a list of maps where each map represents a set of prerequisite details with key-value pairs.- Returns:
- a list of maps, where each map contains prerequisite details as key-value pairs.
-
setPrerequisitesTable
Sets the prerequisites table with the provided list of maps containing prerequisite details.- Parameters:
prerequisitesTable- the list of maps where each map represents a prerequisite. Each map should contain key-value pairs with string data related to the prerequisites.
-
getObjectivesRelationTable
Retrieves the objectives relation table.- Returns:
- a list of maps where each map contains key-value pairs representing the objectives relations.
-
setObjectivesRelationTable
Sets the objectives relation table with the provided list of mappings.- Parameters:
objectivesRelationTable- a list of maps where each map represents a relationship between objectives. The keys and values in the map are expected to be string representations of the relevant data.
-
equals
-
hashCode
public int hashCode()
-