3 * Sets up the tabs used by the scorm pages based on the users capabilities.
5 * @author Dan Marsden and others.
6 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
11 error('You cannot call this script in that way');
13 if (!isset($currenttab)) {
17 $cm = get_coursemodule_from_instance('scorm', $scorm->id
);
21 $contextmodule = get_context_instance(CONTEXT_MODULE
, $cm->id
);
28 if (has_capability('mod/scorm:savetrack', $contextmodule)) {
29 $row[] = new tabobject('info', "$CFG->wwwroot/mod/scorm/view.php?id=$cm->id", get_string('info', 'scorm'));
31 if (has_capability('mod/scorm:viewreport', $contextmodule)) {
32 $row[] = new tabobject('reports', "$CFG->wwwroot/mod/scorm/report.php?id=$cm->id", get_string('results', 'scorm'));
35 if ($currenttab == 'info' && count($row) == 1) {
36 // Don't show only an info tab (e.g. to students).
41 print_tabs($tabs, $currenttab, $inactive, $activated);