scorm-parser

Parser for SCORM 1.2 packages

License

License

Categories

Categories

ORM Data
GroupId

GroupId

io.github.psyanite
ArtifactId

ArtifactId

scorm-parser
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

scorm-parser
Parser for SCORM 1.2 packages
Project URL

Project URL

https://github.com/psyanite/scorm-parser
Source Code Management

Source Code Management

https://github.com/psyanite/scorm-parser

Download scorm-parser

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.psyanite/scorm-parser/ -->
<dependency>
    <groupId>io.github.psyanite</groupId>
    <artifactId>scorm-parser</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.psyanite/scorm-parser/
implementation 'io.github.psyanite:scorm-parser:0.1.0'
// https://jarcasting.com/artifacts/io.github.psyanite/scorm-parser/
implementation ("io.github.psyanite:scorm-parser:0.1.0")
'io.github.psyanite:scorm-parser:jar:0.1.0'
<dependency org="io.github.psyanite" name="scorm-parser" rev="0.1.0">
  <artifact name="scorm-parser" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.psyanite', module='scorm-parser', version='0.1.0')
)
libraryDependencies += "io.github.psyanite" % "scorm-parser" % "0.1.0"
[io.github.psyanite/scorm-parser "0.1.0"]

Dependencies

runtime (3)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 3.0.1
net.lingala.zip4j : zip4j jar 1.3.2
commons-io : commons-io jar 2.4

Project Modules

There are no modules declared in this project.

scorm-parser

A Scala library to parse and validate SCORM 1.2 packages.

Configuration

Scala 2.12.3 is required.

Bintray

groupId: io.github.psyanite
artifactId: scorm-parser_2.12
version: 0.2.6

Usage

Using the parser

import com.psyanite.scorm.PackageParser
import com.psyanite.scorm.validator.ManifestValidator


val zip = new File("my-scorm-package.zip")
try {
  val parser = PackageParser(zip)
  val manifest = parser.parse()
  val errors = ManifestValidator().validate(manifest)
} catch {
  case e: Exception => println(e.message)
}

val directory = new File("/my-unzipped-scorm-package")
try {
  val parser = PackageParser(directory)
  val manifest = parser.parse()
  val errors = ManifestValidator().validate(manifest)
} catch {
  case e: Exception => println(e.message)
}

manifest.item.head.masteryScore match {
  case Some(score) => println("Mastery score is %d".format(score))
  case None        => println("Mastery score not found")
}

manifest.resources.head.href match {
  case Some(href) => println("Entry point on first resource is %s".format(href))
  case None       => println("Entry point on first resource not found")
}

manifest.resources(1).head.href match {
  case Some(href) => println("Entry point on second resource is %s".format(href))
  case None       => println("Entry point on second resource not found")
}

Manifest class

class Manifest (
  var metadata:  Metadata,
  var items:     Seq[Item],
  var resources: Seq[Resource]
)

Metadata class

case class Metadata (
  var schema:        Option[String],
  var schemaVersion: Option[String],
  var scheme:        Option[String]
)

Item class

case class Item (
  var identifier:   String,
  var title:        String,
  var masteryScore: Option[Int]
)

Versions

Version
0.1.0