Skip to content

[Bug] SCORM 2004 runtime does not persist cmi.session_time and cmi.total_time #2329

@juwizify

Description

@juwizify

Problem

The SCORM 2004 runtime in frontend/src/pages/SCORMChapter.vue accepts SetValue calls for cmi.session_time and cmi.total_time, but silently discards the values. Only cmi.completion_status, cmi.success_status, and cmi.suspend_data are persisted to LMS Course Progress.

The same issue applies to SCORM 1.2: cmi.core.session_time and cmi.core.total_time are not persisted either.

As a result, the time spent by learners on SCORM content — which is tracked by the SCORM package itself and correctly sent to the LMS via the runtime API — is lost at the LMS layer.

Expected Behavior

The runtime should:

  1. Parse the ISO 8601 duration format (e.g., PT14H32M) sent by SCORM packages
  2. Persist session time and total time to LMS Course Progress
  3. Accumulate session time into total time across multiple learner sessions

Use Case / Impact

We're running a French training organization that is Qualiopi-certified and delivers regulatory e-learning for finance professionals (DDA / IOBSP). These programs legally require 15 hours of provable training per learner per year, audited by French regulators (ACPR) and certification bodies.

Without persisted SCORM time data, we cannot produce the time-attendance evidence required for regulatory audits. This impacts any Frappe LMS deployment used for regulated e-learning in the EU.

Related to / extends #2021.

Proposed Approach

  1. Add two fields to the LMS Course Progress DocType:

    • session_time (Int, seconds, nullable)
    • total_time (Int, seconds, nullable)
  2. In SCORMChapter.vue, extend the SetValue handler for both SCORM 1.2 (window.API) and SCORM 2004 (window.API_1484_11) runtimes:

    • Parse ISO 8601 duration on SetValue for (cmi.core).session_time and (cmi.core).total_time
    • Persist via a new/existing method on lms_course_progress.py
    • Accumulate into total_time across sessions on Terminate/Finish
  3. Backwards-compatible: nullable fields, existing progress records unaffected.

Contribution Offer

We'd like to help move this forward. Two options on our side:

  • A — We submit a PR ourselves. We have development resources ready and will follow the existing code style and testing conventions.
  • B — We sponsor the development if you prefer to implement it in-house.

Happy to align on the preferred path. cc @raizasafeel @pateljannat

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions