Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/scorm/backup/moodle2/restore_scorm_activity_task.class.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00024 defined('MOODLE_INTERNAL') || die();
00025 
00026 require_once($CFG->dirroot . '/mod/scorm/backup/moodle2/restore_scorm_stepslib.php'); // Because it exists (must)
00027 
00032 class restore_scorm_activity_task extends restore_activity_task {
00033 
00037     protected function define_my_settings() {
00038         // No particular settings for this activity
00039     }
00040 
00044     protected function define_my_steps() {
00045         // scorm only has one structure step
00046         $this->add_step(new restore_scorm_activity_structure_step('scorm_structure', 'scorm.xml'));
00047     }
00048 
00053     static public function define_decode_contents() {
00054         $contents = array();
00055 
00056         $contents[] = new restore_decode_content('scorm', array('intro'), 'scorm');
00057 
00058         return $contents;
00059     }
00060 
00065     static public function define_decode_rules() {
00066         $rules = array();
00067 
00068         $rules[] = new restore_decode_rule('SCORMVIEWBYID', '/mod/scorm/view.php?id=$1', 'course_module');
00069         $rules[] = new restore_decode_rule('SCORMINDEX', '/mod/scorm/index.php?id=$1', 'course');
00070 
00071         return $rules;
00072 
00073     }
00074 
00081     static public function define_restore_log_rules() {
00082         $rules = array();
00083 
00084         $rules[] = new restore_log_rule('scorm', 'add', 'view.php?id={course_module}', '{scorm}');
00085         $rules[] = new restore_log_rule('scorm', 'update', 'view.php?id={course_module}', '{scorm}');
00086         $rules[] = new restore_log_rule('scorm', 'view', 'player.php?cm={course_module}&scoid={scorm_sco}', '{scorm}');
00087         $rules[] = new restore_log_rule('scorm', 'pre-view', 'view.php?id={course_module}', '{scorm}');
00088         $rules[] = new restore_log_rule('scorm', 'report', 'report.php?id={course_module}', '{scorm}');
00089         $rules[] = new restore_log_rule('scorm', 'launch', 'view.php?id={course_module}', '[result]');
00090         $rules[] = new restore_log_rule('scorm', 'delete attempts', 'report.php?id={course_module}', '[oldattempts]');
00091 
00092         return $rules;
00093     }
00094 
00105     static public function define_restore_log_rules_for_course() {
00106         $rules = array();
00107 
00108         $rules[] = new restore_log_rule('scorm', 'view all', 'index.php?id={course}', null);
00109 
00110         return $rules;
00111     }
00112 }
 All Data Structures Namespaces Files Functions Variables Enumerations