[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 <?php 2 // This file is part of Moodle - http://moodle.org/ 3 // 4 // Moodle is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // Moodle is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16 17 // This page is called via AJAX to repopulte the TOC when LMSFinish() is called. 18 19 require_once('../../config.php'); 20 require_once($CFG->dirroot.'/mod/scorm/locallib.php'); 21 22 $id = optional_param('id', '', PARAM_INT); // Course Module ID, or 23 $a = optional_param('a', '', PARAM_INT); // scorm ID 24 $scoid = required_param('scoid', PARAM_INT); // sco ID 25 $attempt = required_param('attempt', PARAM_INT); // attempt number 26 $mode = optional_param('mode', 'normal', PARAM_ALPHA); // navigation mode 27 $currentorg = optional_param('currentorg', '', PARAM_RAW); // selected organization. 28 29 if (!empty($id)) { 30 if (! $cm = get_coursemodule_from_id('scorm', $id)) { 31 print_error('invalidcoursemodule'); 32 } 33 if (! $course = $DB->get_record("course", array("id" => $cm->course))) { 34 print_error('coursemisconf'); 35 } 36 if (! $scorm = $DB->get_record("scorm", array("id" => $cm->instance))) { 37 print_error('invalidcoursemodule'); 38 } 39 } else if (!empty($a)) { 40 if (! $scorm = $DB->get_record("scorm", array("id" => $a))) { 41 print_error('invalidcoursemodule'); 42 } 43 if (! $course = $DB->get_record("course", array("id" => $scorm->course))) { 44 print_error('coursemisconf'); 45 } 46 if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) { 47 print_error('invalidcoursemodule'); 48 } 49 } else { 50 print_error('missingparameter'); 51 } 52 53 $PAGE->set_url('/mod/scorm/prereqs.php', array('scoid' => $scoid, 'attempt' => $attempt, 'id' => $cm->id)); 54 55 require_login($course, false, $cm); 56 57 $scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR)); // Just to be safe. 58 if (!file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php')) { 59 $scorm->version = 'scorm_12'; 60 } 61 require_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php'); 62 63 64 if (confirm_sesskey() && (!empty($scoid))) { 65 $result = true; 66 $request = null; 67 if (has_capability('mod/scorm:savetrack', context_module::instance($cm->id))) { 68 $result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, false); 69 echo $result->toc; 70 } 71 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |