Class Cmi5Parser
java.lang.Object
dev.jcputney.elearning.parser.parsers.BaseParser<Cmi5Metadata,Cmi5Manifest>
dev.jcputney.elearning.parser.parsers.Cmi5Parser
- All Implemented Interfaces:
ModuleParser<Cmi5Manifest>
Cmi5Parser is responsible for parsing cmi5-specific metadata from the cmi5.xml file.
The "cmi5" xAPI-based specification includes Assignable Units (AUs) as discrete learning objects with metadata for LMS tracking and reporting. This parser extracts metadata such as the title, launch URL, prerequisites, dependencies, detailed AU information, and custom metadata.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the cmi5 XML file that contains the module metadata.Fields inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
moduleFileProvider, XAPI_JS_FILE, XAPI_SEND_STATEMENT_FILE -
Constructor Summary
ConstructorsConstructorDescriptionCmi5Parser(FileAccess fileAccess) Constructs a Cmi5Parser with the specified FileAccess instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<Cmi5Manifest>Abstract method to return the class of the manifest object for the specific parser.parse()Parses the cmi5 module located at the specified modulePath.Methods inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
checkForXapi, loadExternalMetadataIntoMetadata, parseManifest, parseXmlToObject
-
Field Details
-
CMI5_XML
The name of the cmi5 XML file that contains the module metadata.- See Also:
-
-
Constructor Details
-
Cmi5Parser
Constructs a Cmi5Parser with the specified FileAccess instance.- Parameters:
fileAccess- An instance of FileAccess for reading files in the module package.
-
-
Method Details
-
parse
Parses the cmi5 module located at the specified modulePath.This method reads the cmi5.xml file to extract metadata such as the title, launch URL, prerequisites, dependencies, list of Assignable Units (AUs), and custom data for LMS tracking. Since cmi5 is always xAPI-enabled, the isXapiEnabled flag is set to true for all cmi5 modules.
- Specified by:
parsein interfaceModuleParser<Cmi5Manifest>- Specified by:
parsein classBaseParser<Cmi5Metadata,Cmi5Manifest> - Returns:
- A Cmi5Metadata object containing the parsed metadata.
- Throws:
ModuleParsingException- If the module's manifest cannot be parsed or if required fields are missing.
-
getManifestClass
Description copied from class:BaseParserAbstract method to return the class of the manifest object for the specific parser.- Specified by:
getManifestClassin classBaseParser<Cmi5Metadata,Cmi5Manifest> - Returns:
- The class of the manifest object.
-