Skip to content

Commit

Permalink
Includes SCORM player scope as a site-level configuration option.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidherney committed Jul 20, 2024
1 parent 3f2ba2d commit 62a88a5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @copyright 2019 David Herney Bernal - cirano
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace format_onetopic\privacy;

/**
Expand Down
3 changes: 2 additions & 1 deletion lang/en/format_onetopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
$string['cssweightlighter'] = 'Lighter';
$string['currentsection'] = 'This topic';
$string['defaultscope'] = 'Default scope';
$string['defaultscope_help'] = 'Default scope used to define the pages on which the tab menu is printed.';
$string['defaultscope_help'] = 'Default scope used to define the pages on which the tab menu is printed. The SCORM Player scope require the Modules scope.';
$string['defaultsectionsnavigation'] = 'Default value to sections navigation';
$string['defaultsectionsnavigation_help'] = 'Default value used in courses to define the "Uses sections navigation" feature. This can be overwrite for each course.';
$string['disable'] = 'Disable';
Expand Down Expand Up @@ -117,6 +117,7 @@
$string['progress_full'] = 'Duplicating topic';
$string['rebuild_course_cache'] = 'Rebuild course cache';
$string['scope_mod'] = 'Modules';
$string['scope_scorm'] = 'SCORM Player';
$string['sectionname'] = 'Topic';
$string['sectionsnavigation_both'] = 'At top and bottom section';
$string['sectionsnavigation_bottom'] = 'Only at the bottom';
Expand Down
4 changes: 4 additions & 0 deletions lang/es/format_onetopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
$string['cssstyles'] = 'Propiedades CSS';
$string['cssstyles_help'] = 'Sirve para cambiar las propiedades CSS de la pestaña. Utilice el formato tradicional del atributo <em>style</em> de una etiqueta html. Ejemplo: <br /><strong>font-weight: bold; font-size: 16px;</strong>';
$string['currentsection'] = 'Este tema';
$string['defaultscope'] = 'Alcance predeterminado';
$string['defaultscope_help'] = 'Alcance predeterminado utilizado para definir las páginas adicionales en las que se imprime el menú de pestañas. El alcance del Reproductor SCORM requiere el alcance de los Módulos.';
$string['defaultsectionsnavigation'] = 'Valor por defecto para la navegación de secciones';
$string['defaultsectionsnavigation_help'] = 'Valor por defecto a ser utilizado para definir el comportamiento de la funcionalidad "Usar navegación en secciones". Este valor puede ser sobreescrito por cada curso.';
$string['disable'] = 'Deshabilitar';
Expand Down Expand Up @@ -76,6 +78,8 @@
$string['progress_counter'] = 'Duplicando actividades ({$a->current}/{$a->size})';
$string['progress_full'] = 'Duplicando el tema';
$string['rebuild_course_cache'] = 'Recreando el caché del curso';
$string['scope_mod'] = 'Módulos';
$string['scope_scorm'] = 'Reproductor de SCORM';
$string['sectionname'] = 'Tema';
$string['sectionsnavigation_both'] = 'En la parte superior e inferior de la sección';
$string['sectionsnavigation_bottom'] = 'Usar en la parte inferior';
Expand Down
10 changes: 10 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class format_onetopic extends core_courseformat\base {
/** @var string Course modules scope */
const SCOPE_MOD = 'mod';

/** @var string Scorm modules scope */
const SCOPE_SCORM = 'scorm';

/** @var bool If the class was previously instanced, in one execution cycle */
private static $loaded = false;

Expand Down Expand Up @@ -143,6 +146,13 @@ protected function __construct($format, $courseid) {
$this->currentscope = self::SCOPE_MOD;
$patternavailable = '/^mod-.*-view$/';
$this->printable = preg_match($patternavailable, $PAGE->pagetype);

if (!$this->printable) {
if (in_array(self::SCOPE_SCORM, $scope) && $PAGE->pagetype == 'mod-scorm-player') {
$this->printable = true;
}
}

} else {
$this->printable = false;
}
Expand Down
1 change: 1 addition & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

$options = [
\format_onetopic::SCOPE_MOD => new lang_string('scope_mod', 'format_onetopic'),
\format_onetopic::SCOPE_SCORM => new lang_string('scope_scorm', 'format_onetopic'),
];
$settings->add(new admin_setting_configmulticheckbox('format_onetopic/defaultscope',
get_string('defaultscope', 'format_onetopic'),
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024050901; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2024050901.01; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2024041600; // Requires this Moodle version.
$plugin->component = 'format_onetopic'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_BETA;
Expand Down

0 comments on commit 62a88a5

Please sign in to comment.