diff --git a/course/format/scorm/config.php b/course/format/scorm/config.php deleted file mode 100644 index 13bd6d636a9..00000000000 --- a/course/format/scorm/config.php +++ /dev/null @@ -1,11 +0,0 @@ -. /** - * This file contains general functions for the course format SCORM + * This file contains main class for the course format SCORM * - * @since 2.0 - * @package moodlecore + * @since 2.0 + * @package format_scorm * @copyright 2009 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** - * The string that is used to describe a section of the course - * e.g. Topic, Week... + * Main class for the Scorm course format * - * @return string + * @package format_scorm + * @copyright 2012 Marina Glancy + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -function callback_scorm_definition() { - return get_string('scorm'); +class format_scorm extends format_base { + + /** + * The URL to use for the specified course + * + * @param int|stdClass $section Section object from database or just field course_sections.section + * if null the course view page is returned + * @param array $options options for view URL. At the moment core uses: + * 'navigation' (bool) if true and section has no separate page, the function returns null + * 'sr' (int) used by multipage formats to specify to which section to return + * @return null|moodle_url + */ + public function get_view_url($section, $options = array()) { + if (!empty($options['navigation']) && $section !== null) { + return null; + } + return new moodle_url('/course/view.php', array('id' => $this->courseid)); + } + + /** + * Loads all of the course sections into the navigation + * + * @param global_navigation $navigation + * @param navigation_node $node The course node within the navigation + */ + public function extend_course_navigation($navigation, navigation_node $node) { + // Scorm course format does not extend course navigation + } + + /** + * Returns the list of blocks to be automatically added for the newly created course + * + * @return array of default blocks, must contain two keys BLOCK_POS_LEFT and BLOCK_POS_RIGHT + * each of values is an array of block names (for left and right side columns) + */ + public function get_default_blocks() { + return array( + BLOCK_POS_LEFT => array(), + BLOCK_POS_RIGHT => array('news_items', 'recent_activity', 'calendar_upcoming') + ); + } } - -/** - * Toogle display of course contents (sections, activities) - * - * @return bool - */ -function callback_scorm_display_content() { - return false; -} - - diff --git a/course/format/scorm/version.php b/course/format/scorm/version.php index 2583df5f39d..5890e40e5be 100644 --- a/course/format/scorm/version.php +++ b/course/format/scorm/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) -$plugin->requires = 2012061700; // Requires this Moodle version +$plugin->version = 2012110900; // The current plugin version (Date: YYYYMMDDXX) +$plugin->requires = 2012110900; // Requires this Moodle version $plugin->component = 'format_scorm'; // Full name of the plugin (used for diagnostics)