parent
61e82178aa
commit
e6a60b5e0c
@ -1,54 +0,0 @@ |
||||
<?php // $Id: XMLencode.php 4083 2005-04-06 19:54:16Z yannoo $
|
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2005 Dokeos S.A. |
||||
Copyright (c) 2005 Warnier Yannick |
||||
Copyright (c) 2004 Denes Nagy |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
* Gets the encoding of the XML file given |
||||
* @param string File path |
||||
* @return string Encoding found |
||||
* @author imandak80, main author |
||||
* @author Yannick Warnier <ywarnier@beeznest.org>, fixes |
||||
* @date unknown, reviewed on 6 April 2005 |
||||
*/ |
||||
function GetXMLEncode($file) |
||||
{ |
||||
if (!($fp = fopen($file, "r"))) { |
||||
echo "could not open XML input : $file"; |
||||
} |
||||
|
||||
$fline = fgets($fp); |
||||
|
||||
// if some Windows special chars are found, return Windows encoding |
||||
fseek($fp,0); |
||||
$thefile=fread($fp,filesize($file)); |
||||
if (strpos($thefile,'é') or strpos($thefile,'ë')) { return('windows-1252'); } |
||||
|
||||
// else get the string located between double quotes after string "ing=" (for "encoding") |
||||
$match = array(); //initialize result var |
||||
preg_match('/encoding="([0-9a-zA-Z-]*)"/i',$fline,$match); //find quoted encoding |
||||
return $match[1]; // return with encoding type |
||||
} |
||||
?> |
@ -1,17 +0,0 @@ |
||||
<?php //$id: $
|
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
?> |
||||
<html> |
||||
<head> |
||||
<link rel='stylesheet' type='text/css' href='../css/scorm.css'> |
||||
</head> |
||||
<body> |
||||
<br><div class='message'> |
||||
|
||||
</div> |
||||
</body> |
||||
</html> |
@ -1,210 +0,0 @@ |
||||
<?php // $id: $
|
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
|
||||
// incoming data from scormfunctions.js : $score - $max - $min - $lesson_status - $time |
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
//include('XMLencode.php'); |
||||
//$charset = GetXMLEncode($_GET['file']); |
||||
header('Content-Type: text/html; charset='. $charset); |
||||
//error_log($_SERVER['REQUEST_URI'],0); |
||||
//error_log("Starting closesco",0); |
||||
|
||||
$lesson_status = $_GET['lesson_status']; |
||||
$score = $_GET['score']; |
||||
$time = $_GET['time']; |
||||
$my_sco_identifier = $_GET['sco_identifier']; |
||||
$contentId = $_SESSION['contentId']; |
||||
$items = $_SESSION['items']; |
||||
$origin = $_GET['origin']; |
||||
$max = $_GET['max']; |
||||
$min = $_GET['min']; |
||||
$file = $_GET['file']; |
||||
|
||||
$charset_lang = 'ISO-8859-15'; |
||||
|
||||
$array_status=array('completed' => htmlentities(get_lang('ScormCompstatus'),ENT_QUOTES,$charset_lang), |
||||
'passed' => htmlentities(get_lang('ScormPassed'),ENT_QUOTES,$charset_lang), |
||||
'failed' => htmlentities(get_lang('ScormFailed'),ENT_QUOTES,$charset_lang), |
||||
'incomplete' => htmlentities(get_lang('ScormIncomplete'),ENT_QUOTES,$charset_lang), |
||||
'not attempted' => htmlentities(get_lang('ScormNotAttempted'),ENT_QUOTES,$charset_lang)); |
||||
//although we defined 'not attempted' here as a common status, it shouldn't be used in |
||||
// the context of this script, which is only for content closing purposes |
||||
|
||||
//save this sco-id in session so that we can check what last sco has been closed |
||||
$_SESSION['last_sco_closed'] = $my_sco_identifier; |
||||
|
||||
if ($lesson_status=='') { $lesson_status='incomplete'; } |
||||
|
||||
$TBL_SCORM_SCO_DATA = Database::get_scorm_sco_data_table(); |
||||
|
||||
//prepare a small reverse-index of "clusterinfo"=>"item index" |
||||
$items_clusterinfo_dictionary = array(); |
||||
foreach($items as $key=>$content){ |
||||
$items_clusterinfo_dictionary[$content['clusterinfo']]=$key; |
||||
} |
||||
|
||||
if($_SESSION['dont_save_last']!=true){ |
||||
//error_log("Element $my_sco_identifier can be saved (no conditions preventing it)",0); |
||||
//check if there are dependent clusters |
||||
$sub_cluster_completed = true; |
||||
$base_child_cluster = $items[$_SESSION['items_dictionary'][$my_sco_identifier]]['clusterinfo']*10; |
||||
for ($i = $base_child_cluster; $i<($base_child_cluster+10);$i++){ |
||||
$j = $items_clusterinfo_dictionary[$i]; |
||||
if(is_array($items[$j])){ |
||||
//error_log('items['.$j.'] is an array',0); |
||||
$sql = "SELECT status FROM $TBL_SCORM_SCO_DATA |
||||
WHERE (contentId='$contentId' and studentId='".$_user['user_id']."' and scoIdentifier='".$items[$j]['identifier']."')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$ar=mysql_fetch_array($result); |
||||
$sub_lesson_status=$ar['status']; |
||||
//error_log('status: '.$sub_lesson_status,0); |
||||
if ((($sub_lesson_status)<>'completed') and ($sub_lesson_status <> 'passed' )) { $sub_cluster_completed=false; } |
||||
} |
||||
} |
||||
if($sub_cluster_completed){ |
||||
//error_log("Element $my_sco_identifier has no incomplete children, change status to $lesson_status",0); |
||||
$sql="UPDATE $TBL_SCORM_SCO_DATA SET score='$score', status='$lesson_status', time='$time' WHERE (studentId='".$_user['user_id']."' and scoIdentifier='$my_sco_identifier' and contentId='$contentId')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
//error_log($sql,0); |
||||
}else{ |
||||
//error_log("Element $my_sco_identifier has incomplete children, set status to incomplete)",0); |
||||
$sql="UPDATE $TBL_SCORM_SCO_DATA SET score='$score', status='incomplete', time='$time' WHERE (studentId='".$_user['user_id']."' and scoIdentifier='$my_sco_identifier' and contentId='$contentId')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
} |
||||
}else{ |
||||
//error_log("Element $my_sco_identifier cannot be saved (restart conditions preventing it)",0); |
||||
} |
||||
/*================================================================================== |
||||
SEARCHING FOR COMPLETE CLUSTERS AND IF ANY, UPDATE THEM TO COMPLETED IF NECCESSARY |
||||
==================================================================================*/ |
||||
|
||||
//if ($lesson_status=='completed') { |
||||
$clustercompleted=true; |
||||
//$i=0; //get to the current element |
||||
$i = $_SESSION['items_dictionary'][$my_sco_identifier]; |
||||
//do { |
||||
// $i++; |
||||
//} while (($items[$i]['identifier'] != $my_sco_identifier) and ($i <= count($items))); |
||||
// now $i is the index of the current element |
||||
//$items[$i]['status'] = $lesson_status; |
||||
//api_session_unregister($items); |
||||
//api_session_register($items); |
||||
|
||||
|
||||
//now check if the current element completes the cluster |
||||
//a. get the parent's clusterinfo (if clusterinfo = 23, parent is 2) |
||||
$startcluster=floor(($items[$i]['clusterinfo'])/10); |
||||
//b. get through all elements of the same cluster (all elements with clusterinfo of 2* - max 10 elems) |
||||
for ($cluster=($startcluster*10); (($cluster<=($startcluster*10+9)) && ($clustercompleted==true)); $cluster++) { |
||||
//$i=0; |
||||
//do { |
||||
// $i++; |
||||
//} while (($items[$i]['clusterinfo'] != $cluster) and ($i <= count($items))); |
||||
//get index of parent cluster |
||||
$i = (!empty($items_clusterinfo_dictionary[$cluster])?$items_clusterinfo_dictionary[$cluster]:0); |
||||
$id=$items[$i]['identifier']; |
||||
$sql = "SELECT status FROM $TBL_SCORM_SCO_DATA |
||||
WHERE (contentId='$contentId' and studentId='".$_user['user_id']."' and scoIdentifier='$id')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$ar=mysql_fetch_array($result); |
||||
$cluster_lesson_status=$ar['status']; |
||||
if ((is_array($items[$i])) and ((($cluster_lesson_status)<>'completed') and ($cluster_lesson_status <> 'passed' ))) { $clustercompleted=false; } |
||||
} |
||||
|
||||
if ($clustercompleted) { //if every sub-element of this cluster was completed |
||||
//$i=0; |
||||
//do { |
||||
// $i++; |
||||
//} while (($items[$i]['clusterinfo'] != $startcluster) and ($i <= count($items))); |
||||
$i = (!empty($items_clusterinfo_dictionary[$startcluster])?$items_clusterinfo_dictionary[$startcluster]:0); |
||||
$my_sco_identifier=$items[$i]['identifier']; |
||||
$sql="UPDATE $TBL_SCORM_SCO_DATA SET status='completed' WHERE (studentId='".$_user['user_id']."' and scoIdentifier='$my_sco_identifier' and contentId='$contentId')"; |
||||
//echo $sql; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
} else { // if at least one element was not completed |
||||
//$i=0; |
||||
//do { |
||||
// $i++; |
||||
//} while (($items[$i]['clusterinfo'] != $startcluster) and ($i <= count($items))); |
||||
$i = (!empty($items_clusterinfo_dictionary[$startcluster])?$items_clusterinfo_dictionary[$startcluster]:0); |
||||
$my_sco_identifier=$items[$i]['identifier']; |
||||
$sql="UPDATE $TBL_SCORM_SCO_DATA SET status='incomplete' WHERE (studentId='".$_user['user_id']."' and scoIdentifier='$my_sco_identifier' and contentId='$contentId')"; |
||||
//echo $sql; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
} |
||||
//} |
||||
|
||||
//$origin can be 'terminate', 'finish' or 'commit' |
||||
|
||||
/*============================================= |
||||
SENDING MESSAGE ABOUT STATUS TO MESSAGE FRAME |
||||
=============================================*/ |
||||
?> |
||||
<html><head><link rel='stylesheet' type='text/css' href='../css/scorm.css'> |
||||
<script type='text/javascript'> |
||||
/* <![CDATA[ */ |
||||
function reloadcontents() { |
||||
newloc=addtime(parent.contents.document.location); |
||||
top.contents.document.location=newloc; //in order to refresh |
||||
} |
||||
function addtime(input) { |
||||
rnd=Math.random()*100; |
||||
if (input.toString().indexOf("#")==-1) { |
||||
newstring=input+'&rnd='+rnd; |
||||
return(newstring); |
||||
} else { |
||||
t=input.toString().indexOf("#"); |
||||
sub1=input.toString().substr(0,t); |
||||
sub2=input.toString().substr(t,input.length); |
||||
newstring=sub1+'&rnd='+rnd+sub2; |
||||
return(newstring); |
||||
} |
||||
} |
||||
/* ]]> */ |
||||
</script> |
||||
</head><body onload='javascript:reloadcontents();'> |
||||
|
||||
<?php |
||||
if (($lesson_status=='completed') or ($lesson_status=='passed')) |
||||
{ |
||||
//echo "<img src='../img/right.gif' alt='right'>"; |
||||
echo "<div class='message'>" |
||||
.htmlentities(get_lang('ScormThisStatus'),ENT_QUOTES,$charset_lang)." : ".$array_status[$lesson_status] |
||||
." </div>"; |
||||
} |
||||
else |
||||
{ |
||||
//echo "<img src='../img/wrong.gif' alt='wrong'>"; |
||||
echo "<div class='message'>" |
||||
.htmlentities(get_lang('ScormThisStatus'),ENT_QUOTES,$charset_lang)." : ".$array_status[$lesson_status] |
||||
."</div>"; |
||||
} |
||||
echo "</body></html>"; |
||||
?> |
@ -1,780 +0,0 @@ |
||||
<?php //$id: $
|
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* Show the table of contents of a scorm-based tutorial |
||||
* |
||||
* This script is a double-pass script. When called, it initialises stuff |
||||
* (generally depending on $menu or $openfirst parameters), then calls |
||||
* the opensco.php script which opens the content in another frame and |
||||
* calls this script back without any action parameter. |
||||
* @author Denes Nagy <darkden@freemail.hu> |
||||
* @author Yannick Warnier <yannick.warnier@dokeos.com> |
||||
* @access public |
||||
* |
||||
* @package dokeos.scorm |
||||
* |
||||
============================================================================== |
||||
*/ |
||||
|
||||
//Initialisation includes |
||||
$langFile = "scorm"; |
||||
require('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
include_once(api_get_path(LIBRARY_PATH).'database.lib.php'); |
||||
include('XMLencode.php'); |
||||
include('scormparsing.lib.php'); |
||||
|
||||
//error_log($_SERVER['REQUEST_URI']."---menu=".$_POST['menu'],0); |
||||
//error_log("---Script started. s_identifier is now:".$_SESSION['s_identifier']." and old s_identifier is now:".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
//Parameters reception |
||||
$edoceo = $_GET['edoceo']; |
||||
$openDir = $_REQUEST['openDir']; |
||||
$menu = $_REQUEST['menu']; |
||||
$openfirst = $_REQUEST['openfirst']; |
||||
//$request_file must be like this : http://localhost/root/Dokeos/Scorm_content1/imsmanifest.xml |
||||
//with SERVER_NAME (=127.0.0.1) it does not work |
||||
$request_file = $_REQUEST['file']; |
||||
// Check if the requested file is in the right location (scorm folder in course directory and no .. in the path) |
||||
$file_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm'; |
||||
if(substr($request_file,0,strlen($file_path)) != $file_path || strpos($request_file,'..') > 0) |
||||
{ |
||||
api_not_allowed(); |
||||
} |
||||
|
||||
//Charset settings (very important for imported contents) |
||||
$charset = GetXMLEncode($_GET['file']); |
||||
header('Content-Type: text/html; charset='. $charset); |
||||
//The following charset describes the encoding of most language files |
||||
//For further enhancements and in order to ensure internationalisation, we |
||||
//should make every language file UTF-8, or adapt get_lang to be able to sort |
||||
//out the file encoding and use htmlentities if required. |
||||
//If using unicode characters (courses in non-european alphabets), change this |
||||
//to $charset_lang = 'UTF-8'; |
||||
$charset_lang = 'ISO-8859-15'; |
||||
|
||||
//Latest language inits |
||||
$array_status=array( |
||||
'completed' => get_lang('ScormCompstatus'), |
||||
'passed' => get_lang('ScormPassed'), |
||||
'failed' => get_lang('ScormFailed'), |
||||
'incomplete' => get_lang('ScormIncomplete'), |
||||
'not attempted' => get_lang('ScormNotAttempted') |
||||
); |
||||
|
||||
|
||||
//Database table names init |
||||
$TBL_SCORM_MAIN = Database :: get_scorm_table(SCORM_MAIN_TABLE); |
||||
$TBL_SCORM_SCO_DATA = Database::get_scorm_sco_data_table(); |
||||
|
||||
//if the last sco visited hasn't been closed, mark it complete: |
||||
if(!empty($_SESSION['last_sco_closed']) && !empty($_SESSION['old_sco_identifier'])){ |
||||
if($_SESSION['last_sco_closed'] != $_SESSION['old_sco_identifier']){ |
||||
$sql = "SELECT status FROM $TBL_SCORM_SCO_DATA |
||||
WHERE contentId='".$_SESSION['contentId']."' |
||||
and scoIdentifier='".$_SESSION['old_sco_identifier']."' |
||||
and studentId='".$_SESSION['_uid']."'"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
if(mysql_num_rows($result)==1){ |
||||
$my_row = mysql_fetch_row($result); |
||||
$my_status=$my_row[0]; |
||||
if($my_status == 'not attempted'){ |
||||
$sql = "UPDATE $TBL_SCORM_SCO_DATA |
||||
SET score='0', status='completed', time='00:00' |
||||
WHERE (studentId='".$__SESSION['_uid']."' |
||||
and scoIdentifier='".$_SESSION['old_sco_identifier']."' |
||||
and contentId='".$_SESSION['contentId']."')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$_SESSION['last_sco_closed'] = $_SESSION['old_sco_identifier']; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
//Backup latest SCO-identifier opened (to use as reference to the last element seen in closesco.php) |
||||
//This operation needs only to be done when the user takes an action, not on automatic reloading |
||||
//of the script. This is checked with the $menu parameter (set on user actions) |
||||
|
||||
$_SESSION['old_sco_identifier'] = $_SESSION['s_identifier']; |
||||
|
||||
//Special condition to avoid buggy database refresh in case of restart (see closesco.php) |
||||
if($_SESSION['just_started']==true){ |
||||
//error_log("Content was just started - prevent saving last element",0); |
||||
$_SESSION['dont_save_last']=true; |
||||
$_SESSION['just_started']=false; |
||||
}else{ |
||||
//error_log("Content was not just started - allow saving last element",0); |
||||
$_SESSION['dont_save_last']=false; |
||||
} |
||||
|
||||
|
||||
//Ensure the items array (TOC) and other session variables are really erased on first visit or on restart |
||||
if ($openfirst == 'yes' or $menu == 'restart'){ |
||||
//error_log("Openfirst or restart was set (unset session[s_identifier] and session[old_sco_identifier]",0); |
||||
//api_session_unregister('items'); |
||||
$_SESSION['items'] = array(); |
||||
$items = array(); |
||||
$_SESSION['items_dictionary'] = array(); |
||||
$items_dictionary = array(); |
||||
$_SESSION['defaultorgtitle'] = ''; |
||||
$defaultorgtitle = ''; |
||||
$_SESSION['contentId'] = ''; |
||||
if($menu == 'restart'){ |
||||
$_SESSION['just_started']=true; |
||||
} |
||||
unset($_SESSION['s_identifier']); |
||||
unset($_SESSION['sco_identifier']); |
||||
unset($_SESSION['old_sco_identifier']); |
||||
}else{ |
||||
//error_log("Openfirst or restart was NOT set",0); |
||||
$items = $_SESSION['items']; |
||||
$defaultorgtitle = $_SESSION['defaultorgtitle']; |
||||
if(!empty($menu)){ |
||||
$_SESSION['just_started']=false; |
||||
} |
||||
} |
||||
|
||||
//HTML start |
||||
|
||||
$output = '<html> |
||||
<head> |
||||
<link rel="stylesheet" type="text/css" href="../css/scorm.css"> |
||||
</head> |
||||
<body>'; |
||||
|
||||
//incoming variables : |
||||
//- $request_file |
||||
//- $tabledraw -> if true, then the program draws a help table for showing imsmanifest.xml tags (technical) |
||||
|
||||
|
||||
// More init (display tweaks) |
||||
$tabledraw=false; //if true, then technical information is shown |
||||
$wrap=true; //if false then the toc is not in a table, if true, then it is |
||||
$tablewidth=255; //this is the width of the content tables |
||||
|
||||
$defaultorgref=''; |
||||
$version='0.0'; |
||||
$inorg=false; //whether we are inside an organisation or not |
||||
$intitle=$inmeta=$ingeneral=false; |
||||
$inversion=false; |
||||
$prereq=false; |
||||
$initem=0; //how deep we are in the hieracrchy of itmes |
||||
$itemindex=0; |
||||
$previouslevel=1; |
||||
$clusterinfo=0; |
||||
|
||||
$exit_after_menu = false; //used to disable printing of javascript redirections in output. |
||||
|
||||
/** |
||||
* This function displays a message in the message frame. |
||||
* |
||||
* For some reason (apparently JavaScript reasons), the message shown |
||||
* cannot be more than 66 characters. Together with the enveloppe, it |
||||
* gets to something around 250 characters, which apparently is too |
||||
* big for the "write" method |
||||
* @param string The message to show. Should be smaller than 66 characters. |
||||
* @return void Doesn't return anything, just writes to the message frame. |
||||
*/ |
||||
function message($text) { |
||||
//ugly little patch for text encoding of accentuated characters - see other comments on 'accentuated' characters |
||||
// and improvements to this patch below in this file |
||||
#global $charset_lang; |
||||
#$text = htmlentities($text,ENT_QUOTES,$charset_lang); |
||||
$string = "<script type='text/javascript'>\n/* <![CDATA[ */\n". |
||||
"zwindow=open('','message');". |
||||
"s='<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"../css/scorm.css\"></head><body>". |
||||
"<div class=\"message\">$text</div></body></html>';". |
||||
"z=zwindow.document;". |
||||
"z.write(s);". |
||||
"z.close();". |
||||
"\n/* ]]> */\n</script>"; |
||||
return $string; |
||||
} |
||||
|
||||
|
||||
|
||||
/****************************************** PROCESSING **********************************/ |
||||
//Real processing starts here |
||||
|
||||
//1. Check whether we need to build the TOC ($items array) or if it already exists |
||||
if($openfirst=='yes' or $menu=='restart'){ |
||||
//error_log("Openfirst or restart was set (generate $items)",0); |
||||
|
||||
/*==================== |
||||
PARSING THE XML FILE |
||||
====================*/ |
||||
//1.1 |
||||
if (!(list($xml_parser, $fp) = new_xml_parser($request_file))) { |
||||
die("<font color='red'>Error : could not open XML input - $request_file</font>"); |
||||
} |
||||
|
||||
//my variables : $xml_parser, new_xml_parser() |
||||
|
||||
if ($tabledraw) { |
||||
$output .= "<table border='0'>" |
||||
."<tr>" |
||||
."<td>Row</td>" |
||||
."<td>Inorg</td>" |
||||
."<td>Initem</td>" |
||||
."<td>Tag name</td>" |
||||
."<td>Attributes</td>" |
||||
."</tr>"; |
||||
} |
||||
|
||||
while ($data = fread($fp, 4096)) { //reads the file in 4096 byte amounts |
||||
if (!xml_parse($xml_parser, $data, feof($fp))) { |
||||
die(sprintf("XML error: %s at line %d\n", |
||||
xml_error_string(xml_get_error_code($xml_parser)), |
||||
xml_get_current_line_number($xml_parser))); |
||||
} |
||||
} |
||||
if ($tabledraw) { |
||||
$output .= "</table>"; |
||||
$output .= "parse complete<br /><hr />"; |
||||
$output .= "<br />Total lines in xml file : "; |
||||
$output .= xml_get_current_line_number($xml_parser); |
||||
$output .= " (xml_get_current_line_number)"; |
||||
$output .= "<br /><br />"; |
||||
} |
||||
|
||||
//build an index of items (item identifier => item index in $items). This should improve parsing speed. |
||||
foreach($items as $key => $content){ |
||||
$items_dictionary[$content['identifier']] = $key; |
||||
} |
||||
$_SESSION['items_dictionary'] = $items_dictionary; |
||||
|
||||
//As we asked to start from the beginning, set the current identifier to the first elem's |
||||
$i=1; |
||||
for(;$items[$i]['href']=='';$i++){ |
||||
/*do nothing (get the index of the first item of href<>'')*/ |
||||
} |
||||
$_SESSION['s_identifier'] = $items[$i]['identifier']; |
||||
$href=api_get_path('WEB_COURSE_PATH').$_course['path']."/scorm".$openDir."/".$items[$i]['href']; |
||||
//error_log("New s_identifier calculated: ".$_SESSION['s_identifier']." - Old one is: ".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
//2. Compute the maximum depth level ot the TOC. |
||||
// For fixed width : width=$tablewidth (in two tables) and enable nbsp substitution in two places |
||||
// $items is a result of the imsmanifest.xml parsing |
||||
$maxlevel=1; |
||||
$i=1; |
||||
|
||||
while ($items[$i]) { |
||||
if (($items[$i]['level'])>$maxlevel) { $maxlevel=$items[$i]['level']; } |
||||
$i++; |
||||
} |
||||
|
||||
|
||||
|
||||
//3. Check if the content was ever opened or not, |
||||
// If not, add a line to scorm_main with the title and course code to record its existence |
||||
$sql = "SELECT dokeosCourse FROM $TBL_SCORM_MAIN WHERE " |
||||
." (contentTitle='".$openDir."' and dokeosCourse='".$_course['official_code']."')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$numrows = mysql_num_rows($result); |
||||
|
||||
if ($numrows==0) { //this means that this Scorm content was never opened by anyone in this dokeos course |
||||
//$result = api_sql_query("SELECT MAX(contentId) FROM $TBL_SCORM_MAIN"); |
||||
//$ar = mysql_fetch_array($result); |
||||
//$maxcontentId = $ar['MAX(contentId)']+1; |
||||
$sql = "INSERT INTO $TBL_SCORM_MAIN (contentTitle, dokeosCourse) VALUES " |
||||
." ('".$openDir."','".$_course['official_code']."')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
} |
||||
|
||||
//4. Get the contentId for this content (whether it has just been inserted or not) to check if the |
||||
// current user ever opened it. |
||||
$sql = "SELECT contentId FROM $TBL_SCORM_MAIN " |
||||
." WHERE (contentTitle='".$openDir."' and dokeosCourse='".$_course['official_code']."')"; |
||||
|
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$ar = mysql_fetch_array($result); |
||||
$mycontentId = $ar['contentId']; //it has to exist, because the previous step checked it existed and if not inserted it |
||||
$_SESSION['contentId'] = $mycontentId; |
||||
|
||||
$everopened = true; |
||||
$numrows2 = 0; |
||||
$result2=''; |
||||
$sql2 = "SELECT * FROM $TBL_SCORM_SCO_DATA WHERE (studentId='".$_user['user_id']."' and contentId='$mycontentId')"; |
||||
$result2 = api_sql_query($sql2,__FILE__,__LINE__); |
||||
$numrows2 = mysql_num_rows($result2); |
||||
|
||||
if ($numrows2 == 0) { //this means that this Scorm content was not opened by the current student |
||||
$everopened = false; |
||||
} |
||||
|
||||
|
||||
/*if($openfirst=='yes' or $menu='restart'){ |
||||
$s_identifier = $items[1]['identifier']; |
||||
$href=api_get_path('WEB_COURSE_PATH').$_course['path']."/scorm".$openDir."/".$items[1]['href']; |
||||
$output .= "<script type='text/javascript'>", |
||||
"nextwindow=open('opensco.php?sco_href=$href&sco_identifier=$s_identifier&file=$request_file&edoceo=$edoceo&openDir=$openDir','message');", |
||||
"</script>"; |
||||
}*/ |
||||
|
||||
|
||||
|
||||
/*========================= |
||||
IF RESTART WAS CLICKED... |
||||
=========================*/ |
||||
//5 If the user clicked on "restart", the $items array has been cleaned |
||||
// and no element has any special mark whatsoever, except the first one which is highlighted |
||||
if ( $menu == 'restart' ) { //Restrart clicked |
||||
//error_log("Restart was set...",0); |
||||
if ( $version == '1.1' ) { |
||||
//5.1.a Ignore if version of SCORM is <1.2 (or that's basically what is intended) |
||||
//display warning message in message frame (side-menu bottom) |
||||
$output .= message(htmlentities(get_lang('ScormNoStatus'),ENT_QUOTE,$charset_lang)); |
||||
} else { |
||||
//error_log("Update database for restart",0); |
||||
//5.1.b.1 Loads a blank page in the "sco" frame, probably to enable scorm API reinit |
||||
//$output .= "<script type='text/javascript'> |
||||
// xwindow=open('about:blank','sco'); |
||||
// </script>"; |
||||
|
||||
//5.1.b.2 update the status for the current user and content in the SCORM data table |
||||
$sql = "UPDATE $TBL_SCORM_SCO_DATA SET score='0', status='not attempted', time='00:00' " |
||||
." WHERE (studentId='".$_user['user_id']."' and contentId='$mycontentId')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
//5.1.b.3 clean session vars about this content |
||||
api_session_unregister('s_href'); |
||||
$i=1; |
||||
for(;$items[$i]['href']=='';$i++){/*do nothing, just get the index of first elem with href*/} |
||||
$_SESSION['s_identifier'] = $items[$i]['identifier']; |
||||
//error_log("New s_identifier generated: ".$_SESSION['s_identifier'],0); |
||||
//api_session_unregister('s_identifier'); |
||||
//5.1.b.4 display info message in message frame (side-menu bottom) |
||||
//$output .=message("<img src=\'../img/restart.jpg\' alt='restart'/>".get_lang('ScormRestarted'));//the img tag fails because of the htmlentities() call in message() |
||||
//$output .=message(htmlentities(get_lang('ScormRestarted'),ENT_QUOTES,$charset_lang)); |
||||
} |
||||
//that's all for the special "restart" treatment, although it includes loading the scorm document - see rest of script |
||||
|
||||
}elseif (($menu=='prev') or ($menu=='next')) { |
||||
//error_log("Menu was 'prev' or 'next'",0); |
||||
|
||||
/*============================== |
||||
IF PREV OR NEXT WAS CLICKED... |
||||
==============================*/ |
||||
//5.2.15 If 'previous' or 'next' were clicked, then we might need to reload this script in order |
||||
// to gain benefits of the database updates before we display the TOC |
||||
|
||||
if ($version=='1.3') { |
||||
$output .=message('Sequencing for 1.3 not yet available'); |
||||
} |
||||
else |
||||
{ |
||||
// if the current identifier is empty, set to first item identifier |
||||
if (empty($_SESSION['s_identifier'])) { |
||||
$i=1; |
||||
for(;$items[$i]['href']=='';$i++){/*get index of first elem with href*/} |
||||
$_SESSION['s_identifier']=$items[$i]['identifier']; |
||||
//error_log("s_identifier was empty - new one: ".$_SESSION['s_identifier'],0); |
||||
|
||||
} |
||||
|
||||
$i=1; |
||||
if($openfirst == 'yes'){ |
||||
//do nothing so that we start on first element |
||||
//$s_identifier = $items[1]['identifier']; |
||||
//error_log("Openfirst was set, found first valid elem: ".$items[$i]['identifier'],0); |
||||
for(;$items[$i]['href']=='';$i++){/*get index of first elem with href*/} |
||||
}else{ |
||||
$i = $items_dictionary[$_SESSION['s_identifier']]; |
||||
|
||||
if ($menu=='next') { |
||||
//error_log("Menu was 'next'",0); |
||||
|
||||
do { // we take the next sco which has a href |
||||
$i++; |
||||
} while (($items[$i]['href'] == '') and ($i <= count($items))); |
||||
if ($i>count($items)) { |
||||
$output .=message(htmlentities(get_lang('ScormNoNext'),ENT_QUOTES,$charset_lang)); |
||||
#echo $output; |
||||
$exit_after_menu=true; |
||||
} |
||||
} |
||||
if ($menu=='prev') { |
||||
//error_log("Menu was 'prev'",0); |
||||
do { // we take the previous sco which has href |
||||
$i--; |
||||
} while (($items[$i]['href'] == '') and ($i >= 1)); |
||||
if ($i<1) { |
||||
$output .=message(htmlentities(get_lang('ScormNoPrev'),ENT_QUOTES,$charset_lang)); |
||||
#echo $output; |
||||
$exit_after_menu=true; |
||||
} |
||||
} |
||||
} |
||||
//sco opening begin |
||||
$href=api_get_path('WEB_COURSE_PATH').$_course['path']."/scorm".$openDir."/".$items[$i]['href']; |
||||
$_SESSION['s_identifier'] = $items[$i]['identifier']; |
||||
//error_log("New s_identifier: ".$_SESSION['s_identifier']." - Old one is: ".$_SESSION['old_sco_identifier'],0); |
||||
//$s_identifier = $identifier; |
||||
} |
||||
}elseif ($menu=='my_status') { |
||||
//error_log("Menu was 'my_status'",0); |
||||
|
||||
/*=========================== |
||||
IF MY STATUS WAS CLICKED... |
||||
===========================*/ |
||||
//6. The user chose to display the status screen. |
||||
// @todo It is a very bad idea to mix status display and the rest of the TOC display. |
||||
// Ideally, this should be fixed by including here two different display scripts depending on what to display. |
||||
|
||||
//allows to not highlight an element if currently displaying status |
||||
$_SESSION['displaying_status']=true; |
||||
|
||||
if ($version=='1.1') { |
||||
$output .=message(htmlentities(get_lang('ScormNoStatus'),ENT_QUOTES,$charset_lang)); |
||||
} else { |
||||
$w=$tablewidth-20; |
||||
$output .= "<br />"; |
||||
|
||||
//if display in fullscreen required |
||||
if (strcmp($_GET["fs"],"true")==0) |
||||
{ $output .= "<table align='center'>"; } |
||||
|
||||
else |
||||
{ $output .= "<table class='margin_table'>"; } |
||||
|
||||
$output .="<tr><td><div class='title'>".htmlentities(get_lang('ScormMystatus'),ENT_QUOTES,$charset_lang)."</div></td></tr>" |
||||
."<tr><td> </td></tr>" |
||||
."<tr><td>" |
||||
."<table border='0' class='data_table'><tr>\n" |
||||
."<td><div class='mystatusfirstrow'>".htmlentities(get_lang('ScormLessonTitle'),ENT_QUOTES,$charset_lang)."</div></td>\n" |
||||
."<td><div class='mystatusfirstrow'>".htmlentities(get_lang('ScormStatus'),ENT_QUOTES,$charset_lang)."</div></td>\n" |
||||
."<td><div class='mystatusfirstrow'>".htmlentities(get_lang('ScormScore'),ENT_QUOTES,$charset_lang)."</div></td>\n" |
||||
."<td><div class='mystatusfirstrow'>".htmlentities(get_lang('ScormTime'),ENT_QUOTES,$charset_lang)."</div></td></tr>\n"; |
||||
|
||||
//going through the items using the $items[] array instead of the database order ensures |
||||
// we get them in the same order as in the imsmanifest file, which is rather random when using |
||||
// the database table |
||||
foreach($items as $i => $myitem ) { |
||||
$sql="SELECT * FROM $TBL_SCORM_SCO_DATA |
||||
WHERE (studentId='".$_user['user_id']."' |
||||
AND contentId='".$mycontentId."' |
||||
AND scoIdentifier = '".$myitem['identifier']."')";// order by scoId"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$ar = mysql_fetch_array($result); |
||||
|
||||
$counter++; |
||||
if (($counter % 2)==0) { $oddclass="row_odd"; } else { $oddclass="row_even"; } |
||||
|
||||
$lesson_status=$ar['status']; |
||||
$score=$ar['score']; |
||||
$time=$ar['time']; |
||||
$scoIdentifier=$ar['scoIdentifier']; |
||||
$title=$myitem['title']; |
||||
if (strlen($title)>65) { |
||||
$title=substr($title,0,64); |
||||
$title.="..."; |
||||
} |
||||
//$title=str_replace(' ',' ',$title); |
||||
//Remove "NaN" if any (@todo: locate the source of these NaN) |
||||
$time = str_replace('NaN','00',$time); |
||||
if (($lesson_status=='completed') or ($lesson_status=='passed')) { $color='green'; } else { $color='black'; } |
||||
$output .= "<tr class='$oddclass'>\n" |
||||
."<td><div class='mystatus'>$title</div></td>\n" |
||||
."<td><font color='$color'><div class='mystatus'>".htmlentities($array_status[$lesson_status],ENT_QUOTES,$charset_lang)."</div></font></td>\n" |
||||
."<td><div class='mystatus' align='center'>".($score==0?'-':$score)."</div></td>\n" |
||||
."<td><div class='mystatus'>$time</div></td>\n" |
||||
."</tr>\n"; |
||||
} |
||||
|
||||
$output .= "</table></td></tr></table>"; |
||||
} |
||||
$output .= "</body></html>"; |
||||
//We just wanted the status, so skip the rest now (we don't need any footer anyway) |
||||
echo $output; |
||||
exit(); |
||||
} |
||||
//echo "<pre>".print_r($items,true)."</pre>"; |
||||
//if the action requested is any of restart, openfirst, next or prev, open the content in the content frame |
||||
//This is done by calling opensco.php in the 'message' frame, which in turn calls the document in the 'sco' frame. |
||||
if(($menu=='restart' or $menu=='next' or $menu=='prev' or $openfirst=='yes') and ($exit_after_menu==false)){ |
||||
//error_log("Menu was 'prev' or 'next' or restart or openfirst was set and could include javascript for opensco and contents.php.",0); |
||||
//error_log('get_better_anchor_target returned '.$target_identifier,0); |
||||
$output .= "<script type='text/javascript'>\n/* <![CDATA[ */\n". |
||||
"nextwindow=open('opensco.php?sco_href=".base64_encode($href)."&sco_identifier=".$_SESSION['s_identifier'] |
||||
."&file=$request_file&edoceo=$edoceo&openDir=$openDir','message');". |
||||
//this line enables the movement of the menu |
||||
//"thiswindow=open('contents.php?file=$request_file&openDir=$openDir&time=$time&edoceo=$edoceo#$identifier','contents');". |
||||
"thiswindow=open('contents.php?file=$request_file&openDir=$openDir&time=$time&edoceo=$edoceo','contents');". |
||||
"\n/* ]]> */\n</script>"; |
||||
//sco opening end |
||||
} |
||||
|
||||
|
||||
/*======================= |
||||
TABLE OF CONTENTS TITLE |
||||
=======================*/ |
||||
//6. If we are here, it's only because the user didn't choose the status display |
||||
// (otherwise we would have exited). SHOW the TOC here... |
||||
//6.1 Deal with the title |
||||
$t=$defaultorgtitle; |
||||
$t=str_replace(' ',' ',$t); |
||||
if ($wrap) { |
||||
$output .= "<div><b>$defaultorgtitle</b></div><br />"; |
||||
} else { |
||||
$output .= "<table border='0' cellspacing='0' cellpadding='0' width='$tablewidth'> |
||||
<tr> |
||||
<td> |
||||
<div><b>$t</b></div> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
<br /> |
||||
<table border='0' cellspacing='0' cellpadding='0' width='$tablewidth'>"; |
||||
} |
||||
|
||||
//remember the title in the session (for later reuse) |
||||
$_SESSION['defaultorgtitle'] = $defaultorgtitle; |
||||
|
||||
/*==================================== |
||||
TABLE OF CONTENTS LISTING ROW BY ROW |
||||
====================================*/ |
||||
//6.2 Displaying TOC |
||||
|
||||
//$output .= "<pre>".print_r($items,true)."</pre>"; |
||||
|
||||
//6.2.1 Init vars to compute total items completed |
||||
$num_of_completed=0; |
||||
$i=1; |
||||
|
||||
while ($items[$i]) { |
||||
//error_log("Now processing item $i: ".$items[$i]['identifier'],0); |
||||
|
||||
//6.2.2 Set whether to highlight the item or not (don't highlight if displaying status) |
||||
$bold = false; |
||||
if( ( $items[$i]['identifier'] == $_SESSION['s_identifier']) && (!$_SESSION['displaying_status'])){ |
||||
//error_log("Item is the current one",0); |
||||
$bold = true; |
||||
} |
||||
|
||||
if (!$wrap) { $output .= "<tr>"; } //do not wrap this item with the previous one } |
||||
|
||||
//6.2.3 if this user never opened this content |
||||
// make initial entries in the scorm data table for this student |
||||
// the order of insertions is the same as in the file (so it is the one we want to keep for status display) |
||||
// $index comes from outside this script and represents the scoId in the table |
||||
if ($everopened==false) { |
||||
$sql = "INSERT INTO $TBL_SCORM_SCO_DATA " |
||||
."(contentId, scoId, scoIdentifier, scoTitle, status, studentID, score, time)VALUES " |
||||
."('".$mycontentId."','".$index."','".$items[$i]['identifier']."','" |
||||
.addslashes($items[$i]['title'])."','not attempted','".$_user['user_id']."','0','00:00')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
} |
||||
|
||||
//6.2.4 Display spaces/cells an amount of time that corresponds to the depth of the element in the hierarchy |
||||
if ($wrap) { |
||||
$output .= str_repeat(" ",$items[$i]['level']-1); |
||||
} else { |
||||
$output .= "<td>".str_repeat(" ",$items[$i]['level']-1)."</td>"; |
||||
} |
||||
$col=$maxlevel-$items[$i]['level']+1; //prepare the number of columns to display |
||||
if (!$wrap) { $output .= '<td colspan="'.$col.'"><table border="0" cellspacing="0" cellpadding="0">'; } |
||||
|
||||
//6.2.5 Get the document/content path |
||||
//$href="../../courses/$_course[path]/scorm".$openDir."/".urlencode($items[$i]['href']); |
||||
if(substr($items[$i]['href'],0,4)=='http'){ |
||||
$href = $items[$i]['href']; |
||||
}else{ |
||||
$href=api_get_path('WEB_COURSE_PATH').$_course['path']."/scorm".$openDir."/".$items[$i]['href']; |
||||
} |
||||
//6.2.6 Get useful values in practical variables |
||||
$identifier=$items[$i]['identifier']; |
||||
$prereq=$items[$i]['prereq']; |
||||
|
||||
//6.2.7 Get the recorded status for this document/content |
||||
$sql3 = "SELECT status FROM $TBL_SCORM_SCO_DATA WHERE " |
||||
." (contentId='$mycontentId' and studentId='".$_user['user_id']."' and scoIdentifier='$identifier')"; |
||||
$result3 = api_sql_query($sql3,__FILE__,__LINE__); |
||||
$ar3=mysql_fetch_array($result3); |
||||
$lesson_status=$ar3['status']; |
||||
|
||||
//6.2.8 Count this lesson as completed if applicable |
||||
if (($lesson_status == 'completed') or ($lesson_status == 'passed')) { $num_of_completed++; } |
||||
|
||||
//6.2.9 display this document/content name as a link to the document/content itself |
||||
if ($items[$i]['href']!='') { |
||||
if (!$wrap) { $output .= "<tr><td>"; } //display choice |
||||
|
||||
//6.2.9.1 if the lesson was completed, display a little icon |
||||
if (($lesson_status=='completed') or ($lesson_status=='passed')) { |
||||
$output .= '<img src="../img/checkbox_on2.gif" border="0" width="13" height="11" alt="on"/>'; |
||||
} else { |
||||
//insert the image but make it invisible, so that the space taken is identical (no movement when image appears) |
||||
$output .= '<img src="../img/checkbox_on2.gif" border="0" width="13" height="11" alt="on" style="visibility: hidden"/>'; |
||||
//$output .= " "; |
||||
} |
||||
|
||||
if (!$wrap) { $output .= "</td><td>"; } //display choice |
||||
|
||||
//6.2.9.2 Add HTML anchor |
||||
$output .= "<a name='$identifier'>"; |
||||
//6.2.9.3 Highlight if applicable |
||||
if ($bold) { $output .= "<b>";} |
||||
//6.2.9.4 Display the link |
||||
$output .= "<a title='". $items[$i]['title']. "' href='opensco.php"; |
||||
if ($version=='1.3') { //SCORM version 1.3 |
||||
if ($items[$i]['parameters']!='') { |
||||
// there should probably be an additional '?' here... maybe... |
||||
$output .= "{$items[$i]['parameters']}"."&"; //add parameters to the link |
||||
} else { |
||||
$output .= "?"; |
||||
} |
||||
} else { //version is not 1.3 |
||||
$output .= "?"; |
||||
} |
||||
|
||||
$output .= "sco_href=".base64_encode($href)."&sco_identifier=$identifier&file=$request_file&edoceo=$edoceo&openDir=$openDir' target='message' class='"; |
||||
//as you might realise, this links points to the message frame, to opensco.php, which will then open the content |
||||
//in the contents frame |
||||
|
||||
//change CSS class to "completed" if completed or passed |
||||
if (($lesson_status=='completed') or ($lesson_status=='passed')) { $output .= $array_status[$lesson_status]; } |
||||
$output .= "'>"; |
||||
//error_log("Added link to opensco with sco_identifier=".$items[$i]['identifier'],0); |
||||
|
||||
}else{ |
||||
if (($lesson_status=='completed') or ($lesson_status=='passed')) { |
||||
$output .= '<img src="../img/checkbox_on2.gif" border="0" width="13" height="11" alt="on"/>'; |
||||
} else { |
||||
//insert the image but make it invisible, so that the space taken is identical (no movement when image appears) |
||||
$output .= '<img src="../img/checkbox_on2.gif" border="0" width="13" height="11" alt="on" style="visibility: hidden"/>'; |
||||
} |
||||
} |
||||
|
||||
//6.2.10 Simulate htmlentities() just for spaces |
||||
$t=$items[$i]['title']; |
||||
|
||||
//6.2.11 Display title (unfiltered if wrapped display - which is the default) |
||||
$t=str_replace(' ',' ',$t); |
||||
$twrap = $items[$i]['title']; |
||||
//cut the title string if too long to fit in typical frame width |
||||
$max_len = 37-(3*$items[$i]['level']); |
||||
if(strlen($twrap)>$max_len){ |
||||
$twrap = str_replace(' ',' ',substr($twrap,0,$max_len-3).'...'); |
||||
} |
||||
|
||||
if (!$wrap) { $output .= $t; } else { $output .= $twrap; } |
||||
|
||||
if ( $items[$i]['href'] != '' ) { $output .= "</a>"; } //see above for opening anchor tag "a name=..." |
||||
if ($bold) { $output .= "</b>";} |
||||
if (!$wrap) { $output .= "</td></tr></table></td></tr>\n"; } else { $output .= "<br />\n"; } |
||||
$i++; |
||||
} |
||||
|
||||
//6.2.12 Display percentage complete |
||||
if ( count($items) != 0 ) { |
||||
$percent=round($num_of_completed/count($items)*100); |
||||
} else { //no item found. Display an error. |
||||
$output .= message(htmlentities(get_lang('ScormNoItems'),ENT_QUOTES,$charset_lang)); echo $output; exit(); |
||||
} |
||||
|
||||
$npercent=100-$percent; |
||||
if (($percent==0) and ($openfirst=='yes') and ($version != '1.3') and ($menu=='')) { $menu="next"; } |
||||
//ie. the first lesson appears if nothing is completed, not if in 1.3 and the user clicked onto Launch just now |
||||
|
||||
if (!$wrap) { $output .= "</table>\n"; } // display-choice |
||||
|
||||
/*================= |
||||
COMPLETION STATUS |
||||
=================*/ |
||||
|
||||
//6.2.13 Display the completion status of the whole learning path |
||||
//! temporary fix for the accentuated characters bug (due to different encoding |
||||
// between the imsmanifest file - which is the source to this frame's encoding - and the language file) |
||||
// The fix is temporary because it will most probably fail on any non-european special character |
||||
// To really fix this, there should be a function to check the language files' encoding and put it |
||||
// in the third argument to htmlentities() here below |
||||
$output .= '<br /><a name="statustable"></a><table border="0"><tr><td>' |
||||
.htmlentities(get_lang('ScormCompstatus'),ENT_QUOTES,$charset_lang)."<br />" |
||||
.'<table border="0" cellpadding="0" cellspacing="0"><tr><td>' |
||||
.'<img src="../img/bar_1.gif" width="1" height="12">' |
||||
.'<img src="../img/bar_1u.gif" width="'.$percent.'" height="12">' |
||||
.'<img src="../img/bar_1m.gif" width="1" height="12">' |
||||
.'<img src="../img/bar_1r.gif" width="'.$npercent.'" height="12">' |
||||
.'<img src="../img/bar_1.gif" width="1" height="12"></td></tr></table>' |
||||
."</td><td valign=\"bottom\"><font align=\"left\"><br />$percent %</td></tr></table>\n"; |
||||
|
||||
if ($tabledraw) { |
||||
$output .= "<br /><br /><hr /><br />"; |
||||
$i=1; |
||||
while ($items[$i]) { |
||||
$output .= "Index : {$items[$i]['index']} " |
||||
."Identifierref : {$items[$i]['identifierref']} " |
||||
."Identifier : {$items[$i]['identifier']} " |
||||
."Level : {$items[$i]['level']} " |
||||
."Title : {$items[$i]['title']} " |
||||
."Href : {$items[$i]['href']} " |
||||
."Prereq : {$items[$i]['prereq']} " |
||||
."Parameters : {$items[$i]['parameters']} " |
||||
."Clusterinfo : {$items[$i]['clusterinfo']}<br />\n"; |
||||
$i++; |
||||
} |
||||
$output .= "<br />\n"; |
||||
$output .= "defaultorg : $defaultorgref<br />defaultorgtitle : $defaultorgtitle"; |
||||
} |
||||
|
||||
//6.2.14 If the parser was used, close it (and the XML file too) |
||||
if($openfirst=='yes' or $menu=='restart'){ |
||||
xml_parser_free($xml_parser); |
||||
fclose($fp); |
||||
} |
||||
|
||||
//$openfirst='no'; |
||||
|
||||
/*=========================== |
||||
VERSION INFO |
||||
===========================*/ |
||||
|
||||
//$output .= "<p class=version>[ Scorm ".get_lang('ScormVersion')." : $version ]</p>"; |
||||
|
||||
//if($menu=='restart'){unset($_SESSION['s_identifier']);} |
||||
$_SESSION['contentId'] = $mycontentId; |
||||
$_SESSION['items'] = $items; |
||||
//if(empty($_SESSION['old_sco_identifier'])){ |
||||
// $_SESSION['old_sco_identifier'] = $_SESSION['s_identifier']; |
||||
//} |
||||
$_SESSION['displaying_status']=false; |
||||
|
||||
//if the user didn't click a menu button, then assume he clicked a SCORM button in the content, |
||||
// and that the element that needs to be updated by closesco.php is the latest element we have here, |
||||
// namely $_SESSION['s_identifier'], instead of $_SESSION['old_s_identifier'] |
||||
if(empty($menu)){ |
||||
$_SESSION['old_sco_identifier'] = $_SESSION['s_identifier']; |
||||
} |
||||
|
||||
//error_log("End of script (before output). s_identifier is now:".$_SESSION['s_identifier']." and old s_identifier is now:".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
|
||||
echo $output; |
||||
//error_log("End of script (after output). s_identifier is now:".$_SESSION['s_identifier']." and old s_identifier is now:".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
?> |
||||
</body></html> |
@ -1,416 +0,0 @@ |
||||
var _Debug = false; // set this to false to turn debugging off
|
||||
// and get rid of those annoying alert boxes.
|
||||
|
||||
// Define exception/error codes
|
||||
var _NoError = 0; |
||||
var _GeneralException = 101; |
||||
var _ServerBusy = 102; |
||||
var _InvalidArgumentError = 201; |
||||
var _ElementCannotHaveChildren = 202; |
||||
var _ElementIsNotAnArray = 203; |
||||
var _NotInitialized = 301; |
||||
var _NotImplementedError = 401; |
||||
var _InvalidSetValue = 402; |
||||
var _ElementIsReadOnly = 403; |
||||
var _ElementIsWriteOnly = 404; |
||||
var _IncorrectDataType = 405; |
||||
|
||||
|
||||
// local variable definitions
|
||||
var apiHandle = null; |
||||
var API = null; |
||||
var findAPITries = 0; |
||||
|
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function: doLMSInitialize() |
||||
** Inputs: None |
||||
** Return: CMIBoolean true if the initialization was successful, or |
||||
** CMIBoolean false if the initialization failed. |
||||
** |
||||
** Description: |
||||
** Initialize communication with LMS by calling the LMSInitialize |
||||
** function which will be implemented by the LMS. |
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSInitialize() |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSInitialize was not successful."); |
||||
return "false"; |
||||
} |
||||
|
||||
var result = api.LMSInitialize(""); |
||||
|
||||
if (result.toString() != "true") |
||||
{ |
||||
var err = ErrorHandler(); |
||||
} |
||||
|
||||
return result.toString(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSFinish() |
||||
** Inputs: None |
||||
** Return: CMIBoolean true if successful |
||||
** CMIBoolean false if failed. |
||||
** |
||||
** Description: |
||||
** Close communication with LMS by calling the LMSFinish |
||||
** function which will be implemented by the LMS |
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSFinish() |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSFinish was not successful."); |
||||
return "false"; |
||||
} |
||||
else |
||||
{ |
||||
// call the LMSFinish function that should be implemented by the API
|
||||
|
||||
var result = api.LMSFinish(""); |
||||
if (result.toString() != "true") |
||||
{ |
||||
var err = ErrorHandler(); |
||||
} |
||||
|
||||
} |
||||
|
||||
return result.toString(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSGetValue(name) |
||||
** Inputs: name - string representing the cmi data model defined category or |
||||
** element (e.g. cmi.core.student_id) |
||||
** Return: The value presently assigned by the LMS to the cmi data model |
||||
** element defined by the element or category identified by the name |
||||
** input value. |
||||
** |
||||
** Description: |
||||
** Wraps the call to the LMS LMSGetValue method |
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSGetValue(name) |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful."); |
||||
return ""; |
||||
} |
||||
else |
||||
{ |
||||
var value = api.LMSGetValue(name); |
||||
var errCode = api.LMSGetLastError().toString(); |
||||
if (errCode != _NoError) |
||||
{ |
||||
// an error was encountered so display the error description
|
||||
var errDescription = api.LMSGetErrorString(errCode); |
||||
alert("LMSGetValue("+name+") failed. \n"+ errDescription); |
||||
return ""; |
||||
} |
||||
else |
||||
{ |
||||
|
||||
return value.toString(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSSetValue(name, value) |
||||
** Inputs: name -string representing the data model defined category or element |
||||
** value -the value that the named element or category will be assigned |
||||
** Return: CMIBoolean true if successful |
||||
** CMIBoolean false if failed. |
||||
** |
||||
** Description: |
||||
** Wraps the call to the LMS LMSSetValue function |
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSSetValue(name, value) |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSSetValue was not successful."); |
||||
return; |
||||
} |
||||
else |
||||
{ |
||||
var result = api.LMSSetValue(name, value); |
||||
if (result.toString() != "true") |
||||
{ |
||||
var err = ErrorHandler(); |
||||
} |
||||
} |
||||
|
||||
return; |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSCommit() |
||||
** Inputs: None |
||||
** Return: None |
||||
** |
||||
** Description: |
||||
** Call the LMSCommit function
|
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSCommit() |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSCommit was not successful."); |
||||
return "false"; |
||||
} |
||||
else |
||||
{ |
||||
var result = api.LMSCommit(""); |
||||
if (result != "true") |
||||
{ |
||||
var err = ErrorHandler(); |
||||
} |
||||
} |
||||
|
||||
return result.toString(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSGetLastError() |
||||
** Inputs: None |
||||
** Return: The error code that was set by the last LMS function call |
||||
** |
||||
** Description: |
||||
** Call the LMSGetLastError function
|
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSGetLastError() |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSGetLastError was not successful."); |
||||
//since we can't get the error code from the LMS, return a general error
|
||||
return _GeneralError; |
||||
} |
||||
|
||||
return api.LMSGetLastError().toString(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSGetErrorString(errorCode) |
||||
** Inputs: errorCode - Error Code |
||||
** Return: The textual description that corresponds to the input error code |
||||
** |
||||
** Description: |
||||
** Call the LMSGetErrorString function
|
||||
** |
||||
********************************************************************************/ |
||||
function doLMSGetErrorString(errorCode) |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSGetErrorString was not successful."); |
||||
} |
||||
|
||||
return api.LMSGetErrorString(errorCode).toString(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function doLMSGetDiagnostic(errorCode) |
||||
** Inputs: errorCode - Error Code(integer format), or null |
||||
** Return: The vendor specific textual description that corresponds to the
|
||||
** input error code |
||||
** |
||||
** Description: |
||||
** Call the LMSGetDiagnostic function |
||||
** |
||||
*******************************************************************************/ |
||||
function doLMSGetDiagnostic(errorCode) |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSGetDiagnostic was not successful."); |
||||
} |
||||
|
||||
return api.LMSGetDiagnostic(errorCode).toString(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function LMSIsInitialized() |
||||
** Inputs: none |
||||
** Return: true if the LMS API is currently initialized, otherwise false |
||||
** |
||||
** Description: |
||||
** Determines if the LMS API is currently initialized or not. |
||||
** |
||||
*******************************************************************************/ |
||||
function LMSIsInitialized() |
||||
{ |
||||
// there is no direct method for determining if the LMS API is initialized
|
||||
// for example an LMSIsInitialized function defined on the API so we'll try
|
||||
// a simple LMSGetValue and trap for the LMS Not Initialized Error
|
||||
|
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nLMSIsInitialized() failed."); |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
var value = api.LMSGetValue("cmi.core.student_name"); |
||||
var errCode = api.LMSGetLastError().toString(); |
||||
if (errCode == _NotInitialized) |
||||
{ |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function ErrorHandler() |
||||
** Inputs: None |
||||
** Return: The current value of the LMS Error Code |
||||
** |
||||
** Description: |
||||
** Determines if an error was encountered by the previous API call |
||||
** and if so, displays a message to the user. If the error code |
||||
** has associated text it is also displayed. |
||||
** |
||||
*******************************************************************************/ |
||||
function ErrorHandler() |
||||
{ |
||||
var api = getAPIHandle(); |
||||
if (api == null) |
||||
{ |
||||
alert("Unable to locate the LMS's API Implementation.\nCannot determine LMS error code."); |
||||
return; |
||||
} |
||||
|
||||
// check for errors caused by or from the LMS
|
||||
var errCode = api.LMSGetLastError().toString(); |
||||
if (errCode != _NoError) |
||||
{ |
||||
// an error was encountered so display the error description
|
||||
var errDescription = api.LMSGetErrorString(errCode); |
||||
|
||||
if (_Debug == true) |
||||
{ |
||||
errDescription += "\n"; |
||||
errDescription += api.LMSGetDiagnostic(null); |
||||
// by passing null to LMSGetDiagnostic, we get any available diagnostics
|
||||
// on the previous error.
|
||||
} |
||||
|
||||
alert(errDescription); |
||||
} |
||||
|
||||
return errCode; |
||||
} |
||||
|
||||
/****************************************************************************** |
||||
** |
||||
** Function getAPIHandle() |
||||
** Inputs: None |
||||
** Return: value contained by APIHandle |
||||
** |
||||
** Description: |
||||
** Returns the handle to API object if it was previously set, |
||||
** otherwise it returns null |
||||
** |
||||
*******************************************************************************/ |
||||
function getAPIHandle() |
||||
{ |
||||
if (apiHandle == null) |
||||
{ |
||||
apiHandle = getAPI(); |
||||
} |
||||
|
||||
return apiHandle; |
||||
} |
||||
|
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function findAPI(win) |
||||
** Inputs: win - a Window Object |
||||
** Return: If an API object is found, it's returned, otherwise null is returned |
||||
** |
||||
** Description: |
||||
** This function looks for an object named API in parent and opener windows |
||||
** |
||||
*******************************************************************************/ |
||||
function findAPI(win) |
||||
{ |
||||
while ((win.API == null) && (win.parent != null) && (win.parent != win)) |
||||
{ |
||||
findAPITries++; |
||||
// Note: 7 is an arbitrary number, but should be more than sufficient
|
||||
if (findAPITries > 7)
|
||||
{ |
||||
alert("Error finding API -- too deeply nested."); |
||||
return null; |
||||
} |
||||
|
||||
win = win.parent; |
||||
|
||||
} |
||||
return win.API; |
||||
} |
||||
|
||||
|
||||
|
||||
/******************************************************************************* |
||||
** |
||||
** Function getAPI() |
||||
** Inputs: none |
||||
** Return: If an API object is found, it's returned, otherwise null is returned |
||||
** |
||||
** Description: |
||||
** This function looks for an object named API, first in the current window's
|
||||
** frame hierarchy and then, if necessary, in the current window's opener window |
||||
** hierarchy (if there is an opener window). |
||||
** |
||||
*******************************************************************************/ |
||||
function getAPI() |
||||
{ |
||||
var theAPI = findAPI(window); |
||||
if ((theAPI == null) && (window.opener != null) && (typeof(window.opener) != "undefined")) |
||||
{ |
||||
theAPI = findAPI(window.opener); |
||||
} |
||||
if (theAPI == null) |
||||
{ |
||||
alert("Unable to find an API adapter"); |
||||
} |
||||
return theAPI |
||||
} |
||||
|
||||
|
@ -1,184 +0,0 @@ |
||||
var startDate; |
||||
var exitPageStatus; |
||||
|
||||
function loadPage() |
||||
{ |
||||
var result = doLMSInitialize(); |
||||
|
||||
var status = doLMSGetValue( "cmi.core.lesson_status" ); |
||||
|
||||
if (status == "not attempted") |
||||
{ |
||||
// the student is now attempting the lesson
|
||||
doLMSSetValue( "cmi.core.lesson_status", "incomplete" ); |
||||
} |
||||
|
||||
exitPageStatus = false; |
||||
startTimer(); |
||||
} |
||||
|
||||
|
||||
function startTimer() |
||||
{ |
||||
startDate = new Date().getTime(); |
||||
} |
||||
|
||||
function computeTime() |
||||
{ |
||||
if ( startDate != 0 ) |
||||
{ |
||||
var currentDate = new Date().getTime(); |
||||
var elapsedSeconds = ( (currentDate - startDate) / 1000 ); |
||||
var formattedTime = convertTotalSeconds( elapsedSeconds ); |
||||
} |
||||
else |
||||
{ |
||||
formattedTime = "00:00:00.0"; |
||||
} |
||||
|
||||
doLMSSetValue( "cmi.core.session_time", formattedTime ); |
||||
} |
||||
|
||||
function doBack() //darkden:this function is never called (not present in any of the files only in this and in this file, only here)
|
||||
{ |
||||
doLMSSetValue( "cmi.core.exit", "suspend" ); |
||||
|
||||
computeTime(); |
||||
exitPageStatus = true; |
||||
|
||||
var result; |
||||
|
||||
result = doLMSCommit(); |
||||
|
||||
// NOTE: LMSFinish will unload the current SCO. All processing
|
||||
// relative to the current page must be performed prior
|
||||
// to calling LMSFinish.
|
||||
|
||||
result = doLMSFinish(); |
||||
|
||||
} |
||||
|
||||
function doContinue( status ) //darkden:this function is never called (not present in any of the files only in this and in this file, only here)
|
||||
{ |
||||
// Reinitialize Exit to blank
|
||||
doLMSSetValue( "cmi.core.exit", "" ); |
||||
|
||||
var mode = doLMSGetValue( "cmi.core.lesson_mode" ); |
||||
|
||||
if ( mode != "review" && mode != "browse" ) |
||||
{ |
||||
doLMSSetValue( "cmi.core.lesson_status", status ); |
||||
} |
||||
|
||||
computeTime(); |
||||
exitPageStatus = true; |
||||
|
||||
var result; |
||||
result = doLMSCommit(); |
||||
// NOTE: LMSFinish will unload the current SCO. All processing
|
||||
// relative to the current page must be performed prior
|
||||
// to calling LMSFinish.
|
||||
|
||||
result = doLMSFinish(); |
||||
|
||||
} |
||||
|
||||
function doQuit( status ) |
||||
{ |
||||
computeTime(); |
||||
exitPageStatus = true; |
||||
|
||||
var result; |
||||
|
||||
result = doLMSCommit(); |
||||
|
||||
result = doLMSSetValue("cmi.core.lesson_status", status); |
||||
|
||||
// NOTE: LMSFinish will unload the current SCO. All processing
|
||||
// relative to the current page must be performed prior
|
||||
// to calling LMSFinish.
|
||||
|
||||
result = doLMSFinish(); |
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** The purpose of this function is to handle cases where the current SCO may be
|
||||
** unloaded via some user action other than using the navigation controls
|
||||
** embedded in the content. This function will be called every time an SCO |
||||
** is unloaded. If the user has caused the page to be unloaded through the |
||||
** preferred SCO control mechanisms, the value of the "exitPageStatus" var |
||||
** will be true so we'll just allow the page to be unloaded. If the value |
||||
** of "exitPageStatus" is false, we know the user caused to the page to be |
||||
** unloaded through use of some other mechanism... most likely the back |
||||
** button on the browser. We'll handle this situation the same way we
|
||||
** would handle a "quit" - as in the user pressing the SCO's quit button. |
||||
*******************************************************************************/ |
||||
function unloadPage( status ) |
||||
{ |
||||
|
||||
if (exitPageStatus != true) |
||||
{ |
||||
doQuit( status ); |
||||
} |
||||
|
||||
// NOTE: don't return anything that resembles a javascript
|
||||
// string from this function or IE will take the
|
||||
// liberty of displaying a confirm message box.
|
||||
|
||||
} |
||||
|
||||
/******************************************************************************* |
||||
** this function will convert seconds into hours, minutes, and seconds in |
||||
** CMITimespan type format - HHHH:MM:SS.SS (Hours has a max of 4 digits & |
||||
** Min of 2 digits |
||||
*******************************************************************************/ |
||||
function convertTotalSeconds(ts) |
||||
{ |
||||
var sec = (ts % 60); |
||||
|
||||
ts -= sec; |
||||
var tmp = (ts % 3600); //# of seconds in the total # of minutes
|
||||
ts -= tmp; //# of seconds in the total # of hours
|
||||
|
||||
// convert seconds to conform to CMITimespan type (e.g. SS.00)
|
||||
sec = Math.round(sec*100)/100; |
||||
|
||||
var strSec = new String(sec); |
||||
var strWholeSec = strSec; |
||||
var strFractionSec = ""; |
||||
|
||||
if (strSec.indexOf(".") != -1) |
||||
{ |
||||
strWholeSec = strSec.substring(0, strSec.indexOf(".")); |
||||
strFractionSec = strSec.substring(strSec.indexOf(".")+1, strSec.length); |
||||
} |
||||
|
||||
if (strWholeSec.length < 2) |
||||
{ |
||||
strWholeSec = "0" + strWholeSec; |
||||
} |
||||
strSec = strWholeSec; |
||||
|
||||
if (strFractionSec.length) |
||||
{ |
||||
strSec = strSec+ "." + strFractionSec; |
||||
} |
||||
|
||||
|
||||
if ((ts % 3600) != 0 ) |
||||
var hour = 0; |
||||
else var hour = (ts / 3600); |
||||
if ( (tmp % 60) != 0 ) |
||||
var min = 0; |
||||
else var min = (tmp / 60); |
||||
|
||||
if ((new String(hour)).length < 2) |
||||
hour = "0"+hour; |
||||
if ((new String(min)).length < 2) |
||||
min = "0"+min; |
||||
|
||||
var rtnVal = hour+":"+min+":"+strSec; |
||||
|
||||
return rtnVal; |
||||
} |
||||
|
@ -1,19 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- filename=ims_xml.xsd --> |
||||
<xsd:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"> |
||||
<xsd:annotation> |
||||
<xsd:documentation>In namespace-aware XML processors, the "xml" prefix is bound to the namespace name http://www.w3.org/XML/1998/namespace.</xsd:documentation> |
||||
<xsd:documentation>Do not reference this file in XML instances</xsd:documentation> |
||||
</xsd:annotation> |
||||
<xsd:attribute name="lang" type="xsd:language"> |
||||
<xsd:annotation> |
||||
<xsd:documentation>Refers to universal XML 1.0 lang attribute</xsd:documentation> |
||||
</xsd:annotation> |
||||
</xsd:attribute> |
||||
<xsd:attribute name="base" type="xsd:anyURI"> |
||||
<xsd:annotation> |
||||
<xsd:documentation>Refers to XML Base: http://www.w3.org/TR/xmlbase</xsd:documentation> |
||||
</xsd:annotation> |
||||
</xsd:attribute> |
||||
<xsd:attribute name="link" type="xsd:anyURI"/> |
||||
</xsd:schema> |
@ -1,381 +0,0 @@ |
||||
<?xml version = "1.0" encoding = "UTF-8"?> |
||||
<!--Generated by Turbo XML 2.3.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema--> |
||||
<xsd:schema xmlns = "http://www.imsglobal.org/xsd/imscp_v1p1" |
||||
targetNamespace = "http://www.imsglobal.org/xsd/imscp_v1p1" |
||||
xmlns:xsd = "http://www.w3.org/2001/XMLSchema" |
||||
version = "IMS CP 1.1.3" |
||||
elementFormDefault = "unqualified"> |
||||
<xsd:import namespace = "http://www.w3.org/XML/1998/namespace" schemaLocation = "http://www.w3.org/2001/03/xml.xsd"/> |
||||
<xsd:annotation> |
||||
<xsd:documentation xml:lang = "en">DRAFT XSD for IMS Content Packaging version 1.1 DRAFT </xsd:documentation> |
||||
<xsd:documentation> Copyright (c) 2001 IMS GLC, Inc. </xsd:documentation> |
||||
<xsd:documentation>2000-04-21, Adjustments by T.D. Wason from CP 1.0. </xsd:documentation> |
||||
<xsd:documentation>2001-02-22, T.D.Wason: Modify for 2000-10-24 XML-Schema version. </xsd:documentation> |
||||
<xsd:documentation> Modified to support extension. </xsd:documentation> |
||||
<xsd:documentation>2001-03-12, T.D.Wason: Change filename, target and meta-data namespaces </xsd:documentation> |
||||
<xsd:documentation> and meta-data filename. </xsd:documentation> |
||||
<xsd:documentation> Add meta-data to itemType, fileType and organizationType. </xsd:documentation> |
||||
<xsd:documentation> Do not define namespaces for xml in XML instances generated from this xsd. </xsd:documentation> |
||||
<xsd:documentation> Imports IMS meta-data xsd, lower case element names. </xsd:documentation> |
||||
<xsd:documentation> This XSD provides a reference to the IMS meta-data root element as imsmd:record </xsd:documentation> |
||||
<xsd:documentation> If the IMS meta-data is to be used in the XML instance then the instance </xsd:documentation> |
||||
<xsd:documentation> must definean IMS meta-data prefix with a namespace. </xsd:documentation> |
||||
<xsd:documentation> The meta-data targetNamespace should be used. </xsd:documentation> |
||||
<xsd:documentation>2001-03-20, Thor Anderson: Remove manifestref, change resourceref back to </xsd:documentation> |
||||
<xsd:documentation> identifierref, change manifest back to contained by manifest. </xsd:documentation> |
||||
<xsd:documentation> --Tom Wason: manifest may contain _none_ or more manifests. </xsd:documentation> |
||||
<xsd:documentation>2001-04-13 Tom Wason: corrected attirbute name structure. Was misnamed type. </xsd:documentation> |
||||
<xsd:documentation>2001-05-14 Schawn Thropp: Made all complexType extensible with the group.any </xsd:documentation> |
||||
<xsd:documentation> Added the anyAttribute to all complexTypes. </xsd:documentation> |
||||
<xsd:documentation> Changed the href attribute on the fileType and resourceType to xsd:string </xsd:documentation> |
||||
<xsd:documentation> Changed the maxLength of the href, identifierref, parameters, structure </xsd:documentation> |
||||
<xsd:documentation> attributes to match the Information model. </xsd:documentation> |
||||
<xsd:documentation>2001-07-25 Schawn Thropp: Changed the namespace for the Schema of Schemas to </xsd:documentation> |
||||
<xsd:documentation> the 5/2/2001 W3C XML Schema Recommendation. </xsd:documentation> |
||||
<xsd:documentation> attributeGroup attr.imsmd deleted, was not used anywhere. </xsd:documentation> |
||||
<xsd:documentation> Any attribute declarations that have use = "default" </xsd:documentation> |
||||
<xsd:documentation> changed to use="optional" - attr.structure.req. </xsd:documentation> |
||||
<xsd:documentation> Any attribute declarations that have value="somevalue" changed to </xsd:documentation> |
||||
<xsd:documentation> default="somevalue" - attr.structure.req (hierarchical). </xsd:documentation> |
||||
<xsd:documentation> Removed references to IMS MD Version 1.1. </xsd:documentation> |
||||
<xsd:documentation> Modified attribute group "attr.resourcetype.req" to change use from optional </xsd:documentation> |
||||
<xsd:documentation> to required to match the information model. As a result the default value </xsd:documentation> |
||||
<xsd:documentation> also needed to be removed </xsd:documentation> |
||||
<xsd:documentation> Name change for XSD. Changed to match version of CP Spec </xsd:documentation> |
||||
<xsd:documentation> 2001-11-04 Chris Moffatt: </xsd:documentation> |
||||
<xsd:documentation> 1. Refer to the xml namespace using the "x" abbreviation instead of "xml". </xsd:documentation> |
||||
<xsd:documentation> This changes enables the schema to work with commercial XML Tools </xsd:documentation> |
||||
<xsd:documentation> 2. Revert to original IMS CP version 1.1 namespace. </xsd:documentation> |
||||
<xsd:documentation> i.e. "http://www.imsglobal.org/xsd/imscp_v1p1" </xsd:documentation> |
||||
<xsd:documentation> This change done to support the decision to only change the XML namespace with </xsd:documentation> |
||||
<xsd:documentation> major revisions of the specification i.e. where the information model or binding</xsd:documentation> |
||||
<xsd:documentation> changes (as opposed to addressing bugs or omissions). A stable namespace is </xsd:documentation> |
||||
<xsd:documentation> necessary to the increasing number of implementors. </xsd:documentation> |
||||
<xsd:documentation> 3. Changed name of schema file to "imscp_v1p1p3.xsd" and </xsd:documentation> |
||||
<xsd:documentation> version attribute to "IMS CP 1.1.3" to reflect minor version change </xsd:documentation> |
||||
<xsd:documentation>Inclusions and Imports </xsd:documentation> |
||||
<xsd:documentation>Attribute Declarations </xsd:documentation> |
||||
<xsd:documentation>element groups </xsd:documentation> |
||||
<xsd:documentation> |
||||
</xsd:documentation> |
||||
<xsd:documentation>2003-03-21 Schawn Thropp </xsd:documentation> |
||||
<xsd:documentation>The following updates were made to the Version 1.1.3 "Public Draft" version: </xsd:documentation> |
||||
<xsd:documentation> 1. Updated name of schema file (imscp_v1p1.xsd) to match to IMS naming guideance </xsd:documentation> |
||||
<xsd:documentation> 2. Updated the import statement to reference the xml.xsd found at </xsd:documentation> |
||||
<xsd:documentation> "http://www.w3.org/2001/03/xml.xsd". This is the current W3C schema </xsd:documentation> |
||||
<xsd:documentation> recommended by the W3C to reference. </xsd:documentation> |
||||
<xsd:documentation> 3. Removed all maxLength's facets. The maxLength facets was an incorrect binding </xsd:documentation> |
||||
<xsd:documentation> implementation. These lengths were supposed, according to the information </xsd:documentation> |
||||
<xsd:documentation> model, to be treated as smallest permitted maximums. </xsd:documentation> |
||||
<xsd:documentation> 4. Added the variations content model to support the addition in the information </xsd:documentation> |
||||
<xsd:documentation> model. </xsd:documentation> |
||||
</xsd:annotation> |
||||
<xsd:attributeGroup name = "attr.base"> |
||||
<xsd:attribute ref = "xml:base"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.default"> |
||||
<xsd:attribute name = "default" type = "xsd:IDREF"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.href"> |
||||
<xsd:attribute name = "href" type = "xsd:anyURI"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.href.req"> |
||||
<xsd:attribute name = "href" use = "required" type = "xsd:anyURI"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.identifier.req"> |
||||
<xsd:attribute name = "identifier" use = "required" type = "xsd:ID"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.identifier"> |
||||
<xsd:attribute name = "identifier" type = "xsd:ID"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.isvisible"> |
||||
<xsd:attribute name = "isvisible" type = "xsd:boolean"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.parameters"> |
||||
<xsd:attribute name = "parameters" type = "xsd:string"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.identifierref"> |
||||
<xsd:attribute name = "identifierref" type = "xsd:string"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.identifierref.req"> |
||||
<xsd:attribute name = "identifierref" use = "required" type = "xsd:string"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.resourcetype.req"> |
||||
<xsd:attribute name = "type" use = "required" type = "xsd:string"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.structure.req"> |
||||
<xsd:attribute name = "structure" default = "hierarchical" type = "xsd:string"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:attributeGroup name = "attr.version"> |
||||
<xsd:attribute name = "version" type = "xsd:string"/> |
||||
</xsd:attributeGroup> |
||||
<xsd:group name = "grp.any"> |
||||
<xsd:annotation> |
||||
<xsd:documentation>Any namespaced element from any namespace may be included within an "any" element. The namespace for the imported element must be defined in the instance, and the schema must be imported. </xsd:documentation> |
||||
</xsd:annotation> |
||||
<xsd:sequence> |
||||
<xsd:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:group> |
||||
|
||||
<!-- Copyright (2) 2003 IMS Global Learning Consortium, Inc. --> |
||||
|
||||
|
||||
<!-- ******************** --> |
||||
|
||||
|
||||
<!-- ** Change History ** --> |
||||
|
||||
|
||||
<!-- ******************** --> |
||||
|
||||
|
||||
<!-- **************************** --> |
||||
|
||||
|
||||
<!-- ** Attribute Declarations ** --> |
||||
|
||||
|
||||
<!-- **************************** --> |
||||
|
||||
|
||||
<!-- ************************** --> |
||||
|
||||
|
||||
<!-- ** Element Declarations ** --> |
||||
|
||||
|
||||
<!-- ************************** --> |
||||
|
||||
<xsd:element name = "dependency" type = "dependencyType"/> |
||||
<xsd:element name = "file" type = "fileType"/> |
||||
<xsd:element name = "item" type = "itemType"/> |
||||
<xsd:element name = "manifest" type = "manifestType"/> |
||||
<xsd:element name = "metadata" type = "metadataType"/> |
||||
<xsd:element name = "organization" type = "organizationType"/> |
||||
<xsd:element name = "organizations" type = "organizationsType"/> |
||||
<xsd:element name = "resource" type = "resourceType"/> |
||||
<xsd:element name = "resources" type = "resourcesType"/> |
||||
<xsd:element name = "schema" type = "schemaType"/> |
||||
<xsd:element name = "schemaversion" type = "schemaversionType"/> |
||||
<xsd:element name = "title" type = "titleType"/> |
||||
<xsd:element name = "variation" type = "variationType"/> |
||||
|
||||
<!-- ******************* --> |
||||
|
||||
|
||||
<!-- ** Complex Types ** --> |
||||
|
||||
|
||||
<!-- ******************* --> |
||||
|
||||
|
||||
<!-- **************** --> |
||||
|
||||
|
||||
<!-- ** dependency ** --> |
||||
|
||||
|
||||
<!-- **************** --> |
||||
|
||||
<xsd:complexType name = "dependencyType"> |
||||
<xsd:sequence> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.identifierref.req"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ********** --> |
||||
|
||||
|
||||
<!-- ** file ** --> |
||||
|
||||
|
||||
<!-- ********** --> |
||||
|
||||
<xsd:complexType name = "fileType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "metadata" minOccurs = "0"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.href.req"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ********** --> |
||||
|
||||
|
||||
<!-- ** item ** --> |
||||
|
||||
|
||||
<!-- ********** --> |
||||
|
||||
<xsd:complexType name = "itemType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "title" minOccurs = "0"/> |
||||
<xsd:element ref = "item" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:element ref = "metadata" minOccurs = "0"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.identifier.req"/> |
||||
<xsd:attributeGroup ref = "attr.identifierref"/> |
||||
<xsd:attributeGroup ref = "attr.isvisible"/> |
||||
<xsd:attributeGroup ref = "attr.parameters"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ************** --> |
||||
|
||||
|
||||
<!-- ** manifest ** --> |
||||
|
||||
|
||||
<!-- ************** --> |
||||
|
||||
<xsd:complexType name = "manifestType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "metadata" minOccurs = "0"/> |
||||
<xsd:element ref = "organizations"/> |
||||
<xsd:element ref = "resources"/> |
||||
<xsd:element ref = "manifest" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.identifier.req"/> |
||||
<xsd:attributeGroup ref = "attr.version"/> |
||||
<xsd:attribute ref = "xml:base"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ************** --> |
||||
|
||||
|
||||
<!-- ** metadata ** --> |
||||
|
||||
|
||||
<!-- ************** --> |
||||
|
||||
<xsd:complexType name = "metadataType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "schema" minOccurs = "0"/> |
||||
<xsd:element ref = "schemaversion" minOccurs = "0"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ******************* --> |
||||
|
||||
|
||||
<!-- ** organizations ** --> |
||||
|
||||
|
||||
<!-- ******************* --> |
||||
|
||||
<xsd:complexType name = "organizationsType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "organization" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.default"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ****************** --> |
||||
|
||||
|
||||
<!-- ** organization ** --> |
||||
|
||||
|
||||
<!-- ****************** --> |
||||
|
||||
<xsd:complexType name = "organizationType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "title" minOccurs = "0"/> |
||||
<xsd:element ref = "item" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:element ref = "metadata" minOccurs = "0"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.identifier.req"/> |
||||
<xsd:attributeGroup ref = "attr.structure.req"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- *************** --> |
||||
|
||||
|
||||
<!-- ** resources ** --> |
||||
|
||||
|
||||
<!-- *************** --> |
||||
|
||||
<xsd:complexType name = "resourcesType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "resource" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.base"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ************** --> |
||||
|
||||
|
||||
<!-- ** resource ** --> |
||||
|
||||
|
||||
<!-- ************** --> |
||||
|
||||
<xsd:complexType name = "resourceType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "metadata" minOccurs = "0"/> |
||||
<xsd:element ref = "file" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:element ref = "dependency" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:element ref = "variation" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:group ref = "grp.any"/> |
||||
</xsd:sequence> |
||||
<xsd:attributeGroup ref = "attr.identifier.req"/> |
||||
<xsd:attributeGroup ref = "attr.resourcetype.req"/> |
||||
<xsd:attributeGroup ref = "attr.base"/> |
||||
<xsd:attributeGroup ref = "attr.href"/> |
||||
<xsd:anyAttribute namespace = "##other" processContents = "strict"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- *************** --> |
||||
|
||||
|
||||
<!-- ** variation ** --> |
||||
|
||||
|
||||
<!-- *************** --> |
||||
|
||||
<xsd:complexType name = "variationType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref = "metadata"/> |
||||
<xsd:element ref = "file" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:element ref = "dependency" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
<xsd:element ref = "variation" minOccurs = "0" maxOccurs = "unbounded"/> |
||||
</xsd:sequence> |
||||
<xsd:attribute ref = "xml:base"/> |
||||
<xsd:attributeGroup ref = "attr.resourcetype.req"/> |
||||
<xsd:attributeGroup ref = "attr.identifier.req"/> |
||||
<xsd:attributeGroup ref = "attr.href"/> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ****************** --> |
||||
|
||||
|
||||
<!-- ** Simple Types ** --> |
||||
|
||||
|
||||
<!-- ****************** --> |
||||
|
||||
<xsd:simpleType name = "schemaType"> |
||||
<xsd:restriction base = "xsd:string"/> |
||||
</xsd:simpleType> |
||||
<xsd:simpleType name = "schemaversionType"> |
||||
<xsd:restriction base = "xsd:string"/> |
||||
</xsd:simpleType> |
||||
<xsd:simpleType name = "titleType"> |
||||
<xsd:restriction base = "xsd:string"/> |
||||
</xsd:simpleType> |
||||
</xsd:schema> |
@ -1,571 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- edited by Thomas Wason --> |
||||
<xsd:schema xmlns="http://www.imsglobal.org/xsd/imsmd_v1p2" |
||||
targetNamespace="http://www.imsglobal.org/xsd/imsmd_v1p2" |
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
||||
elementFormDefault="unqualified" |
||||
version="IMS MD 1.2.1"> |
||||
|
||||
<xsd:import namespace = "http://www.w3.org/XML/1998/namespace" schemaLocation = "http://www.w3.org/2001/03/xml.xsd"/> |
||||
|
||||
<!-- ******************** --> |
||||
<!-- ** Change History ** --> |
||||
<!-- ******************** --> |
||||
<xsd:annotation> |
||||
<xsd:documentation>2001-04-26 T.D.Wason. IMS meta-data 1.2 XML-Schema. </xsd:documentation> |
||||
<xsd:documentation>2001-06-07 S.E.Thropp. Changed the multiplicity on all elements to match the </xsd:documentation> |
||||
<xsd:documentation>Final 1.2 Binding Specification. </xsd:documentation> |
||||
<xsd:documentation>Changed all elements that use the langstringType to a multiplicy of 1 or more </xsd:documentation> |
||||
<xsd:documentation>Changed centity in the contribute element to have a multiplicity of 0 or more. </xsd:documentation> |
||||
<xsd:documentation>Changed the requirement element to have a multiplicity of 0 or more. </xsd:documentation> |
||||
<xsd:documentation> 2001-07-25 Schawn Thropp. Updates to bring the XSD up to speed with the W3C </xsd:documentation> |
||||
<xsd:documentation> XML Schema Recommendation. The following changes were made: Change the </xsd:documentation> |
||||
<xsd:documentation> namespace to reference the 5/2/2001 W3C XML Schema Recommendation,the base </xsd:documentation> |
||||
<xsd:documentation> type for the durtimeType, simpleType, was changed from timeDuration to duration. </xsd:documentation> |
||||
<xsd:documentation> Any attribute declarations that have use="default" had to change to use="optional" </xsd:documentation> |
||||
<xsd:documentation> - attr.type. Any attribute declarations that have value ="somevalue" had to change </xsd:documentation> |
||||
<xsd:documentation> to default = "somevalue" - attr.type (URI) </xsd:documentation> |
||||
<xsd:documentation> 2001-09-04 Schawn Thropp </xsd:documentation> |
||||
<xsd:documentation> Changed the targetNamespace and namespace of schema to reflect version change </xsd:documentation> |
||||
</xsd:annotation> |
||||
|
||||
<!-- *************************** --> |
||||
<!-- ** Attribute Declaration ** --> |
||||
<!-- *************************** --> |
||||
|
||||
<xsd:attributeGroup name="attr.type"> |
||||
<xsd:attribute name="type" use="optional" default="URI"> |
||||
<xsd:simpleType> |
||||
<xsd:restriction base="xsd:string"> |
||||
<xsd:enumeration value="URI"/> |
||||
<xsd:enumeration value="TEXT"/> |
||||
</xsd:restriction> |
||||
</xsd:simpleType> |
||||
</xsd:attribute> |
||||
</xsd:attributeGroup> |
||||
|
||||
<xsd:group name="grp.any"> |
||||
<xsd:annotation> |
||||
<xsd:documentation>Any namespaced element from any namespace may be used for an "any" element. The namespace for the imported element must be defined in the instance, and the schema must be imported. </xsd:documentation> |
||||
</xsd:annotation> |
||||
<xsd:sequence> |
||||
<xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:group> |
||||
|
||||
<!-- ************************* --> |
||||
<!-- ** Element Declaration ** --> |
||||
<!-- ************************* --> |
||||
|
||||
<xsd:element name="aggregationlevel" type="aggregationlevelType"/> |
||||
<xsd:element name="annotation" type="annotationType"/> |
||||
<xsd:element name="catalogentry" type="catalogentryType"/> |
||||
<xsd:element name="catalog" type="catalogType"/> |
||||
<xsd:element name="centity" type="centityType"/> |
||||
<xsd:element name="classification" type="classificationType"/> |
||||
<xsd:element name="context" type="contextType"/> |
||||
<xsd:element name="contribute" type="contributeType"/> |
||||
<xsd:element name="copyrightandotherrestrictions" type="copyrightandotherrestrictionsType"/> |
||||
<xsd:element name="cost" type="costType"/> |
||||
<xsd:element name="coverage" type="coverageType"/> |
||||
<xsd:element name="date" type="dateType"/> |
||||
<xsd:element name="datetime" type="datetimeType"/> |
||||
<xsd:element name="description" type="descriptionType"/> |
||||
<xsd:element name="difficulty" type="difficultyType"/> |
||||
<xsd:element name="educational" type="educationalType"/> |
||||
<xsd:element name="entry" type="entryType"/> |
||||
<xsd:element name="format" type="formatType"/> |
||||
<xsd:element name="general" type="generalType"/> |
||||
<xsd:element name="identifier" type="xsd:string"/> |
||||
<xsd:element name="intendedenduserrole" type="intendedenduserroleType"/> |
||||
<xsd:element name="interactivitylevel" type="interactivitylevelType"/> |
||||
<xsd:element name="interactivitytype" type="interactivitytypeType"/> |
||||
<xsd:element name="keyword" type="keywordType"/> |
||||
<xsd:element name="kind" type="kindType"/> |
||||
<xsd:element name="langstring" type="langstringType"/> |
||||
<xsd:element name="language" type="xsd:string"/> |
||||
<xsd:element name="learningresourcetype" type="learningresourcetypeType"/> |
||||
<xsd:element name="lifecycle" type="lifecycleType"/> |
||||
<xsd:element name="location" type="locationType"/> |
||||
<xsd:element name="lom" type="lomType"/> |
||||
<xsd:element name="maximumversion" type="minimumversionType"/> |
||||
<xsd:element name="metadatascheme" type="metadataschemeType"/> |
||||
<xsd:element name="metametadata" type="metametadataType"/> |
||||
<xsd:element name="minimumversion" type="maximumversionType"/> |
||||
<xsd:element name="name" type="nameType"/> |
||||
<xsd:element name="purpose" type="purposeType"/> |
||||
<xsd:element name="relation" type="relationType"/> |
||||
<xsd:element name="requirement" type="requirementType"/> |
||||
<xsd:element name="resource" type="resourceType"/> |
||||
<xsd:element name="rights" type="rightsType"/> |
||||
<xsd:element name="role" type="roleType"/> |
||||
<xsd:element name="semanticdensity" type="semanticdensityType"/> |
||||
<xsd:element name="size" type="sizeType"/> |
||||
<xsd:element name="source" type="sourceType"/> |
||||
<xsd:element name="status" type="statusType"/> |
||||
<xsd:element name="structure" type="structureType"/> |
||||
<xsd:element name="taxon" type="taxonType"/> |
||||
<xsd:element name="taxonpath" type="taxonpathType"/> |
||||
<xsd:element name="technical" type="technicalType"/> |
||||
<xsd:element name="title" type="titleType"/> |
||||
<xsd:element name="type" type="typeType"/> |
||||
<xsd:element name="typicalagerange" type="typicalagerangeType"/> |
||||
<xsd:element name="typicallearningtime" type="typicallearningtimeType"/> |
||||
<xsd:element name="value" type="valueType"/> |
||||
<xsd:element name="person" type="personType"/> |
||||
<xsd:element name="vcard" type="xsd:string"/> |
||||
<xsd:element name="version" type="versionType"/> |
||||
<xsd:element name="installationremarks" type="installationremarksType"/> |
||||
<xsd:element name="otherplatformrequirements" type="otherplatformrequirementsType"/> |
||||
<xsd:element name="duration" type="durationType"/> |
||||
<xsd:element name="id" type="idType"/> |
||||
|
||||
<!-- ******************* --> |
||||
<!-- ** Complex Types ** --> |
||||
<!-- ******************* --> |
||||
|
||||
<xsd:complexType name="aggregationlevelType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="annotationType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="person" minOccurs="0"/> |
||||
<xsd:element ref="date" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="catalogentryType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="catalog"/> |
||||
<xsd:element ref="entry"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="centityType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="vcard"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="classificationType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="purpose" minOccurs="0"/> |
||||
<xsd:element ref="taxonpath" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
<xsd:element ref="keyword" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="contextType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="contributeType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="role"/> |
||||
<xsd:element ref="centity" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="date" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="copyrightandotherrestrictionsType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="costType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="coverageType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="dateType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="datetime" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="descriptionType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="difficultyType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="durationType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="datetime" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="educationalType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="interactivitytype" minOccurs="0"/> |
||||
<xsd:element ref="learningresourcetype" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="interactivitylevel" minOccurs="0"/> |
||||
<xsd:element ref="semanticdensity" minOccurs="0"/> |
||||
<xsd:element ref="intendedenduserrole" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="context" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="typicalagerange" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="difficulty" minOccurs="0"/> |
||||
<xsd:element ref="typicallearningtime" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
<xsd:element ref="language" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="entryType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="generalType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="identifier" minOccurs="0"/> |
||||
<xsd:element ref="title" minOccurs="0"/> |
||||
<xsd:element ref="catalogentry" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="language" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="keyword" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="coverage" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="structure" minOccurs="0"/> |
||||
<xsd:element ref="aggregationlevel" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="installationremarksType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="intendedenduserroleType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="interactivitylevelType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="interactivitytypeType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="keywordType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="kindType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="langstringType"> |
||||
<xsd:simpleContent> |
||||
<xsd:extension base="xsd:string"> |
||||
<xsd:attribute ref="xml:lang"/> |
||||
</xsd:extension> |
||||
</xsd:simpleContent> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="learningresourcetypeType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="lifecycleType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="version" minOccurs="0"/> |
||||
<xsd:element ref="status" minOccurs="0"/> |
||||
<xsd:element ref="contribute" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="locationType"> |
||||
<xsd:simpleContent> |
||||
<xsd:extension base="xsd:string"> |
||||
<xsd:attributeGroup ref="attr.type"/> |
||||
</xsd:extension> |
||||
</xsd:simpleContent> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="lomType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="general" minOccurs="0"/> |
||||
<xsd:element ref="lifecycle" minOccurs="0"/> |
||||
<xsd:element ref="metametadata" minOccurs="0"/> |
||||
<xsd:element ref="technical" minOccurs="0"/> |
||||
<xsd:element ref="educational" minOccurs="0"/> |
||||
<xsd:element ref="rights" minOccurs="0"/> |
||||
<xsd:element ref="relation" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="annotation" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="classification" minOccurs="0" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="metametadataType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="identifier" minOccurs="0"/> |
||||
<xsd:element ref="catalogentry" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="contribute" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="metadatascheme" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="language" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="nameType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="otherplatformrequirementsType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="personType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="vcard"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="purposeType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="relationType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="kind" minOccurs="0"/> |
||||
<xsd:element ref="resource" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="requirementType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="type" minOccurs="0"/> |
||||
<xsd:element ref="name" minOccurs="0"/> |
||||
<xsd:element ref="minimumversion" minOccurs="0"/> |
||||
<xsd:element ref="maximumversion" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="resourceType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="identifier" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
<xsd:element ref="catalogentry" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="rightsType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="cost" minOccurs="0"/> |
||||
<xsd:element ref="copyrightandotherrestrictions" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="roleType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="semanticdensityType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="sourceType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="statusType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="stringType"> |
||||
<xsd:simpleContent> |
||||
<xsd:extension base="xsd:string"> |
||||
<xsd:attribute ref="xml:lang"/> |
||||
</xsd:extension> |
||||
</xsd:simpleContent> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="structureType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="taxonpathType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source" minOccurs="0"/> |
||||
<xsd:element ref="taxon" minOccurs="0" maxOccurs="1"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="taxonType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="id" minOccurs="0"/> |
||||
<xsd:element ref="entry" minOccurs="0"/> |
||||
<xsd:element ref="taxon" minOccurs="0" maxOccurs="1"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="technicalType" mixed="true"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="format" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="size" minOccurs="0"/> |
||||
<xsd:element ref="location" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="requirement" minOccurs="0" maxOccurs="unbounded"/> |
||||
<xsd:element ref="installationremarks" minOccurs="0"/> |
||||
<xsd:element ref="otherplatformrequirements" minOccurs="0"/> |
||||
<xsd:element ref="duration" minOccurs="0"/> |
||||
<xsd:group ref="grp.any"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="titleType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="typeType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="source"/> |
||||
<xsd:element ref="value"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="typicalagerangeType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="typicallearningtimeType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="datetime" minOccurs="0"/> |
||||
<xsd:element ref="description" minOccurs="0"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="valueType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<xsd:complexType name="versionType"> |
||||
<xsd:sequence> |
||||
<xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> |
||||
</xsd:sequence> |
||||
</xsd:complexType> |
||||
|
||||
<!-- ****************** --> |
||||
<!-- ** Simple Types ** --> |
||||
<!-- ****************** --> |
||||
|
||||
<xsd:simpleType name="formatType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="sizeType"> |
||||
<xsd:restriction base="xsd:int"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="datetimeType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="idType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="metadataschemeType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="catalogType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="minimumversionType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
<xsd:simpleType name="maximumversionType"> |
||||
<xsd:restriction base="xsd:string"/> |
||||
</xsd:simpleType> |
||||
|
||||
</xsd:schema> |
@ -1,20 +0,0 @@ |
||||
<?php // $id: $
|
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
$langFile = "scormdocument"; |
||||
|
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
$openDir = $_GET['openDir']; |
||||
$pos=strrpos($openDir,'//'); |
||||
$nameTools = substr($openDir,$pos+1,strlen($openDir)); |
||||
|
||||
$noPHP_SELF=true; |
||||
|
||||
$interbreadcrumb[]= array ("url"=>"./scormdocument.php", "name"=> get_lang('Doc')); |
||||
Display::display_header($nameTools,"Path"); |
||||
?> |
@ -1,50 +0,0 @@ |
||||
<?php |
||||
/** |
||||
============================================================================== |
||||
* DEPRECATED |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
/* |
||||
---------------------------------------------------------------------- |
||||
|
||||
!!!!!!!!!!!!!!! NO LONGER IN USE !!!!!!!!!!!!!!!!!!!!!!!!!! |
||||
|
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
$time=time(); |
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
if ($_user['user_id']=='') |
||||
{ //that means, that the used logged out in the other window |
||||
echo "<script type=\"text/javascript\"> |
||||
/* <![CDATA[ */ |
||||
alert('".get_lang('ScormLoggedout')."'); |
||||
window.close(); |
||||
/* ]]> */ |
||||
</script>"; |
||||
exit(); |
||||
} |
||||
echo "<html><head><title>".get_lang('ScormTitle')."</title></head>"; ?> |
||||
|
||||
|
||||
<frameset rows="40,*" frameborder="yes" framespacing="1"> |
||||
<frameset cols="500,*,0,0,0" frameborder="yes" framespacing="1"> |
||||
<frame name="load" src="load.php<?php echo "?file=$file&openDir=$openDir&time=$time"; ?>" scrolling="no">
|
||||
<frame name="message" scrolling="no"> |
||||
<frame name="API" src="scormfunctions.php<?php echo "?$time"; ?>"> <!-- Scorm 1.2 contents search for this -->
|
||||
<frame name="API_1484_11" src="scormfunctions.php<?php echo "?$time"; ?>"> <!-- Scorm 1.3 contents search for this -->
|
||||
<frame name="hidden3"> |
||||
</frameset> |
||||
<frameset cols="270,100%" frameborder="yes" framespacing="1"> |
||||
<frame name='contents' scrolling='auto' src="contents.php<?php echo "?file=$file&openDir=$openDir&time=$time"; ?>">";
|
||||
<frame name="sco" scrolling="auto"> |
||||
</frameset> |
||||
</frameset> |
||||
<noframes><body bgcolor="#FFFFFF"> |
||||
Your browser cannot handle frames ! |
||||
</body></noframes> |
||||
</html> |
@ -1,127 +0,0 @@ |
||||
<?php |
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* This file is the buttons menu that allows going forward-backward in the |
||||
* SCORM sequence. It is independent from the current element viewed. |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
|
||||
//this file loads in when the whole content is loaded, and does not refresh while in operaion ! |
||||
|
||||
*/ |
||||
//error_log($_SERVER['REQUEST_URI'],0); |
||||
$time=time(); |
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
header('Content-Type: text/html; charset='. $charset); |
||||
|
||||
$indexRoute = $_REQUEST['indexRoute']; |
||||
$file = $_REQUEST['file']; |
||||
// Check if the requested file is in the right location (scorm folder in course directory and no .. in the path) |
||||
$file_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm'; |
||||
if(substr($file,0,strlen($file_path)) != $file_path || strpos($file,'..') > 0) |
||||
{ |
||||
api_not_allowed(); |
||||
} |
||||
$edoceo = $_REQUEST['edoceo']; |
||||
$openDir = $_REQUEST['openDir']; |
||||
|
||||
$backurl = $_REQUEST['backurl']; |
||||
$fs = $_REQUEST['fs']; |
||||
|
||||
$who=$_user ['firstName']." ".$_user ['lastName']; |
||||
|
||||
$RequestUri = GetbackURL($_SERVER["REQUEST_URI"]); |
||||
|
||||
?> |
||||
<html> |
||||
<head> |
||||
<link rel="stylesheet" type="text/css" href="../css/scorm.css"> |
||||
</head> |
||||
<body> |
||||
<form action="contents.php<?php echo "?file=$file&openDir=".urlencode($openDir)."&edoceo=$edoceo&time=$time"; ?>" method="post" target="contents" name='theform'>
|
||||
<table cellpadding='0' cellspacing='0' align='left'><tr><td><font color='white'><div align='left' style='margin-left: 0.5em'> |
||||
|
||||
<a href="contents.php?menu=my_status&file=<?php echo "$file&openDir=$openDir&edoceo=$edoceo&time=$time&fs=$fs"; ?>#statustable" target="sco"><img border="0" src="../img/scormstatus.gif" title="<?php echo get_lang('ScormMystatus'); ?>"></a>
|
||||
<a href="javascript:document.theform.menu.value='prev';document.theform.submit();"><img border="0" src="../img/previous.gif" title="<?php echo get_lang('ScormPrevious'); ?>"></a>
|
||||
|
||||
<a href="javascript:document.theform.menu.value='next';document.theform.submit();"><img border="0" src="../img/next.gif" title="<?php echo get_lang('ScormNext'); ?>"></a>
|
||||
|
||||
<a href="javascript:document.theform.menu.value='restart';document.theform.submit();"><img border="0" src="../img/scormrestart.jpg" title="<?php echo get_lang('ScormRestart'); ?>"></a>
|
||||
|
||||
|
||||
<?php
|
||||
if (isset($_GET["fs"])) |
||||
{ |
||||
if(strcmp($_GET["fs"],"true")==0) |
||||
{ |
||||
?> |
||||
<a href="<?php echo $RequestUri."&fs=false"; ?>" target='_top'><img border="0" src="../img/scormexitfullscreen.jpg" title="<?php echo get_lang('ScormExitFullScreen'); ?>"></a>
|
||||
|
||||
<?php |
||||
} |
||||
else |
||||
{ |
||||
?> |
||||
<a href="<?php echo $RequestUri."&fs=true"; ?>" target='_top'><img border="0" src="../img/scormfullscreen.jpg" title="<?php echo get_lang('ScormFullScreen'); ?>"></a>
|
||||
|
||||
<?php |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
?> |
||||
<a href="<?php echo $RequestUri."&fs=true"; ?>" target='_top'><img border="0" src="../img/scormfullscreen.jpg" title="<?php echo get_lang('ScormFullScreen'); ?>"></a>
|
||||
|
||||
<?php |
||||
} |
||||
|
||||
// functions |
||||
|
||||
|
||||
// get backurl from $_SERVER["REQUEST_URI"] |
||||
function GetbackURL($path) |
||||
{ |
||||
$url = explode('backurl=',$path); |
||||
$url = explode('showinframes.php?',$url[1]); |
||||
return ClearbackURL("showinframes.php?".$url[1]); |
||||
} |
||||
// cut "&fs=true" |
||||
function ClearbackURL($path) |
||||
{ |
||||
$url = explode('&fs=',$path); |
||||
return $url[0]; |
||||
} |
||||
|
||||
?> |
||||
</font></div></td></tr></table> |
||||
<input type='hidden' name='menu' value='init' /> |
||||
</form> |
||||
<?php |
||||
api_session_unregister('s_href'); |
||||
//api_session_unregister('s_identifier'); |
||||
?> |
||||
</body> |
||||
</html> |
@ -1,181 +0,0 @@ |
||||
<?php // $id: $
|
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
* Opens a scorm lesson |
||||
============================================================================== |
||||
*/ |
||||
|
||||
//Maritime :if you open the first, done it, then the second, then the first and not done it and then the second, then //your access is denied (the scos behave this way) !! |
||||
//error_log($_SERVER['REQUEST_URI'],0); |
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
include('XMLencode.php'); |
||||
$charset = GetXMLEncode($_GET['file']); |
||||
header('Content-Type: text/html; charset='. $charset); |
||||
|
||||
//error_log("Opensco start... s_identifier is now:".$_SESSION['s_identifier']." and old s_identifier is now:".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
|
||||
//$TBL_SCORM_SCO_DATA=$scormDbName."`.`scorm_sco_data"; |
||||
$TBL_SCORM_SCO_DATA = Database::get_scorm_sco_data_table(); |
||||
$sco_href = base64_decode($_GET['sco_href']); |
||||
$sco_identifier = $_GET['sco_identifier']; |
||||
$file = $_GET['file']; |
||||
$edoceo = $_GET['edoceo']; |
||||
$items = $_SESSION['items']; |
||||
$contentId = $_SESSION['contentId']; |
||||
$openDir = $_REQUEST['openDir']; |
||||
//prepare those variables for scormfunctions.php |
||||
$_SESSION['file']=$file; |
||||
$charset_lang = 'ISO-8859-15'; |
||||
/* |
||||
* Small utility function to position the menu on a sensible item (several elements before the current one) |
||||
* @param string sco_id of the target element |
||||
* @param array reference to the items array |
||||
* @param array reference to the sco_id inverse-index array |
||||
* @param integer Optional number of elements we want before the selected element |
||||
* @return string sco_id (and HTML anchor ID) of the element to which the menu should point |
||||
* @author Yannick Warnier <yannick.warnier@dokeos.com> |
||||
* |
||||
function get_better_anchor_target($my_id, &$my_items, &$my_items_dictionary, $num = 6){ |
||||
$k = $my_items_dictionary[$my_id]; |
||||
if( ( $k<$num ) || (!is_array($my_items[$k-$num]))){ |
||||
return $my_items[1]['identifier']; |
||||
}else{ |
||||
return $my_items[$k-$num]['identifier']; |
||||
} |
||||
return $my_items[1]['identifier']; |
||||
} |
||||
Function apparently useless to call from here |
||||
*/ |
||||
|
||||
if(!is_array($items)){ |
||||
//error_log('$items is not an array!!!',0); |
||||
} |
||||
|
||||
//the problem is that it is not sure that the closesco.php is called, maybe not, the user can click to any other sco |
||||
//without finishing the current one, that is why that this code looks ugly |
||||
|
||||
/*====================================== |
||||
SEARCHING FOR PREREQUISITIES OF COURSE |
||||
======================================*/ |
||||
|
||||
//$i=0; |
||||
$i=$_SESSION['items_dictionary'][$sco_identifier]; |
||||
//do { |
||||
// $i++; |
||||
//} while (($items[$i]['identifier'] != $sco_identifier) and ($i <= count($items))); |
||||
//while goes on if it is true, it stops at false |
||||
//we search the prerequisites of the current course (now only working for scorm 1.2 ; scorm 1.3 use another method) |
||||
$prereq=$items[$i]['prereq']; |
||||
$title=$items[$i]['title']; |
||||
//$i=0; |
||||
$i=$_SESSION['items_dictionary'][$prereq]; |
||||
//do { |
||||
// $i++; |
||||
//} while (($items[$i]['identifier'] != $prereq) and ($i <= count($items))); |
||||
$prereqtitle=$items[$i]['title']; |
||||
if ($prereq != '') { |
||||
$result = api_sql_query("SELECT status FROM $TBL_SCORM_SCO_DATA |
||||
WHERE (scoIdentifier='$prereq' and studentId='".$_user['user_id']."' and contentId='$contentId')",__FILE__,__LINE__); |
||||
//echo "SELECT status FROM `$TBL_SCORM_SCO_DATA` WHERE (scoIdentifier='$prereq' and studentId='".$_user['user_id']."' and contentId='$contentId')"; |
||||
$ar=mysql_fetch_array($result); |
||||
$status=$ar['status']; |
||||
if ($status=='completed' or $status='passed') { $openpage=true; } else { $openpage=false; } |
||||
} else { |
||||
$openpage=true; |
||||
} |
||||
|
||||
/*============================== |
||||
OPENING THE PAGE IF ACCESSIBLE |
||||
==============================*/ |
||||
|
||||
if ($openpage) { |
||||
api_session_unregister('s_href'); |
||||
//api_session_unregister('s_identifier'); |
||||
//unset($_SESSION['s_identifier']); |
||||
|
||||
//If the user clicked on an item directly in the menu, then we didn't pass through |
||||
//content.php, and consequently $_SESSION['s_identifier'] has not been renewed. |
||||
//It is important to reset $_SESSION['s_identifier'] and $_SESSION['old_sco_identifier'] |
||||
//before loading scormfunctions.php, which will use them to call closesco.php |
||||
if($sco_identifier != $_SESSION['s_identifier']){ |
||||
$_SESSION['s_identifier'] = $sco_identifier; |
||||
$_SESSION['old_sco_identifier'] = $sco_identifier; |
||||
} |
||||
|
||||
$s_href=$sco_href; |
||||
//$_SESSION['s_identifier']=$sco_identifier; |
||||
|
||||
//check that file actually exists on this system (or if it doesn't start with the domain name |
||||
// of this system, leave it to the risk of generating a crappy apache list page - we cannot be sure) |
||||
$my_href = str_replace(api_get_path(WEB_PATH),api_get_path(SYS_PATH),$sco_href); |
||||
if(($my_href == $sco_href) or (is_file(preg_replace('/(.*)\?.*/','$1',$my_href)))){ |
||||
//ok |
||||
}else{ |
||||
$sco_href = 'blank.php'; |
||||
} |
||||
|
||||
api_session_register('s_href'); |
||||
//api_session_register('s_identifier'); |
||||
|
||||
$pos=strpos($sco_href,'http:',5); //in case of external sco_hrefs, we cut the Dokoes-related part off |
||||
if ($pos === false) { |
||||
} else { |
||||
$sco_href=substr($sco_href,$pos); |
||||
} |
||||
|
||||
echo "<html><head><link rel='stylesheet' type='text/css' href='../css/scorm.css'></head><body>", |
||||
"<script type='text/javascript'>\n/* <![CDATA[ */\n"; |
||||
//ok that the session has the s_href and the s_identifier but the scormfunction.php ran before this and |
||||
//these new variables are not written in the hidden scormfunction.php in the hidden frame, so we must |
||||
//refresh it in order to be able to use these variables ! here is the refresh : |
||||
if ($edoceo=="no") { |
||||
echo |
||||
"apiwindow=open('scormfunctions.php','API');", |
||||
"api1484window=open('scormfunctions.php','API_1484_11');"; |
||||
} |
||||
//$target_identifier = get_better_anchor_target($sco_identifier, $_SESSION['items'], $_SESSION['items_dictionary'],6); |
||||
echo |
||||
"zwindow=open('$sco_href','sco');", |
||||
"cwindow=open('contents.php?file=$file&edoceo=$edoceo&openDir=$openDir','contents');", |
||||
// "parent.load.document.location=parent.load.document.location;", |
||||
"\n/* ]]> */\n</script>", |
||||
"<div class='message'><font color='black'>$title</font></div></body></html>"; |
||||
//error_log("Opensco ending... s_identifier is now:".$_SESSION['s_identifier']." and old s_identifier is now:".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
} else { |
||||
//ugly patch with htmlentities here for the accentuated characters bug. See contents.php for a tip on how |
||||
// to improve this. |
||||
echo "<html><head><link rel='stylesheet' type='text/css' href='../css/scorm.css'></head><body>", |
||||
"<div class='message_thin'>".htmlentities(get_lang('ScormToEnter'),ENT_QUOTES,$charset_lang) |
||||
." <b>$title</b> ".htmlentities(get_lang('ScormFirstNeedTo'),ENT_QUOTES,$charset_lang) |
||||
." <b>$prereqtitle</b></div>.</body></html>"; |
||||
//error_log("Opensco ending (prereqs)... s_identifier is now:".$_SESSION['s_identifier']." and old s_identifier is now:".$_SESSION['old_sco_identifier'],0); |
||||
|
||||
} |
||||
|
||||
?> |
@ -1,82 +0,0 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
|
||||
$langFile = "scormdocument"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
api_session_register('items'); |
||||
echo "<html><head><title>".get_lang('ScormBuilder')." - Dokeos</title>"; |
||||
?> |
||||
<script type='text/javascript'> |
||||
/* <![CDATA[ */ |
||||
function gonnadie() { |
||||
if (window.opener && !window.opener.closed) { |
||||
opener.document.theform.starter.value='dead'; |
||||
} |
||||
} |
||||
function aliveagain() { |
||||
opener.document.theform.starter.value='alive'; |
||||
window.resizeTo(screen.width-250,screen.height-70-112); |
||||
window.moveTo(200,200); |
||||
alert('onload happened in new window'); |
||||
} |
||||
/* ]]> */ |
||||
</script> |
||||
</head> |
||||
<?php |
||||
if ($open=='builderwindow') { //opening the new browsing window and saving the title of Path |
||||
echo "<frameset rows='27,100%' frameborder='yes' framespacing='1' onunload='javascript:gonnadie()' onload='javascript:aliveagain()'>", |
||||
" <frame name='builderheader' scrolling='no' src='scormbuilderstarter.php'>", |
||||
" <frame name='buildernet' src='http://www.google.com'>", |
||||
"</frameset>"; //$rootWeb/index.php (Dokeos) |
||||
// UNDER CONSTRUCTION ----------------------------------------------------- |
||||
//$result = api_sql_query("INSERT INTO `$TBL_SCORM_MAIN` VALUES ('".$index."','".$defaultorgtitle."','".$_course['official_code']."')"); |
||||
// UNDER CONSTRUCTION END ------------------------------------------------- |
||||
} else { |
||||
//opening the normal Dokeos window |
||||
echo "<frameset rows='112,*' frameborder='yes' framespacing='1' onload='javascript:window.resizeTo(screen.width-200,screen.height-25)'>", |
||||
//if you put this : onload='javascript:window.resizeTo(screen.width-600,screen.height-50)' then |
||||
//the original Dokeos window will be resized |
||||
" <frame name='top' scrolling='no' target='contents' src='scormbuilderheader.php'>", |
||||
" <frameset cols='245,100%' frameborder='yes' framespacing='1'>", |
||||
" <frameset rows='143,*' frameborder='no' framespacing='0'>", |
||||
" <frame name='toc1' scrolling='no' src='scormbuilderadditem.php'>", |
||||
" <frame name='toc2' scrolling='no' src='scormbuilderbrowse.php'>", |
||||
" </frameset>", |
||||
" <frame name='net' scrolling='auto'"; |
||||
echo ">", |
||||
"</frameset>"; |
||||
} |
||||
?> |
||||
<noframes> |
||||
<body> |
||||
<p>This page uses frames, but your browser doesn't support them. |
||||
If you cannot use a more modern browser, please contact us to ask for a non-frames version. |
||||
</p> |
||||
</body> |
||||
</noframes> |
||||
</html> |
@ -1,113 +0,0 @@ |
||||
<?php |
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* This file is needed because this opens the new window and this keeps the contact with it |
||||
* if this reloads, I cannot reach the new window via Javascript |
||||
* so this window must stay and never reload |
||||
* |
||||
* @author Denes Nagy <darkden@freemail.hu> |
||||
* @version v 0.1 |
||||
* @access public |
||||
* |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
|
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
header('Content-Type: text/html; charset='. $charset); |
||||
|
||||
api_session_unregister('items'); |
||||
unset($items); |
||||
|
||||
?> |
||||
|
||||
<html><head> |
||||
<script type='text/javascript'> |
||||
/* <![CDATA[ */ |
||||
function additem() { |
||||
if (document.theform.started.value!='yes') { alert("First, click to start to begin browsing !"); return; } |
||||
if (window.builderwindow && window.builderwindow.open && !window.builderwindow.closed) { |
||||
alert("our little browsi is open, sure"); |
||||
} else { |
||||
alert("our little browsi is not found, my godness !"); |
||||
return false; |
||||
} |
||||
if (document.theform.starter.value=='dead') { alert("but the starter honey is dead inside"); //s=window.builderwindow.location.toString(); |
||||
} |
||||
if (document.theform.starter.value!='dead') { alert("and the starter honey is also alive"); //s=window.builderwindow.buildernet.location.toString(); |
||||
} |
||||
s=builderwindow.document.location.href; |
||||
//I can set the builderwindow.location.href, like this : |
||||
//builderwindow.location.href="http://www.hvg.hu"; |
||||
//BUT I cannot read it, if it is a web-url, not localhost !!!!!!!!!!!! |
||||
alert("browsi's loc : "+s); |
||||
//it took me 1 hour to discover that top.net.location is not a string in itself, and |
||||
//as a consequence, i cannot use indexOf function to that; but no error messages appeared ! never ! |
||||
//I hate Javascript !!! |
||||
c=s.charAt(s.length-1); |
||||
if (c=='/') { s=s.slice(0,s.length-1); } //we cut the final '/' if exists |
||||
last=s.lastIndexOf('/',s.length-2); |
||||
amount=s.length-last-1; |
||||
suggestion=s.slice(last+1, s.length); |
||||
answer=prompt('Give a name to this item : ',suggestion); |
||||
if (answer=='') { alert('You cannot add an item without a name !'); return false; } |
||||
if (answer) { |
||||
document.theform.newname.value=answer; |
||||
document.theform.newaddress.value=s; |
||||
} |
||||
document.theform.submit(); |
||||
s="<html><link rel='stylesheet' type='text/css' href='../css/scorm.css'></head><body bgcolor='#EEEEEE'><br><br><br><br>"; |
||||
s+="If you want to add more items to your Path, go back to the other browser window, select the desired "; |
||||
s+="page and click on <font color=red>'Add Item'</font> here.</body></html>"; |
||||
zwindow=open('','net'); |
||||
z=zwindow.document; |
||||
z.write(s); |
||||
z.close(); |
||||
} |
||||
function startit() { |
||||
if (document.theform.pathname.value=='') { alert('You MUST give a name first to your Path !'); return false; } |
||||
builderwindow=window.open('scormbuilder.php?open=builderwindow','builderwindow'); //with header frame |
||||
//builderwindow=window.open('http://www.google.com',''); //with no frames |
||||
document.theform.started.value="yes"; |
||||
} |
||||
/* ]]> */ |
||||
</script> |
||||
<link rel='stylesheet' type='text/css' href='../css/scorm.css'> |
||||
</head> |
||||
|
||||
<body bgcolor='#EEEEEE'><form action="scormbuilderbrowse.php" name='theform' target='toc2'><p style='text-align:justify'> |
||||
|
||||
<FIELDSET> |
||||
<LEGEND>Basic</LEGEND> |
||||
Give a name to your Path below and click 'Start' button, and a new window will open, where you can browse the web or Dokeos pages. If you find a page interesting, click 'Add Item' below to add it into your Path.<br><div align=center> |
||||
Path name : <input type='text' name='pathname' maxlength='100' size='6'></input><input type='button' onclick="startit()" value="START" /><br /> |
||||
<input type='button' onclick="additem()" value="ADD ITEM" /> |
||||
</FIELDSET> |
||||
<input type='hidden' name='newaddress'><input type='hidden' name='newname'> |
||||
<input type='hidden' name='action'><input type='hidden' name='starter'><input type='hidden' name='started'> |
||||
|
||||
</div> |
||||
</form></body></html> |
@ -1,132 +0,0 @@ |
||||
<?php |
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* The table of contents manager file of the Scorm Builder tool |
||||
* |
||||
* @author Denes Nagy <darkden@freemail.hu> |
||||
* @version v 0.1 |
||||
* @access public |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
|
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
header('Content-Type: text/html; charset='. $charset); ?> |
||||
|
||||
<html><head> |
||||
<script type='text/javascript'> |
||||
/* <![CDATA[ */ |
||||
function additem() { |
||||
var s=builderwindow.net.location.toString(); |
||||
//it took me 1 hour to discover that top.net.location is not a string in itself, and |
||||
//as a consequence, i cannot use indexOf function to that; but no error messages appeared ! never ! |
||||
//I hate Javascript !!! |
||||
c=s.charAt(s.length-1); |
||||
if (c=='/') { s=s.slice(0,s.length-1); } //we cut the final '/' if exists |
||||
last=s.lastIndexOf('/',s.length-2); |
||||
amount=s.length-last-1; |
||||
suggestion=s.slice(last+1, s.length); |
||||
answer=prompt('Give a name to this item : ',suggestion); |
||||
if (answer=='') { alert('You cannot add an item without a name !'); return false; } |
||||
if (answer) { |
||||
document.theform.newname.value=answer; |
||||
document.theform.newaddress.value=top.net.location; |
||||
} |
||||
document.theform.submit(); |
||||
builderwindow=open(s,''); |
||||
} |
||||
function addchaptertitle() { |
||||
answer=prompt('Write in the chapter title : ',''); |
||||
if (answer=='') { alert('You cannot add an empty chapter title !'); return false; } |
||||
if (answer) { |
||||
document.theform.newname.value=answer; |
||||
document.theform.newaddress.value=''; |
||||
} |
||||
document.theform.submit(); |
||||
} |
||||
/* ]]> */ |
||||
</script> |
||||
<link rel='stylesheet' type='text/css' href='../css/scorm.css' /> |
||||
</head> |
||||
|
||||
<body bgcolor='#EEEEEE'> |
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" name='theform'>
|
||||
<div align='left'> |
||||
<FIELDSET> |
||||
<LEGEND>Other building tools</LEGEND> |
||||
<br /> |
||||
<a href='#' onclick="addchaptertitle()" class='menu'>Add chapter title</a><br> |
||||
<a href='#' onclick="javascript:document.theform.action.value='clear';document.theform.submit();"; class='menu'>Clear Path</a><br /> |
||||
<br /> |
||||
</FIELDSET> |
||||
<br /> |
||||
</div> |
||||
<div align='center'> |
||||
<?php |
||||
echo "</div>", |
||||
"<input type='hidden' name='newaddress'><input type='hidden' name='newname'><input type='hidden' name='action'></form>"; |
||||
|
||||
if (($newaddress != '') || ($newname != '')) { |
||||
$newelement['url']=$newaddress; $newelement['name']=$newname; $items[]=$newelement; |
||||
} |
||||
if (($move == 'up') and ($index != 0)) { |
||||
$temp=$items[$index-1]; |
||||
$items[$index-1]=$items[$index]; |
||||
$items[$index]=$temp; |
||||
} |
||||
if (($move == 'down') and ($index != count($items)-1)) { |
||||
$temp=$items[$index+1]; |
||||
$items[$index+1]=$items[$index]; |
||||
$items[$index]=$temp; |
||||
} |
||||
if ($delete != '') { |
||||
array_splice($items,$delete,1); |
||||
} |
||||
if ($action=='clear') { |
||||
api_session_unregister('items'); |
||||
unset($items); |
||||
api_session_register('items'); |
||||
} |
||||
echo "<table width='245' cellpadding='0' cellspacing='0' border='0'>"; |
||||
for ($i=0; $i<count($items); $i++) { |
||||
echo "<tr><td>"; |
||||
if ($items[$i]['url'] != '') { |
||||
echo " <a href='{$items[$i]['url']}' target='net'>{$items[$i]['name']}</a>"; |
||||
} else { |
||||
echo "{$items[$i]['name']}"; |
||||
} |
||||
echo "</td><td>"; |
||||
if ($i != 0) { echo "<a href='".$_SERVER['PHP_SELF']."?move=up&index=$i'><img src='../img/up.gif' border='0' alt='Move up'></a>"; } |
||||
echo "</td><td>"; |
||||
if ($i != count($items)-1) { echo "<a href='".$_SERVER['PHP_SELF']."?move=down&index=$i' alt='Move down'><img src='../img/down.gif' border=0></a>"; } |
||||
echo "</td><td><a href='".$_SERVER['PHP_SELF']."?delete=$i'><img src='../img/delete.gif' border='0' alt='Delete'></a><td>", |
||||
"<img src='../img/scormpre.gif' border=0 alt='Prerequirements'>", |
||||
"</td></tr>"; |
||||
} |
||||
echo "</table>"; |
||||
//print_r($items); |
||||
?> |
||||
</body></html> |
@ -1,15 +0,0 @@ |
||||
<?php |
||||
/** |
||||
============================================================================== |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
$langFile = "scormdocument"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
$nameTools = get_lang('ScormBuilder'); |
||||
$noPHP_SELF=true; |
||||
$interbreadcrumb[]= array ("url"=>"./scormdocument.php", "name"=> get_lang('Doc')); |
||||
Display::display_header($nameTools,"Path"); |
||||
?> |
@ -1,48 +0,0 @@ |
||||
<?php |
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
* |
||||
* The starter frame of the new browser window. In case of Onload and onunload, the frameset of thisit modifies a |
||||
* variable in the opener window. |
||||
* |
||||
* @author Denes Nagy <darkden@freemail.hu> |
||||
* @version v 0.1 |
||||
* @access public |
||||
* @package dokeos.scorm |
||||
*/ |
||||
|
||||
$langFile = "scorm"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
header('Content-Type: text/html; charset='. $charset); ?> |
||||
|
||||
<html><head> |
||||
<script type='text/javascript'> |
||||
|
||||
</script> |
||||
<link rel='stylesheet' type='text/css' href='../css/scorm.css' /> |
||||
</head> |
||||
|
||||
<body bgcolor='#EEEEEE'> |
||||
All the Tools you need are in the original Dokeos window... |
||||
</body></html> |
File diff suppressed because it is too large
Load Diff
@ -1,276 +0,0 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* API event handler functions for Scorm 1.1 and 1.2 and 1.3 |
||||
* |
||||
* @author Denes Nagy <darkden@freemail.hu> |
||||
* @version v 1.0 |
||||
* @access public |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
|
||||
/* |
||||
============================================================================== |
||||
INIT SECTION |
||||
============================================================================== |
||||
*/ |
||||
|
||||
// if you open the imsmanifest.xml via local machine (f.ex.: file://c:/...), then the Apiwrapper.js |
||||
// of Maritime Navigation when trying to execute this row |
||||
// var result = api.LMSInitialize(""); |
||||
// get the error response : you are not authorized to call this function |
||||
|
||||
|
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
$TBL_SCORM_SCO_DATA=$scormDbName.".scorm_sco_data"; |
||||
$old_s_identifier = $_SESSION['old_sco_identifier']; |
||||
$my_s_identifier = $_SESSION['s_identifier']; |
||||
$file = $_SESSION['file']; |
||||
|
||||
//in some cases (manual clicks), there is no "old" s_identifier because there is no "new" one. |
||||
if(empty($old_s_identifier)){ |
||||
$old_s_identifier = $my_s_identifier; |
||||
} |
||||
|
||||
/* |
||||
============================================================================== |
||||
JavaScript Functions |
||||
============================================================================== |
||||
*/ |
||||
?> |
||||
<html><head><script type='text/javascript'> |
||||
/* <![CDATA[ */ |
||||
var alerts=0; //debug output level. 0 = none, 1=light, 2=a lot, 3(not implemented)=all |
||||
if (alerts>1) { alert('scormfunctions.php included'); } |
||||
|
||||
function APIobject() { |
||||
this.LMSInitialize=LMSInitialize; //for Scorm 1.2 |
||||
this.Initialize=LMSInitialize; //for Scorm 1.3 |
||||
this.LMSGetValue=LMSGetValue; |
||||
this.GetValue=LMSGetValue; |
||||
this.LMSSetValue=LMSSetValue; |
||||
this.SetValue=LMSSetValue; |
||||
this.LMSCommit=LMSCommit; |
||||
this.Commit=LMSCommit; |
||||
this.LMSFinish=LMSFinish; |
||||
this.Finish=LMSFinish; |
||||
this.LMSGetLastError=LMSGetLastError; |
||||
this.GetLastError=LMSGetLastError; |
||||
this.LMSGetErrorString=LMSGetErrorString; |
||||
this.GetErrorString=LMSGetErrorString; |
||||
this.LMSGetDiagnostic=LMSGetDiagnostic; |
||||
this.GetDiagnostic=LMSGetDiagnostic; |
||||
this.Terminate=Terminate; //only in Scorm 1.3 |
||||
} |
||||
|
||||
//it is not sure that the scos use the above declarations |
||||
|
||||
API = new APIobject(); //for scrom 1.2 |
||||
api = new APIobject(); //for scrom 1.2 |
||||
API_1484_11 = new APIobject(); //for scrom 1.3 |
||||
api_1484_11 = new APIobject(); //for scrom 1.3 |
||||
|
||||
var G_NoError = 0; |
||||
var G_GeneralException = 101; |
||||
var G_ServerBusy = 102; |
||||
var G_InvalidArgumentError = 201; |
||||
var G_ElementCannotHaveChildren = 202; |
||||
var G_ElementIsNotAnArray = 203; |
||||
var G_NotInitialized = 301; |
||||
var G_NotImplementedError = 401; |
||||
var G_InvalidSetValue = 402; |
||||
var G_ElementIsReadOnly = 403; |
||||
var G_ElementIsWriteOnly = 404; |
||||
var G_IncorrectDataType = 405; |
||||
|
||||
var G_LastError = G_NoError ; |
||||
|
||||
var commit = false ; |
||||
|
||||
var score=0; |
||||
var max=0; |
||||
var min=0; |
||||
var lesson_status=''; |
||||
var session_time=0; |
||||
|
||||
function LMSInitialize() { //this is the initialize function of all APIobjects |
||||
if (alerts>0) { alert('LMSInitialise() called (by SCORM content)'); } |
||||
//initialise the lesson status between two lessons, to avoid status override |
||||
lesson_status = ''; |
||||
return('true'); |
||||
} |
||||
|
||||
function Initialize() { //this is the initialize function of all APIobjects |
||||
return LMSInitialize(); |
||||
} |
||||
|
||||
|
||||
function LMSGetValue(param) { |
||||
var result; |
||||
switch(param) { |
||||
case 'cmi.core._children' : |
||||
case 'cmi.core_children' : |
||||
result='entry, exit, lesson_status, student_id, student_name, lesson_location, total_time, credit, lesson_mode, score, session_time'; break; |
||||
case 'cmi.core.entry' : result=''; break; |
||||
case 'cmi.core.exit' : result=''; break; |
||||
case 'cmi.core.lesson_status' : |
||||
if(lesson_status != '') {result=lesson_status;} |
||||
else{<?php |
||||
$result = api_sql_query("SELECT status FROM $TBL_SCORM_SCO_DATA WHERE (studentId='".$_user['user_id']."' and scoIdentifier='$my_s_identifier')"); |
||||
$ar=mysql_fetch_array($result); |
||||
$status=$ar['status']; |
||||
if(empty($ar['status'])){$status = "not attempted";} |
||||
#echo "{ if (alerts>1) { alert('Status of $s_identifier : $status'); } |
||||
# TODO: implement this better thanks to the runtime environment doc of SCORM |
||||
echo " result='$status';";?> |
||||
} |
||||
break; |
||||
case 'cmi.core.student_id' : <?php echo "result='".$_user['user_id']."';"; ?> break;
|
||||
case 'cmi.core.student_name' : |
||||
<?php |
||||
$who=$_user ['firstName']." ".$_user ['lastName']; |
||||
echo "{ result='$who'; }"; |
||||
?> break; |
||||
case 'cmi.core.lesson_location' : result=''; break; |
||||
case 'cmi.core.total_time' : result='0000:00:00.00';break; |
||||
case 'cmi.core.score._children' : result='raw,min,max'; break; |
||||
case 'cmi.core.score.raw' : result=score; break; |
||||
case 'cmi.core.score.max' : result='100'; break; |
||||
case 'cmi.core.score.min' : result='0'; break; |
||||
case 'cmi.core.score' : result='0'; break; |
||||
case 'cmi.core.credit' : result='credit'; break; |
||||
case 'cmi.core.lesson_mode' : result='normal'; break; |
||||
case 'cmi.suspend_data' : result=''; break; |
||||
case 'cmi.launch_data' : result=''; break; |
||||
case 'cmi.objectives._count' : result='0'; break; |
||||
default : result=''; break; |
||||
} |
||||
if (alerts>0) { alert("SCORM calls LMSGetValue('"+param+"')\nReturned '"+result+"'"); } |
||||
return result; |
||||
} |
||||
|
||||
function GetValue(param) { |
||||
return LMSGetValue(param); |
||||
} |
||||
|
||||
function LMSSetValue(param, val) { |
||||
if (alerts>0) { alert("SCORM calls LMSSetValue('"+param+"','"+val+"')"); } |
||||
switch(param) { |
||||
case 'cmi.core.score.raw' : score= val ; break; |
||||
case 'cmi.core.score.max' : max = val; break; |
||||
case 'cmi.core.score.min' : min = val; break; |
||||
case 'cmi.core.lesson_status' : lesson_status = val; break; |
||||
case 'cmi.completion_status' : lesson_status = val; break; //1.3 |
||||
case 'cmi.core.session_time' : session_time = val; break; |
||||
case 'cmi.score.scaled' : score = val ; break; //1.3 |
||||
case 'cmi.success_status' : success_status = val; break; //1.3 |
||||
} |
||||
return(true); |
||||
} |
||||
|
||||
function SetValue(param, val) { |
||||
return LMSSetValue(param, val); |
||||
} |
||||
|
||||
function savedata(origin) { //origin can be 'commit', 'finish' or 'terminate' |
||||
//if( ( lesson_status == 'incomplete') && (score >= (0.8*max) ) ){ |
||||
// lesson_status = 'completed'; |
||||
//} |
||||
param = 'origin='+origin+'&score='+score+'&max='+max+'&min='+min+'&lesson_status='+lesson_status+'&time='+session_time; |
||||
|
||||
url="http://<?php |
||||
$self=$_SERVER['PHP_SELF']; |
||||
$url=$_SERVER['HTTP_HOST'].$self; |
||||
$url=substr($url,0,-19);//19 is the length of this file's name (/scormfunctions.php) |
||||
echo $url; |
||||
?>/closesco.php?<?php echo "sco_identifier=$old_s_identifier&file=$file&"; ?>" + param + "";
|
||||
scowindow=open(url,'message'); |
||||
//the window.location command does not work here !!!! |
||||
//and for some reason if I just call closesco.php without http//..., it does not work either |
||||
if (alerts>1) { alert('saving data : '+url); } |
||||
} |
||||
|
||||
function LMSCommit(val) { |
||||
if (alerts>0) { alert('LMSCommit() called'); } |
||||
commit = true ; |
||||
savedata('commit'); |
||||
return('true'); |
||||
} |
||||
|
||||
function Commit(val) { |
||||
return LMSCommit(val); |
||||
} |
||||
|
||||
function LMSFinish(val) { |
||||
if (( commit == false ) && (alerts>0)) { alert('LMSFinish() called without LMSCommit()'); } |
||||
if ( commit == true ) { |
||||
if(alerts>0) { alert('LMSFinish() called');} |
||||
savedata('finish'); |
||||
} |
||||
return('true'); |
||||
} |
||||
|
||||
function Finish(val) { |
||||
return LMSFinish(val); |
||||
} |
||||
|
||||
function LMSGetLastError() { |
||||
if (alerts>1) { alert('LMSGetLastError() called'); } |
||||
return(G_LastError); |
||||
} |
||||
|
||||
function GetLastError() { |
||||
return LMSGetLastError(); |
||||
} |
||||
|
||||
function LMSGetErrorString(errCode){ |
||||
if (alerts>1) { alert('LMSGetErrorString() called'); } |
||||
return('No error !'); |
||||
} |
||||
|
||||
function GetErrorString(errCode){ |
||||
return LMSGetErrorString(errCode); |
||||
} |
||||
|
||||
function LMSGetDiagnostic(errCode){ |
||||
if (alerts>1) { alert('LMSGetDiagnostic() called'); } |
||||
return(API.LMSGetLastError()); |
||||
} |
||||
|
||||
function GetDiagnostic(errCode){ |
||||
return LMSGetDiagnostic(errCode); |
||||
} |
||||
|
||||
function Terminate(){ |
||||
if (alerts>0) { alert('Terminate() called'); } |
||||
commit = true; |
||||
savedata('terminate'); |
||||
return (true); |
||||
} |
||||
/* ]]> */ |
||||
</script> |
||||
</head> |
||||
<body><i><b>This is an API / API_1484_11 system window. Nothing to be worried about!</b></i></body></html> |
@ -1,217 +0,0 @@ |
||||
<?php //$id: $
|
||||
/* |
||||
---------------------------------------------------------------------- |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2005 Dokeos S.A. |
||||
Copyright (c) Yannick Warnier (yannick.warnier@dokeos.com) |
||||
Copyright (c) Denes Nagy (darkden@freemail.hu) |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
---------------------------------------------------------------------- |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* Library containing functions to parse the imsmanifest.xml file that goes |
||||
* along every SCORM content. |
||||
* |
||||
* @author Denes Nagy <darkden@freemail.hu> |
||||
* @access public |
||||
* |
||||
* @package dokeos.scorm |
||||
* |
||||
============================================================================== |
||||
*/ |
||||
|
||||
/** |
||||
* Sets the href string value of the element whose identifierref field equals the given identifier. |
||||
* Modifies the $items array. |
||||
* @param string Identifier seeked |
||||
* @param string href link to set in the $items array |
||||
* @return void Nothing |
||||
*/ |
||||
function put_it_to_items($ident,$href) { //from the resources array, it puts the href to the appropriate place in items array |
||||
global $items; |
||||
$i=1; |
||||
while ($items[$i]) { |
||||
if ($items[$i]['identifierref']==$ident) { $items[$i]['href']=$href; } |
||||
$i++; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* This handles the start tags. Modifies the $items array. |
||||
* name is the name of the tag, if more attributes than $attribs is an array |
||||
* @param resource Parser handler |
||||
* @param string Name of the tag |
||||
* @param mixed String or array of attributes |
||||
* @return void Nothing |
||||
*/ |
||||
function startElement($parser, $name, $attribs) |
||||
{ |
||||
global $xml_parser, $defaultorgref, $defaultorgtitle, $inorg, $initem, $intitle, $inmeta, $items, $itemindex, $tabledraw, $inversion, $prereq, $previouslevel, $clusterinfo, $ingeneral; |
||||
|
||||
if ($tabledraw) { |
||||
echo "<tr><td>"; |
||||
echo xml_get_current_line_number($xml_parser); |
||||
echo "</td><td>$inorg</td><td>$initem</td>"; |
||||
} |
||||
|
||||
if ($name=='ORGANIZATIONS') { |
||||
list($key, $value) = each($attribs); |
||||
$defaultorgref=$value; |
||||
} |
||||
if (($name=='ORGANIZATION') or ($name=='tableofcontents')) { |
||||
$inorg=true; |
||||
} |
||||
if ($name=='SCHEMAVERSION') { |
||||
$inversion=true; |
||||
} |
||||
if ($name=='ADLCP:PREREQUISITES') { |
||||
$prereq=true; |
||||
} |
||||
if ($name=='METADATA') { |
||||
$inmeta=true; |
||||
} |
||||
if ($name=='GENERAL') { |
||||
$ingeneral=true; |
||||
} |
||||
|
||||
|
||||
if ($name=='ITEM') { |
||||
$initem++; |
||||
$itemindex++; |
||||
while (list($key, $value) = each($attribs)) { |
||||
if ($key=='IDENTIFIERREF') { $items[$itemindex]['identifierref']=$value; } |
||||
if ($key=='IDENTIFIER') { $items[$itemindex]['identifier']=$value; } |
||||
if ($key=='PARAMETERS') { $items[$itemindex]['parameters']=$value; } |
||||
if ($key=='TITLE') { $items[$itemindex]['title']=$value; } |
||||
} |
||||
$items[$itemindex]['index']=$itemindex; |
||||
$items[$itemindex]['level']=$initem; |
||||
|
||||
if ($initem==$previouslevel) { $clusterinfo++; } |
||||
if ($initem>$previouslevel) { $clusterinfo=$clusterinfo*10+1; $previouslevel=$initem; } |
||||
if ($initem<$previouslevel) { $clusterinfo=floor($clusterinfo/10)+1; $previouslevel=$initem; } |
||||
$items[$itemindex]['clusterinfo']=$clusterinfo; |
||||
} |
||||
if ($name=='TITLE') { |
||||
$intitle=true; |
||||
} |
||||
if ($name=='RESOURCE') { //by the time it gets there, all the items are already read (overpassed) |
||||
while (list($key, $value) = each($attribs)) { |
||||
if ($key=='HREF') { $href=$value; } |
||||
if ($key=='IDENTIFIER') { $ident=$value; } |
||||
} |
||||
put_it_to_items($ident,$href); |
||||
} |
||||
|
||||
reset($attribs); //drawing the table |
||||
if ($tabledraw) { |
||||
echo "<td><font color='#0000cc'>$name</font></td>"; |
||||
if (sizeof($attribs)) { |
||||
while (list($k, $v) = each($attribs)) { |
||||
echo "<td><font color='#009900'>$k</font>=<font color='#990000'>$v</font></td>"; |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Handles the end tags |
||||
* @param resource Parser handler |
||||
* @param string Name of the closing tag |
||||
* @return void Nothing |
||||
*/ |
||||
function endElement($parser, $name) |
||||
{ |
||||
global $inorg,$initem,$inmeta,$ingeneral,$intitle,$inversion,$prereq; |
||||
|
||||
if (($name=='ORGANIZATION') or ($name=='tableofcontents')) { |
||||
$inorg=false; |
||||
} |
||||
if ($name=='ITEM') { |
||||
$initem--; |
||||
} |
||||
if ($name=='METADATA') { |
||||
$inmeta==false; |
||||
} |
||||
if ($name=='GENERAL') { |
||||
$ingeneral==false; |
||||
} |
||||
if ($name=='TITLE') { |
||||
$intitle=false; |
||||
} |
||||
if ($name=='SCHEMAVERSION') { |
||||
$inversion=false; |
||||
} |
||||
if ($name=='ADLCP:PREREQUISITES') { //this is only good for scorm 1.2 |
||||
$prereq=false; |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* handles the data between start and and tags. Modifies the $items array. |
||||
* note : if f.ex. Steering & sailing is the data, then this function is called 3 times !!! |
||||
* @param resource Parser handler |
||||
* @param string The data between start and stop tags |
||||
* @return void Nothing |
||||
*/ |
||||
function characterData($parser, $data) |
||||
{ |
||||
global $defaultorgtitle, $initem, $intitle, $inmeta, $inorg, $items, $itemindex, $inversion, $version, $prereq, $ingeneral; |
||||
//echo "<td>int:$intitle ino:$inorg ini:$initem inm:$inmeta</td>"; |
||||
if (($intitle==true) and ($inorg==true) and ($initem==false) and ($ingeneral==false)) { |
||||
$defaultorgtitle.=$data; |
||||
return; |
||||
} |
||||
if (($intitle==true) and ($initem==true)) { |
||||
$items[$itemindex]['title'].=$data; |
||||
return; |
||||
} |
||||
if ($inversion==true) { |
||||
$version=$data; //this will provide the last schemaversion tag version number only ! |
||||
return; |
||||
} |
||||
if ($prereq==true) { |
||||
$items[$itemindex]['prereq']=$data; |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Creates a new xml parser and returns an array containing the parser resource and the xml file resource. |
||||
* @param string Path to the XML file we want to parse |
||||
* @return mixed Array containing the parser handler and the XML file handler. |
||||
*/ |
||||
function new_xml_parser($request_file) |
||||
{ |
||||
global $parser_file; |
||||
|
||||
$xml_parser = xml_parser_create(); |
||||
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 1); |
||||
xml_set_element_handler($xml_parser, "startElement", "endElement"); //telling which function will handle start and end tags |
||||
xml_set_character_data_handler($xml_parser, "characterData"); |
||||
|
||||
if (!($fp = @fopen($request_file, "r"))) { |
||||
return false; |
||||
} |
||||
if (!is_array($parser_file)) { |
||||
settype($parser_file, "array"); |
||||
} |
||||
$parser_file[$xml_parser] = $request_file; |
||||
return array($xml_parser, $fp); |
||||
} |
||||
?> |
@ -1,162 +0,0 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004-2005 Dokeos S.A. |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium |
||||
Mail: info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* This is the copy of showinframes.php, with little modifications for the scorm player. |
||||
* |
||||
* Based on showincontext.php, this file will show documents in a separate frame. |
||||
* |
||||
* @author Denes Nagy |
||||
* @package dokeos.scorm |
||||
============================================================================== |
||||
*/ |
||||
|
||||
$langFile = "scormdocument"; |
||||
include('../inc/global.inc.php'); |
||||
$this_section=SECTION_COURSES; |
||||
|
||||
$openfirst = $_REQUEST['openfirst']; |
||||
$indexRoute = $_REQUEST['indexRoute']; |
||||
$file = $_REQUEST['file']; |
||||
$openDir = $_REQUEST['openDir']; |
||||
// Check if the requested file is in the right location (scorm folder in course directory and no .. in the path) |
||||
$file_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm'; |
||||
if(substr($file,0,strlen($file_path)) != $file_path || strpos($file,'..') > 0) |
||||
{ |
||||
api_not_allowed(); |
||||
} |
||||
echo "<html><head><title>".get_lang('Doc')." - Dokeos</title></head>"; |
||||
|
||||
$path=api_get_path(WEB_COURSE_PATH).api_get_course_path().'/scorm'.$openDir; |
||||
//if we find the given text in file (=imsmanifest.xml), then the content is an e-doceo contentm so |
||||
// API frames are not to be implemented |
||||
$filename=$path.'/imsmanifest.xml'; |
||||
$edoceo='no'; |
||||
// introducing the brand new... file check! ;-) |
||||
if (!is_file($filename)){ |
||||
// is this AICC? |
||||
}else{ |
||||
//detect if AICC |
||||
$handle = fopen($filename, "rb"); |
||||
$contents = ''; |
||||
while (!feof($handle)) { |
||||
$contents .= fread($handle, 8192); |
||||
} |
||||
fclose($handle); |
||||
|
||||
$needle="Made with elearning maker"; |
||||
$pos=strpos($contents, $needle); |
||||
if ($pos > 0) { $edoceo="yes"; } else { $edoceo="no"; } |
||||
} |
||||
|
||||
$time=time(); |
||||
|
||||
$backurl = getURL(api_get_path(WEB_PATH)).$_SERVER['REQUEST_URI']; |
||||
|
||||
|
||||
|
||||
if ((isset($_GET["fs"])) && (strcmp($_GET["fs"],"true")==0)) //fullscreen |
||||
|
||||
{ |
||||
?> |
||||
|
||||
<frameset rows="0,27,0,*,70,0,0" frameborder="no" framespacing="0"> |
||||
|
||||
<frame name="top" scrolling="no" target="contents" src="headerpage.php?openDir=<?php echo urlencode($openDir); ?>">
|
||||
<frame name="load" src="load.php<?php echo "?file=".urlencode($file)."&openDir=".urlencode($openDir)."&time=$time&backurl=$backurl&fs=true&edoceo=$edoceo"; ?>" scrolling="no">
|
||||
<frame name='contents' scrolling='auto' src="contents.php<?php echo "?file=".urlencode($file)."&openDir=".urlencode($openDir)."&time=$time&openfirst=$openfirst&edoceo=$edoceo"; ?>">
|
||||
<frame src="UntitledFrame-12" name="sco" scrolling="auto"> |
||||
<frame name="message" scrolling="no" src="blank.php"> |
||||
|
||||
<?php if (empty($indexRoute)) { ?> |
||||
|
||||
|
||||
<?php if ($edoceo=="no") { ?> |
||||
<frame name="API" src="scormfunctions.php<?php echo "?$time"; ?>"> <!-- Scorm 1.2 contents search for this -->
|
||||
<frame name="API_1484_11" src="scormfunctions.php<?php echo "?$time"; ?>"> <!-- Scorm 1.3 contents search for this -->
|
||||
<?php } else { ?> |
||||
<frame name="edoceo1" src="blank.php"> |
||||
<frame name="edoceo2" src="blank.php"> |
||||
<?php } ?> |
||||
|
||||
<?php } else { //indexRoute exists -> Plantyn content ?>
|
||||
|
||||
<frame name='contents' scrolling='auto' src="<?php echo "$path/$indexRoute"; ?>">
|
||||
<frame name="Untitled" src="blank.php"> |
||||
|
||||
<?php } ?> |
||||
|
||||
</frameset> |
||||
|
||||
|
||||
|
||||
<?php |
||||
} else { //not fullscreen |
||||
?> |
||||
|
||||
<frameset rows="100,*" frameborder="no" framespacing="0"> |
||||
|
||||
<frame name="top" scrolling="no" target="contents" src="headerpage.php?openDir=<?php echo urlencode($openDir); ?>">
|
||||
|
||||
<?php if (empty($indexRoute)) { ?> |
||||
|
||||
<frameset cols="220,*" frameborder="1" framespacing="2" border="1"> |
||||
<frameset rows="*,27,70" frameborder="no" framespacing="0"> |
||||
<frame name='contents' scrolling='auto' src="contents.php<?php echo "?file=".urlencode($file)."&openDir=".urlencode($openDir)."&time=$time&openfirst=$openfirst&edoceo=$edoceo"; ?>">
|
||||
<frameset cols="0,0,275" frameborder="no" framespacing="0"> |
||||
<?php if ($edoceo=="no") { ?> |
||||
<frame name="API" src="scormfunctions.php<?php echo "?$time"; ?>"> <!-- Scorm 1.2 contents search for this -->
|
||||
<frame name="API_1484_11" src="scormfunctions.php<?php echo "?$time"; ?>"> <!-- Scorm 1.3 contents search for this -->
|
||||
<?php } else { ?> |
||||
<frame name="edoceo1" src="blank.php"> |
||||
<frame name="edoceo2" src="blank.php"> |
||||
<?php } ?> |
||||
<frame name="load" src="load.php<?php echo "?file=".urlencode($file)."&openDir=".urlencode($openDir)."&time=$time&backurl=$backurl&edoceo=$edoceo"; ?>" scrolling="no">
|
||||
</frameset> |
||||
<frame name="message" scrolling="no" src="blank.php"> |
||||
</frameset> |
||||
|
||||
<frame name="sco" scrolling="auto"> |
||||
</frameset> |
||||
|
||||
<?php } else { //indexRoute exists -> Plantyn content ?>
|
||||
|
||||
<frame name='contents' scrolling='auto' src="<?php echo "$path/$indexRoute"; ?>">
|
||||
|
||||
<?php } ?> |
||||
|
||||
</frameset> |
||||
|
||||
|
||||
<?php |
||||
} |
||||
?> |
||||
|
||||
<noframes> |
||||
<body> |
||||
<p>This page uses frames, but your browser doesn't support them. |
||||
If you cannot use a more modern browser, please contact us to ask for a non-frames version. |
||||
</p> |
||||
</body> |
||||
</noframes> |
||||
</frameset> |
||||
</html> |
Loading…
Reference in new issue