Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

SCORM reports

From MoodleDocs
Revision as of 13:38, 14 July 2021 by David Mudrak (talk | contribs) (Text replacement - "<code php>" to "<syntaxhighlight lang="php">")

Moodle 2.2

Introduction

SCORM reports were converted to a pluggable architecture as of MOODLE 2.2. The original documentation of the project can be found at SCORM Reporting Improvements. Scorm Reports define a way for developer to develop reports of their own for the scorm module. The rest of this page deals with the details of how to develop such a report.

Template

Here is a basic template for scorm report plugin on Github

File structure

Each plugin is allowed to have following files and folders:

Mandatory Files

  • classes/report.php
  • lang/xx/scormreport_pluginname.php

Other Optional Files

  • Version.php
  • db/install.php
  • db/install.xml
  • db/upgrade.php
  • db/access.php

Please refer Upgrade API and Access API to understand the working of above files.

As you might have noticed the file structure for scorm report plugin is similar to any other standard plugin in Moodle. The only differences are:-

  • There must be a file classes/report.php implementing class \scormreport_yourreport\report that must extend the default reporting class "\mod_scorm\report" and the extended class must implement the method "display($scorm, $cm, $course, $download)", which should handle the core reporting feature.
  • The lang file is not optional. That is, each plugin must define the string "pluginname" in the lang files.

Naming Conventions

Following Naming conventions should be kept in mind while writing a scorm report plugin:-

  • Folder name should be same as pluginname
  • Name of the extended class should be in format \scormreport_myreport\report
  • \scormreport_myreport\report must implement the function

<syntaxhighlight lang="php">

  function display($scorm, $cm, $course, $download) {}

  • Each plugin must define the string "pluginname" in the language files.

See Also

SCORM Reporting Improvements Original GSOC 2011 Project Documentation

User Docs

Using SCORM

SCORM FAQ

SCORM Module