Note:

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

SCORM reports: Difference between revisions

From MoodleDocs
m (Text replacement - "</code>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 3 users not shown)
Line 20: Line 20:


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:-
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 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.
* 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.
* The lang file is not optional. That is, each plugin must define the string "pluginname" in the lang files.


Line 26: Line 26:
Following Naming conventions should be kept in mind while writing a scorm report plugin:-
Following Naming conventions should be kept in mind while writing a scorm report plugin:-
* Folder name should be same as pluginname
* Folder name should be same as pluginname
* Name of the extended class should be scorm_pluginname_report
* Name of the extended class should be in format \scormreport_myreport\report
* scorm_pluginname_report must implement the function
* \scormreport_myreport\report must implement the function
<code php>
<syntaxhighlight lang="php">
   function display($scorm, $cm, $course, $download) {}
   function display($scorm, $cm, $course, $download) {}
</code>
</syntaxhighlight>
* Each plugin must define the string "pluginname" in the language files.
* Each plugin must define the string "pluginname" in the language files.
== See Also ==
== See Also ==
[https://docs.moodle.org/dev/SCORM_reporting_improvements SCORM Reporting Improvements] Original GSOC 2011 Project Documentation
[https://docs.moodle.org/dev/SCORM_reporting_improvements SCORM Reporting Improvements] Original GSOC 2011 Project Documentation
Line 41: Line 42:
[https://docs.moodle.org/en/SCORM_module SCORM Module]
[https://docs.moodle.org/en/SCORM_module SCORM Module]


[[Category:SCORM]]
[[Category:Tutorial]]
[[Category:Tutorial]]
[[Category:Plugins]]
[[Category:Plugins]]

Latest revision as of 20:20, 14 July 2021

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
   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