RevLearning¶
A lightweight learning-runtime abstraction for Unity.
RevLearning gives your content a consistent API for talking to learning standards, so your code depends on RevLearning rather than on any one LMS: SCORM 1.2 and SCORM 2004 behind ILmsRuntime / IScormDataModel, plus a parallel IXApiRuntime for xAPI statement delivery. Your content decides what happened; RevLearning reports it; the LMS records it.
RevLearning is not a learning system. It is a bridge between your content and the LMS. See
RevLearning_Mental_Model.md.
Features¶
- One API per family — SCORM 1.2 and SCORM 2004 behind
ILmsRuntime/IScormDataModel, so content written once runs under either standard; xAPI alongside them throughIXApiRuntime. - Editor stub runtime — develop and test learning flows without an LMS; the stub is used automatically in the Editor and on non-WebGL platforms.
- Learner state helpers — status, score (incl. SCORM 2004 scaled score), bookmarks, completion, objectives, and interactions via extension methods.
- Safe suspend data — automatic JSON storage against the standard's
suspend_datalimits, compressed to fit; a payload that still will not fit is refused and reported rather than trimmed, because a trimmed one will not deserialize and would destroy the last save that did. - Resumable sessions — exit/resume control (
SuspendAsync,LmsExit). - Resilient xAPI delivery — FIFO queue with exponential-backoff retry and persistence (PlayerPrefs / IndexedDB on WebGL).
- Packaging workflow — single-SCO
imsmanifest.xmlbuilder, post-build packaging, an LMS validator window, and a page helper that commits learner progress when the tab closes. - Error visibility —
ILmsRuntime.LastErrormirrors the SCORMGetLastError/LMSGetLastErrorvalue.
Requirements¶
- Unity 2021.3 or newer (see Compatibility for what is verified)
- WebGL build target for LMS deployment (Editor/standalone use the stub runtime)
Installation¶
RevLearning is licensed software — see LICENSE.md. Installation requires access granted under your agreement with RevGaming; the instructions below assume you have it.
Unity Package Manager → Add package from git URL…, or in Packages/manifest.json:
Samples are imported on demand from the package's entry in Package Manager rather than compiled into your project by default.
Quickstart¶
using System;
using UnityEngine;
using RevGaming.RevLearning;
public sealed class CourseRunner : MonoBehaviour
{
private ILmsRuntime _runtime;
private async void Start()
{
// Version comes from the synchronized runtime config asset.
var config = Resources.Load<RevLearningRuntimeConfig>("RevLearning_RuntimeConfig");
var version = config ? config.defaultVersion : LmsVersion.Scorm2004;
_runtime = await RevLearningRuntime.InitializeAsync(version);
if (_runtime?.Cmi == null)
return; // not connected — handle gracefully
// Report learner state. Your content decides these values.
_runtime.Cmi.LessonLocation = "Module1/Scene1";
_runtime.Cmi.ScoreMax = 100;
_runtime.Cmi.ScoreRaw = 85;
_runtime.Cmi.LessonStatus = LessonStatus.Completed;
_runtime.Cmi.SessionTime += TimeSpan.FromSeconds(30);
// Commit returns false when the LMS refused to persist. Every refused
// write is already logged with the decoded LMS error, so a course only
// needs to react to the ones it cares about.
if (!await _runtime.CommitAsync())
Debug.LogError($"[Course] progress was not saved: {_runtime.DescribeLastError()}");
}
}
LastError reflects the most recent call only, so check it after the write you care about rather than once at the end of a batch:
_runtime.Cmi.ScoreRaw = 85;
if (_runtime.LastError != LmsError.None)
Debug.LogError($"[Course] score rejected: {_runtime.DescribeLastError()}");
A write that RevLearning blocks before it reaches the LMS — after FinishAsync, or outside a live session — does not refresh LastError, because the LMS was never asked. Those are reported as warnings in the console instead. So a single LastError check after several writes can read None precisely when writes are being discarded, which is why the quickstart above checks the commit result.
See the Samples folder for complete SCORM and xAPI examples (QuickstartExample, QuickstartResumeExample, XApiQuickstartExample).
Documentation¶
- Mental Model — how to think about RevLearning.
- FAQ — integration, configuration, and LMS behaviour.
- Changelog
Compatibility¶
Unity¶
Verified on 2021.3.45f2 and 6000.3.5f2. On both: the full test suite compiles and passes, a WebGL player builds, and the post-build packer produces a SCORM package that passes Tests~/tools/validate-package.py. CI runs the suite on 6000.3.
Editors between the two are expected to work — nothing in the package uses a Unity API newer than 2020.2 or a C# feature above version 9 — but are not individually verified.
WebGL is the build target for LMS deployment; the Editor and other platforms use the stub runtime.
LMS platforms¶
RevLearning is LMS-agnostic and targets any LMS that can host SCORM or xAPI content.
Both standards have been run end-to-end on SCORM Cloud against this release: import, initialization, score, completion and success, objectives, interactions including incorrect answers, suspend and resume, exit modes, commit and terminate. The step-by-step results — including the two defects that run found, and the steps it did not cover — are recorded in Tests~/CONFORMANCE.md, along with the checklist itself so you can repeat it on your own platform.
An earlier validation on Thrive LXP is not claimed here: it predates a correctness pass that deliberately changed how completion, success, exit modes and interactions are reported, so it no longer describes this code.
Platforms differ in how they interpret completion, success, attempts and bookmarking, and those differences are not always documented. Validate against the LMS your learners will actually use before you rely on it.
Cmi.PassingScore is null for packages built by the in-box packer: the manifest carries no mastery score, and there is no setting to add one, so the LMS has nothing to report. Decide pass and fail in your content.
Not covered: multi-SCO packages, sequencing and navigation, attempt management, and the xAPI State and Profile APIs. See the FAQ for the full list and for CORS and hosting-header guidance, which are the two most common deployment failures.
License¶
Proprietary — © 2026 RevGaming. All rights reserved. See LICENSE.md.