latest changes
authorCindy Li <cli@ocad.ca>
Tue, 16 Feb 2010 20:50:54 +0000 (20:50 -0000)
committerCindy Li <cli@ocad.ca>
Tue, 16 Feb 2010 20:50:54 +0000 (20:50 -0000)
215 files changed:
docs/home/classes/ContentManager.class.php [new file with mode: 0644]
docs/home/classes/ContentUtility.class.php [new file with mode: 0644]
docs/home/course/content.php [new file with mode: 0644]
docs/home/course/content_nav_inline_editor_submit.php [new file with mode: 0644]
docs/home/course/course_property.php [new file with mode: 0644]
docs/home/course/del_course.php [new file with mode: 0644]
docs/home/course/index.php [new file with mode: 0644]
docs/home/course/outline.php [new file with mode: 0644]
docs/home/course/refresh_content_nav.php [new file with mode: 0644]
docs/home/create_course.php [new file with mode: 0644]
docs/home/ims/domainProfile_0/imsccauth_v1p0.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_0/imsccauth_v1p0_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/anyElement.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/anyElement_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/anyElement.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/dataTypes.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/elementNames.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/elementTypes.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/rootElement.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/vocabTypes.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/common/vocabValues.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/dataTypes_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/elementNames_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/elementTypes_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/extend/custom.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/imscc_m_definition.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/lomLoose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/lomLoose_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/loose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/rootElement_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/unique/loose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/vocab/loose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/vocabTypes_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_1/vocabValues_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/anyElement.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/anyElement_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/anyElement.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/dataTypes.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/elementNames.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/elementTypes.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/rootElement.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/vocabTypes.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/common/vocabValues.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/dataTypes_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/elementNames_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/elementTypes_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/extend/custom.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/imscc_mR_definition.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/lomLoose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/lomLoose_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/loose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/rootElement_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/unique/loose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/vocab/loose.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/vocabTypes_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_2/vocabValues_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_3/imscp_extensionv1p2.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_3/imscp_extensionv1p2_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_4/ims_qtiasiv1p2.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_4/ims_qtiasiv1p2_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_4/imscc_q_definition.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_4/xml.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_5/imswl_v1p0.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_5/imswl_v1p0_localised.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_6/imsdt_v1p0.xsd [new file with mode: 0644]
docs/home/ims/domainProfile_6/imsdt_v1p0_localised.xsd [new file with mode: 0644]
docs/home/ims/glossary.xsd [new file with mode: 0644]
docs/home/ims/ims_export.php [new file with mode: 0644]
docs/home/ims/ims_import.old.php [new file with mode: 0644]
docs/home/ims/ims_import.php
docs/home/ims/imscc_c1p2maeV0p15_definition.xsd [new file with mode: 0644]
docs/home/ims/imscp_v1p2.xsd [new file with mode: 0644]
docs/home/ims/imscp_v1p2_constraintsDocument.scmt [new file with mode: 0644]
docs/home/ims/imscp_v1p2_localised.xsd [new file with mode: 0644]
docs/home/ims/imsdt_v1p0_localised.xsd [new file with mode: 0644]
docs/home/ims/imsmanifest.xml [new file with mode: 0644]
docs/home/ims/imswl_v1p0_localised.xsd [new file with mode: 0644]
docs/home/ims/index.php [new file with mode: 0644]
docs/home/ims/main.xsd [new file with mode: 0644]
docs/home/ims/ns.inc.php [new file with mode: 0644]
docs/home/imscc/ims_export.php [new file with mode: 0644]
docs/home/index.php
docs/home/lib/test_result_functions.inc.php [new file with mode: 0644]
docs/home/prog.php [new file with mode: 0644]
docs/home/search.php [new file with mode: 0644]
docs/images/action_add.png [deleted file]
docs/images/action_delete.png [deleted file]
docs/images/arrow_back.png [new file with mode: 0644]
docs/images/arrow_next.png [new file with mode: 0644]
docs/images/medit.gif [new file with mode: 0644]
docs/images/mfolder.gif [new file with mode: 0644]
docs/images/mlock.gif [new file with mode: 0644]
docs/images/mpage.gif [new file with mode: 0644]
docs/images/mswitch_minus.gif [new file with mode: 0644]
docs/images/mswitch_plus.gif [new file with mode: 0644]
docs/images/tree/Thumbs.db [new file with mode: 0644]
docs/images/tree/index.html [new file with mode: 0644]
docs/images/tree/tree_collapse.gif [new file with mode: 0644]
docs/images/tree/tree_disabled.gif [new file with mode: 0644]
docs/images/tree/tree_end.gif [new file with mode: 0644]
docs/images/tree/tree_expand.gif [new file with mode: 0644]
docs/images/tree/tree_horizontal.gif [new file with mode: 0644]
docs/images/tree/tree_space.gif [new file with mode: 0644]
docs/images/tree/tree_split.gif [new file with mode: 0644]
docs/images/tree/tree_vertline.gif [new file with mode: 0644]
docs/images/x.gif [new file with mode: 0644]
docs/include/classes/A4a/A4a.class.php
docs/include/classes/A4a/A4aExport.class.php
docs/include/classes/A4a/A4aImport.class.php
docs/include/classes/DAO/ContentDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/ContentTestsAssocDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/CoursesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/DAO.class.php
docs/include/classes/DAO/LanguagesDAO.class.php
docs/include/classes/DAO/PrimaryResourcesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/PrimaryResourcesTypesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/ResourceTypesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/SecondaryResourcesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/SecondaryResourcesTypesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/TestsDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/TestsQuestionsAssocDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/UserCoursesDAO.class.php [new file with mode: 0644]
docs/include/classes/DAO/UsersDAO.class.php
docs/include/classes/FileUtility.class.php [new file with mode: 0644]
docs/include/classes/Language/LanguageManager.class.php
docs/include/classes/Language/RemoteLanguageManager.class.php
docs/include/classes/Menu.class.php
docs/include/classes/QTI/QTIImport.class.php
docs/include/classes/QTI/QTIParser.class.php
docs/include/classes/RESTWebServiceOutput.class.php [new file with mode: 0644]
docs/include/classes/User.class.php
docs/include/classes/Utility.class.php
docs/include/classes/Weblinks/WeblinksExport.class.php
docs/include/classes/XML/XML_HTMLSax/HTMLSax/XML_HTMLSax_Decorators.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/HTMLSax/XML_HTMLSax_States.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/OS/Guess.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/PEAR.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/PEAR/Autoloader.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/PEAR/Common.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/PEAR/Config.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/PEAR/Remote.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/System.php [new file with mode: 0644]
docs/include/classes/XML/XML_HTMLSax/XML_HTMLSax.php [new file with mode: 0644]
docs/include/classes/testQuestions.class.php [new file with mode: 0644]
docs/include/classes/vcard.php [new file with mode: 0644]
docs/include/constants.inc.php
docs/include/footer.inc.php
docs/include/header.inc.php
docs/include/imscc/ims_template.inc.php [new file with mode: 0644]
docs/include/jscripts/handleAjaxResponse.js [moved from docs/include/jscripts/handleResponse.js with 72% similarity]
docs/include/jscripts/transformable.js [new file with mode: 0644]
docs/include/lib/filemanager.inc.php [deleted file]
docs/include/lib/output.inc.php
docs/include/lib/pclzip_callback.lib.php [new file with mode: 0644]
docs/include/page_constants.inc.php
docs/include/side_menu.inc.php [new file with mode: 0644]
docs/include/vitals.inc.php
docs/install/db/db_schema.sql
docs/install/db/language_text.sql
docs/install/include/common.inc.php
docs/install/include/config_template.php
docs/install/include/header.inc.php
docs/install/include/step3.php
docs/install/include/step4.php
docs/install/include/upgrade_header.php
docs/install/include/ustep1.php
docs/install/include/ustep2.php
docs/language/index.php
docs/language/index_inline_editor_submit.php
docs/language/language_add_edit.php
docs/search.php [new file with mode: 0644]
docs/themes/default/home/course/content.tmpl.php [new file with mode: 0644]
docs/themes/default/home/course/course_property.tmpl.php [new file with mode: 0644]
docs/themes/default/home/create_course.tmpl.php [new file with mode: 0644]
docs/themes/default/home/create_course_tmpl.tmpl.php [new file with mode: 0644]
docs/themes/default/home/index_course.tmpl.php [new file with mode: 0644]
docs/themes/default/home/index_search.tmpl.php [new file with mode: 0644]
docs/themes/default/images/Thumbs.db [new file with mode: 0644]
docs/themes/default/images/bottom-right.gif [new file with mode: 0644]
docs/themes/default/images/bottom.gif [new file with mode: 0644]
docs/themes/default/images/course_property.png [new file with mode: 0644]
docs/themes/default/images/exit.png [new file with mode: 0644]
docs/themes/default/images/export.png [new file with mode: 0644]
docs/themes/default/images/goto_top.gif [new file with mode: 0644]
docs/themes/default/images/leftside.gif [new file with mode: 0644]
docs/themes/default/images/my_own_course.png [new file with mode: 0644]
docs/themes/default/images/next.gif [new file with mode: 0644]
docs/themes/default/images/previous.gif [new file with mode: 0644]
docs/themes/default/images/resume.gif [new file with mode: 0644]
docs/themes/default/images/rightside.gif [new file with mode: 0644]
docs/themes/default/images/top-right.gif [new file with mode: 0644]
docs/themes/default/images/top.gif [new file with mode: 0644]
docs/themes/default/include/box.tmpl.php [new file with mode: 0644]
docs/themes/default/include/footer.tmpl.php
docs/themes/default/include/header.tmpl.php
docs/themes/default/language/index.tmpl.php
docs/themes/default/language/language_add_edit.tmpl.php
docs/themes/default/login.tmpl.php
docs/themes/default/profile/index.tmpl.php
docs/themes/default/register.tmpl.php
docs/themes/default/styles.css
docs/themes/default/system/index.tmpl.php
docs/themes/default/updater/myown_patches.tmpl.php
docs/themes/default/updater/patch_create_edit.tmpl.php
docs/themes/default/user/index.tmpl.php
docs/themes/default/user/user_group.tmpl.php
docs/themes/default/user/user_group_create_edit.tmpl.php
docs/translation/index.php
docs/updater/classes/Patch.class.php
docs/updater/classes/PatchCreator.class.php
docs/updater/index.php
docs/updater/myown_patches_inline_editor_submit.php
docs/user/index_inline_editor_submit.php
docs/user/user_group_inline_editor_submit.php

diff --git a/docs/home/classes/ContentManager.class.php b/docs/home/classes/ContentManager.class.php
new file mode 100644 (file)
index 0000000..b1287a8
--- /dev/null
@@ -0,0 +1,1536 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+require_once(TR_INCLUDE_PATH. 'classes/DAO/ContentDAO.class.php');
+require_once(TR_INCLUDE_PATH. 'classes/Utility.class.php');
+
+class ContentManager
+{
+       /* db handler   */
+       var $db;
+
+       /*      array           */
+       var $_menu;
+
+       /*      array           */
+       var $_menu_info;
+
+       /*      array           */
+       var $_menu_in_order;
+
+       /* int                  */
+       var $course_id;
+
+       // private
+       var $num_sections;
+       var $max_depth;
+       var $content_length;
+       var $dao;
+       var $contentDAO;
+
+       /* constructor  */
+       function ContentManager($course_id) {
+               if (!($course_id > 0)) {
+                       return;
+               }
+               $this->course_id = $course_id;
+               $this->dao = new DAO();
+               $this->contentDAO = new ContentDAO();
+               
+               /* x could be the ordering or even the content_id       */
+               /* don't really need the ordering anyway.                       */
+               /* $_menu[content_parent_id][x] = array('content_id', 'ordering', 'title') */
+               $_menu = array();
+
+               /* number of content sections */
+               $num_sections = 0;
+
+               $max_depth = array();
+               $_menu_info = array();
+
+//             $sql = "SELECT content_id, content_parent_id, ordering, title, UNIX_TIMESTAMP(release_date) AS u_release_date, content_type 
+//                       FROM ".TABLE_PREFIX."content 
+//                      WHERE course_id=$this->course_id 
+//                      ORDER BY content_parent_id, ordering";
+//             $result = mysql_query($sql, $this->db);
+
+               $rows = $this->contentDAO->getContentByCourseID($this->course_id);
+               
+               if (is_array($rows)) {
+                       foreach ($rows as $row) {
+                               $num_sections++;
+                               $_menu[$row['content_parent_id']][] = array('content_id'=> $row['content_id'],
+                                                                                                                       'ordering'      => $row['ordering'], 
+                                                                                                                       'title'         => htmlspecialchars($row['title']),
+                                                                                                                       'content_type' => $row['content_type']);
+       
+                               $_menu_info[$row['content_id']] = array('content_parent_id' => $row['content_parent_id'],
+                                                                                                               'title'                         => htmlspecialchars($row['title']),
+                                                                                                               'ordering'                      => $row['ordering'],
+                                                                                                               'content_type' => $row['content_type']);
+       
+                               /* 
+                                * add test content asscioations
+                                * find associations per content page, and add it as a sublink.
+                                * @author harris
+                                */
+                               $test_rows = $this->getContentTestsAssoc($row['content_id']);
+                               if (is_array($test_rows)) {
+                                       foreach ($test_rows as $test_row){
+                                               $_menu[$row['content_id']][] = array(   'test_id'       => $test_row['test_id'],
+                                                                                                                               'title'         => htmlspecialchars($test_row['title']),
+                                                                                                                               'content_type' => CONTENT_TYPE_CONTENT);
+                                       } // end of foreach
+                               } // end of if
+                               /* End of add test content asscioations */
+       
+                               if ($row['content_parent_id'] == 0) {
+                                       $max_depth[$row['content_id']] = 1;
+                               } else {
+                                       $max_depth[$row['content_id']] = $max_depth[$row['content_parent_id']]+1;
+                               }
+                       } // end of foreach
+               } // end of if
+
+               $this->_menu = $_menu;
+
+               $this->_menu_info =  $_menu_info;
+
+               $this->num_sections = $num_sections;
+
+               if (count($max_depth) > 1) {
+                       $this->max_depth = max($max_depth);
+               } else {
+                       $this->max_depth = 0;
+               }
+
+               // generate array of all the content ids in the same order that they appear in "content navigation"
+               $this->_menu_in_order[] = $next_content_id = $this->getNextContentID(0);
+               while ($next_content_id > 0)
+               {
+                       $next_content_id = $this->getNextContentID($next_content_id);
+                       
+                       if (in_array($next_content_id, $this->_menu_in_order)) break;
+                       else if ($next_content_id > 0) $this->_menu_in_order[] = $next_content_id;
+               }
+               
+               $this->content_length = count($_menu[0]);
+       }
+
+       // This function is called by initContent to construct $this->_menu_in_order, an array to 
+       // holds all the content ids in the same order that they appear in "content navigation"
+       function getNextContentID($content_id, $order=0) {
+               // return first root content when $content_id is not given
+               if (!$content_id) {
+                       return $this->_menu[0][0]['content_id'];
+               }
+               
+               $myParent = $this->_menu_info[$content_id]['content_parent_id'];
+               $myOrder  = $this->_menu_info[$content_id]['ordering'];
+               
+               // calculate $myOrder, add in the number of tests in front of this content page
+               if (is_array($this->_menu[$myParent])) {
+                       $num_of_tests = 0;
+                       foreach ($this->_menu[$myParent] as $menuContent) {
+                               if ($menuContent['content_id'] == $content_id) break;
+                               if (isset($menuContent['test_id'])) $num_of_tests++;
+                       }
+               }
+               $myOrder += $num_of_tests;
+               // end of calculating $myOrder
+               
+               /* if this content has children, then take the first one. */
+               if ( isset($this->_menu[$content_id]) && is_array($this->_menu[$content_id]) && ($order==0) ) {
+                       /* has children */
+                       // if the child is a test, keep searching for the content id
+                       foreach ($this->_menu[$content_id] as $menuID => $menuContent)
+                       {
+                               if (!empty($menuContent['test_id'])) continue;
+                               else 
+                               {
+                                       $nextMenu = $this->_menu[$content_id][$menuID]['content_id'];
+                                       break;
+                               }
+                       }
+                       
+                       // all children are tests
+                       if (!isset($nextMenu))
+                       {
+                               if (isset($this->_menu[$myParent][$myOrder]['content_id'])) {
+                                       // has sibling
+                                       return $this->_menu[$myParent][$myOrder]['content_id'];
+                               }
+                               else { // no sibling
+                                       $nextMenu = $this->getNextContentID($myParent, 1);
+                               }
+                       }
+                       return $nextMenu;
+               } else {
+                       /* no children */
+                       if (isset($this->_menu[$myParent][$myOrder]) && $this->_menu[$myParent][$myOrder] != '') {
+                               /* Has sibling */
+                               return $this->_menu[$myParent][$myOrder]['content_id'];
+                       } else {
+                               /* No more siblings */
+                               if ($myParent != 0) {
+                                       return $this->getNextContentID($myParent, 1);
+                               }
+                       }
+               }
+       }
+       
+       function getContent($parent_id=-1, $length=-1) {
+               if ($parent_id == -1) {
+                       $my_menu_copy = $this->_menu;
+                       if ($length != -1) {
+                               $my_menu_copy[0] = array_slice($my_menu_copy[0], 0, $length);
+                       }
+                       return $my_menu_copy;
+               }
+               return $this->_menu[$parent_id];
+       }
+
+
+       function &getContentPath($content_id) {
+               $path = array();
+
+               $path[] = array('content_id' => $content_id, 'title' => $this->_menu_info[$content_id]['title']);
+
+               $this->getContentPathRecursive($content_id, $path);
+
+               $path = array_reverse($path);
+               return $path;
+       }
+
+
+       function getContentPathRecursive($content_id, &$path) {
+               $parent_id = $this->_menu_info[$content_id]['content_parent_id'];
+
+               if ($parent_id > 0) {
+                       $path[] = array('content_id' => $parent_id, 'title' => $this->_menu_info[$parent_id]['title']);
+                       $this->getContentPathRecursive($parent_id, $path);
+               }
+       }
+
+       function addContent($course_id, $content_parent_id, $ordering, $title, $text, $keywords, 
+                           $related, $formatting, $head = '', $use_customized_head = 0, 
+                           $test_message = '', $allow_test_export = 1, $content_type = CONTENT_TYPE_CONTENT) {
+               global $_current_user;
+               
+           if (!isset($_current_user) || !$_current_user->isAuthor($this->course_id)) {
+                       return false;
+               }
+
+               // shift the new neighbouring content down
+               $sql = "UPDATE ".TABLE_PREFIX."content SET ordering=ordering+1 
+                        WHERE ordering>=$ordering 
+                          AND content_parent_id=$content_parent_id 
+                          AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+
+               /* main topics all have minor_num = 0 */
+               $sql = "INSERT INTO ".TABLE_PREFIX."content
+                              (course_id,
+                               content_parent_id,
+                               ordering,
+                               last_modified,
+                               revision,
+                               formatting,
+                               head,
+                               use_customized_head,
+                               keywords,
+                               content_path,
+                               title,
+                               text,
+                                               test_message,
+                                               allow_test_export,
+                                               content_type)
+                       VALUES ($course_id, 
+                               $content_parent_id, 
+                               $ordering, 
+                               NOW(), 
+                               0, 
+                               $formatting, 
+                               '$head',
+                               $use_customized_head,
+                               '$keywords', 
+                               '', 
+                               '$title',
+                               '$text',
+                                               '$test_message',
+                                               $allow_test_export,
+                                               $content_type)";
+
+               $err = mysql_query($sql, $this->db);
+
+               /* insert the related content */
+               $sql = "SELECT LAST_INSERT_ID() AS insert_id";
+               $result = mysql_query($sql, $this->db);
+               $row = mysql_fetch_assoc($result);
+               $cid = $row['insert_id'];
+
+               $sql = '';
+               if (is_array($related)) {
+                       foreach ($related as $x => $related_content_id) {
+                               $related_content_id = intval($related_content_id);
+
+                               if ($related_content_id != 0) {
+                                       if ($sql != '') {
+                                               $sql .= ', ';
+                                       }
+                                       $sql .= '('.$cid.', '.$related_content_id.')';
+                                       $sql .= ', ('.$related_content_id.', '.$cid.')';
+                               }
+                       }
+
+                       if ($sql != '') {
+                               $sql    = 'INSERT INTO '.TABLE_PREFIX.'related_content VALUES '.$sql;
+                               $result = mysql_query($sql, $this->db);
+                       }
+               }
+
+               return $cid;
+       }
+       
+       function editContent($content_id, $title, $text, $keywords,$related, $formatting, 
+                            $head, $use_customized_head, $test_message, 
+                            $allow_test_export) {
+           global $_current_user;
+           
+               if (!isset($_current_user) || !$_current_user->isAuthor($this->course_id)) {
+                       return FALSE;
+               }
+
+               /* update the title, text of the newly moved (or not) content */
+               $sql    = "UPDATE ".TABLE_PREFIX."content 
+                             SET title='$title', head='$head', use_customized_head=$use_customized_head, 
+                                 text='$text', keywords='$keywords', formatting=$formatting, 
+                                 revision=revision+1, last_modified=NOW(),  
+                                 test_message='$test_message', allow_test_export=$allow_test_export 
+                           WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+
+               /* update the related content */
+               $result = mysql_query("DELETE FROM ".TABLE_PREFIX."related_content WHERE content_id=$content_id OR related_content_id=$content_id", $this->db);
+               $sql = '';
+               if (is_array($related)) {
+                       foreach ($related as $x => $related_content_id) {
+                               $related_content_id = intval($related_content_id);
+
+                               if ($related_content_id != 0) {
+                                       if ($sql != '') {
+                                               $sql .= ', ';
+                                       }
+                                       $sql .= '('.$content_id.', '.$related_content_id.')';
+                                       $sql .= ', ('.$related_content_id.', '.$content_id.')';
+                               }
+                       }
+
+                       if ($sql != '') {
+                               /* delete the old related content */
+                               $result = mysql_query("DELETE FROM ".TABLE_PREFIX."related_content WHERE content_id=$content_id OR related_content_id=$content_id", $this->db);
+
+                               /* insert the new, and the old related content again */
+                               $sql    = 'INSERT INTO '.TABLE_PREFIX.'related_content VALUES '.$sql;
+                               $result = mysql_query($sql, $this->db);
+                       }
+               }
+       }
+
+       function moveContent($content_id, $new_content_parent_id, $new_content_ordering) {
+               global $msg, $_current_user;
+               
+           if (!isset($_current_user) || !$_current_user->isAuthor($this->course_id)) {
+                       return FALSE;
+               }
+
+               /* first get the content to make sure it exists */
+               $sql    = "SELECT ordering, content_parent_id FROM ".TABLE_PREFIX."content WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+               if (!($row = mysql_fetch_assoc($result)) ) {
+                       return FALSE;
+               }
+               $old_ordering           = $row['ordering'];
+               $old_content_parent_id  = $row['content_parent_id'];
+               
+               $sql    = "SELECT max(ordering) max_ordering FROM ".TABLE_PREFIX."content WHERE content_parent_id=$old_content_parent_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+               $row = mysql_fetch_assoc($result);
+               $max_ordering = $row['max_ordering'];
+               
+               if ($content_id == $new_content_parent_id) {
+                       $msg->addError("NO_SELF_AS_PARENT");
+                       return;
+               }
+               
+               if ($old_content_parent_id == $new_content_parent_id && $old_ordering == $new_content_ordering) {
+                       $msg->addError("SAME_LOCATION");
+                       return;
+               }
+               
+               $content_path = $this->getContentPath($new_content_parent_id);
+               foreach ($content_path as $parent){
+                       if ($parent['content_id'] == $content_id) {
+                               $msg->addError("NO_CHILD_AS_PARENT");
+                               return;
+                       }
+               }
+               
+               // if the new_content_ordering is greater than the maximum ordering of the parent content, 
+               // set the $new_content_ordering to the maximum ordering. This happens when move the content 
+               // to the last element under the same parent content.
+               if ($old_content_parent_id == $new_content_parent_id && $new_content_ordering > $max_ordering) 
+                       $new_content_ordering = $max_ordering;
+               
+               if (($old_content_parent_id != $new_content_parent_id) || ($old_ordering != $new_content_ordering)) {
+                       // remove the gap left by the moved content
+                       $sql = "UPDATE ".TABLE_PREFIX."content 
+                                  SET ordering=ordering-1 
+                                WHERE ordering>$old_ordering 
+                                  AND content_parent_id=$old_content_parent_id 
+                                  AND content_id<>$content_id 
+                                  AND course_id=$_SESSION[course_id]";
+                       $result = mysql_query($sql, $this->db);
+
+                       // shift the new neighbouring content down
+                       $sql = "UPDATE ".TABLE_PREFIX."content 
+                                  SET ordering=ordering+1 
+                                WHERE ordering>=$new_content_ordering 
+                                  AND content_parent_id=$new_content_parent_id 
+                                  AND content_id<>$content_id 
+                                  AND course_id=$_SESSION[course_id]";
+                       $result = mysql_query($sql, $this->db);
+
+                       $sql    = "UPDATE ".TABLE_PREFIX."content 
+                                     SET content_parent_id=$new_content_parent_id, ordering=$new_content_ordering 
+                                   WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+                       $result = mysql_query($sql, $this->db);
+               }
+       }
+       
+       function deleteContent($content_id) {
+               global $_current_user;
+               
+               if (!isset($_current_user) || !$_current_user->isAuthor($this->course_id)) {
+                       return false;
+               }
+
+               /* check if exists */
+               $sql    = "SELECT ordering, content_parent_id FROM ".TABLE_PREFIX."content WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+               if (!($row = @mysql_fetch_assoc($result)) ) {
+                       return false;
+               }
+               $ordering                       = $row['ordering'];
+               $content_parent_id      = $row['content_parent_id'];
+
+               /* check if this content has sub content        */
+               $children = $this->_menu[$content_id];
+
+               if (is_array($children) && (count($children)>0) ) {
+                       /* delete its children recursively first*/
+                       foreach ($children as $x => $info) {
+                               $this->deleteContentRecursive($info['content_id']);
+                       }
+               }
+
+               /* delete this content page                                     */
+               $sql    = "DELETE FROM ".TABLE_PREFIX."content WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+
+               /* delete this content from member tracking page        */
+//             $sql    = "DELETE FROM ".TABLE_PREFIX."member_track WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+//             $result = mysql_query($sql, $this->db);
+
+               $sql    = "DELETE FROM ".TABLE_PREFIX."related_content WHERE content_id=$content_id OR related_content_id=$content_id";
+               $result = mysql_query($sql, $this->db);
+
+               /* delete the content tests association */
+               $sql    = "DELETE FROM ".TABLE_PREFIX."content_tests_assoc WHERE content_id=$content_id";
+               $result = mysql_query($sql, $this->db);
+
+               /* delete the content forum association */
+//             $sql    = "DELETE FROM ".TABLE_PREFIX."content_forums_assoc WHERE content_id=$content_id";
+//             $result = mysql_query($sql, $this->db);
+
+               /* Delete all AccessForAll contents */
+               require_once(TR_INCLUDE_PATH.'classes/A4a/A4a.class.php');
+               $a4a = new A4a($content_id);
+               $a4a->deleteA4a();
+
+               /* re-order the rest of the content */
+               $sql = "UPDATE ".TABLE_PREFIX."content SET ordering=ordering-1 WHERE ordering>=$ordering AND content_parent_id=$content_parent_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+               /* end moving block */
+
+               /* remove the "resume" to this page, b/c it was deleted */
+               $sql = "UPDATE ".TABLE_PREFIX."course_enrollment SET last_cid=0 WHERE course_id=$_SESSION[course_id] AND last_cid=$content_id";
+               $result = mysql_query($sql, $this->db);
+
+               return true;
+       }
+
+
+       /* private. call from deleteContent only. */
+       function deleteContentRecursive($content_id) {
+               /* check if this content has sub content        */
+               $children = $this->_menu[$content_id];
+
+               if (is_array($children) && (count($children)>0) ) {
+                       /* delete its children recursively first*/
+                       foreach ($children as $x => $info) {
+                               $this->deleteContent($info['content_id']);
+                       }
+               }
+
+               /* delete this content page                                     */
+               $sql    = "DELETE FROM ".TABLE_PREFIX."content WHERE content_id=$content_id AND course_id=$_SESSION[course_id]";
+               $result = mysql_query($sql, $this->db);
+
+               /* delete this content from member tracking page        */
+               $sql    = "DELETE FROM ".TABLE_PREFIX."member_track WHERE content_id=$content_id";
+               $result = mysql_query($sql, $this->db);
+
+               $sql    = "DELETE FROM ".TABLE_PREFIX."related_content WHERE content_id=$content_id OR related_content_id=$content_id";
+               $result = mysql_query($sql, $this->db);
+
+               /* delete the content tests association */
+               $sql    = "DELETE FROM ".TABLE_PREFIX."content_tests_assoc WHERE content_id=$content_id";
+               $result = mysql_query($sql, $this->db);
+       }
+
+       function getContentPage($content_id) {
+               include_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php');
+               $contentDAO = new ContentDAO();
+               return $contentDAO->get($content_id);
+       }
+       
+       /* @See editor/edit_content.php include/html/dropdowns/related_topics.inc.php include/lib/editor_tabs_functions.inc.php */
+       function getRelatedContent($content_id, $all=false) {
+               if ($content_id == 0) {
+                       return;
+               }
+               if ($content_id == '') {
+                       return;
+               }
+               $related_content = array();
+
+               if ($all) {
+                       $sql = "SELECT * FROM ".TABLE_PREFIX."related_content WHERE content_id=$content_id OR related_content_id=$content_id";
+               } else {
+                       $sql = "SELECT * FROM ".TABLE_PREFIX."related_content WHERE content_id=$content_id";
+               }
+               $result = mysql_query($sql, $this->db);
+
+               while ($row = mysql_fetch_assoc($result)) {
+                       if ($row['related_content_id'] != $content_id) {
+                               $related_content[] = $row['related_content_id'];
+                       } else {
+                               $related_content[] = $row['content_id'];
+                       }
+               }
+
+               return $related_content;
+       }
+
+       /** 
+        * Return a list of tests associated with the selected content
+        * @param       int             the content id that all tests are associated with it.
+        * @return      array   list of tests
+        * @date        Sep 10, 2008
+        * @author      Harris
+        */
+       function & getContentTestsAssoc($content_id){
+               $sql    = "SELECT ct.test_id, t.title FROM (SELECT * FROM ".TABLE_PREFIX."content_tests_assoc WHERE content_id=$content_id) AS ct LEFT JOIN ".TABLE_PREFIX."tests t ON ct.test_id=t.test_id";
+               return $this->dao->execute($sql);
+       }
+
+        /*TODO***************BOLOGNA***************REMOVE ME**********/
+//     function & getContentForumsAssoc($content_id){
+//             $sql    = "SELECT cf.forum_id, f.title FROM (SELECT * FROM ".TABLE_PREFIX."content_forums_assoc WHERE content_id=$content_id) AS cf LEFT JOIN ".TABLE_PREFIX."forums f ON cf.forum_id=f.forum_id";
+//             return $this->dao->execute($sql);
+//     }
+
+       function & cleanOutput($value) {
+               return stripslashes(htmlspecialchars($value));
+       }
+
+
+       /* @See include/html/editor_tabs/properties.inc.php */
+       /* Access: Public */
+       function getNumSections() {
+               return $this->num_sections;
+       }
+
+       /* Access: Public */
+       function getMaxDepth() {
+               return $this->max_depth;
+       }
+
+       /* Access: Public */
+       function getContentLength() {
+               return $this->content_length;
+       }
+
+       /* @See include/html/dropdowns/local_menu.inc.php */
+       function getLocationPositions($parent_id, $content_id) {
+               $siblings = $this->getContent($parent_id);
+               for ($i=0;$i<count($siblings); $i++){
+                       if ($siblings[$i]['content_id'] == $content_id) {
+                               return $i;
+                       }
+               }
+               return 0;       
+       }
+
+       /* Access: Private */
+       function getNumbering($content_id) {
+               $path = $this->getContentPath($content_id);
+               $parent = 0;
+               $numbering = '';
+               foreach ($path as $page) {
+                       $num = $this->getLocationPositions($parent, $page['content_id']) +1;
+                       $parent = $page['content_id'];
+                       $numbering .= $num.'.';
+               }
+               $numbering = substr($numbering, 0, -1);
+
+               return $numbering;
+       }
+
+       function getPreviousContent($content_id) {
+               if (is_array($this->_menu_in_order))
+               {
+                       foreach ($this->_menu_in_order as $content_location => $this_content_id)
+                       {
+                               if ($this_content_id == $content_id) break;
+                       }
+                       
+                       for ($i=$content_location-1; $i >= 0; $i--)
+                       {
+                               $content_type = $this->_menu_info[$this->_menu_in_order[$i]]['content_type'];
+                               
+                               if ($content_type == CONTENT_TYPE_CONTENT || $content_type == CONTENT_TYPE_WEBLINK)
+                                       return array('content_id'       => $this->_menu_in_order[$i],
+                                                'ordering'             => $this->_menu_info[$this->_menu_in_order[$i]]['ordering'],
+                                                    'title'            => $this->_menu_info[$this->_menu_in_order[$i]]['title']);
+                       }
+               }
+               return NULL;
+       }
+       
+       /**
+        * return the array of the next content node of the given $content_id
+        * when $content_id = 0 or is not set, return the first content node
+        * @param $content_id
+        * @return an array of the next content node
+        */
+       function getNextContent($content_id) {
+               if (is_array($this->_menu_in_order))
+               {
+                       // find out the location of the $content_id
+                       if (!$content_id) $content_location = 0; // the first content location when $content_id = 0 or is not set
+                       else
+                       {
+                               foreach ($this->_menu_in_order as $content_location => $this_content_id)
+                               {
+                                       if ($this_content_id == $content_id) 
+                                       {
+                                               $content_location++;
+                                               break;
+                                       }
+                               }
+                       }
+                       
+                       // the next content node must be at or after the $content_location
+                       // and with the content type CONTENT or WEBLINK
+                       for ($i=$content_location; $i < count($this->_menu_in_order); $i++)
+                       {
+                               $content_type = $this->_menu_info[$this->_menu_in_order[$i]]['content_type'];
+                               
+                               if ($content_type == CONTENT_TYPE_CONTENT || $content_type == CONTENT_TYPE_WEBLINK)
+                                       return(array('content_id'       => $this->_menu_in_order[$i],
+                                                'ordering'             => $this->_menu_info[$this->_menu_in_order[$i]]['ordering'],
+                                                    'title'            => $this->_menu_info[$this->_menu_in_order[$i]]['title']));
+                       }
+               }
+               return NULL;
+       }
+       
+       /* @See include/header.inc.php */
+       function generateSequenceCrumbs($cid) {
+               global $_base_path;
+
+               $sequence_links = array();
+
+               $first = $this->getNextContent(0); // get first
+               if ($_SESSION['prefs']['PREF_NUMBERING'] && $first) {
+                       $first['title'] = $this->getNumbering($first['content_id']).' '.$first['title'];
+               }
+               if ($first) {
+//                     $first['url'] = $_base_path.url_rewrite('content.php?cid='.$first['content_id']);
+                       $first['url'] = $_base_path.'home/course/content.php?_cid='.$first['content_id'];
+                       $sequence_links['first'] = $first;
+               }
+
+               if (!$cid && $_SESSION['s_cid']) {
+                       $resume['title'] = $this->_menu_info[$_SESSION['s_cid']]['title'];
+
+                       if ($_SESSION['prefs']['PREF_NUMBERING']) {
+                               $resume['title'] = $this->getNumbering($_SESSION['s_cid']).' ' . $resume['title'];
+                       }
+
+//                     $resume['url'] = $_base_path.url_rewrite('content.php?cid='.$_SESSION['s_cid']);
+                       $resume['url'] = $_base_path.'home/course/content.php?_cid='.$_SESSION['s_cid'];
+                       
+                       $sequence_links['resume'] = $resume;
+               } else {
+                       if ($cid) {
+                               $previous = $this->getPreviousContent($cid);
+                       }
+                       $next = $this->getNextContent($cid ? $cid : 0);
+
+                       if ($_SESSION['prefs']['PREF_NUMBERING']) {
+                               $previous['title'] = $this->getNumbering($previous['content_id']).' '.$previous['title'];
+                               $next['title'] = $this->getNumbering($next['content_id']).' '.$next['title'];
+                       }
+
+//                     $next['url'] = $_base_path.url_rewrite('content.php?cid='.$next['content_id']);
+                       $next['url'] = $_base_path.'home/course/content.php?_cid='.$next['content_id'];
+                       if (isset($previous['content_id'])) {
+//                             $previous['url'] = $_base_path.url_rewrite('content.php?cid='.$previous['content_id']);
+                               $previous['url'] = $_base_path.'home/course/content.php?_cid='.$previous['content_id'];
+                       }
+                       
+                       if (isset($previous['content_id'])) {
+                               $sequence_links['previous'] = $previous;
+                       } else if ($cid) {
+//                             $previous['url']   = $_base_path . url_rewrite('index.php');
+                               $previous['url']   = $_base_path . 'home/course/index.php';
+                               $previous['title'] = _AT('home');
+                               $sequence_links['previous'] = $previous;
+                       }
+                       if (!empty($next['content_id'])) {
+                               $sequence_links['next'] = $next;
+                       }
+               }
+
+               return $sequence_links;
+       }
+
+       /** Generate javascript to hide all root content folders, except the one with current content page
+        * access: private
+        * @return print out javascript function initContentMenu()
+        */
+       function initMenu(){
+               global $_base_path;
+               
+               echo '
+function initContentMenu() {
+  tree_collapse_icon = "'.$_base_path.'images/tree/tree_collapse.gif";
+  tree_expand_icon = "'.$_base_path.'images/tree/tree_expand.gif";
+               
+';
+               
+               $sql = "SELECT content_id
+                         FROM ".TABLE_PREFIX."content 
+                        WHERE course_id=$this->course_id
+                          AND content_type = ".CONTENT_TYPE_FOLDER;
+               $rows = $this->dao->execute($sql);
+
+               // collapse all root content folders
+               if (is_array($rows)) {
+                       foreach ($rows as $row) {
+                               echo '
+  if (getcookie("c'.$_SESSION['course_id'].'_'.$row['content_id'].'") == "1")
+  {
+    jQuery("#folder"+'.$row['content_id'].').show();
+    jQuery("#tree_icon"+'.$row['content_id'].').attr("src", tree_collapse_icon);
+    jQuery("#tree_icon"+'.$row['content_id'].').attr("alt", "'._AT("collapse").'");
+    jQuery("#tree_icon"+'.$row['content_id'].').attr("title", "'._AT("collapse").'");
+  }
+  else
+  {
+    jQuery("#folder"+'.$row['content_id'].').hide();
+    jQuery("#tree_icon"+'.$row['content_id'].').attr("src", tree_expand_icon);
+    jQuery("#tree_icon"+'.$row['content_id'].').attr("alt", "'._AT("expand").'");
+    jQuery("#tree_icon"+'.$row['content_id'].').attr("title", "'._AT("expand").'");
+  }
+';
+                       }
+               }
+               
+               // expand the content folder that has current content
+               if (isset($_SESSION['s_cid']) && $_SESSION['s_cid'] > 0) {
+                       $current_content_path = $this->getContentPath($_SESSION['s_cid']);
+                       
+                       for ($i=0; $i < count($current_content_path)-1; $i++)
+                               echo '
+  jQuery("#folder"+'.$current_content_path[$i]['content_id'].').show();
+  jQuery("#tree_icon"+'.$current_content_path[$i]['content_id'].').attr("src", tree_collapse_icon);
+  jQuery("#tree_icon"+'.$current_content_path[$i]['content_id'].').attr("alt", "'._AT("collapse").'");
+  setcookie("c'.$_SESSION['course_id'].'_'.$current_content_path[$i]['content_id'].'", "1", 1);
+';
+               }
+               echo '}'; // end of javascript function initContentMenu()
+       }
+       
+       /* @See include/html/dropdowns/menu_menu.inc.php */
+       function printMainMenu( ) {
+               global $_current_user, $_course_id;
+               
+               if (!($this->course_id > 0)) {
+                       return;
+               }
+               
+               global $_base_path;
+               
+               $parent_id    = 0;
+               $depth        = 0;
+               $path         = '';
+               $children     = array();
+               $truncate     = true;
+               $ignore_state = true;
+
+               $this->start = true;
+               
+               // if change the location of this line, change function switchEditMode(), else condition accordingly
+               echo '<div id="editable_table">';
+               
+               if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !Utility::isMobileTheme())
+               {
+                       echo "\n".'
+  <div class="menuedit">
+    <a href="'.$_base_path.'editor/edit_content_folder.php">
+      <img id="img_create_top_folder" src="'.$_base_path.'images/mfolder.gif" alt="'._AT("add_top_folder").'" title="'._AT("add_top_folder").'" style="border:0;height:1.2em" />
+    </a>'."\n".'
+    <a href="'.$_base_path.'editor/edit_content.php">
+      <img id="img_create_top_content" src="'.$_base_path.'images/mpage.gif" alt="'._AT("add_top_page").'" title="'._AT("add_top_page").'" style="border:0;height:1.2em" />
+    </a>'."\n".'
+    <a href="javascript:void(0)" onclick="javascript:switchEditMode();">
+      <img id="img_switch_edit_mode" src="'.$_base_path.'images/medit.gif" alt="'._AT("enter_edit_mode").'" title="'._AT("enter_edit_mode").'" style="border:0;height:1.2em" />
+    </a>
+  </div>'."\n";
+               }
+               $this->printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_state);
+               
+               // javascript for inline editor
+               echo '
+<script type="text/javascript">
+';
+               // only expand the content folder that has the current content page
+               $this->initMenu();
+               
+               echo '
+function switchEditMode() {
+  title_edit = "'._AT("enter_edit_mode").'";
+  img_edit = "'.$_base_path.'images/medit.gif";
+       
+  title_view = "'._AT("exit_edit_mode").'";
+  img_view = "'.$_base_path.'images/mlock.gif";
+       
+  if (jQuery("#img_switch_edit_mode").attr("src") == img_edit)
+  {
+    jQuery("#img_switch_edit_mode").attr("src", img_view);
+    jQuery("#img_switch_edit_mode").attr("alt", title_view);
+    jQuery("#img_switch_edit_mode").attr("title", title_view);
+    inlineEditsSetup();
+  }
+  else
+  { // refresh the content navigation to exit the edit mode
+    jQuery.post("'. TR_BASE_HREF. 'home/course/refresh_content_nav.php?_course_id='.$_course_id.'", {}, 
+                function(data) {jQuery("#editable_table").replaceWith(data); initContentMenu();});
+  }
+}
+
+function inlineEditsSetup() {
+  jQuery("#editable_table").find(".inlineEdits").each(function() {
+    jQuery(this).text(jQuery(this).attr("title"));
+  });
+       
+  var tableEdit = fluid.inlineEdits("#editable_table", {
+    selectors : {
+      text : ".inlineEdits",
+      editables : "span:has(span.inlineEdits)"
+    },
+    defaultViewText: "",
+      applyEditPadding: false,
+      useTooltip: true,
+      listeners: {
+        afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
+          if (newValue != oldValue) 
+          {
+            rtn = jQuery.post("'. TR_BASE_HREF. 'home/course/content_nav_inline_editor_submit.php", { "field":viewNode.id, "value":newValue }, 
+                  function(data) {}, "json");
+          }
+        }
+      }
+   });
+
+  jQuery(".fl-inlineEdit-edit").css("width", "80px")
+};
+
+initContentMenu();
+</script>
+';
+               echo '</div>';
+       }
+
+       /* @See tools/sitemap/index.php */
+       function printSiteMapMenu() {
+               $parent_id    = 0;
+               $depth        = 1;
+               $path         = '';
+               $children     = array();
+               $truncate     = false;
+               $ignore_state = true;
+
+               $this->start = true;
+               $this->printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_state, 'sitemap');
+       }
+
+       /* @See index.php */
+       function printTOCMenu($cid, $top_num) {
+               $parent_id    = $cid;
+               $depth        = 1;
+               $path         = $top_num.'.';
+               $children     = array();
+               $truncate     = false;
+               $ignore_state = false;
+
+               $this->start = true;
+               $this->printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_state);
+       }
+
+       /* @See index.php include/html/dropdowns/local_menu.inc.php */
+       function printSubMenu($cid, $top_num) {
+               $parent_id    = $cid;
+               $depth        = 1;
+               $path         = $top_num.'.';
+               $children     = array();
+               $truncate     = true;
+               $ignore_state = false;
+       
+               $this->start = true;
+               $this->printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_state);
+       }
+
+       /* @See include/html/menu_menu.inc.php  */
+       /* Access: PRIVATE */
+       function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_state, $from = '') {
+               global $cid, $_my_uri, $_base_path, $rtl, $substr, $strlen, $_current_user;
+               static $temp_path;
+
+               if (!isset($temp_path)) {
+                       if ($cid) {
+                               $temp_path      = $this->getContentPath($cid);
+                       } else {
+                               $temp_path      = $this->getContentPath($_SESSION['s_cid']);
+                       }
+               }
+
+               $highlighted = array();
+               if (is_array($temp_path)) {
+                       foreach ($temp_path as $temp_path_item) {
+                               $_SESSION['menu'][$temp_path_item['content_id']] = 1;
+                               $highlighted[$temp_path_item['content_id']] = true;
+                       }
+               }
+
+               if ($this->start) {
+                       reset($temp_path);
+                       $this->start = false;
+               }
+
+               if ( isset($this->_menu[$parent_id]) && is_array($this->_menu[$parent_id]) ) {
+                       $top_level = $this->_menu[$parent_id];
+                       $counter = 1;
+                       $num_items = count($top_level);
+                       
+//                     if ($parent_id <> 0) echo '<li>';
+                       
+//                     echo '<ul id="folder'.$parent_id.$from.'">'."\n";
+                       echo '<div id="folder'.$parent_id.$from.'">'."\n";
+                       
+                       foreach ($top_level as $garbage => $content) {
+                               $link = '';
+                               //tests do not have content id
+                               $content['content_id'] = isset($content['content_id']) ? $content['content_id'] : '';
+
+                               if (!$ignore_state) {
+                                       $link .= '<a name="menu'.$content['content_id'].'"></a>';
+                               }
+
+                               $on = false;
+
+                               if ( (($_SESSION['s_cid'] != $content['content_id']) || ($_SESSION['s_cid'] != $cid)) && ($content['content_type'] == CONTENT_TYPE_CONTENT || $content['content_type'] == CONTENT_TYPE_WEBLINK)) 
+                               { // non-current content nodes with content type "CONTENT_TYPE_CONTENT"
+                                       if (isset($highlighted[$content['content_id']])) {
+                                               $link .= '<strong>';
+                                               $on = true;
+                                       }
+
+                                       //content test extension  @harris
+                                       //if this is a test link.
+                                       if (isset($content['test_id'])){
+                                               $title_n_alt =  $content['title'];
+                                               $in_link = 'tools/test_intro.php?tid='.$content['test_id'];
+                                               $img_link = ' <img src="'.$_base_path.'images/check.gif" title="'.$title_n_alt.'" alt="'.$title_n_alt.'" />';
+                                       } else {
+                                               $in_link = $_base_path.'home/course/content.php?_cid='.$content['content_id'];
+                                               $img_link = '';
+                                       }
+                                       
+                                       $full_title = $content['title'];
+//                                     $link .= $img_link . ' <a href="'.$_base_path.url_rewrite($in_link).'" title="';
+                                       $link .= $img_link . ' <a href="'.$in_link.'" title="';
+                                       $base_title_length = 29;
+                                       if ($_SESSION['prefs']['PREF_NUMBERING']) {
+//                                             $link .= $path.$counter.' ';
+                                               $base_title_length = 24;
+                                       }
+
+                                       $link .= $content['title'].'">';
+
+                                       if ($truncate && ($strlen($content['title']) > ($base_title_length-$depth*4)) ) {
+                                               $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, ($base_title_length-$depth*4)-4))).'...';
+                                       }
+//                                     $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, $base_title_length-4))).'...';
+                                       
+                                       if (isset($content['test_id']))
+                                               $link .= $content['title'];
+                                       else
+                                               $link .= '<span class="inlineEdits" id="menu-'.$content['content_id'].'" title="'.$full_title.'">'.
+                                                        ($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
+                                                        $content['title'].'</span>';
+                                       
+                                       $link .= '</a>';
+                                       if ($on) {
+                                               $link .= '</strong>';
+                                       }
+                                       
+                                       // instructors have privilege to delete content
+                                       if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !isset($content['test_id']) && !Utility::isMobileTheme()) {
+                                               $link .= '<a href="'.$_base_path.'editor/delete_content.php?cid='.$content['content_id'].'"><img src="'.TR_BASE_HREF.'images/x.gif" alt="'._AT("delete_content").'" title="'._AT("delete_content").'" style="border:0" height="10" /></a>';
+                                       }
+                               } 
+                               else 
+                               { // current content page & nodes with content type "CONTENT_TYPE_FOLDER"
+                                       $base_title_length = 26;
+                                       if ($_SESSION['prefs']['PREF_NUMBERING']) {
+                                               $base_title_length = 21;
+                                       }
+                                       
+                                       if (isset($highlighted[$content['content_id']])) {
+                                               $link .= '<strong>';
+                                               $on = true;
+                                       }
+
+                                       if ($content['content_type'] == CONTENT_TYPE_CONTENT || $content['content_type'] == CONTENT_TYPE_WEBLINK)
+                                       { // current content page
+                                               $full_title = $content['title'];
+                                               $link .= '<a href="'.$_my_uri.'"><img src="'.$_base_path.'images/clr.gif" alt="'._AT('you_are_here').': '.
+                                                        ($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter : '').
+                                                        $content['title'].'" height="1" width="1" border="0" /></a><strong style="color:red" title="'.$content['title'].'">'."\n";
+                                               
+                                               if ($truncate && ($strlen($content['title']) > ($base_title_length-$depth*4)) ) {
+                                                       $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, ($base_title_length-$depth*4)-4))).'...';
+                                               }
+//                                             $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, $base_title_length-4))).'...';
+                                               $link .= '<a name="menu'.$content['content_id'].'"></a><span class="inlineEdits" id="menu-'.$content['content_id'].'" title="'.$full_title.'">'.
+                                                        ($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
+                                                        $content['title'].'</span></strong>';
+                                               
+                                               // instructors have privilege to delete content
+                                               if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !Utility::isMobileTheme()) {
+                                                       $link .= '<a href="'.$_base_path.'editor/delete_content.php?cid='.$content['content_id'].'"><img src="'.TR_BASE_HREF.'images/x.gif" alt="'._AT("delete_content").'" title="'._AT("delete_content").'" style="border:0" height="10" /></a>';
+                                               }
+                                       }
+                                       else
+                                       { // nodes with content type "CONTENT_TYPE_FOLDER"
+//                                             $link .= '<a href="javascript:void(0)" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\'); "><img src="'.$_base_path.'images/clr.gif" alt="'._AT('content_folder').': '.$content['title'].'" height="1" width="1" border="0" /></a>'."\n";
+                                               
+                                               $full_title = $content['title'];
+                                               if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !Utility::isMobileTheme()) {
+//                                                     $link .= '<a href="'.$_base_path.url_rewrite("editor/edit_content_folder.php?_cid=".$content['content_id']).'" title="'.$full_title. _AT('click_edit').'">'."\n";
+                                                       $link .= '<a href="editor/edit_content_folder.php?_cid='.$content['content_id'].'" title="'.$full_title. _AT('click_edit').'">'."\n";
+                                               }
+                                               else {
+                                                       $link .= '<span style="cursor:pointer" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\', \''._AT("expand").'\', \''._AT('collapse').'\'); ">'."\n";
+                                               }
+                                               
+                                               if ($truncate && ($strlen($content['title']) > ($base_title_length-$depth*4)) ) {
+                                                       $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, ($base_title_length-$depth*4)-4))).'...';
+                                               }
+//                                             $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, $base_title_length-4))).'...';
+                                               if (isset($content['test_id']))
+                                                       $link .= $content['title'];
+                                               else
+                                                       $link .= '<span class="inlineEdits" id="menu-'.$content['content_id'].'" title="'.$full_title.'">'.
+                                                                ($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
+                                                                $content['title'].'</span>';
+                                               
+                                               if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !Utility::isMobileTheme()) {
+                                                       $link .= '</a>'."\n";
+                                               }
+                                               else {
+                                                       $link .= '</span>'."\n";
+                                               }
+                                               
+                                               // instructors have privilege to delete content
+                                               if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !Utility::isMobileTheme()) {
+                                                       $link .= '<a href="'.$_base_path.'editor/delete_content.php?cid='.$content['content_id'].'"><img src="'.TR_BASE_HREF.'images/x.gif" alt="'._AT("delete_content").'" title="'._AT("delete_content").'" style="border:0" height="10" /></a>';
+                                               }
+//                                             echo '<div id="folder_content_'.$content['content_id'].'">';
+                                       }
+                                       
+                                       if ($on) {
+                                               $link .= '</strong>';
+                                       }
+                               }
+
+                               if ($ignore_state) {
+                                       $on = true;
+                               }
+
+//                             echo '<li>'."\n";
+                               echo '<span>'."\n";
+                               
+                               if ( isset($this->_menu[$content['content_id']]) && is_array($this->_menu[$content['content_id']]) ) {
+                                       /* has children */
+                                       for ($i=0; $i<$depth; $i++) {
+                                               if ($children[$i] == 1) {
+                                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_vertline.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                               } else {
+                                                       echo '<img src="'.$_base_path.'images/clr.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                               }
+                                       }
+
+                                       if (($counter == $num_items) && ($depth > 0)) {
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_end.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                               $children[$depth] = 0;
+                                       } else if ($counter == $num_items) {
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_end.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                               $children[$depth] = 0;
+                                       } else {
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_split.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                               $children[$depth] = 1;
+                                       }
+
+                                       if ($_SESSION['s_cid'] == $content['content_id']) {
+                                               if (is_array($this->_menu[$content['content_id']])) {
+                                                       $_SESSION['menu'][$content['content_id']] = 1;
+                                               }
+                                       }
+
+                                       if (isset($_SESSION['menu'][$content['content_id']]) && $_SESSION['menu'][$content['content_id']] == 1) {
+                                               if ($on) {
+//                                                     echo '<img src="'.$_base_path.'images/tree/tree_collapse.gif" id="tree_icon'.$content['content_id'].$from.'" alt="'._AT('collapse').'" border="0" width="16" height="16" title="'._AT('collapse').'" class="img-size-tree" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\'); " />'."\n";
+                                                       echo '<a href="javascript:void(0)" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\', \''._AT("expand").'\', \''._AT('collapse').'\'); "><img src="'.$_base_path.'images/tree/tree_collapse.gif" id="tree_icon'.$content['content_id'].$from.'" alt="'._AT('collapse').'" border="0" width="16" height="16" title="'._AT('collapse').'" class="img-size-tree" /></a>'."\n";
+                                                       
+                                               } else {
+                                                       echo '<a href="'.$_my_uri.'collapse='.$content['content_id'].'">'."\n";
+                                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_collapse.gif" id="tree_icon'.$content['content_id'].$from.'" alt="'._AT('collapse').'" border="0" width="16" height="16" title="'._AT('collapse').' '.$content['title'].'" class="img-size-tree" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\', \''._AT("expand").'\', \''._AT('collapse').'\'); " />'."\n";
+                                                       echo '</a>'."\n";
+                                               }
+                                       } else {
+                                               if ($on) {
+//                                                     echo '<img src="'.$_base_path.'images/tree/tree_collapse.gif" id="tree_icon'.$content['content_id'].$from.'" alt="'._AT('collapse').'" border="0" width="16" height="16" title="'._AT('collapse').'" class="img-size-tree" />'."\n";
+                                                       echo '<a href="javascript:void(0)" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\', \''._AT("expand").'\', \''._AT('collapse').'\'); "><img src="'.$_base_path.'images/tree/tree_collapse.gif" id="tree_icon'.$content['content_id'].$from.'" alt="'._AT('collapse').'" border="0" width="16" height="16" title="'._AT('collapse').'" class="img-size-tree" /></a>'."\n";
+                                                       
+                                               } else {
+                                                       echo '<a href="'.$_my_uri.'expand='.$content['content_id'].'">'."\n";
+                                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_expand.gif" id="tree_icon'.$content['content_id'].$from.'" alt="'._AT('expand').'" border="0" width="16" height="16"    title="'._AT('expand').' '.$content['title'].'" class="img-size-tree" onclick="javascript: toggleFolder(\''.$content['content_id'].$from.'\', \''._AT("expand").'\', \''._AT('collapse').'\'); " />';
+                                                       echo '</a>'."\n";
+                                               }
+                                       }
+
+                               } else {
+                                       /* doesn't have children */
+                                       if ($counter == $num_items) {
+                                               for ($i=0; $i<$depth; $i++) {
+                                                       if ($children[$i] == 1) {
+                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_vertline.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                                       } else {
+                                                               echo '<img src="'.$_base_path.'images/clr.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                                       }
+                                               }
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_end.gif" alt="" border="0" class="img-size-tree" />'."\n";
+                                       } else {
+                                               for ($i=0; $i<$depth; $i++) {
+                                                       if ($children[$i] == 1) {
+                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_vertline.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                                       } else {
+                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_space.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                                       }
+                                               }
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_split.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                                       }
+                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_horizontal.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />'."\n";
+                               }
+
+//                             if ($_SESSION['prefs']['PREF_NUMBERING']) {
+//                                     echo $path.$counter;
+//                             }
+                               
+                               echo $link;
+                               
+                               echo "\n<br /></span>\n\n";
+                               
+                               if ( $ignore_state || (isset($_SESSION['menu'][$content['content_id']]) && $_SESSION['menu'][$content['content_id']] == 1)) {
+
+                                       $depth ++;
+
+                                       $this->printMenu($content['content_id'],
+                                                                               $depth, 
+                                                                               $path.$counter.'.', 
+                                                                               $children,
+                                                                               $truncate, 
+                                                                               $ignore_state,
+                                                                               $from);
+
+                                                                               
+                                       $depth--;
+
+                               }
+                               $counter++;
+                       } // end of foreach
+//                     echo "</ul>";
+//                     if ($parent_id <> 0) print "</li>\n\n";
+                       print "</div>\n\n";
+               }
+       }
+
+       /* @See include/html/editor_tabs/properties.inc.php
+          @See editor/arrange_content.php
+           $print_type: "movable" or "related_content"
+        */
+       function printActionMenu($menu, $parent_id, $depth, $path, $children, $print_type = 'movable') {
+               
+               global $cid, $_my_uri, $_base_path, $rtl;
+
+               static $end;
+
+               $top_level = $menu[$parent_id];
+
+               if ( is_array($top_level) ) {
+                       $counter = 1;
+                       $num_items = count($top_level);
+                       foreach ($top_level as $current_num => $content) {
+                               if (isset($content['test_id'])){
+                                       continue;
+                               }
+
+                               $link = $buttons = '';
+
+                               echo '<tr>'."\n";
+                               
+                               if ($print_type == 'movable')
+                               {
+                                       if ($content['content_id'] == $_POST['moved_cid']) {
+                                               $radio_selected = ' checked="checked" ';
+                                       }
+                                       else {
+                                               $radio_selected = '';
+                                       }
+                               
+                                       $buttons = '<td>'."\n".
+                                                  '   <small>'."\n".
+                                                  '      <input type="image" name="move['.$parent_id.'_'.$content['ordering'].']" src="'.$_base_path.'images/before.gif" alt="'._AT('before_topic', $content['title']).'" title="'._AT('before_topic', $content['title']).'" style="height:1.5em; width:1.9em;" />'."\n";
+
+                                       if ($current_num + 1 == count($top_level))
+                                               $buttons .= '      <input type="image" name="move['.$parent_id.'_'.($content['ordering']+1).']" src="'.$_base_path.'images/after.gif" alt="'._AT('after_topic', $content['title']).'" title="'._AT('after_topic', $content['title']).'" style="height:1.5em; width:1.9em;" />'."\n";
+                                       
+                                       $buttons .= '   </small>'."\n".
+                                                  '</td>'."\n".
+                                                  '<td>';
+                                       
+                                       if ($content['content_type'] == CONTENT_TYPE_FOLDER)
+                                               $buttons .= '<input type="image" name="move['.$content['content_id'].'_1]" src="'.$_base_path.'images/child_of.gif" style="height:1.25em; width:1.7em;" alt="'._AT('child_of', $content['title']).'" title="'._AT('child_of', $content['title']).'" />';
+                                       else
+                                               $buttons .= '&nbsp;';
+                                               
+                                       $buttons .= '</td>'."\n".
+                                                  '<td><input name="moved_cid" value="'.$content['content_id'].'" type="radio" id="r'.$content['content_id'].'" '.$radio_selected .'/></td>'."\n";
+                               }
+                               
+                               $buttons .= '<td>'."\n";
+                               if ($print_type == "related_content")
+                               {
+                                       if ($content['content_type'] == CONTENT_TYPE_CONTENT || $content['content_type'] == CONTENT_TYPE_WEBLINK)
+                                       {
+                                               $link .= '<input type="checkbox" name="related[]" value="'.$content['content_id'].'" id="r'.$content['content_id'].'" ';
+                                               if (isset($_POST['related']) && in_array($content['content_id'], $_POST['related'])) {
+                                                       $link .= ' checked="checked"';
+                                               }
+                                               $link .= ' />'."\n";
+                                       }
+                               }       
+                               
+                               if ($content['content_type'] == CONTENT_TYPE_FOLDER)
+                               {
+                                       $link .= '<img src="'.$_base_path.'images/folder.gif" />';
+                               }
+                               $link .= '&nbsp;<label for="r'.$content['content_id'].'">'.$content['title'].'</label>'."\n";
+
+                               if ( is_array($menu[$content['content_id']]) && !empty($menu[$content['content_id']]) ) {
+                                       /* has children */
+
+                                       for ($i=0; $i<$depth; $i++) {
+                                               if ($children[$i] == 1) {
+                                                       echo $buttons;
+                                                       unset($buttons);
+                                                       if ($end && ($i==0)) {
+                                                               echo '<img src="'.$_base_path.'images/clr.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />';
+                                                       } else {
+                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_vertline.gif" alt="" border="0" width="16" height="16" />';
+                                                       }
+                                               } else {
+                                                       echo '<img src="'.$_base_path.'images/clr.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />';
+                                               }
+                                       }
+
+                                       if (($counter == $num_items) && ($depth > 0)) {
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_end.gif" alt="" border="0" width="16" height="16" />';
+                                               $children[$depth] = 0;
+                                       } else {
+                                               echo $buttons;
+                                               if (($num_items == $counter) && ($parent_id == 0)) {
+                                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_end.gif" alt="" border="0" width="16" height="16" />';
+                                                       $end = true;
+                                               } else {
+                                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_split.gif" alt="" border="0" width="16" height="16" />';
+                                               }
+                                               $children[$depth] = 1;
+                                       }
+
+                                       if ($_SESSION['s_cid'] == $content['content_id']) {
+                                               if (is_array($menu[$content['content_id']])) {
+                                                       $_SESSION['menu'][$content['content_id']] = 1;
+                                               }
+                                       }
+
+                                       if ($_SESSION['menu'][$content['content_id']] == 1) {
+                                               echo '<img src="'.$_base_path.'images/tree/tree_disabled.gif" alt="'._AT('toggle_disabled').'" border="0" width="16" height="16" title="'._AT('toggle_disabled').'" />';
+
+                                       } else {
+                                               echo '<img src="'.$_base_path.'images/tree/tree_disabled.gif" alt="'._AT('toggle_disabled').'" border="0" width="16" height="16" title="'._AT('toggle_disabled').'" />';
+                                       }
+
+                               } else {
+                                       /* doesn't have children */
+                                       if ($counter == $num_items) {
+                                               if ($depth) {
+                                                       echo $buttons;
+                                                       for ($i=0; $i<$depth; $i++) {
+                                                               if ($children[$i] == 1) {
+                                                                       if ($end && ($i == 0)) {
+                                                                               echo '<img src="'.$_base_path.'images/clr.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />';
+                                                                       } else {
+                                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_vertline.gif" alt="" border="0" width="16" height="16" />';
+                                                                       }
+                                                               } else {
+                                                                       echo '<img src="'.$_base_path.'images/clr.gif" alt="" border="0" width="16" height="16" class="img-size-tree" />';
+                                                               }
+                                                       }
+                                               } else {
+                                                       echo $buttons;
+                                               }
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_end.gif" alt="" border="0" />';
+                                       } else {
+                                               if ($depth) {
+                                                       echo $buttons;
+                                                       $print = false;
+                                                       for ($i=0; $i<$depth; $i++) {
+                                                               if ($children[$i] == 1) {
+                                                                       if ($end && !$print) {
+                                                                               $print = true;
+                                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_space.gif" alt="" border="0" width="16" height="16" />';
+                                                                       } else {
+                                                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_vertline.gif" alt="" border="0" width="16" height="16" />';
+                                                                       }
+                                                               } else {
+                                                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_space.gif" alt="" border="0" width="16" height="16" />';
+                                                               }
+                                                       }
+                                                       $print = false;
+                                               } else {
+                                                       echo $buttons;
+                                               }
+               
+                                               echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_split.gif" alt="" border="0" width="16" height="16" />';
+                                       }
+                                       echo '<img src="'.$_base_path.'images/'.$rtl.'tree/tree_horizontal.gif" alt="" border="0" width="16" height="16" />';
+                               }
+
+                               echo '<small> '.($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter : '');
+                               
+                               echo $link;
+                               
+                               echo '</small></td>'."\n".'</tr>'."\n";
+
+                               $this->printActionMenu($menu,
+                                                                       $content['content_id'],
+                                                                       ++$depth, 
+                                                                       $path.$counter.'.', 
+                                                                       $children,
+                                                                       $print_type);
+                               $depth--;
+
+                               $counter++;
+                       }
+               }
+       }
+
+       /* returns the timestamp of release if this page has not yet been released, or is under a page that has not been released, true otherwise */
+       /* finds the max(timestamp) of all parents and returns that, true if less than now */
+       /* Access: public */
+/* Transformable does not have content.release_date 
+       function isReleased($cid) {
+               if ($this->_menu_info[$cid]['content_parent_id'] == 0) {
+                       // this $cid has no parent, so we check its release date directly
+                       if ($this->_menu_info[$cid]['u_release_date'] <= time()) {      
+                               // yup! it's released
+                               return true;
+                       } else {
+                               // nope! not released
+                               return $this->_menu_info[$cid]['u_release_date'];
+                       }
+               }
+               // this is a sub page, need to check ALL its parents
+               $parent = $this->isReleased($this->_menu_info[$cid]['content_parent_id']); // recursion
+
+               if ($parent !== TRUE && $parent > $this->_menu_info[$cid]['u_release_date']) {
+                       return $parent;
+               } else if ($this->_menu_info[$cid]['u_release_date'] <= time()) {
+                       return true;
+               } else {
+                       return $this->_menu_info[$cid]['u_release_date'];
+               }
+       }
+*/
+       
+       /* returns the first test_id if this page has pre-test(s) to be passed, 
+        * or is under a page that has pre-test(s) to be passed, 
+        * 0 if has no pre-test(s) to be passed
+        * -1 if one of the pre-test(s) has expired, the content should not be displayed in this case
+        * Access: public 
+        */
+       function getPretest($cid) {
+               $this_pre_test_id = $this->getOnePretest($cid);
+               
+               if ($this->_menu_info[$cid]['content_parent_id'] == 0) {
+                       // this $cid has no parent, so we check its release date directly
+                       return $this_pre_test_id;
+               }
+               
+               // this is a sub page, need to check ALL its parents
+               $parent_pre_test_id = $this->getOnePretest($this->_menu_info[$cid]['content_parent_id']);
+               
+               if ($this_pre_test_id > 0 || $this_pre_test_id == -1)
+                       return $this_pre_test_id;
+               else if ($parent_pre_test_id > 0 || $parent_pre_test_id == -1)
+                       return $parent_pre_test_id;
+               else
+                       return 0;
+       }
+
+       /* returns the first test_id if this content has pre-test(s) to be passed, 
+        * 0 if has no pre-test(s) to be passed
+        * -1 if one of the pre-test(s) has expired, the content should not be displayed in this case
+        * Access: public 
+        */
+       function getOnePretest($cid) {
+               global $db, $msg;
+               include_once(TR_INCLUDE_PATH.'../home/lib/test_result_functions.inc.php');
+               
+               $sql = "SELECT *, UNIX_TIMESTAMP(t.start_date) AS start_date, UNIX_TIMESTAMP(t.end_date) AS end_date 
+                         FROM ".TABLE_PREFIX."tests t, ".TABLE_PREFIX."content_prerequisites cp
+                        WHERE cp.content_id=".$cid."
+                          AND cp.type = '".CONTENT_PRE_TEST."'
+                          AND cp.item_id=t.test_id";
+               $result= mysql_query($sql, $db);
+               
+               while ($row = mysql_fetch_assoc($result))
+               {
+                       // check to make sure we can access this test
+//                     if (!$row['guests'] && ($_SESSION['enroll'] == AT_ENROLL_NO || $_SESSION['enroll'] == AT_ENROLL_ALUMNUS)) {
+//                             $msg->addInfo('NOT_ENROLLED');
+//                     }
+                       
+                       if (!$row['guests'] && !authenticate_test($row['test_id'])) {
+                               $msg->addInfo(array('PRETEST_NO_PRIV',$row['title']));
+                       }
+                       
+                       // if the test is not release, not allow student to view the content
+                       if ($row['start_date'] > time() || $row['end_date'] < time()) {
+                               $msg->addInfo(array('PRETEST_EXPIRED',$row['title']));
+                               return -1;
+                       }
+                       
+                       $sql = "SELECT tr.result_id, count(*) num_of_questions, sum(ta.score) score, sum(tqa.weight) total_weight
+                                 FROM ".TABLE_PREFIX."tests_results tr, ".TABLE_PREFIX."tests_answers ta, ".TABLE_PREFIX."tests_questions_assoc tqa 
+                                WHERE tr.test_id = ".$row['test_id']."
+                                  AND tr.member_id = ".$_SESSION['user_id']."
+                                  AND tr.result_id = ta.result_id
+                                  AND tr.test_id = tqa.test_id
+                                  AND ta.question_id = tqa.question_id
+                                GROUP BY tr.result_id";
+                       $result_score = mysql_query($sql, $db);
+                       
+                       $num_of_attempts = 0;
+                       while ($row_score = mysql_fetch_assoc($result_score))
+                       {
+                               // skip the test when:
+                               // 1. no pass score is defined. this is a survey.
+                               // 2. the student has passed the test 
+                               // 3. the test has no question
+                               if (($row['passscore'] == 0 && $row['passpercent'] == 0) ||
+                                   $row_score['num_of_questions'] == 0 ||
+                                   ($row['passscore']<>0 && $row_score['score']>=$row['passscore']) || 
+                                   ($row['passpercent']<>0 && ($row_score['score']/$row_score['total_weight']*100)>=$row['passpercent']))
+                                   continue 2;
+                               
+                               $num_of_attempts++;
+                       }
+                       
+                       if ($row['num_takes'] != TR_TESTS_TAKE_UNLIMITED && $num_of_attempts >= $row['num_takes'])
+                       {
+                               $msg->addInfo(array('PRETEST_FAILED',$row['title']));
+                       }
+                       else
+                               return $row['test_id'];
+               }
+               return 0;
+       }
+
+       /** 
+        * Return true if this content page allows export, else false.
+        * @param       int     content id
+        * @return      true if 'allow_test_export'==1 || is instructor
+        */
+       function allowTestExport($content_id){
+//             if (isset($_SESSION['is_admin'])){      
+//                     return true;
+//             }
+               $row = $this->contentDAO->get($content_id);
+               if ($row['allow_test_export'] == 1){
+                       return true;
+               }
+               return false;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/docs/home/classes/ContentUtility.class.php b/docs/home/classes/ContentUtility.class.php
new file mode 100644 (file)
index 0000000..292ebe8
--- /dev/null
@@ -0,0 +1,443 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+/**\r
+* Content Utility functions \r
+* @access      public\r
+* @author      Cindy Qi Li\r
+*/\r
+\r
+if (!defined('TR_INCLUDE_PATH')) exit;\r
+\r
+class ContentUtility {\r
+\r
+       /**\r
+       * This function cuts out html body\r
+       * @access  public\r
+       * @param   $text  html text\r
+       * @author  Cindy Qi Li\r
+       */\r
+       public static function getHtmlBody($text) {\r
+               /* strip everything before <body> */\r
+               $start_pos      = strpos(strtolower($text), '<body');\r
+               if ($start_pos !== false) {\r
+                       $start_pos      += strlen('<body');\r
+                       $end_pos        = strpos(strtolower($text), '>', $start_pos);\r
+                       $end_pos        += strlen('>');\r
+       \r
+                       $text = substr($text, $end_pos);\r
+               }\r
+       \r
+               /* strip everything after </body> */\r
+               $end_pos        = strpos(strtolower($text), '</body>');\r
+               if ($end_pos !== false) {\r
+                       $text = trim(substr($text, 0, $end_pos));\r
+               }\r
+       \r
+               return $text;\r
+       }\r
+\r
+       /**\r
+       * This function cuts out requested tag information from html head\r
+       * @access  public\r
+       * @param   $text  html text\r
+       * @param   $tags  a string or an array of requested tags\r
+       * @author  Cindy Qi Li\r
+       */\r
+       public static function getHtmlHeadByTag($text, $tags)\r
+       {\r
+               $head = ContentUtility::getHtmlHead($text);\r
+               $rtn_text = "";\r
+               \r
+               if (!is_array($tags) && strlen(trim($tags)) > 0)\r
+               {\r
+                       $tags = array(trim($tags));\r
+               }\r
+               foreach ($tags as $tag)\r
+               {\r
+                       $tag = strtolower($tag);\r
+       \r
+                       /* strip everything before <{tag}> */\r
+                       $start_pos      = stripos($head, '<'.$tag);\r
+                       $temp_head = $head;\r
+                       \r
+                       while ($start_pos !== false) \r
+                       {\r
+                               $temp_text = substr($temp_head, $start_pos);\r
+               \r
+                               /* strip everything after </{tag}> or />*/\r
+                               $end_pos        = stripos($temp_text, '</' . $tag . '>');\r
+               \r
+                               if ($end_pos !== false) \r
+                               {\r
+                                       $end_pos += strlen('</' . $tag . '>');\r
+                                       \r
+                                       // add an empty line after each tag information\r
+                                       $rtn_text .= trim(substr($temp_text, 0, $end_pos)) . '\r
+               \r
+       ';\r
+                               }\r
+                               else  // match /> as ending tag if </tag> is not found\r
+                               {\r
+                                       $end_pos        = stripos($temp_text, '/>');\r
+                                       \r
+                                       if($end_pos === false && stripos($temp_text, $tag.'>')===false){\r
+                                               //if /> is not found, then this is not a valid XHTML\r
+                                               //text iff it's not tag>\r
+                                               $end_pos = stripos($temp_text, '>');\r
+                                               $end_pos += strlen('>');\r
+                                       } else {\r
+                                               $end_pos += strlen('/>');\r
+                                       }\r
+                                       // add an empty line after each tag information\r
+                                       $rtn_text .= trim(substr($temp_text, 0, $end_pos)) . '\r
+               \r
+       ';\r
+                               }\r
+                               \r
+                               // initialize vars for next round of matching\r
+                               $temp_head = substr($temp_text, $end_pos);\r
+                               $start_pos = stripos($temp_head, '<'.$tag);\r
+                       }\r
+               }\r
+               return $rtn_text;\r
+       }\r
+\r
+       /**\r
+       * This function cuts out html head\r
+       * @access  private\r
+       * @param   $text  html text\r
+       * @author  Cindy Qi Li\r
+       */\r
+       private static function getHtmlHead ($text) {\r
+               /* strip everything before <head> */\r
+               $start_pos      = stripos($text, '<head');\r
+               if ($start_pos !== false) {\r
+                       $start_pos      += strlen('<head');\r
+                       $end_pos        = stripos($text, '>', $start_pos);\r
+                       $end_pos        += strlen('>');\r
+       \r
+                       $text = substr($text, $end_pos);\r
+               }\r
+       \r
+               /* strip everything after </head> */\r
+               $end_pos        = stripos($text, '</head');\r
+               if ($end_pos !== false) {\r
+                       $text = trim(substr($text, 0, $end_pos));\r
+               }\r
+               return $text;\r
+       }\r
+\r
+       /**\r
+       * This function converts the input string into Transformable html content string \r
+       * @access  public\r
+       * @param   $input: input string\r
+       *          $html: whether the input is in html\r
+       * @return  converted Transformable html content string\r
+       * @author  Cindy Qi Li\r
+       */\r
+       public static function formatContent($input, $html = 0) {\r
+               global $_base_path, $_config;\r
+       \r
+               if (!$html) {\r
+                       $input = str_replace('<', '&lt;', $input);\r
+                       $input = str_replace('&lt;?php', '<?php', $input); // for bug #2087\r
+               } elseif ($html==2) {\r
+                       $output = '<iframe width="100%" frameborder="0" id="content_frame" marginheight="0" marginwidth="0" src="'.$input.'"></iframe>';\r
+                       $output .=      '<script type="text/javascript">\r
+                                               function resizeIframe() {\r
+                                                       var height = document.documentElement.clientHeight;\r
+                                                       \r
+                                                       // not sure how to get this dynamically\r
+                                                       height -= 20; /* whatever you set your body bottom margin/padding to be */\r
+                                                       \r
+                                                       document.getElementById(\'content_frame\').style.height = height +"px";\r
+                                                       \r
+                                               };\r
+                                               document.getElementById(\'content_frame\').onload = resizeIframe;\r
+                                               window.onresize = resizeIframe;\r
+                                               </script>';\r
+                       return $output;\r
+               }\r
+       \r
+               /* Commented by Cindy Qi Li on Jan 12, 2010\r
+                * Transformable does not support glossary\r
+               // do the glossary search and replace:\r
+               if (is_array($glossary)) {\r
+                       foreach ($glossary as $k => $v) {\r
+                               $k = urldecode($k);\r
+                               $v = str_replace("\n", '<br />', $v);\r
+                               $v = str_replace("\r", '', $v);\r
+       \r
+                               // escape special characters\r
+                               $k = preg_quote($k);\r
+       \r
+                               $k = str_replace('&lt;', '<', $k);\r
+                               $k = str_replace('/', '\/', $k);\r
+       \r
+                               $original_term = $k;\r
+                               $term = $original_term;\r
+       \r
+                               $term = '(\s*'.$term.'\s*)';\r
+                               $term = str_replace(' ','((<br \/>)*\s*)', $term); \r
+       \r
+                               $def = htmlspecialchars($v, ENT_QUOTES, 'UTF-8');               \r
+                               if ($simple) {\r
+                                       $input = preg_replace\r
+                                                       ("/(\[\?\])$term(\[\/\?\])/i",\r
+                                                       '<a href="'.$simple.'glossary.html#'.urlencode($original_term).'" target="body" class="at-term">\\2</a>',\r
+                                                       $input);\r
+                               } else {\r
+                                       $input = preg_replace\r
+                                                       ("/(\[\?\])$term(\[\/\?\])/i",\r
+                                                       '\\2<sup><a class="tooltip" href="'.$_base_path.'glossary/index.php?g_cid='.$_SESSION['s_cid'].htmlentities(SEP).'w='.urlencode($original_term).'#term" title="'.addslashes($original_term).': '.$def.'"><span style="color: blue; text-decoration: none;font-size:small; font-weight:bolder;">?</span></a></sup>',$input);\r
+                               }\r
+                       }\r
+               } else if (!$user_glossary) {\r
+                       $input = str_replace(array('[?]','[/?]'), '', $input);\r
+               }\r
+               */\r
+\r
+               \r
+               $input = str_replace('CONTENT_DIR', '', $input);\r
+       \r
+               if (isset($_config['latex_server']) && $_config['latex_server']) {\r
+                       // see: http://www.forkosh.com/mimetex.html\r
+                       $input = preg_replace('/\[tex\](.*?)\[\/tex\]/sie', "'<img src=\"'.\$_config['latex_server'].rawurlencode('$1').'\" align=\"middle\">'", $input);\r
+               }\r
+       \r
+               /* Commented by Cindy Qi Li on Jan 12, 2010\r
+               if ($html) {\r
+                       $x = apply_customized_format(format_final_output($input, false));\r
+                       return $x;\r
+               }\r
+       \r
+               $output = apply_customized_format(format_final_output($input));\r
+               */\r
+       \r
+               $output = '<p>'.$input.'</p>';\r
+       \r
+               return $output;\r
+       }\r
+       \r
+       /**\r
+        * This function returns html string of "table of content"\r
+        * @access: public\r
+        * @param: $content: a string\r
+        * @return: a html string of "table of content"\r
+        */\r
+       public static function getContentTable($content)\r
+       {\r
+               preg_match_all("/<(h[\d]+)[^>]*>(.*)<\/(\s*)\\1(\s*)>/i", $content, $found_headers, PREG_SET_ORDER);\r
+               \r
+               if (count($found_headers) == 0) return array("", $content);\r
+               else\r
+               {\r
+                       $num_of_headers = 0;\r
+       \r
+                       for ($i = 0; $i < count($found_headers); $i++)\r
+                       {\r
+                               $div_id = "_header_" . $num_of_headers++;\r
+                               \r
+                               if ($i == 0)\r
+                               {\r
+                                       $content_table = "<div id=\"toc\">\n<fieldset id=\"toc\"><legend>". _AT("table_of_contents")."</legend>\n";\r
+                               }\r
+       \r
+                               $content = str_replace($found_headers[$i][0], '<div id="'.$div_id.'">'.$found_headers[$i][0].'</div>', $content);\r
+                               $content_table .= '<a href="'.$_SERVER["REQUEST_URI"].'#'.$div_id.'" class="'.$found_headers[$i][1].'">'. $found_headers[$i][2]."</a>\n";\r
+       \r
+                               if ($i == count($found_headers) - 1)\r
+                               {\r
+                                       $content_table .= "</fieldset></div><br />";\r
+                               }\r
+                       }\r
+                       return array($content_table, $content);\r
+               }\r
+       }\r
+       \r
+       /**\r
+       * replace source object with alternatives according to user's preferences\r
+       * @access       public\r
+       * @param        $cid:                           content id.\r
+       * @param        $content:                       the original content page ($content_row['text'], from content.php).\r
+       * @return       string                          $content: the content page with the appropriated resources.\r
+       * @see          $db                             from include/vitals.inc.php\r
+       * @author       Cindy Qi Li\r
+       */\r
+       public static function applyAlternatives($cid, $content){\r
+               global $db;\r
+               \r
+               include_once(TR_INCLUDE_PATH.'classes/DAO/DAO.class.php');\r
+               $dao = new DAO();\r
+               \r
+               $vidoe_exts = array("mpg", "avi", "wmv", "mov", "swf", "mp3", "wav", "ogg", "mid");\r
+               $txt_exts = array("txt", "html", "htm");\r
+               \r
+               if (($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_TEXT']==0) && ($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_AUDIO']==0) && ($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_VISUAL']==0)) \r
+               {\r
+                       //No user's preferences related to content format are declared\r
+                       return $content;\r
+               }\r
+               \r
+               // get all relations between primary resources and their alternatives\r
+               $sql = "SELECT c.content_path, pr.resource, prt.type_id primary_type, sr.secondary_resource, srt.type_id secondary_type\r
+                         FROM ".TABLE_PREFIX."primary_resources pr, ".\r
+                                TABLE_PREFIX."primary_resources_types prt,".\r
+                                TABLE_PREFIX."secondary_resources sr,".\r
+                                TABLE_PREFIX."secondary_resources_types srt,".\r
+                                TABLE_PREFIX."content c\r
+                        WHERE pr.content_id=".$cid."\r
+                              AND pr.primary_resource_id = prt.primary_resource_id\r
+                              AND pr.primary_resource_id = sr.primary_resource_id\r
+                              AND sr.language_code='".$_SESSION['prefs']['PREF_ALT_AUDIO_PREFER_LANG']."'\r
+                              AND sr.secondary_resource_id = srt.secondary_resource_id\r
+                          AND pr.content_id = c.content_id\r
+                            ORDER BY pr.primary_resource_id, prt.type_id";\r
+               \r
+               $rows = $dao->execute($sql);\r
+       \r
+               if (!is_array($rows)) return $content;\r
+               \r
+               foreach ($rows as $row) \r
+               {\r
+                       if (($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_TEXT']==1 && $row['primary_type']==3 &&\r
+                           ($_SESSION['prefs']['PREF_ALT_TO_TEXT']=="audio" && $row['secondary_type']==1 || \r
+                            $_SESSION['prefs']['PREF_ALT_TO_TEXT']=="visual" && $row['secondary_type']==4 || \r
+                            $_SESSION['prefs']['PREF_ALT_TO_TEXT']=="sign_lang" && $row['secondary_type']==2)) ||\r
+                            \r
+                            ($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_AUDIO']==1 && $row['primary_type']==1 &&\r
+                            ($_SESSION['prefs']['PREF_ALT_TO_AUDIO']=="visual" && $row['secondary_type']==4 || \r
+                             $_SESSION['prefs']['PREF_ALT_TO_AUDIO']=="text" && $row['secondary_type']==3 || \r
+                             $_SESSION['prefs']['PREF_ALT_TO_AUDIO']=="sign_lang" && $row['secondary_type']==2)) ||\r
+                             \r
+                            ($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_VISUAL']==1 && $row['primary_type']==4 &&\r
+                            ($_SESSION['prefs']['PREF_ALT_TO_VISUAL']=="audio" && $row['secondary_type']==1 || \r
+                             $_SESSION['prefs']['PREF_ALT_TO_VISUAL']=="text" && $row['secondary_type']==3 || \r
+                             $_SESSION['prefs']['PREF_ALT_TO_VISUAL']=="sign_lang" && $row['secondary_type']==2))\r
+                           )\r
+                       {\r
+                               $ext = substr($row['secondary_resource'], strrpos($row['secondary_resource'], '.')+1);\r
+                               \r
+                               // alternative is video\r
+                               if (in_array($ext, $vidoe_exts))\r
+                                       $target = '[media]'.$row['secondary_resource'].'[/media]';\r
+                               // a text primary to be replaced by a visual alternative \r
+                               else if (in_array($ext, $txt_exts))\r
+                               {\r
+                                       if (substr($row['secondary_resource'], 0, 2) == '..') \r
+                                               $file_location = substr($row['secondary_resource'], 3);\r
+                                       else \r
+                                               $file_location = $row['secondary_resource'];\r
+                                       $file .= $file_location;\r
+                                       \r
+                                       if ($row['content_path'] <> '') {\r
+                                               $file = AT_CONTENT_DIR.$_SESSION['course_id'] . '/'.$row['content_path'].'/'.$file_location;\r
+                                       }\r
+                                       else {\r
+                                               $file = AT_CONTENT_DIR.$_SESSION['course_id'] . '/'.$file_location;\r
+                                       }\r
+                                       $target = file_get_contents($file);\r
+                                       \r
+                                       // check whether html file\r
+                                       if (preg_match('/.*\<html.*\<\/html\>.*/s', $target))\r
+                                       { // is a html file, use iframe to display\r
+                                               // get real path to the text file\r
+                                               if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) {\r
+                                                       $course_base_href = 'get.php/';\r
+                                               } else {\r
+                                                       $course_base_href = 'content/' . $_SESSION['course_id'] . '/';\r
+                                               }\r
+               \r
+                                               $file = AT_BASE_HREF . $course_base_href.$file_location;\r
+                                                       \r
+                                               $target = '<iframe width="100%" frameborder="0" class="autoHeight" scrolling="auto" src="'.$file.'"></iframe>';\r
+                                       }\r
+                                       else\r
+                                       { // is a text file, insert/replace into content\r
+                                               $target = nl2br($target);\r
+                                       }\r
+                               } \r
+                               else if ($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_TEXT']==1 \r
+                                        && $_SESSION['prefs']['PREF_ALT_TO_TEXT']=="visual")\r
+                                       $target = '<img border="0" alt="Alternate Text" src="'.$row['secondary_resource'].'"/>';\r
+                               // otherwise\r
+                               else\r
+                                       $target = '<p><a href="'.$row['secondary_resource'].'">'.$row['secondary_resource'].'</a></p>';\r
+                               \r
+                               // replace or append the target alternative to the source\r
+                               if (($row['primary_type']==3 && $_SESSION['prefs']['PREF_ALT_TO_TEXT_APPEND_OR_REPLACE'] == 'replace') ||\r
+                                       ($row['primary_type']==1 && $_SESSION['prefs']['PREF_ALT_TO_AUDIO_APPEND_OR_REPLACE']=='replace') ||\r
+                                       ($row['primary_type']==4 && $_SESSION['prefs']['PREF_ALT_TO_VISUAL_APPEND_OR_REPLACE']=='replace'))\r
+                                       $pattern_replace_to = '${1}'.$target.'${3}';\r
+                               else\r
+                                       $pattern_replace_to = '${1}${2}'.$target.'${3}';\r
+                                       \r
+                               // append/replace target alternative to [media]source[/media]\r
+                               $content = preg_replace("/(.*)(".preg_quote("[media]".$row['resource']."[/media]", "/").")(.*)/s", \r
+                                            $pattern_replace_to, $content);\r
+                               \r
+                               // append/replace target alternative to <a>...source...</a> or <a ...source...>...</a>\r
+                               if (preg_match("/\<a.*".preg_quote($row['resource'], "/").".*\<\/a\>/s", $content))\r
+                               {\r
+                                       $content = preg_replace("/(.*)(\<a.*".preg_quote($row['resource'], "/").".*\<\/a\>)(.*)/s", \r
+                                                       $pattern_replace_to, $content);\r
+                               }\r
+       \r
+                               // append/replace target alternative to <img ... src="source" ...></a>\r
+                               if (preg_match("/\<img.*src=\"".preg_quote($row['resource'], "/")."\".*\/\>/s", $content))\r
+                               {\r
+                                       $content = preg_replace("/(.*)(\<img.*src=\"".preg_quote($row['resource'], "/")."\".*\/\>)(.*)/s", \r
+                                                       $pattern_replace_to, $content);\r
+                               }\r
+                               \r
+                               // append/replace target alternative to <object ... source ...></object>\r
+                               if (preg_match("/\<object.*".preg_quote($row['resource'], "/").".*\<\/object\>/s", $content))\r
+                               {\r
+                                       $content = preg_replace("/(.*)(\<object.*".preg_quote($row['resource'], "/").".*\<\/object\>)(.*)/s", \r
+                                                       $pattern_replace_to, $content);\r
+                               }\r
+       \r
+                               // append/replace target alternative to <embed ... source ...>\r
+                               if (preg_match("/\<embed.*".preg_quote($row['resource'], "/").".*\>/s", $content))\r
+                               {\r
+                                       $content = preg_replace("/(.*)(\<embed.*".preg_quote($row['resource'], "/").".*\>)(.*)/s", \r
+                                                       $pattern_replace_to, $content);\r
+                               }\r
+                       }\r
+               }\r
+               return $content;\r
+       }       \r
+               \r
+       /**\r
+        * This function save the last content_id accessed by current user on a course into db and set $_SESSION['s_cid']\r
+        * @access: public\r
+        * @param: $content_id\r
+        * @return: save $content_id, the last visited one of the current user, into db and session\r
+        */\r
+       public static function saveLastCid($content_id)\r
+       {\r
+               global $_course_id;\r
+               \r
+               if (!$content_id) return;\r
+               \r
+               include_once(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');\r
+               \r
+               $userCoursesDAO = new UserCoursesDAO();\r
+               if ($userCoursesDAO->isExist($_SESSION['user_id'], $_course_id))\r
+               {\r
+                       $userCoursesDAO->UpdateLastCid($_SESSION['user_id'], $_course_id, $content_id);\r
+                       $_SESSION['s_cid'] = $content_id;\r
+               }\r
+       }\r
+}\r
+?>
\ No newline at end of file
diff --git a/docs/home/course/content.php b/docs/home/course/content.php
new file mode 100644 (file)
index 0000000..0eb0926
--- /dev/null
@@ -0,0 +1,259 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
+
+global $_current_user, $_course_id, $_content_id, $contentManager;
+
+$cid = $_content_id;
+
+if ($cid == 0) {
+       header('Location: '.$_base_href.'index.php');
+       exit;
+}
+
+/* show the content page */
+$content_row = $contentManager->getContentPage($cid);
+
+if (!$content_row) {
+       $_pages['home/course/content.php']['title_var'] = 'missing_content';
+       $_pages['home/course/content.php']['parent']    = 'home/index.php';
+       $_pages['home/course/content.php']['ignore']    = true;
+
+
+       require(TR_INCLUDE_PATH.'header.inc.php');
+
+       $msg->addError('PAGE_NOT_FOUND');
+       $msg->printAll();
+
+       require (TR_INCLUDE_PATH.'footer.inc.php');
+       exit;
+} /* else: */
+
+if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
+       $course_base_href = 'get.php/';
+} else {
+       $course_base_href = 'content/' . $_course_id . '/';
+}
+
+/* the "heading navigation": */
+$path  = $contentManager->getContentPath($cid);
+
+if ($content_row['content_path']) {
+       $content_base_href = $content_row['content_path'].'/';
+}
+
+$parent_headings = '';
+$num_in_path = count($path);
+
+/* the page title: */
+$page_title = '';
+$page_title .= $content_row['title'];
+
+for ($i=0; $i<$num_in_path; $i++) {
+       $content_info = $path[$i];
+       if ($_SESSION['prefs']['PREF_NUMBERING']) {
+               if ($contentManager->_menu_info[$content_info['content_id']]['content_parent_id'] == 0) {
+                       $top_num = $contentManager->_menu_info[$content_info['content_id']]['ordering'];
+                       $parent_headings .= $top_num;
+               } else {
+                       $top_num = $top_num.'.'.$contentManager->_menu_info[$content_info['content_id']]['ordering'];
+                       $parent_headings .= $top_num;
+               }
+               if ($_SESSION['prefs']['PREF_NUMBERING']) {
+                       $path[$i]['content_number'] = $top_num . ' ';
+               }
+               $parent_headings .= ' ';
+       }
+}
+
+if ($_SESSION['prefs']['PREF_NUMBERING']) {
+       if ($top_num != '') {
+               $top_num = $top_num.'.'.$content_row['ordering'];
+               $page_title .= $top_num.' ';
+       } else {
+               $top_num = $content_row['ordering'];
+               $page_title .= $top_num.' ';
+       }
+}
+
+$parent = 0;
+
+foreach ($path as $i=>$page) {
+       // When login is a student, remove content folder from breadcrumb path as content folders are
+       // just toggles for students. Keep content folder in breadcrumb path for instructors as they
+       // can edit content folder title. 
+       if ((!isset($_current_user) || !$_current_user->isAuthor($_course_id)) && 
+           $contentManager->_menu_info[$page['content_id']]['content_type'] == CONTENT_TYPE_FOLDER) {
+               unset($path[$i]);
+               continue;
+       }
+       
+       if ($contentManager->_menu_info[$page['content_id']]['content_type'] == CONTENT_TYPE_FOLDER)
+               $content_url = 'home/course/edit_content_folder.php?_cid='.$page['content_id'];
+       else
+               $content_url = 'home/course/content.php?_cid='.$page['content_id'];
+               
+       if (!$parent) {
+               $_pages[$content_url]['title']    = $page['content_number'] . $page['title'];
+               $_pages[$content_url]['parent']   = 'home/index.php';
+       } else {
+               $_pages[$content_url]['title']    = $page['content_number'] . $page['title'];
+               $_pages[$content_url]['parent']   = 'home/course/edit_content_folder.php?_cid='.$parent;
+       }
+
+       $_pages[$content_url]['ignore'] = true;
+       $parent = $page['content_id'];
+}
+$last_page = array_pop($_pages);
+$_pages['home/course/content.php'] = $last_page;
+
+reset($path);
+$first_page = current($path);
+
+/* the content test extension page */
+$content_test_ids = array();   //the html
+$content_test_rows = $contentManager->getContentTestsAssoc($cid);
+if (is_array($content_test_rows))
+{
+       foreach ($content_test_rows as $content_test_row){
+               $content_test_ids[] = $content_test_row;
+       }
+}
+
+/*TODO***************BOLOGNA***************REMOVE ME**********/
+/* the content forums extension page*/
+//$content_forum_ids = array();        //the html
+//$content_forum_rows = $contentManager->getContentForumsAssoc($cid);
+//if (is_array($content_forum_rows))
+//{
+//     foreach ($content_forum_rows as $content_forum_row){
+//             $content_forum_ids[] = $content_forum_row;
+//     }
+//}
+
+// use any styles that were part of the imported document
+// $_custom_css = $_base_href.'headstuff.php?cid='.$cid.SEP.'path='.urlEncode($_base_href.$course_base_href.$content_base_href);
+
+if ($content_row['use_customized_head'] && strlen($content_row['head']) > 0)
+{
+       $_custom_head .= $content_row['head'];
+}
+
+global $_custom_head;
+$_custom_head .= '
+       <script language="javascript" type="text/javascript">
+       //<!--
+       jQuery(function() {
+       jQuery(\'a.tooltip\').tooltip( { showBody: ": ", showURL: false } );
+       } );
+       //-->
+       </script>
+';
+
+ContentUtility::saveLastCid($cid);
+
+if (isset($top_num) && $top_num != (int) $top_num) {
+       $top_num = substr($top_num, 0, strpos($top_num, '.'));
+}
+
+$shortcuts = array();
+if (((!$content_row['content_parent_id'] && ($_SESSION['packaging'] == 'top'))
+      || ($_SESSION['packaging'] == 'all'))
+         || (isset($_current_user) && $_current_user->isAuthor($_course_id))) {
+
+       $shortcuts[] = array('title' => _AT('export_content'), 'url' => $_base_href . 'tools/ims/ims_export.php?cid='.$cid);
+}
+
+if (isset($_current_user) && $_current_user->isAuthor($_course_id)) {
+       $shortcuts[] = array('title' => _AT('edit_this_page'),   'url' => $_base_href . 'mods/_core/editor/edit_content.php?cid='.$cid);
+       $shortcuts[] = array('title' => _AT('add_top_folder'),   'url' => $_base_href . 'mods/_core/editor/edit_content_folder.php');
+
+       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
+               $shortcuts[] = array('title' => _AT('add_sibling_folder'), 'url' => $_base_href .
+                       'mods/_core/editor/edit_content_folder.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id']);
+       }
+       $shortcuts[] = array('title' => _AT('add_top_page'),     'url' => $_base_href . 'mods/_core/editor/edit_content.php');
+       if ($contentManager->_menu_info[$cid]['content_parent_id']) {
+               $shortcuts[] = array('title' => _AT('add_sibling_page'), 'url' => $_base_href .
+                       'mods/_core/editor/edit_content.php?pid='.$contentManager->_menu_info[$cid]['content_parent_id']);
+       }
+       $shortcuts[] = array('title' => _AT('delete_this_page'), 'url' => $_base_href . 'mods/_core/editor/delete_content.php?cid='.$cid);
+}
+$savant->assign('shortcuts', $shortcuts);
+
+//if it has test and forum associated with it, still display it even if the content is empty
+if ($content_row['text'] == '' && empty($content_test_ids)){
+       $msg->addInfo('NO_PAGE_CONTENT');
+       $savant->assign('body', '');
+} else {
+// Commented by Cindy Qi Li on Jan 27, 2010
+//     $pre_test_id = $contentManager->getPretest($cid);
+//     
+//     if (intval($pre_test_id) > 0)
+//     {
+//             if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN)) {
+//                     $msg->addInfo('PRETEST');
+//             }
+//             else {
+//                     header('Location: '.url_rewrite('tools/test_intro.php?tid='.$pre_test_id.SEP.'cid='.$cid, TR_PRETTY_URL_IS_HEADER));
+//             }
+//     }
+       
+       // if one of the prerequisite test(s) has expired, student cannot view the content 
+//     if (intval($pre_test_id) != -1 || $_current_user->isAuthor($_course_id))
+// end of Commented by Cindy Qi Li on Jan 27, 2010
+
+       //Silvia: to provide appropriated content on the basis of users' preferences
+       $content = ContentUtility::applyAlternatives($cid, $content_row['text']);
+                
+       $content = ContentUtility::formatContent($content, $content_row['formatting']);
+
+       $content_array = ContentUtility::getContentTable($content);
+       
+       $savant->assign('content_table', $content_array[0]);
+       $savant->assign('body', $content_array[1]);
+
+       //assign test pages if there are tests associated with this content page
+       if (!empty($content_test_ids)){
+               $savant->assign('test_message', $content_row['test_message']);
+               $savant->assign('test_ids', $content_test_ids);
+       } else {
+               $savant->assign('test_message', '');
+               $savant->assign('test_ids', array());
+       }
+
+               /*TODO***************BOLOGNA***************REMOVE ME**********/
+               //assign forum pages if there are forums associated with this content page
+//             if (!empty($content_forum_ids)){
+//                     $savant->assign('forum_message','');
+//                     $savant->assign('forum_ids', $content_forum_ids);
+//             } else {
+//                     $savant->assign('forum_message', '');
+//                     $savant->assign('forum_ids', array());
+//             }
+}
+
+$savant->assign('content_info', _AT('page_info', AT_date(_AT('page_info_date_format'), $content_row['last_modified'], TR_DATE_MYSQL_DATETIME), $content_row['revision'], AT_date(_AT('inbox_date_format'), $content_row['release_date'], TR_DATE_MYSQL_DATETIME)));
+$savant->assign('course_id', $_course_id);
+
+require(TR_INCLUDE_PATH.'header.inc.php');
+
+$savant->display('home/course/content.tmpl.php');
+
+//save last visit page.
+$_SESSION['last_visited_page'] = $server_protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+
+require (TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/home/course/content_nav_inline_editor_submit.php b/docs/home/course/content_nav_inline_editor_submit.php
new file mode 100644 (file)
index 0000000..d68ea5a
--- /dev/null
@@ -0,0 +1,41 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+define('TR_INCLUDE_PATH', '../../include/');\r
+require(TR_INCLUDE_PATH.'vitals.inc.php');\r
+require_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php');\r
+\r
+global $db;\r
+\r
+if (trim($_POST['field']) <> "" && trim($_POST['value']) <> "")\r
+{\r
+       $fields = explode('-', $_POST['field']);\r
+       $content_id = intval($fields[1]);\r
+       \r
+       if ($content_id > 0)\r
+       {\r
+               $contentDAO = new ContentDAO();\r
+               \r
+               if ($contentDAO->UpdateField($content_id, 'title', $_POST['value']))\r
+               {\r
+                       $rtn['status'] = 'success';\r
+                       $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');\r
+               }\r
+               else\r
+               {\r
+                       $rtn['status'] = 'fail';\r
+                       $rtn['success'][] = _AT('TR_ERROR_UNABLE_UPDATE_DB');\r
+               }\r
+               echo json_encode($rtn);\r
+       }\r
+}\r
+?>
\ No newline at end of file
diff --git a/docs/home/course/course_property.php b/docs/home/course/course_property.php
new file mode 100644 (file)
index 0000000..a644669
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+
+global $_course_id;
+
+$coursesDAO = new CoursesDAO();
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: '.TR_BASE_HREF.'home/course/index.php?_course_id='.$_course_id);
+       exit;
+}
+else if($_POST['submit']){
+       $coursesDAO->UpdateField($_course_id, 'title', $_POST['title']);
+       $coursesDAO->UpdateField($_course_id, 'primary_language', $_POST['pri_lang']);
+       $coursesDAO->UpdateField($_course_id, 'description', $_POST['description']);
+       $coursesDAO->UpdateField($_course_id, 'copyright', $_POST['copyright']);
+       
+       if (isset($_POST['hide_course']))
+               $access = 'private';
+       else
+               $access = 'public';
+       
+       $coursesDAO->UpdateField($_course_id, 'access', $access);
+       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+}
+
+$savant->assign('course_id', $_course_id);
+$savant->assign('course_row', $coursesDAO->get($_course_id));
+
+global $onload;
+$onload = "document.form.title.focus();";
+require(TR_INCLUDE_PATH.'header.inc.php'); 
+
+$savant->display('home/course/course_property.tmpl.php');
+
+require(TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/home/course/del_course.php b/docs/home/course/del_course.php
new file mode 100644 (file)
index 0000000..c244b13
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+global $_course_id;
+
+Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
+
+$coursesDAO = new CoursesDAO();
+$course_info = $coursesDAO->get($_course_id);
+
+if (isset($_POST['submit_no'])) {
+       $msg->addFeedback('CANCELLED');
+       header('Location: '.TR_BASE_HREF.'home/course/index.php?_course_id='.$_course_id);
+       exit;
+} else if (isset($_POST['step']) && ($_POST['step'] == 2) && isset($_POST['submit_yes'])) {
+       $coursesDAO->Delete($_course_id);
+       
+       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+       header('Location: '.TR_BASE_HREF.'home/index.php');
+       exit;
+}
+
+require(TR_INCLUDE_PATH.'header.inc.php'); 
+
+if (!isset($_POST['step'])) {
+       $hidden_vars['step'] = 1;
+       $hidden_vars['_course_id'] = $_course_id;
+       $msg->addConfirm(array('DELETE_COURSE_1', $course_info['title']), $hidden_vars);
+       $msg->printConfirm();
+} else if ($_POST['step'] == 1) {
+       $hidden_vars['step'] = 2;
+       $hidden_vars['_course_id'] = $_course_id;
+       $msg->addConfirm(array('DELETE_COURSE_2', $course_info['title']), $hidden_vars);
+       $msg->printConfirm();
+}
+
+require(TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/home/course/index.php b/docs/home/course/index.php
new file mode 100644 (file)
index 0000000..4c3c2b7
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+
+global $msg, $contentManager, $_course_id;
+
+if ($_course_id <= 0)
+{
+       $msg->addError('MISSING_COURSE_ID');
+       header('Location: '.TR_BASE_HREF.'home/index.php');
+       exit;
+}
+
+if (isset($_sequence_links['resume']['url']))
+       $url = $_sequence_links['resume']['url'];
+else if (isset($_sequence_links['first']['url']))
+       $url = $_sequence_links['first']['url'];
+else
+{
+       // go to content wizard
+}
+
+header('Location: '.$url);
+?>
\ No newline at end of file
diff --git a/docs/home/course/outline.php b/docs/home/course/outline.php
new file mode 100644 (file)
index 0000000..d837c90
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+
+global $msg, $contentManager;
+
+//if (!isset($contentManager))
+//{
+//     $msg->addError('MISSING_COURSE_ID');
+//     require(TR_INCLUDE_PATH.'header.inc.php');
+//}
+
+require(TR_INCLUDE_PATH.'header.inc.php');
+
+if (isset($contentManager))
+{
+       echo '<p>';
+       $contentManager->printSiteMapMenu();
+       echo '</p>';
+}
+else
+{
+       $msg->addError('MISSING_COURSE_ID');
+       $msg->printAll();
+}
+
+require(TR_INCLUDE_PATH.'footer.inc.php');
+?>
\ No newline at end of file
diff --git a/docs/home/course/refresh_content_nav.php b/docs/home/course/refresh_content_nav.php
new file mode 100644 (file)
index 0000000..83933e6
--- /dev/null
@@ -0,0 +1,20 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+define('TR_INCLUDE_PATH', '../../include/');\r
+require(TR_INCLUDE_PATH.'vitals.inc.php');\r
+\r
+global $contentManager;\r
+\r
+// save updated content navigation menu into cache\r
+echo $contentManager->printMainMenu();\r
+?>
\ No newline at end of file
diff --git a/docs/home/create_course.php b/docs/home/create_course.php
new file mode 100644 (file)
index 0000000..2f1e3e5
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+// make sure the user has author privilege
+Utility::authenticate(TR_PRIV_ISAUTHOR);
+
+$savant->display('home/create_course.tmpl.php');
+?>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_0/imsccauth_v1p0.xsd b/docs/home/ims/domainProfile_0/imsccauth_v1p0.xsd
new file mode 100644 (file)
index 0000000..738ccda
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imsccauth_v1p0" targetNamespace="http://www.imsglobal.org/xsd/imsccauth_v1p0" elementFormDefault="qualified">\r
+\r
+  <xs:element name="authorizations" type="authorizationsType" />\r
+\r
+  <xs:complexType name="authorizationsType">\r
+       <xs:sequence>\r
+               <xs:element name="authorization" type="authorizationType" />\r
+               <xs:group ref="grpStrict.any" minOccurs="0" maxOccurs="unbounded" />\r
+       </xs:sequence>\r
+       <xs:attribute name="access" type="accessType" use="required" />\r
+    <xs:attribute name="import" type="xs:boolean" default="false" />\r
+  </xs:complexType>\r
+\r
+  <xs:complexType name="authorizationType">\r
+    <xs:sequence>\r
+      <xs:element name="cartridgeId" type="xs:string" />\r
+      <xs:element name="webservice" type="xs:string" minOccurs="0" />\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <xs:simpleType name="accessType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:enumeration value="cartridge" />\r
+      <xs:enumeration value="resource" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+\r
+    <xs:group name="grpStrict.any">\r
+        <xs:annotation>\r
+            <xs:documentation>\r
+                This group is defined exactly as in IMS Content Packaging v 1.2.\r
+                Any namespaced element from any namespace may be included within an "any" element.\r
+                The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                The extension has a definition of "strict" i.e. they must have their own namespace.\r
+            </xs:documentation>\r
+        </xs:annotation>\r
+        <xs:sequence>\r
+            <xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+        </xs:sequence>\r
+    </xs:group>\r
+\r
+  <xs:attribute name="protected" type="xs:boolean" default="false" />\r
+\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_0/imsccauth_v1p0_localised.xsd b/docs/home/ims/domainProfile_0/imsccauth_v1p0_localised.xsd
new file mode 100644 (file)
index 0000000..d73795c
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imsccauth_v1p0.xsd                                                  **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imsccauth_v1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/imsccauth_v1p0" elementFormDefault="qualified">\r
+\r
+  <xs:annotation>\r
+        <xs:documentation xml:lang="en">general: This specification defines the authorizations for Common Cartridges and the roles to be used for selective display of resources to Learner or Instructor.</xs:documentation>\r
+    </xs:annotation><xs:element name="authorizations" type="authorizationsType" />\r
+\r
+  <xs:complexType name="authorizationsType">\r
+       <xs:sequence>\r
+               <xs:element name="authorization" type="authorizationType" />\r
+               <xs:group ref="grpStrict.any" minOccurs="0" maxOccurs="unbounded" />\r
+       </xs:sequence>\r
+       <xs:attribute name="access" type="accessType" use="required" />\r
+    <xs:attribute name="import" type="xs:boolean" default="false" />\r
+  </xs:complexType>\r
+\r
+  <xs:complexType name="authorizationType">\r
+    <xs:sequence>\r
+      <xs:element name="cartridgeId" type="xs:string" />\r
+      <xs:element name="webservice" type="xs:string" minOccurs="0" />\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <xs:simpleType name="accessType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:enumeration value="cartridge" />\r
+      <xs:enumeration value="resource" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+\r
+    <xs:group name="grpStrict.any">\r
+        <xs:annotation>\r
+            <xs:documentation>\r
+                This group is defined exactly as in IMS Content Packaging v 1.2.\r
+                Any namespaced element from any namespace may be included within an "any" element.\r
+                The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                The extension has a definition of "strict" i.e. they must have their own namespace.\r
+            </xs:documentation>\r
+        </xs:annotation>\r
+        <xs:sequence>\r
+            <xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+        </xs:sequence>\r
+    </xs:group>\r
+\r
+  <xs:attribute name="protected" type="xs:boolean" default="false" />\r
+\r
+\r
+\r
+       </xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/anyElement.xsd b/docs/home/ims/domainProfile_1/anyElement.xsd
new file mode 100644 (file)
index 0000000..5b2ba1d
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides the element group declaration and the\r
+         attribute group declaration used for extension XML elements and attributes.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <xs:group name="customElements">\r
+      <xs:choice>\r
+         <xs:any namespace="##other" processContents="lax" />\r
+      </xs:choice>\r
+   </xs:group>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/anyElement_localised.xsd b/docs/home/ims/domainProfile_1/anyElement_localised.xsd
new file mode 100644 (file)
index 0000000..0dfe131
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** anyElement.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_m_definition.xsd" />\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides the element group declaration and the\r
+         attribute group declaration used for extension XML elements and attributes.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <xs:group name="customElements">\r
+      <xs:choice>\r
+         <xs:any namespace="##other" processContents="lax" />\r
+      </xs:choice>\r
+   </xs:group>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/common/anyElement.xsd b/docs/home/ims/domainProfile_1/common/anyElement.xsd
new file mode 100644 (file)
index 0000000..34d6c6a
--- /dev/null
@@ -0,0 +1,39 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides the element group declaration and the\r
+         attribute group declaration used for extension XML elements and attributes.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <xs:group name="customElements">\r
+      <xs:choice>\r
+         <xs:any namespace="##other" processContents="lax"/>\r
+      </xs:choice>\r
+   </xs:group>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/common/dataTypes.xsd b/docs/home/ims/domainProfile_1/common/dataTypes.xsd
new file mode 100644 (file)
index 0000000..eebfb93
--- /dev/null
@@ -0,0 +1,118 @@
+<xs:schema xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion defines global schema data type declarations\r
+         for data types defined in the LOMv1.0 base schema.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="../unique/loose.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="../extend/custom.xsd"/>\r
+        <xs:include schemaLocation="elementTypes.xsd"/>\r
+       <!-- Data type declarations -->\r
+       <!-- CharacterString -->\r
+       <xs:simpleType name="CharacterString">\r
+               <xs:restriction base="xs:string"/>\r
+       </xs:simpleType>\r
+       <!-- LanguageId -->\r
+       <xs:complexType name="LanguageId">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:language">\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- VCard -->\r
+       <xs:complexType name="VCard">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- MimeType -->\r
+       <xs:simpleType name="MimeType">\r
+               <xs:restriction base="CharacterString"/>\r
+       </xs:simpleType>\r
+       <!-- Size -->\r
+       <xs:simpleType name="Size">\r
+               <xs:restriction base="xs:nonNegativeInteger"/>\r
+       </xs:simpleType>\r
+       <!-- LanguageString -->\r
+       <xs:complexType name="LanguageString">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="string" type="LangString"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="LangString">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attribute name="language" type="xs:language"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- DateTime -->\r
+       <xs:complexType name="DateTime">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="dateTime" type="DateTimeValue"/>\r
+                       <xs:element name="description" type="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DateTimeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DateTimeString">\r
+                               <xs:attributeGroup ref="ag:DateTimeValue"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DateTimeString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]|[0-9][1-9][0-9]{2}|[1-9][0-9]{3})(\-(0[1-9]|1[0-2])(\-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9](:[0-5][0-9](\.[0-9]{1,}(Z|((\+|\-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?)?)?)?)?)?)?"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- Duration -->\r
+       <xs:complexType name="Duration">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="duration" type="DurationValue"/>\r
+                       <xs:element name="description" type="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DurationValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DurationString">\r
+                               <xs:attributeGroup ref="ag:DurationValue"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DurationString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="P([0-9]{1,}Y){0,1}([0-9]{1,}M){0,1}([0-9]{1,}D){0,1}(T([0-9]{1,}H){0,1}([0-9]{1,}M){0,1}([0-9]{1,}(\.[0-9]{1,}){0,1}S){0,1}){0,1}"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/common/elementNames.xsd b/docs/home/ims/domainProfile_1/common/elementNames.xsd
new file mode 100644 (file)
index 0000000..019dd2e
--- /dev/null
@@ -0,0 +1,783 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion defines global element declarations for\r
+         each of the data elements defined in the LOMv1.0 base schema.  This component\r
+         schema definition is used to check for the uniqueness of elements declared\r
+         to be unique within their parent elements by the presence of the\r
+         "uniqueElementName" attribute.  The XML Schema constraint "unique" is used\r
+         to enforce uniqueness constraints.\r
+\r
+         Duplicate declarations are included as comments for completeness.  These\r
+         declarations should remain commented out or they can be removed completely.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Duplicate declarations are included as comments. -->\r
+\r
+   <!-- 1 General -->\r
+   <xs:group name="general">\r
+      <xs:sequence>\r
+         <xs:element name="general" type="general">\r
+            <xs:unique name="generalUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1 Identifier -->\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.1 Catalog -->\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.2 Entry -->\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.2 Title -->\r
+   <xs:group name="title">\r
+      <xs:sequence>\r
+         <xs:element name="title" type="title"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.3 Language-->\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.4 Description -->\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.5 Keyword -->\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.6 Coverage -->\r
+   <xs:group name="coverage">\r
+      <xs:sequence>\r
+         <xs:element name="coverage" type="coverage"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:group name="structure">\r
+      <xs:sequence>\r
+         <xs:element name="structure" type="structure">\r
+            <xs:unique name="structureUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:group name="aggregationLevel">\r
+      <xs:sequence>\r
+         <xs:element name="aggregationLevel" type="aggregationLevel">\r
+            <xs:unique name="aggregationLevelUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2 Life Cycle -->\r
+   <xs:group name="lifeCycle">\r
+      <xs:sequence>\r
+         <xs:element name="lifeCycle" type="lifeCycle">\r
+            <xs:unique name="lifeCycleUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.1 Version -->\r
+   <xs:group name="version">\r
+      <xs:sequence>\r
+         <xs:element name="version" type="version"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:group name="status">\r
+      <xs:sequence>\r
+         <xs:element name="status" type="status">\r
+            <xs:unique name="statusUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3 Contribute -->\r
+   <xs:group name="contribute">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contribute">\r
+            <xs:unique name="contributeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:group name="role">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="role">\r
+            <xs:unique name="roleUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.2 Entity -->\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:group name="date">\r
+     <xs:sequence>\r
+        <xs:element name="date" type="date">\r
+           <xs:unique name="dateUnique">\r
+              <xs:selector xpath="*"/>\r
+              <xs:field xpath="@uniqueElementName"/>\r
+           </xs:unique>\r
+        </xs:element>\r
+     </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3 Meta-Metadata -->\r
+   <xs:group name="metaMetadata">\r
+      <xs:sequence>\r
+         <xs:element name="metaMetadata" type="metaMetadata">\r
+            <xs:unique name="metaMetadataUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2 Contribute -->\r
+   <xs:group name="contributeMeta">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contributeMeta">\r
+            <xs:unique name="contributeMetaUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:group name="roleMeta">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="roleMeta">\r
+            <xs:unique name="roleMetaUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.2 Entity\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2.3 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.3 Metadata Schema -->\r
+   <xs:group name="metadataSchema">\r
+      <xs:sequence>\r
+         <xs:element name="metadataSchema" type="metadataSchema"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.4 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 4 Technical -->\r
+   <xs:group name="technical">\r
+      <xs:sequence>\r
+         <xs:element name="technical" type="technical">\r
+            <xs:unique name="technicalUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.1 Format -->\r
+  <xs:group name="format">\r
+      <xs:sequence>\r
+         <xs:element name="format" type="format"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.2 Size -->\r
+   <xs:group name="size">\r
+      <xs:sequence>\r
+         <xs:element name="size" type="size"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.3 Location -->\r
+   <xs:group name="location">\r
+      <xs:sequence>\r
+         <xs:element name="location" type="location"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4 Requirement -->\r
+   <xs:group name="requirement">\r
+      <xs:sequence>\r
+         <xs:element name="requirement" type="requirement"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1 OrComposite -->\r
+   <xs:group name="orComposite">\r
+      <xs:sequence>\r
+         <xs:element name="orComposite" type="orComposite">\r
+            <xs:unique name="orCompositeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:group name="type">\r
+      <xs:sequence>\r
+         <xs:element name="type" type="type">\r
+            <xs:unique name="typeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:group name="name">\r
+      <xs:sequence>\r
+         <xs:element name="name" type="name">\r
+            <xs:unique name="nameUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.3 Minimum Version -->\r
+   <xs:group name="minimumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="minimumVersion" type="minimumVersion"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.4 Maximum Version -->\r
+   <xs:group name="maximumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="maximumVersion" type="maximumVersion"/>\r
+      </xs:sequence>\r
+    </xs:group>\r
+\r
+   <!-- 4.5 Installation Remarks -->\r
+   <xs:group name="installationRemarks">\r
+      <xs:sequence>\r
+         <xs:element name="installationRemarks" type="installationRemarks"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.6 Other Platform Requirements -->\r
+   <xs:group name="otherPlatformRequirements">\r
+      <xs:sequence>\r
+         <xs:element name="otherPlatformRequirements" type="otherPlatformRequirements"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.7 Duration -->\r
+   <xs:group name="duration">\r
+      <xs:sequence>\r
+         <xs:element name="duration" type="duration">\r
+            <xs:unique name="durationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5 Educational -->\r
+   <xs:group name="educational">\r
+      <xs:sequence>\r
+         <xs:element name="educational" type="educational">\r
+            <xs:unique name="educationalUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:group name="interactivityType">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityType" type="interactivityType">\r
+            <xs:unique name="interactivityTypeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:group name="learningResourceType">\r
+      <xs:sequence>\r
+         <xs:element name="learningResourceType" type="learningResourceType">\r
+            <xs:unique name="learningResourceTypeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:group name="interactivityLevel">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityLevel" type="interactivityLevel">\r
+            <xs:unique name="interactivityLevelUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:group name="semanticDensity">\r
+      <xs:sequence>\r
+         <xs:element name="semanticDensity" type="semanticDensity">\r
+            <xs:unique name="semanticDensityUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:group name="intendedEndUserRole">\r
+      <xs:sequence>\r
+         <xs:element name="intendedEndUserRole" type="intendedEndUserRole">\r
+            <xs:unique name="intendedEndUserRoleUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:group name="context">\r
+      <xs:sequence>\r
+         <xs:element name="context" type="context">\r
+            <xs:unique name="contextUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.7 Typical Age Range -->\r
+   <xs:group name="typicalAgeRange">\r
+      <xs:sequence>\r
+         <xs:element name="typicalAgeRange" type="typicalAgeRange"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:group name="difficulty">\r
+      <xs:sequence>\r
+         <xs:element name="difficulty" type="difficulty">\r
+            <xs:unique name="difficultyUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.9 Typical Learning Time -->\r
+   <xs:group name="typicalLearningTime">\r
+      <xs:sequence>\r
+         <xs:element name="typicalLearningTime" type="typicalLearningTime">\r
+            <xs:unique name="typicalLearningTimeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.10 Description\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 5.11 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group>-->\r
+\r
+   <!-- 6 Rights -->\r
+   <xs:group name="rights">\r
+      <xs:sequence>\r
+         <xs:element name="rights" type="rights">\r
+            <xs:unique name="rightsUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:group name="cost">\r
+      <xs:sequence>\r
+         <xs:element name="cost" type="cost">\r
+            <xs:unique name="costUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:group name="copyrightAndOtherRestrictions">\r
+      <xs:sequence>\r
+         <xs:element name="copyrightAndOtherRestrictions" type="copyrightAndOtherRestrictions">\r
+            <xs:unique name="copyrightAndOtherRestrictionsUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.3 Description -->\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7 Relation -->\r
+   <xs:group name="relation">\r
+      <xs:sequence>\r
+         <xs:element name="relation" type="relation">\r
+            <xs:unique name="relationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:group name="kind">\r
+      <xs:sequence>\r
+         <xs:element name="kind" type="kind">\r
+            <xs:unique name="kindUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2 Resource -->\r
+   <xs:group name="resource">\r
+      <xs:sequence>\r
+         <xs:element name="resource" type="resource"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.2 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8 Annotation -->\r
+   <xs:group name="annotation">\r
+      <xs:sequence>\r
+         <xs:element name="annotation" type="annotation">\r
+            <xs:unique name="annotationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.1 Entity -->\r
+   <xs:group name="entity">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="entity"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.2 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9 Classification -->\r
+   <xs:group name="classification">\r
+      <xs:sequence>\r
+         <xs:element name="classification" type="classification">\r
+            <xs:unique name="classificationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:group name="purpose">\r
+      <xs:sequence>\r
+         <xs:element name="purpose" type="purpose">\r
+            <xs:unique name="purposeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2 Taxon Path -->\r
+   <xs:group name="taxonPath">\r
+      <xs:sequence>\r
+         <xs:element name="taxonPath" type="taxonPath">\r
+            <xs:unique name="taxonPathUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.1 Source -->\r
+   <xs:group name="source">\r
+      <xs:sequence>\r
+         <xs:element name="source" type="source"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2 Taxon -->\r
+   <xs:group name="taxon">\r
+      <xs:sequence>\r
+         <xs:element name="taxon" type="taxon">\r
+            <xs:unique name="taxonUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.1 Id -->\r
+   <xs:group name="id">\r
+      <xs:sequence>\r
+         <xs:element name="id" type="id"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.2 Entry -->\r
+   <xs:group name="entryTaxon">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entryTaxon"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9.4 Keyword\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/common/elementTypes.xsd b/docs/home/ims/domainProfile_1/common/elementTypes.xsd
new file mode 100644 (file)
index 0000000..9d45a71
--- /dev/null
@@ -0,0 +1,779 @@
+<xs:schema xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+               <xs:documentation>\r
+       This component schema defintion defines global schema data type declarations\r
+       for data elements defined in the LOMv1.0 base schema.  This component XSD\r
+       defines the aggregation relationship among the LOM data elements.  These aggregation\r
+       relationships enforce the LOMv1.0 base schema requirement that elements can only\r
+       be present in a LOM XML instance as elements of the aggregate element to which they\r
+       belong.\r
+\r
+       Duplicate declarations are included as comments for completeness.  These declarations\r
+       should remain commented out or they can be removed completely.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="../unique/loose.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="../extend/custom.xsd"/>\r
+       <!-- Element type declarations -->\r
+       <!-- Learning Object Metadata -->\r
+       <xs:complexType name="lom">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="general"/>\r
+                       <xs:group ref="lifeCycle"/>\r
+                       <xs:group ref="metaMetadata"/>\r
+                       <xs:group ref="technical"/>\r
+                       <xs:group ref="educational"/>\r
+                       <xs:group ref="rights"/>\r
+                       <xs:group ref="relation"/>\r
+                       <xs:group ref="annotation"/>\r
+                       <xs:group ref="classification"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lom"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 1 General -->\r
+       <xs:complexType name="general">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier"/>\r
+                       <xs:group ref="title"/>\r
+                       <xs:group ref="language"/>\r
+                       <xs:group ref="descriptionUnbounded"/>\r
+                       <xs:group ref="keyword"/>\r
+                       <xs:group ref="coverage"/>\r
+                       <xs:group ref="structure"/>\r
+                       <xs:group ref="aggregationLevel"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:general"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 1.1 Identifier -->\r
+       <xs:complexType name="identifier">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="catalog"/>\r
+                       <xs:group ref="entry"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:identifier"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 1.1.1 Catalog -->\r
+       <xs:complexType name="catalog">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:catalog"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.1.2 Entry -->\r
+       <xs:complexType name="entry">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:entry"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.2 Title -->\r
+       <xs:complexType name="title">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:title"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.3 Language -->\r
+       <xs:complexType name="language">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageId">\r
+                               <xs:attributeGroup ref="ag:language"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.4 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 1.5 Keyword -->\r
+       <xs:complexType name="keyword">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:keyword"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.6 Coverage -->\r
+       <xs:complexType name="coverage">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:coverage"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structure">\r
+               <xs:complexContent>\r
+                       <xs:extension base="structureVocab">\r
+                               <xs:attributeGroup ref="ag:structure"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="aggregationLevelVocab">\r
+                               <xs:attributeGroup ref="ag:aggregationLevel"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2 Life Cycle -->\r
+       <xs:complexType name="lifeCycle">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="version"/>\r
+                       <xs:group ref="status"/>\r
+                       <xs:group ref="contribute"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lifeCycle"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 2.1 Version -->\r
+       <xs:complexType name="version">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:version"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="status">\r
+               <xs:complexContent>\r
+                       <xs:extension base="statusVocab">\r
+                               <xs:attributeGroup ref="ag:status"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3 Contribute -->\r
+       <xs:complexType name="contribute">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="role"/>\r
+                       <xs:group ref="entityUnbounded"/>\r
+                       <xs:group ref="date"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="role">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleVocab">\r
+                               <xs:attributeGroup ref="ag:role"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 2.3.3 Date -->\r
+       <xs:complexType name="date">\r
+               <xs:complexContent>\r
+                       <xs:extension base="DateTime">\r
+                               <xs:attributeGroup ref="ag:date"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3 Meta-Metadata -->\r
+       <xs:complexType name="metaMetadata">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier"/>\r
+                       <xs:group ref="contributeMeta"/>\r
+                       <xs:group ref="metadataSchema"/>\r
+                       <xs:group ref="language"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:metaMetadata"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 3.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2 Contribute -->\r
+       <xs:complexType name="contributeMeta">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="roleMeta"/>\r
+                       <xs:group ref="entityUnbounded"/>\r
+                       <xs:group ref="date"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMeta">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleMetaVocab">\r
+                               <xs:attributeGroup ref="ag:role"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2.3 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.3 Metadata Schema -->\r
+       <xs:complexType name="metadataSchema">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:metadataSchema"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.4 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>-->\r
+       <!-- 4 Technical -->\r
+       <xs:complexType name="technical">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="format"/>\r
+                       <xs:group ref="size"/>\r
+                       <xs:group ref="location"/>\r
+                       <xs:group ref="requirement"/>\r
+                       <xs:group ref="installationRemarks"/>\r
+                       <xs:group ref="otherPlatformRequirements"/>\r
+                       <xs:group ref="duration"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:technical"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 4.1 Format -->\r
+       <xs:complexType name="format">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="MimeType">\r
+                               <xs:attributeGroup ref="ag:format"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.2 Size -->\r
+       <xs:complexType name="size">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="Size">\r
+                               <xs:attributeGroup ref="ag:size"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.3 Location -->\r
+       <xs:complexType name="location">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:location"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4 Requirement -->\r
+       <xs:complexType name="requirement">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="orComposite"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:requirement"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 4.4.1 OrComposite -->\r
+       <xs:complexType name="orComposite">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="type"/>\r
+                       <xs:group ref="name"/>\r
+                       <xs:group ref="minimumVersion"/>\r
+                       <xs:group ref="maximumVersion"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:orComposite"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="type">\r
+               <xs:complexContent>\r
+                       <xs:extension base="typeVocab">\r
+                               <xs:attributeGroup ref="ag:type"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="name">\r
+               <xs:complexContent>\r
+                       <xs:extension base="nameVocab">\r
+                               <xs:attributeGroup ref="ag:name"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.3 Minimum Version -->\r
+       <xs:complexType name="minimumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:minimumVersion"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.4 Maximum Version -->\r
+       <xs:complexType name="maximumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:maximumVersion"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.5 Installation Remarks -->\r
+       <xs:complexType name="installationRemarks">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:installationRemarks"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.6 Other Platform Requirements -->\r
+       <xs:complexType name="otherPlatformRequirements">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:otherPlatformRequirements"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.7 Duration -->\r
+       <xs:complexType name="duration">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:duration"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5 Educational -->\r
+       <xs:complexType name="educational">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="interactivityType"/>\r
+                       <xs:group ref="learningResourceType"/>\r
+                       <xs:group ref="interactivityLevel"/>\r
+                       <xs:group ref="semanticDensity"/>\r
+                       <xs:group ref="intendedEndUserRole"/>\r
+                       <xs:group ref="context"/>\r
+                       <xs:group ref="typicalAgeRange"/>\r
+                       <xs:group ref="difficulty"/>\r
+                       <xs:group ref="typicalLearningTime"/>\r
+                       <xs:group ref="descriptionUnbounded"/>\r
+                       <xs:group ref="language"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:educational"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityTypeVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityType"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="learningResourceTypeVocab">\r
+                               <xs:attributeGroup ref="ag:learningResourceType"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityLevelVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityLevel"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="semanticDensityVocab">\r
+                               <xs:attributeGroup ref="ag:semanticDensity"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRole">\r
+               <xs:complexContent>\r
+                       <xs:extension base="intendedEndUserRoleVocab">\r
+                               <xs:attributeGroup ref="ag:intendedEndUserRole"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="context">\r
+               <xs:complexContent>\r
+                       <xs:extension base="contextVocab">\r
+                               <xs:attributeGroup ref="ag:context"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.7 Typical Age Range -->\r
+       <xs:complexType name="typicalAgeRange">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:typicalAgeRange"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficulty">\r
+               <xs:complexContent>\r
+                       <xs:extension base="difficultyVocab">\r
+                               <xs:attributeGroup ref="ag:difficulty"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.9 Typical Learning Time -->\r
+       <xs:complexType name="typicalLearningTime">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:typicalLearningTime"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.10 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 5.11 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 6 Rights -->\r
+       <xs:complexType name="rights">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="cost"/>\r
+                       <xs:group ref="copyrightAndOtherRestrictions"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:rights"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="cost">\r
+               <xs:complexContent>\r
+                       <xs:extension base="costVocab">\r
+                               <xs:attributeGroup ref="ag:cost"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictions">\r
+               <xs:complexContent>\r
+                       <xs:extension base="copyrightAndOtherRestrictionsVocab">\r
+                               <xs:attributeGroup ref="ag:copyrightAndOtherRestrictions"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.3 Description -->\r
+       <xs:complexType name="description">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:description"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7 Relation -->\r
+       <xs:complexType name="relation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="kind"/>\r
+                       <xs:group ref="resource"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:relation"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kind">\r
+               <xs:complexContent>\r
+                       <xs:extension base="kindVocab">\r
+                               <xs:attributeGroup ref="ag:kind"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7.2 Resource -->\r
+       <xs:complexType name="resource">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:resource"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 7.2.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.2 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8 Annotation -->\r
+       <xs:complexType name="annotation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="entity"/>\r
+                       <xs:group ref="date"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:annotation"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 8.1 Entity -->\r
+       <xs:complexType name="entity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="VCard">\r
+                               <xs:attributeGroup ref="ag:entity"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 8.2 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9 Classification -->\r
+       <xs:complexType name="classification">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="purpose"/>\r
+                       <xs:group ref="taxonPath"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="keyword"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:classification"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purpose">\r
+               <xs:complexContent>\r
+                       <xs:extension base="purposeVocab">\r
+                               <xs:attributeGroup ref="ag:purpose"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2 Taxon Path -->\r
+       <xs:complexType name="taxonPath">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="source"/>\r
+                       <xs:group ref="taxon"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxonPath"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 9.2.1 Source -->\r
+       <xs:complexType name="source">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:source"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2 Taxon -->\r
+       <xs:complexType name="taxon">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="id"/>\r
+                       <xs:group ref="entryTaxon"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxon"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 9.2.2.1 Id -->\r
+       <xs:complexType name="id">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:id"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2.2 Entry -->\r
+       <xs:complexType name="entryTaxon">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:entry"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9.4 Keyword\r
+  <xs:complexType name="keyword">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:keyword"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/common/rootElement.xsd b/docs/home/ims/domainProfile_1/common/rootElement.xsd
new file mode 100644 (file)
index 0000000..936f045
--- /dev/null
@@ -0,0 +1,43 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion provides the element name declaration for the\r
+         root element for all LOM XML instances.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Learning Object Metadata -->\r
+   <xs:element name="lom" type="lom">\r
+      <xs:unique name="lomUnique">\r
+         <xs:selector xpath="*"/>\r
+         <xs:field xpath="@uniqueElementName"/>\r
+      </xs:unique>\r
+   </xs:element>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/common/vocabTypes.xsd b/docs/home/ims/domainProfile_1/common/vocabTypes.xsd
new file mode 100644 (file)
index 0000000..128de9e
--- /dev/null
@@ -0,0 +1,355 @@
+<xs:schema xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns:voc="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion provides global type declarations for those\r
+         LOM data elements whose values are taken from a Vocabulary data type.\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:annotation>\r
+               <xs:documentation>This component XSD requires schema components from other\r
+       schemas that are defined in other namespaces.  These statements import the\r
+       appropriate components. The xsi:schemaLocation attribute is used to specify\r
+       the location of the file that contains the schema that defines the namespace.\r
+       The xsi:schemaLocation attribute is optional and is ommitted.  By definition of\r
+       the composite schemas the appropriate namespaces and related files where those\r
+       namespaces are defined are brought into scope.  Some XML parsers may require\r
+       these import statements to contain the optional xsi:schemaLocation attribute.</xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="../unique/loose.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="../extend/custom.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" schemaLocation="../vocab/loose.xsd"/>\r
+       <!-- Vocabulary type declarations -->\r
+       <!-- Source -->\r
+       <xs:complexType name="sourceValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:source">\r
+                               <xs:attributeGroup ref="ag:source"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structureVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="structureValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="structureValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:structure">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="aggregationLevelValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="aggregationLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:aggregationLevel">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="statusVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="statusValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="statusValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:status">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="roleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="roleValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="roleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:role">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMetaVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="roleMetaValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="roleMetaValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:roleMeta">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="typeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="typeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="typeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:type">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="nameVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="nameValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="nameValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:name">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="interactivityTypeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityType">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="learningResourceTypeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="learningResourceTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:learningResourceType">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="interactivityLevelValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityLevel">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensityVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="semanticDensityValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="semanticDensityValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:semanticDensity">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRoleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="intendedEndUserRoleValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="intendedEndUserRoleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:intendedEndUserRole">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="contextVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="contextValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="contextValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:context">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficultyVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="difficultyValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="difficultyValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:difficulty">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="costVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="costValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="costValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:cost">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictionsVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="copyrightAndOtherRestrictionsValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="copyrightAndOtherRestrictionsValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:copyrightAndOtherRestrictions">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kindVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="kindValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="kindValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:kind">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purposeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="purposeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="purposeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:purpose">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/common/vocabValues.xsd b/docs/home/ims/domainProfile_1/common/vocabValues.xsd
new file mode 100644 (file)
index 0000000..8d26b6e
--- /dev/null
@@ -0,0 +1,266 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides global type declarations for the standard\r
+         LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from\r
+         a Vocabulary data type.\r
+\r
+         This component schema defintion defines the stanard vocabulary value\r
+         declarations as defined in the LOMv1.0 base schema.  These vocabulary\r
+         value declarations are used in conjunction with both vocab/custom.xsd and\r
+         vocab/loose.xsd.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- LOMv1.0 base schema vocabulary source and value declarations -->\r
+\r
+   <!-- Source -->\r
+   <xs:simpleType name="sourceValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="LOMv1.0"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:simpleType name="structureValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="atomic"/>\r
+         <xs:enumeration value="collection"/>\r
+         <xs:enumeration value="networked"/>\r
+         <xs:enumeration value="hierarchical"/>\r
+         <xs:enumeration value="linear"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:simpleType name="aggregationLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="1"/>\r
+         <xs:enumeration value="2"/>\r
+         <xs:enumeration value="3"/>\r
+         <xs:enumeration value="4"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:simpleType name="statusValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="draft"/>\r
+         <xs:enumeration value="final"/>\r
+         <xs:enumeration value="revised"/>\r
+         <xs:enumeration value="unavailable"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:simpleType name="roleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="author"/>\r
+         <xs:enumeration value="publisher"/>\r
+         <xs:enumeration value="unknown"/>\r
+         <xs:enumeration value="initiator"/>\r
+         <xs:enumeration value="terminator"/>\r
+         <xs:enumeration value="validator"/>\r
+         <xs:enumeration value="editor"/>\r
+         <xs:enumeration value="graphical designer"/>\r
+         <xs:enumeration value="technical implementer"/>\r
+         <xs:enumeration value="content provider"/>\r
+         <xs:enumeration value="technical validator"/>\r
+         <xs:enumeration value="educational validator"/>\r
+         <xs:enumeration value="script writer"/>\r
+         <xs:enumeration value="instructional designer"/>\r
+         <xs:enumeration value="subject matter expert"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:simpleType name="roleMetaValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="creator"/>\r
+         <xs:enumeration value="validator"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:simpleType name="typeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="operating system"/>\r
+         <xs:enumeration value="browser"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:simpleType name="nameValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="pc-dos"/>\r
+         <xs:enumeration value="ms-windows"/>\r
+         <xs:enumeration value="macos"/>\r
+         <xs:enumeration value="unix"/>\r
+         <xs:enumeration value="multi-os"/>\r
+         <xs:enumeration value="none"/>\r
+         <xs:enumeration value="any"/>\r
+         <xs:enumeration value="netscape communicator"/>\r
+         <xs:enumeration value="ms-internet explorer"/>\r
+         <xs:enumeration value="opera"/>\r
+         <xs:enumeration value="amaya"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:simpleType name="interactivityTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="active"/>\r
+         <xs:enumeration value="expositive"/>\r
+         <xs:enumeration value="mixed"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:simpleType name="learningResourceTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="exercise"/>\r
+         <xs:enumeration value="simulation"/>\r
+         <xs:enumeration value="questionnaire"/>\r
+         <xs:enumeration value="diagram"/>\r
+         <xs:enumeration value="figure"/>\r
+         <xs:enumeration value="graph"/>\r
+         <xs:enumeration value="index"/>\r
+         <xs:enumeration value="slide"/>\r
+         <xs:enumeration value="table"/>\r
+         <xs:enumeration value="narrative text"/>\r
+         <xs:enumeration value="exam"/>\r
+         <xs:enumeration value="experiment"/>\r
+         <xs:enumeration value="problem statement"/>\r
+         <xs:enumeration value="self assessment"/>\r
+         <xs:enumeration value="lecture"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:simpleType name="interactivityLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low"/>\r
+         <xs:enumeration value="low"/>\r
+         <xs:enumeration value="medium"/>\r
+         <xs:enumeration value="high"/>\r
+         <xs:enumeration value="very high"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:simpleType name="semanticDensityValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low"/>\r
+         <xs:enumeration value="low"/>\r
+         <xs:enumeration value="medium"/>\r
+         <xs:enumeration value="high"/>\r
+         <xs:enumeration value="very high"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:simpleType name="intendedEndUserRoleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="teacher"/>\r
+         <xs:enumeration value="author"/>\r
+         <xs:enumeration value="learner"/>\r
+         <xs:enumeration value="manager"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:simpleType name="contextValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="school"/>\r
+         <xs:enumeration value="higher education"/>\r
+         <xs:enumeration value="training"/>\r
+         <xs:enumeration value="other"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:simpleType name="difficultyValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very easy"/>\r
+         <xs:enumeration value="easy"/>\r
+         <xs:enumeration value="medium"/>\r
+         <xs:enumeration value="difficult"/>\r
+         <xs:enumeration value="very difficult"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:simpleType name="costValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes"/>\r
+         <xs:enumeration value="no"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:simpleType name="copyrightAndOtherRestrictionsValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes"/>\r
+         <xs:enumeration value="no"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:simpleType name="kindValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="ispartof"/>\r
+         <xs:enumeration value="haspart"/>\r
+         <xs:enumeration value="isversionof"/>\r
+         <xs:enumeration value="hasversion"/>\r
+         <xs:enumeration value="isformatof"/>\r
+         <xs:enumeration value="hasformat"/>\r
+         <xs:enumeration value="references"/>\r
+         <xs:enumeration value="isreferencedby"/>\r
+         <xs:enumeration value="isbasedon"/>\r
+         <xs:enumeration value="isbasisfor"/>\r
+         <xs:enumeration value="requires"/>\r
+         <xs:enumeration value="isrequiredby"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:simpleType name="purposeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="discipline"/>\r
+         <xs:enumeration value="idea"/>\r
+         <xs:enumeration value="prerequisite"/>\r
+         <xs:enumeration value="educational objective"/>\r
+         <xs:enumeration value="accessibility restrictions"/>\r
+         <xs:enumeration value="educational level"/>\r
+         <xs:enumeration value="skill level"/>\r
+         <xs:enumeration value="security level"/>\r
+         <xs:enumeration value="competency"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/dataTypes_localised.xsd b/docs/home/ims/domainProfile_1/dataTypes_localised.xsd
new file mode 100644 (file)
index 0000000..a374709
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** dataTypes.xsd                                                       **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_m_definition.xsd" />\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion defines global schema data type declarations\r
+         for data types defined in the LOMv1.0 base schema.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="./unique/loose.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="./extend/custom.xsd" />\r
+        <xs:include schemaLocation="elementTypes_localised.xsd" />\r
+       <!-- Data type declarations -->\r
+       <!-- CharacterString -->\r
+       <xs:simpleType name="CharacterString">\r
+               <xs:restriction base="xs:string" />\r
+       </xs:simpleType>\r
+       <!-- LanguageId -->\r
+       <xs:complexType name="LanguageId">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:language">\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- VCard -->\r
+       <xs:complexType name="VCard">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- MimeType -->\r
+       <xs:simpleType name="MimeType">\r
+               <xs:restriction base="CharacterString" />\r
+       </xs:simpleType>\r
+       <!-- Size -->\r
+       <xs:simpleType name="Size">\r
+               <xs:restriction base="xs:nonNegativeInteger" />\r
+       </xs:simpleType>\r
+       <!-- LanguageString -->\r
+       <xs:complexType name="LanguageString">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="string" type="LangString" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="LangString">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attribute name="language" type="xs:language" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- DateTime -->\r
+       <xs:complexType name="DateTime">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="dateTime" type="DateTimeValue" />\r
+                       <xs:element name="description" type="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DateTimeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DateTimeString">\r
+                               <xs:attributeGroup ref="ag:DateTimeValue" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DateTimeString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]|[0-9][1-9][0-9]{2}|[1-9][0-9]{3})(\-(0[1-9]|1[0-2])(\-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9](:[0-5][0-9](\.[0-9]{1,}(Z|((\+|\-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?)?)?)?)?)?)?" />\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- Duration -->\r
+       <xs:complexType name="Duration">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="duration" type="DurationValue" />\r
+                       <xs:element name="description" type="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DurationValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DurationString">\r
+                               <xs:attributeGroup ref="ag:DurationValue" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DurationString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="P([0-9]{1,}Y){0,1}([0-9]{1,}M){0,1}([0-9]{1,}D){0,1}(T([0-9]{1,}H){0,1}([0-9]{1,}M){0,1}([0-9]{1,}(\.[0-9]{1,}){0,1}S){0,1}){0,1}" />\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/elementNames_localised.xsd b/docs/home/ims/domainProfile_1/elementNames_localised.xsd
new file mode 100644 (file)
index 0000000..9ab993e
--- /dev/null
@@ -0,0 +1,787 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** elementNames.xsd                                                    **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion defines global element declarations for\r
+         each of the data elements defined in the LOMv1.0 base schema.  This component\r
+         schema definition is used to check for the uniqueness of elements declared\r
+         to be unique within their parent elements by the presence of the\r
+         "uniqueElementName" attribute.  The XML Schema constraint "unique" is used\r
+         to enforce uniqueness constraints.\r
+\r
+         Duplicate declarations are included as comments for completeness.  These\r
+         declarations should remain commented out or they can be removed completely.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Duplicate declarations are included as comments. -->\r
+\r
+   <!-- 1 General -->\r
+   <xs:group name="general">\r
+      <xs:sequence>\r
+         <xs:element name="general" type="general">\r
+            <xs:unique name="generalUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1 Identifier -->\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.1 Catalog -->\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.2 Entry -->\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.2 Title -->\r
+   <xs:group name="title">\r
+      <xs:sequence>\r
+         <xs:element name="title" type="title" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.3 Language-->\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.4 Description -->\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.5 Keyword -->\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.6 Coverage -->\r
+   <xs:group name="coverage">\r
+      <xs:sequence>\r
+         <xs:element name="coverage" type="coverage" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:group name="structure">\r
+      <xs:sequence>\r
+         <xs:element name="structure" type="structure">\r
+            <xs:unique name="structureUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:group name="aggregationLevel">\r
+      <xs:sequence>\r
+         <xs:element name="aggregationLevel" type="aggregationLevel">\r
+            <xs:unique name="aggregationLevelUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2 Life Cycle -->\r
+   <xs:group name="lifeCycle">\r
+      <xs:sequence>\r
+         <xs:element name="lifeCycle" type="lifeCycle">\r
+            <xs:unique name="lifeCycleUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.1 Version -->\r
+   <xs:group name="version">\r
+      <xs:sequence>\r
+         <xs:element name="version" type="version" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:group name="status">\r
+      <xs:sequence>\r
+         <xs:element name="status" type="status">\r
+            <xs:unique name="statusUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3 Contribute -->\r
+   <xs:group name="contribute">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contribute">\r
+            <xs:unique name="contributeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:group name="role">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="role">\r
+            <xs:unique name="roleUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.2 Entity -->\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:group name="date">\r
+     <xs:sequence>\r
+        <xs:element name="date" type="date">\r
+           <xs:unique name="dateUnique">\r
+              <xs:selector xpath="*" />\r
+              <xs:field xpath="@uniqueElementName" />\r
+           </xs:unique>\r
+        </xs:element>\r
+     </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3 Meta-Metadata -->\r
+   <xs:group name="metaMetadata">\r
+      <xs:sequence>\r
+         <xs:element name="metaMetadata" type="metaMetadata">\r
+            <xs:unique name="metaMetadataUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2 Contribute -->\r
+   <xs:group name="contributeMeta">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contributeMeta">\r
+            <xs:unique name="contributeMetaUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:group name="roleMeta">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="roleMeta">\r
+            <xs:unique name="roleMetaUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.2 Entity\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2.3 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.3 Metadata Schema -->\r
+   <xs:group name="metadataSchema">\r
+      <xs:sequence>\r
+         <xs:element name="metadataSchema" type="metadataSchema" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.4 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 4 Technical -->\r
+   <xs:group name="technical">\r
+      <xs:sequence>\r
+         <xs:element name="technical" type="technical">\r
+            <xs:unique name="technicalUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.1 Format -->\r
+  <xs:group name="format">\r
+      <xs:sequence>\r
+         <xs:element name="format" type="format" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.2 Size -->\r
+   <xs:group name="size">\r
+      <xs:sequence>\r
+         <xs:element name="size" type="size" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.3 Location -->\r
+   <xs:group name="location">\r
+      <xs:sequence>\r
+         <xs:element name="location" type="location" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4 Requirement -->\r
+   <xs:group name="requirement">\r
+      <xs:sequence>\r
+         <xs:element name="requirement" type="requirement" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1 OrComposite -->\r
+   <xs:group name="orComposite">\r
+      <xs:sequence>\r
+         <xs:element name="orComposite" type="orComposite">\r
+            <xs:unique name="orCompositeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:group name="type">\r
+      <xs:sequence>\r
+         <xs:element name="type" type="type">\r
+            <xs:unique name="typeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:group name="name">\r
+      <xs:sequence>\r
+         <xs:element name="name" type="name">\r
+            <xs:unique name="nameUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.3 Minimum Version -->\r
+   <xs:group name="minimumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="minimumVersion" type="minimumVersion" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.4 Maximum Version -->\r
+   <xs:group name="maximumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="maximumVersion" type="maximumVersion" />\r
+      </xs:sequence>\r
+    </xs:group>\r
+\r
+   <!-- 4.5 Installation Remarks -->\r
+   <xs:group name="installationRemarks">\r
+      <xs:sequence>\r
+         <xs:element name="installationRemarks" type="installationRemarks" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.6 Other Platform Requirements -->\r
+   <xs:group name="otherPlatformRequirements">\r
+      <xs:sequence>\r
+         <xs:element name="otherPlatformRequirements" type="otherPlatformRequirements" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.7 Duration -->\r
+   <xs:group name="duration">\r
+      <xs:sequence>\r
+         <xs:element name="duration" type="duration">\r
+            <xs:unique name="durationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5 Educational -->\r
+   <xs:group name="educational">\r
+      <xs:sequence>\r
+         <xs:element name="educational" type="educational">\r
+            <xs:unique name="educationalUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:group name="interactivityType">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityType" type="interactivityType">\r
+            <xs:unique name="interactivityTypeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:group name="learningResourceType">\r
+      <xs:sequence>\r
+         <xs:element name="learningResourceType" type="learningResourceType">\r
+            <xs:unique name="learningResourceTypeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:group name="interactivityLevel">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityLevel" type="interactivityLevel">\r
+            <xs:unique name="interactivityLevelUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:group name="semanticDensity">\r
+      <xs:sequence>\r
+         <xs:element name="semanticDensity" type="semanticDensity">\r
+            <xs:unique name="semanticDensityUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:group name="intendedEndUserRole">\r
+      <xs:sequence>\r
+         <xs:element name="intendedEndUserRole" type="intendedEndUserRole">\r
+            <xs:unique name="intendedEndUserRoleUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:group name="context">\r
+      <xs:sequence>\r
+         <xs:element name="context" type="context">\r
+            <xs:unique name="contextUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.7 Typical Age Range -->\r
+   <xs:group name="typicalAgeRange">\r
+      <xs:sequence>\r
+         <xs:element name="typicalAgeRange" type="typicalAgeRange" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:group name="difficulty">\r
+      <xs:sequence>\r
+         <xs:element name="difficulty" type="difficulty">\r
+            <xs:unique name="difficultyUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.9 Typical Learning Time -->\r
+   <xs:group name="typicalLearningTime">\r
+      <xs:sequence>\r
+         <xs:element name="typicalLearningTime" type="typicalLearningTime">\r
+            <xs:unique name="typicalLearningTimeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.10 Description\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 5.11 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group>-->\r
+\r
+   <!-- 6 Rights -->\r
+   <xs:group name="rights">\r
+      <xs:sequence>\r
+         <xs:element name="rights" type="rights">\r
+            <xs:unique name="rightsUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:group name="cost">\r
+      <xs:sequence>\r
+         <xs:element name="cost" type="cost">\r
+            <xs:unique name="costUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:group name="copyrightAndOtherRestrictions">\r
+      <xs:sequence>\r
+         <xs:element name="copyrightAndOtherRestrictions" type="copyrightAndOtherRestrictions">\r
+            <xs:unique name="copyrightAndOtherRestrictionsUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.3 Description -->\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7 Relation -->\r
+   <xs:group name="relation">\r
+      <xs:sequence>\r
+         <xs:element name="relation" type="relation">\r
+            <xs:unique name="relationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:group name="kind">\r
+      <xs:sequence>\r
+         <xs:element name="kind" type="kind">\r
+            <xs:unique name="kindUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2 Resource -->\r
+   <xs:group name="resource">\r
+      <xs:sequence>\r
+         <xs:element name="resource" type="resource" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.2 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8 Annotation -->\r
+   <xs:group name="annotation">\r
+      <xs:sequence>\r
+         <xs:element name="annotation" type="annotation">\r
+            <xs:unique name="annotationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.1 Entity -->\r
+   <xs:group name="entity">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="entity" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.2 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9 Classification -->\r
+   <xs:group name="classification">\r
+      <xs:sequence>\r
+         <xs:element name="classification" type="classification">\r
+            <xs:unique name="classificationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:group name="purpose">\r
+      <xs:sequence>\r
+         <xs:element name="purpose" type="purpose">\r
+            <xs:unique name="purposeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2 Taxon Path -->\r
+   <xs:group name="taxonPath">\r
+      <xs:sequence>\r
+         <xs:element name="taxonPath" type="taxonPath">\r
+            <xs:unique name="taxonPathUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.1 Source -->\r
+   <xs:group name="source">\r
+      <xs:sequence>\r
+         <xs:element name="source" type="source" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2 Taxon -->\r
+   <xs:group name="taxon">\r
+      <xs:sequence>\r
+         <xs:element name="taxon" type="taxon">\r
+            <xs:unique name="taxonUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.1 Id -->\r
+   <xs:group name="id">\r
+      <xs:sequence>\r
+         <xs:element name="id" type="id" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.2 Entry -->\r
+   <xs:group name="entryTaxon">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entryTaxon" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9.4 Keyword\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/elementTypes_localised.xsd b/docs/home/ims/domainProfile_1/elementTypes_localised.xsd
new file mode 100644 (file)
index 0000000..406435b
--- /dev/null
@@ -0,0 +1,905 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** elementTypes.xsd                                                    **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_m_definition.xsd" />\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+               <xs:documentation>\r
+       This component schema defintion defines global schema data type declarations\r
+       for data elements defined in the LOMv1.0 base schema.  This component XSD\r
+       defines the aggregation relationship among the LOM data elements.  These aggregation\r
+       relationships enforce the LOMv1.0 base schema requirement that elements can only\r
+       be present in a LOM XML instance as elements of the aggregate element to which they\r
+       belong.\r
+\r
+       Duplicate declarations are included as comments for completeness.  These declarations\r
+       should remain commented out or they can be removed completely.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="./unique/loose.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="./extend/custom.xsd" />\r
+       <!-- Element type declarations -->\r
+       <!-- Learning Object Metadata -->\r
+       <xs:complexType name="lom">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="general" />\r
+                       <xs:group ref="lifeCycle" />\r
+                       <xs:group ref="metaMetadata" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: metaMetadata is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="technical" />\r
+                       <xs:group ref="educational" />\r
+                       <xs:group ref="rights" />\r
+                       <xs:group ref="relation" />\r
+                       <xs:group ref="annotation" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: lom.annotation is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="classification" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lom" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 1 General -->\r
+       <xs:complexType name="general">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier" />\r
+                       <xs:group ref="title" />\r
+                       <xs:group ref="language" />\r
+                       <xs:group ref="descriptionUnbounded" />\r
+                       <xs:group ref="keyword" />\r
+                       <xs:group ref="coverage" />\r
+                       <xs:group ref="structure" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: General.structure is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="aggregationLevel" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: General.aggregationLevel is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:general" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 1.1 Identifier -->\r
+       <xs:complexType name="identifier">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="catalog" />\r
+                       <xs:group ref="entry" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:identifier" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 1.1.1 Catalog -->\r
+       <xs:complexType name="catalog">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:catalog" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.1.2 Entry -->\r
+       <xs:complexType name="entry">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:entry" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.2 Title -->\r
+       <xs:complexType name="title">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:title" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.3 Language -->\r
+       <xs:complexType name="language">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageId">\r
+                               <xs:attributeGroup ref="ag:language" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.4 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 1.5 Keyword -->\r
+       <xs:complexType name="keyword">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:keyword" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.6 Coverage -->\r
+       <xs:complexType name="coverage">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:coverage" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structure">\r
+               <xs:complexContent>\r
+                       <xs:extension base="structureVocab">\r
+                               <xs:attributeGroup ref="ag:structure" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="aggregationLevelVocab">\r
+                               <xs:attributeGroup ref="ag:aggregationLevel" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2 Life Cycle -->\r
+       <xs:complexType name="lifeCycle">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="version" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: liveCycle.version is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="status" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: lifeCycle.status is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="contribute" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lifeCycle" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 2.1 Version -->\r
+       <xs:complexType name="version">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:version" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="status">\r
+               <xs:complexContent>\r
+                       <xs:extension base="statusVocab">\r
+                               <xs:attributeGroup ref="ag:status" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3 Contribute -->\r
+       <xs:complexType name="contribute">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="role" />\r
+                       <xs:group ref="entityUnbounded" />\r
+                       <xs:group ref="date" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="role">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleVocab">\r
+                               <xs:attributeGroup ref="ag:role" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 2.3.3 Date -->\r
+       <xs:complexType name="date">\r
+               <xs:complexContent>\r
+                       <xs:extension base="DateTime">\r
+                               <xs:attributeGroup ref="ag:date" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3 Meta-Metadata -->\r
+       <xs:complexType name="metaMetadata">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier" />\r
+                       <xs:group ref="contributeMeta" />\r
+                       <xs:group ref="metadataSchema" />\r
+                       <xs:group ref="language" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:metaMetadata" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 3.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2 Contribute -->\r
+       <xs:complexType name="contributeMeta">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="roleMeta" />\r
+                       <xs:group ref="entityUnbounded" />\r
+                       <xs:group ref="date" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMeta">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleMetaVocab">\r
+                               <xs:attributeGroup ref="ag:role" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2.3 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.3 Metadata Schema -->\r
+       <xs:complexType name="metadataSchema">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:metadataSchema" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.4 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>-->\r
+       <!-- 4 Technical -->\r
+       <xs:complexType name="technical">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="format" />\r
+                       <xs:group ref="size" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: technical.size is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="location" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: technical.location is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="requirement" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: technical.requirement is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="installationRemarks" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: technical.installationRemarks is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="otherPlatformRequirements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: technical.otherPlatformRequirements is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="duration" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: technical.duration is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:technical" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 4.1 Format -->\r
+       <xs:complexType name="format">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="MimeType">\r
+                               <xs:attributeGroup ref="ag:format" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.2 Size -->\r
+       <xs:complexType name="size">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="Size">\r
+                               <xs:attributeGroup ref="ag:size" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.3 Location -->\r
+       <xs:complexType name="location">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:location" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4 Requirement -->\r
+       <xs:complexType name="requirement">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="orComposite" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:requirement" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 4.4.1 OrComposite -->\r
+       <xs:complexType name="orComposite">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="type" />\r
+                       <xs:group ref="name" />\r
+                       <xs:group ref="minimumVersion" />\r
+                       <xs:group ref="maximumVersion" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:orComposite" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="type">\r
+               <xs:complexContent>\r
+                       <xs:extension base="typeVocab">\r
+                               <xs:attributeGroup ref="ag:type" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="name">\r
+               <xs:complexContent>\r
+                       <xs:extension base="nameVocab">\r
+                               <xs:attributeGroup ref="ag:name" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.3 Minimum Version -->\r
+       <xs:complexType name="minimumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:minimumVersion" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.4 Maximum Version -->\r
+       <xs:complexType name="maximumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:maximumVersion" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.5 Installation Remarks -->\r
+       <xs:complexType name="installationRemarks">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:installationRemarks" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.6 Other Platform Requirements -->\r
+       <xs:complexType name="otherPlatformRequirements">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:otherPlatformRequirements" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.7 Duration -->\r
+       <xs:complexType name="duration">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:duration" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5 Educational -->\r
+       <xs:complexType name="educational">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="interactivityType" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: interactivityType is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="learningResourceType" />\r
+                       <xs:group ref="interactivityLevel" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: interactivityLevel is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="semanticDensity" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: semanticDensity is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="intendedEndUserRole" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: intendedEndUserRole is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="context" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: Context is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="typicalAgeRange" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: typicalAgeRange is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="difficulty" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: difficulty is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="typicalLearningTime" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: typicalLearningTime is unused.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="descriptionUnbounded" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: description is unused in educational context.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="language" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: language unused in technical context, only in general context.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:educational" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityTypeVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityType" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceTypeVocab_copy">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="learningResourceTypeValue" fixed="IMS Common Cartridge" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                        <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                    </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+\r
+<xs:complexType name="learningResourceType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="learningResourceTypeVocab_copy">\r
+                               <xs:attributeGroup ref="ag:learningResourceType" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityLevelVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityLevel" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="semanticDensityVocab">\r
+                               <xs:attributeGroup ref="ag:semanticDensity" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRole">\r
+               <xs:complexContent>\r
+                       <xs:extension base="intendedEndUserRoleVocab">\r
+                               <xs:attributeGroup ref="ag:intendedEndUserRole" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="context">\r
+               <xs:complexContent>\r
+                       <xs:extension base="contextVocab">\r
+                               <xs:attributeGroup ref="ag:context" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.7 Typical Age Range -->\r
+       <xs:complexType name="typicalAgeRange">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:typicalAgeRange" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficulty">\r
+               <xs:complexContent>\r
+                       <xs:extension base="difficultyVocab">\r
+                               <xs:attributeGroup ref="ag:difficulty" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.9 Typical Learning Time -->\r
+       <xs:complexType name="typicalLearningTime">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:typicalLearningTime" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.10 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 5.11 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 6 Rights -->\r
+       <xs:complexType name="rights">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="cost" />\r
+                       <xs:group ref="copyrightAndOtherRestrictions" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:rights" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="cost">\r
+               <xs:complexContent>\r
+                       <xs:extension base="costVocab">\r
+                               <xs:attributeGroup ref="ag:cost" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictions">\r
+               <xs:complexContent>\r
+                       <xs:extension base="copyrightAndOtherRestrictionsVocab">\r
+                               <xs:attributeGroup ref="ag:copyrightAndOtherRestrictions" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.3 Description -->\r
+       <xs:complexType name="description">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:description" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7 Relation -->\r
+       <xs:complexType name="relation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="kind" />\r
+                       <xs:group ref="resource" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:relation" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kind">\r
+               <xs:complexContent>\r
+                       <xs:extension base="kindVocab">\r
+                               <xs:attributeGroup ref="ag:kind" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7.2 Resource -->\r
+       <xs:complexType name="resource">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:resource" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 7.2.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.2 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8 Annotation -->\r
+       <xs:complexType name="annotation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="entity" />\r
+                       <xs:group ref="date" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:annotation" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 8.1 Entity -->\r
+       <xs:complexType name="entity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="VCard">\r
+                               <xs:attributeGroup ref="ag:entity" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 8.2 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9 Classification -->\r
+       <xs:complexType name="classification">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="purpose" />\r
+                       <xs:group ref="taxonPath" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="keyword" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:classification" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purpose">\r
+               <xs:complexContent>\r
+                       <xs:extension base="purposeVocab">\r
+                               <xs:attributeGroup ref="ag:purpose" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2 Taxon Path -->\r
+       <xs:complexType name="taxonPath">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="source" />\r
+                       <xs:group ref="taxon" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxonPath" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 9.2.1 Source -->\r
+       <xs:complexType name="source">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:source" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2 Taxon -->\r
+       <xs:complexType name="taxon">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="id" />\r
+                       <xs:group ref="entryTaxon" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxon" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 9.2.2.1 Id -->\r
+       <xs:complexType name="id">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:id" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2.2 Entry -->\r
+       <xs:complexType name="entryTaxon">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:entry" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9.4 Keyword\r
+  <xs:complexType name="keyword">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:keyword"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/extend/custom.xsd b/docs/home/ims/domainProfile_1/extend/custom.xsd
new file mode 100644 (file)
index 0000000..bba5a3f
--- /dev/null
@@ -0,0 +1,52 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM/extend"\r
+           xmlns:lom="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema defines the XML Schema content model groups customElements\r
+       and customAttributes to support validation of extension XML elements and attributes.\r
+\r
+       This component XSD should be used if extensions are to be supported in LOM\r
+       XML instances.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+\r
+  </xs:annotation>\r
+\r
+  <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM" schemaLocation="../lomLoose_localised.xsd"/>\r
+\r
+  <!-- Model group declarations -->\r
+\r
+  <xs:group name="customElements">\r
+    <xs:choice>\r
+      <xs:group ref="lom:customElements"/>\r
+    </xs:choice>\r
+  </xs:group>\r
+\r
+  <xs:attributeGroup name="customAttributes">\r
+     <xs:anyAttribute namespace="##other" processContents="lax" />\r
+  </xs:attributeGroup>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/imscc_m_definition.xsd b/docs/home/ims/domainProfile_1/imscc_m_definition.xsd
new file mode 100644 (file)
index 0000000..7c67154
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM">\r
+  <!--****************************************************************************************-->\r
+  <!--** Definition document - this document holds AP defined simpleType elements that have **-->\r
+  <!--** been referenced through a type attribute in one of the modified, resultant schema. **-->\r
+  <!--****************************************************************************************-->\r
+  <xs:simpleType name="ImsCCType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="IMS Common Cartridge" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xsd:schema>\r
+\r
diff --git a/docs/home/ims/domainProfile_1/lomLoose.xsd b/docs/home/ims/domainProfile_1/lomLoose.xsd
new file mode 100644 (file)
index 0000000..ecb82c7
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:voc="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+        <xs:documentation>\r
+         This file represents a composite schema for validating\r
+         LOM XML Instances.  This file is built by default to represent a\r
+         composite schema for validation of the following:\r
+\r
+         1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary\r
+            source/value pairs only\r
+         2) Uniqueness constraints defined by LOMv1.0 base schema\r
+         3) No existenace of any defined extensions:\r
+            LOMv1.0 base schema XML element extension,\r
+            LOMv1.0 base schema XML attribute extension and\r
+            LOMv1.0 base schema vocabulary data type extension\r
+\r
+         Alternative composite schemas can be assembled by selecting\r
+         from the various alternative component schema listed below.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+    </xs:annotation>\r
+    <!-- Learning Object Metadata -->\r
+    <xs:include schemaLocation="common/anyElement.xsd" />\r
+    <!-- LOM data element uniqueness constraints:  use one of the following         -->\r
+    <!-- Use unique/loose.xsd to relax element uniqueness constraints               -->\r
+    <!-- Use unique/strict.xsd to enforce element uniqueness constraints            -->\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique"\r
+              schemaLocation="unique/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="unique/loose.xsd" />\r
+\r
+    <!-- Vocabulary value validation:  use one of the following                     -->\r
+    <!-- Use vocab/loose.xsd to relax vocabulary value constraints                  -->\r
+    <!-- Use vocab/strict.xsd to enforce the LOMv1.0 base schema vocabulary values  -->\r
+    <!-- Use vocab/custom.xsd to enforce custom vocabulary values                   -->\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab"\r
+              schemaLocation="vocab/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" schemaLocation="vocab/loose.xsd" />\r
+\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab"\r
+              schemaLocation="vocab/custom.xsd"/> -->\r
+    <!-- Extension elements/attributes support:  use one of the following           -->\r
+    <!-- Use extend/strict.xsd to enforce no element/attribute extension            -->\r
+    <!-- Use extend/custom.xsd to allow element/attribute extension                 -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="extend/custom.xsd" />\r
+\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend"\r
+              schemaLocation="extend/custom.xsd"/> -->\r
+    <xs:include schemaLocation="common/dataTypes.xsd" />\r
+    <xs:include schemaLocation="common/elementNames.xsd" />\r
+    <xs:include schemaLocation="common/elementTypes.xsd" />\r
+    <xs:include schemaLocation="common/rootElement.xsd" />\r
+    <xs:include schemaLocation="common/vocabValues.xsd" />\r
+    <xs:include schemaLocation="common/vocabTypes.xsd" />\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/lomLoose_localised.xsd b/docs/home/ims/domainProfile_1/lomLoose_localised.xsd
new file mode 100644 (file)
index 0000000..db2aece
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** lomLoose_localised.xsd                                                        **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:voc="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_m_definition.xsd" />\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+        <xs:documentation>\r
+         This file represents a composite schema for validating\r
+         LOM XML Instances.  This file is built by default to represent a\r
+         composite schema for validation of the following:\r
+\r
+         1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary\r
+            source/value pairs only\r
+         2) Uniqueness constraints defined by LOMv1.0 base schema\r
+         3) No existenace of any defined extensions:\r
+            LOMv1.0 base schema XML element extension,\r
+            LOMv1.0 base schema XML attribute extension and\r
+            LOMv1.0 base schema vocabulary data type extension\r
+\r
+         Alternative composite schemas can be assembled by selecting\r
+         from the various alternative component schema listed below.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+    <xs:documentation xml:lang="en">conformance: This profile restricts 'IEEE LOM 1.0 loose' to the elements needed to cover unqualified Dublin Core.\r
+dc:contributor, dc:creator, dc:publisher map to        lifeCycle.contribute.entity with appropriate value of lifeCycle.contribute.role,\r
+dc:coverage maps to general.coverage,\r
+dc:date maps to lifeCycle.contribute.date,\r
+dc:description maps to general.description,\r
+dc:format maps to technical.format,\r
+dc:identifier maps to general.identifier,\r
+dc:language maps to general.language,\r
+dc:relation maps to Relation,\r
+dc:rights maps to Rights,\r
+dc:source is not mapped,\r
+dc:subject maps to general.keyword (see also classification.keyword),\r
+dc:title maps to general.title\r
+dc:type maps to Educational.learningResourceType\r
+</xs:documentation>\r
+       <xs:documentation xml:lang="en">scope: This profile is used within the Common Cartridge specification.</xs:documentation>\r
+       <xs:documentation xml:lang="en">name: IMS Common Cartridge profile of IEEE LOM V1.0 loose  for unqualified Dublin Core</xs:documentation>\r
+       </xs:annotation>\r
+    <!-- Learning Object Metadata -->\r
+    <xs:include schemaLocation="anyElement_localised.xsd" />\r
+    <!-- LOM data element uniqueness constraints:  use one of the following         -->\r
+    <!-- Use unique/loose.xsd to relax element uniqueness constraints               -->\r
+    <!-- Use unique/strict.xsd to enforce element uniqueness constraints            -->\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique"\r
+              schemaLocation="unique/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="unique/loose.xsd" />\r
+\r
+    <!-- Vocabulary value validation:  use one of the following                     -->\r
+    <!-- Use vocab/loose.xsd to relax vocabulary value constraints                  -->\r
+    <!-- Use vocab/strict.xsd to enforce the LOMv1.0 base schema vocabulary values  -->\r
+    <!-- Use vocab/custom.xsd to enforce custom vocabulary values                   -->\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab"\r
+              schemaLocation="vocab/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" schemaLocation="vocab/loose.xsd" />\r
+\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab"\r
+              schemaLocation="vocab/custom.xsd"/> -->\r
+    <!-- Extension elements/attributes support:  use one of the following           -->\r
+    <!-- Use extend/strict.xsd to enforce no element/attribute extension            -->\r
+    <!-- Use extend/custom.xsd to allow element/attribute extension                 -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="extend/custom.xsd" />\r
+\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend"\r
+              schemaLocation="extend/custom.xsd"/> -->\r
+    <xs:include schemaLocation="dataTypes_localised.xsd" />\r
+    <xs:include schemaLocation="elementNames_localised.xsd" />\r
+    <xs:include schemaLocation="elementTypes_localised.xsd" />\r
+    <xs:include schemaLocation="rootElement_localised.xsd" />\r
+    <xs:include schemaLocation="vocabValues_localised.xsd" />\r
+    <xs:include schemaLocation="vocabTypes_localised.xsd" />\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/loose.xsd b/docs/home/ims/domainProfile_1/loose.xsd
new file mode 100644 (file)
index 0000000..bc6a047
--- /dev/null
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM/unique" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema definition provides attribute group declarations for\r
+       LOM data elements to support schema-based validation of uniqueness constraints\r
+       within a LOM XML instance where the exact set of attributes associated with each\r
+       element has to be as specified by the LOM XML Schema binding (i.e., where extra\r
+       attributes to enforce uniqueness have to be avoided).\r
+\r
+       Duplicate declarations are included as comments for completeness.  These\r
+       declarations should remain commented out or they can be removed completely.\r
+\r
+       NOTE: The absence of the enforcement of the uniqueness constraints does not\r
+       relieve a particular LOM XML instance from satisfying the uniqueness constraints\r
+       described in the LOMv1.0 base schema. Applications that require the use of\r
+       the unique/loose.xsd component XSD have to enforce those uniqueness constraints\r
+       by other means.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the\r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported\r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the\r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+\r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+  </xs:annotation>\r
+\r
+  <!-- Attribute group declarations -->\r
+\r
+  <!-- Duplicate declarations are included as comments. -->\r
+\r
+  <!-- Learning Object Metadata -->\r
+  <xs:attributeGroup name="lom" />\r
+\r
+  <!-- DateTime -->\r
+  <xs:attributeGroup name="DateTimeValue" />\r
+\r
+  <!-- Duration -->\r
+  <xs:attributeGroup name="DurationValue" />\r
+\r
+  <!-- Source -->\r
+  <xs:attributeGroup name="source" />\r
+\r
+  <!-- Value -->\r
+  <xs:attributeGroup name="value" />\r
+\r
+  <!-- 1 General -->\r
+  <xs:attributeGroup name="general" />\r
+\r
+  <!-- 1.1 Identifier -->\r
+  <xs:attributeGroup name="identifier" />\r
+\r
+  <!-- 1.1.1 Catalog -->\r
+  <xs:attributeGroup name="catalog" />\r
+\r
+  <!-- 1.1.2 Entry -->\r
+  <xs:attributeGroup name="entry" />\r
+\r
+  <!-- 1.2 Title -->\r
+  <xs:attributeGroup name="title" />\r
+\r
+  <!-- 1.3 Language -->\r
+  <xs:attributeGroup name="language" />\r
+\r
+  <!-- 1.4 Description -->\r
+  <xs:attributeGroup name="description" />\r
+\r
+  <!-- 1.5 Keyword -->\r
+  <xs:attributeGroup name="keyword" />\r
+\r
+  <!-- 1.6 Coverage -->\r
+  <xs:attributeGroup name="coverage" />\r
+\r
+  <!-- 1.7 Structure -->\r
+  <xs:attributeGroup name="structure" />\r
+\r
+  <!-- 1.8 Aggregation Level -->\r
+  <xs:attributeGroup name="aggregationLevel" />\r
+\r
+  <!-- 2 Life Cycle -->\r
+  <xs:attributeGroup name="lifeCycle" />\r
+\r
+  <!-- 2.1 Version -->\r
+  <xs:attributeGroup name="version" />\r
+\r
+  <!-- 2.2 Status -->\r
+  <xs:attributeGroup name="status" />\r
+\r
+  <!-- 2.3 Contribute -->\r
+  <xs:attributeGroup name="contribute" />\r
+\r
+  <!-- 2.3.1 Role -->\r
+  <xs:attributeGroup name="role" />\r
+\r
+  <!-- 2.3.2 Entity -->\r
+  <xs:attributeGroup name="entity" />\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:attributeGroup name="date" />\r
+\r
+  <!-- 3 Meta-Metadata -->\r
+  <xs:attributeGroup name="metaMetadata" />\r
+\r
+  <!-- 3.1 Identifier\r
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 3.1.1 Catalog\r
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 3.1.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 3.2 Contribute\r
+  <xs:attributeGroup name="contribute"/> -->\r
+\r
+  <!-- 3.2.1 Role\r
+  <xs:attributeGroup name="role"/> -->\r
+\r
+  <!-- 3.2.2 Entity\r
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 3.2.3 Date\r
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 3.3 Metadata Schema -->\r
+  <xs:attributeGroup name="metadataSchema" />\r
+\r
+  <!-- 3.4 Language\r
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 4 Technical -->\r
+  <xs:attributeGroup name="technical" />\r
+\r
+  <!-- 4.1 Format -->\r
+  <xs:attributeGroup name="format" />\r
+\r
+  <!-- 4.2 Size -->\r
+  <xs:attributeGroup name="size" />\r
+\r
+  <!-- 4.3 Location -->\r
+  <xs:attributeGroup name="location" />\r
+\r
+  <!-- 4.4 Requirement -->\r
+  <xs:attributeGroup name="requirement" />\r
+\r
+  <!-- 4.4.1 OrComposite -->\r
+  <xs:attributeGroup name="orComposite" />\r
+\r
+  <!-- 4.4.1.1 Type -->\r
+  <xs:attributeGroup name="type" />\r
+\r
+  <!-- 4.4.1.2 Name -->\r
+  <xs:attributeGroup name="name" />\r
+\r
+  <!-- 4.4.1.3 Minimum Version -->\r
+  <xs:attributeGroup name="minimumVersion" />\r
+\r
+  <!-- 4.4.1.4 Maximum Version -->\r
+  <xs:attributeGroup name="maximumVersion" />\r
+\r
+  <!-- 4.5 Installation Remarks -->\r
+  <xs:attributeGroup name="installationRemarks" />\r
+\r
+  <!-- 4.6 Other Platform Requirements -->\r
+  <xs:attributeGroup name="otherPlatformRequirements" />\r
+\r
+  <!-- 4.7 Duration -->\r
+  <xs:attributeGroup name="duration" />\r
+\r
+  <!-- 5 Educational -->\r
+  <xs:attributeGroup name="educational" />\r
+\r
+  <!-- 5.1 Interactivity Type -->\r
+  <xs:attributeGroup name="interactivityType" />\r
+\r
+  <!-- 5.2 Learning Resource Type -->\r
+  <xs:attributeGroup name="learningResourceType" />\r
+\r
+  <!-- 5.3 Interactivity Level -->\r
+  <xs:attributeGroup name="interactivityLevel" />\r
+\r
+  <!-- 5.4 Semantic Density -->\r
+  <xs:attributeGroup name="semanticDensity" />\r
+\r
+  <!-- 5.5 Intended End User Role -->\r
+  <xs:attributeGroup name="intendedEndUserRole" />\r
+\r
+  <!-- 5.6 Context -->\r
+  <xs:attributeGroup name="context" />\r
+\r
+  <!-- 5.7 Typical Age Range -->\r
+  <xs:attributeGroup name="typicalAgeRange" />\r
+\r
+  <!-- 5.8 Difficulty -->\r
+  <xs:attributeGroup name="difficulty" />\r
+\r
+  <!-- 5.9 Typical Learning Time -->\r
+  <xs:attributeGroup name="typicalLearningTime" />\r
+\r
+  <!-- 5.10 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 5.11 Language\r
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 6 Rights -->\r
+  <xs:attributeGroup name="rights" />\r
+\r
+  <!-- 6.1 Cost -->\r
+  <xs:attributeGroup name="cost" />\r
+\r
+  <!-- 6.2 Copyright and Other Restrictions -->\r
+  <xs:attributeGroup name="copyrightAndOtherRestrictions" />\r
+\r
+  <!-- 6.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 7 Relation -->\r
+  <xs:attributeGroup name="relation" />\r
+\r
+  <!-- 7.1 Kind -->\r
+  <xs:attributeGroup name="kind" />\r
+\r
+  <!-- 7.2 Resource -->\r
+  <xs:attributeGroup name="resource" />\r
+\r
+  <!-- 7.2.1 Identifier\r
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 7.2.1.1 Catalog\r
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 7.2.1.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 7.2.2 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 8 Annotation -->\r
+  <xs:attributeGroup name="annotation" />\r
+\r
+  <!-- 8.1 Entity\r
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 8.2 Date\r
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 8.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9 Classification -->\r
+  <xs:attributeGroup name="classification" />\r
+\r
+  <!-- 9.1 Purpose -->\r
+  <xs:attributeGroup name="purpose" />\r
+\r
+  <!-- 9.2 Taxon Path -->\r
+  <xs:attributeGroup name="taxonPath" />\r
+\r
+  <!-- 9.2.1 Source\r
+  <xs:attributeGroup name="source"/> -->\r
+\r
+  <!-- 9.2.2 Taxon -->\r
+  <xs:attributeGroup name="taxon" />\r
+\r
+  <!-- 9.2.2.1 Id -->\r
+  <xs:attributeGroup name="id" />\r
+\r
+  <!-- 9.2.2.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 9.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9.4 Keyword\r
+  <xs:attributeGroup name="keyword"/> -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/rootElement_localised.xsd b/docs/home/ims/domainProfile_1/rootElement_localised.xsd
new file mode 100644 (file)
index 0000000..dfddcb2
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** rootElement.xsd                                                     **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion provides the element name declaration for the\r
+         root element for all LOM XML instances.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Learning Object Metadata -->\r
+   <xs:element name="lom" type="lom">\r
+      <xs:unique name="lomUnique">\r
+         <xs:selector xpath="*" />\r
+         <xs:field xpath="@uniqueElementName" />\r
+      </xs:unique>\r
+   </xs:element>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/unique/loose.xsd b/docs/home/ims/domainProfile_1/unique/loose.xsd
new file mode 100644 (file)
index 0000000..8047676
--- /dev/null
@@ -0,0 +1,295 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM/unique"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema definition provides attribute group declarations for\r
+       LOM data elements to support schema-based validation of uniqueness constraints\r
+       within a LOM XML instance where the exact set of attributes associated with each\r
+       element has to be as specified by the LOM XML Schema binding (i.e., where extra\r
+       attributes to enforce uniqueness have to be avoided).\r
+\r
+       Duplicate declarations are included as comments for completeness.  These\r
+       declarations should remain commented out or they can be removed completely.\r
+\r
+       NOTE: The absence of the enforcement of the uniqueness constraints does not\r
+       relieve a particular LOM XML instance from satisfying the uniqueness constraints\r
+       described in the LOMv1.0 base schema. Applications that require the use of\r
+       the unique/loose.xsd component XSD have to enforce those uniqueness constraints\r
+       by other means.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the\r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported\r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the\r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+\r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+  </xs:annotation>\r
+\r
+  <!-- Attribute group declarations -->\r
+\r
+  <!-- Duplicate declarations are included as comments. -->\r
+\r
+  <!-- Learning Object Metadata -->\r
+  <xs:attributeGroup name="lom"/>\r
+\r
+  <!-- DateTime -->\r
+  <xs:attributeGroup name="DateTimeValue"/>\r
+\r
+  <!-- Duration -->\r
+  <xs:attributeGroup name="DurationValue"/>\r
+\r
+  <!-- Source -->\r
+  <xs:attributeGroup name="source"/>\r
+\r
+  <!-- Value -->\r
+  <xs:attributeGroup name="value"/>\r
+\r
+  <!-- 1 General -->\r
+  <xs:attributeGroup name="general"/>\r
+\r
+  <!-- 1.1 Identifier -->\r
+  <xs:attributeGroup name="identifier"/>\r
+\r
+  <!-- 1.1.1 Catalog -->\r
+  <xs:attributeGroup name="catalog"/>\r
+\r
+  <!-- 1.1.2 Entry -->\r
+  <xs:attributeGroup name="entry"/>\r
+\r
+  <!-- 1.2 Title -->\r
+  <xs:attributeGroup name="title"/>\r
+\r
+  <!-- 1.3 Language -->\r
+  <xs:attributeGroup name="language"/>\r
+\r
+  <!-- 1.4 Description -->\r
+  <xs:attributeGroup name="description"/>\r
+\r
+  <!-- 1.5 Keyword -->\r
+  <xs:attributeGroup name="keyword"/>\r
+\r
+  <!-- 1.6 Coverage -->\r
+  <xs:attributeGroup name="coverage"/>\r
+\r
+  <!-- 1.7 Structure -->\r
+  <xs:attributeGroup name="structure"/>\r
+\r
+  <!-- 1.8 Aggregation Level -->\r
+  <xs:attributeGroup name="aggregationLevel"/>\r
+\r
+  <!-- 2 Life Cycle -->\r
+  <xs:attributeGroup name="lifeCycle"/>\r
+\r
+  <!-- 2.1 Version -->\r
+  <xs:attributeGroup name="version"/>\r
+\r
+  <!-- 2.2 Status -->\r
+  <xs:attributeGroup name="status"/>\r
+\r
+  <!-- 2.3 Contribute -->\r
+  <xs:attributeGroup name="contribute"/>\r
+\r
+  <!-- 2.3.1 Role -->\r
+  <xs:attributeGroup name="role"/>\r
+\r
+  <!-- 2.3.2 Entity -->\r
+  <xs:attributeGroup name="entity"/>\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:attributeGroup name="date"/>\r
+\r
+  <!-- 3 Meta-Metadata -->\r
+  <xs:attributeGroup name="metaMetadata"/>\r
+\r
+  <!-- 3.1 Identifier\r
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 3.1.1 Catalog\r
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 3.1.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 3.2 Contribute\r
+  <xs:attributeGroup name="contribute"/> -->\r
+\r
+  <!-- 3.2.1 Role\r
+  <xs:attributeGroup name="role"/> -->\r
+\r
+  <!-- 3.2.2 Entity\r
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 3.2.3 Date\r
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 3.3 Metadata Schema -->\r
+  <xs:attributeGroup name="metadataSchema"/>\r
+\r
+  <!-- 3.4 Language\r
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 4 Technical -->\r
+  <xs:attributeGroup name="technical"/>\r
+\r
+  <!-- 4.1 Format -->\r
+  <xs:attributeGroup name="format"/>\r
+\r
+  <!-- 4.2 Size -->\r
+  <xs:attributeGroup name="size"/>\r
+\r
+  <!-- 4.3 Location -->\r
+  <xs:attributeGroup name="location"/>\r
+\r
+  <!-- 4.4 Requirement -->\r
+  <xs:attributeGroup name="requirement"/>\r
+\r
+  <!-- 4.4.1 OrComposite -->\r
+  <xs:attributeGroup name="orComposite"/>\r
+\r
+  <!-- 4.4.1.1 Type -->\r
+  <xs:attributeGroup name="type"/>\r
+\r
+  <!-- 4.4.1.2 Name -->\r
+  <xs:attributeGroup name="name"/>\r
+\r
+  <!-- 4.4.1.3 Minimum Version -->\r
+  <xs:attributeGroup name="minimumVersion"/>\r
+\r
+  <!-- 4.4.1.4 Maximum Version -->\r
+  <xs:attributeGroup name="maximumVersion"/>\r
+\r
+  <!-- 4.5 Installation Remarks -->\r
+  <xs:attributeGroup name="installationRemarks"/>\r
+\r
+  <!-- 4.6 Other Platform Requirements -->\r
+  <xs:attributeGroup name="otherPlatformRequirements"/>\r
+\r
+  <!-- 4.7 Duration -->\r
+  <xs:attributeGroup name="duration"/>\r
+\r
+  <!-- 5 Educational -->\r
+  <xs:attributeGroup name="educational"/>\r
+\r
+  <!-- 5.1 Interactivity Type -->\r
+  <xs:attributeGroup name="interactivityType"/>\r
+\r
+  <!-- 5.2 Learning Resource Type -->\r
+  <xs:attributeGroup name="learningResourceType"/>\r
+\r
+  <!-- 5.3 Interactivity Level -->\r
+  <xs:attributeGroup name="interactivityLevel"/>\r
+\r
+  <!-- 5.4 Semantic Density -->\r
+  <xs:attributeGroup name="semanticDensity"/>\r
+\r
+  <!-- 5.5 Intended End User Role -->\r
+  <xs:attributeGroup name="intendedEndUserRole"/>\r
+\r
+  <!-- 5.6 Context -->\r
+  <xs:attributeGroup name="context"/>\r
+\r
+  <!-- 5.7 Typical Age Range -->\r
+  <xs:attributeGroup name="typicalAgeRange"/>\r
+\r
+  <!-- 5.8 Difficulty -->\r
+  <xs:attributeGroup name="difficulty"/>\r
+\r
+  <!-- 5.9 Typical Learning Time -->\r
+  <xs:attributeGroup name="typicalLearningTime"/>\r
+\r
+  <!-- 5.10 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 5.11 Language\r
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 6 Rights -->\r
+  <xs:attributeGroup name="rights"/>\r
+\r
+  <!-- 6.1 Cost -->\r
+  <xs:attributeGroup name="cost"/>\r
+\r
+  <!-- 6.2 Copyright and Other Restrictions -->\r
+  <xs:attributeGroup name="copyrightAndOtherRestrictions"/>\r
+\r
+  <!-- 6.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 7 Relation -->\r
+  <xs:attributeGroup name="relation"/>\r
+\r
+  <!-- 7.1 Kind -->\r
+  <xs:attributeGroup name="kind"/>\r
+\r
+  <!-- 7.2 Resource -->\r
+  <xs:attributeGroup name="resource"/>\r
+\r
+  <!-- 7.2.1 Identifier\r
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 7.2.1.1 Catalog\r
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 7.2.1.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 7.2.2 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 8 Annotation -->\r
+  <xs:attributeGroup name="annotation"/>\r
+\r
+  <!-- 8.1 Entity\r
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 8.2 Date\r
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 8.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9 Classification -->\r
+  <xs:attributeGroup name="classification"/>\r
+\r
+  <!-- 9.1 Purpose -->\r
+  <xs:attributeGroup name="purpose"/>\r
+\r
+  <!-- 9.2 Taxon Path -->\r
+  <xs:attributeGroup name="taxonPath"/>\r
+\r
+  <!-- 9.2.1 Source\r
+  <xs:attributeGroup name="source"/> -->\r
+\r
+  <!-- 9.2.2 Taxon -->\r
+  <xs:attributeGroup name="taxon"/>\r
+\r
+  <!-- 9.2.2.1 Id -->\r
+  <xs:attributeGroup name="id"/>\r
+\r
+  <!-- 9.2.2.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 9.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9.4 Keyword\r
+  <xs:attributeGroup name="keyword"/> -->\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/vocab/loose.xsd b/docs/home/ims/domainProfile_1/vocab/loose.xsd
new file mode 100644 (file)
index 0000000..c25d38f
--- /dev/null
@@ -0,0 +1,147 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab"\r
+           xmlns="http://ltsc.ieee.org/xsd/imscc/LOM/vocab"\r
+           xmlns:lom="http://ltsc.ieee.org/xsd/imscc/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema definition provides simple type declarations for LOM\r
+       data elements that are defined as Vocabulary data types.\r
+\r
+       This component schema definition enforces that vocabulary sources and values\r
+       are character strings, which simplifies the schema validation process for those\r
+       applications that perform vocabulary source/value validation using\r
+       post-schema-validation.\r
+\r
+       This component schema definition relaxes the validation constraints by\r
+       allowing both sources and values to be arbitrary character strings.\r
+\r
+       NOTE: The absence of the enforcement of vocabulary values does not relieve a\r
+       particular LOM XML instance from satisfying vocabulary requirements defined\r
+       in the LOMv1.0 base schema. Applications that require the use of vocab/loose.xsd\r
+       component XSD should enforce those vocabulary requirements by other means.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+\r
+  </xs:annotation>\r
+\r
+  <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM" schemaLocation="../lomLoose_localised.xsd"/>\r
+\r
+  <!-- Vocabulary data type declarations -->\r
+\r
+  <!-- Source -->\r
+  <xs:simpleType name="source">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 1.7 Structure -->\r
+  <xs:simpleType name="structure">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 1.8 Aggregation Level -->\r
+  <xs:simpleType name="aggregationLevel">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 2.2 Status -->\r
+  <xs:simpleType name="status">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 2.3.1 Role -->\r
+  <xs:simpleType name="role">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 3.2.1 Role -->\r
+  <xs:simpleType name="roleMeta">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 4.4.1.1 Type -->\r
+  <xs:simpleType name="type">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 4.4.1.2 Name -->\r
+  <xs:simpleType name="name">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.1 Interactivity Type -->\r
+  <xs:simpleType name="interactivityType">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.2 Learning Resource Type -->\r
+  <xs:simpleType name="learningResourceType">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.3 Interactivity Level -->\r
+  <xs:simpleType name="interactivityLevel">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.4 Semantic Density -->\r
+  <xs:simpleType name="semanticDensity">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.5 Intended End User Role -->\r
+  <xs:simpleType name="intendedEndUserRole">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.6 Context -->\r
+  <xs:simpleType name="context">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.8 Difficulty -->\r
+  <xs:simpleType name="difficulty">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 6.1 Cost -->\r
+  <xs:simpleType name="cost">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 6.2 Copyright and Other Restrictions -->\r
+  <xs:simpleType name="copyrightAndOtherRestrictions">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 7.1 Kind -->\r
+  <xs:simpleType name="kind">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 9.1 Purpose -->\r
+  <xs:simpleType name="purpose">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_1/vocabTypes_localised.xsd b/docs/home/ims/domainProfile_1/vocabTypes_localised.xsd
new file mode 100644 (file)
index 0000000..57ad0a1
--- /dev/null
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** vocabTypes.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/imscc/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/imscc/LOM/extend" xmlns:voc="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_m_definition.xsd" />\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion provides global type declarations for those\r
+         LOM data elements whose values are taken from a Vocabulary data type.\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:annotation>\r
+               <xs:documentation>This component XSD requires schema components from other\r
+       schemas that are defined in other namespaces.  These statements import the\r
+       appropriate components. The xsi:schemaLocation attribute is used to specify\r
+       the location of the file that contains the schema that defines the namespace.\r
+       The xsi:schemaLocation attribute is optional and is ommitted.  By definition of\r
+       the composite schemas the appropriate namespaces and related files where those\r
+       namespaces are defined are brought into scope.  Some XML parsers may require\r
+       these import statements to contain the optional xsi:schemaLocation attribute.</xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/unique" schemaLocation="./unique/loose.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/extend" schemaLocation="./extend/custom.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/imscc/LOM/vocab" schemaLocation="./vocab/loose.xsd" />\r
+       <!-- Vocabulary type declarations -->\r
+       <!-- Source -->\r
+       <xs:complexType name="sourceValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:source">\r
+                               <xs:attributeGroup ref="ag:source" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structureVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="structureValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="structureValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:structure">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="aggregationLevelValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="aggregationLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:aggregationLevel">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="statusVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="statusValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="statusValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:status">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="roleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="roleValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="roleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:role">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMetaVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="roleMetaValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="roleMetaValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:roleMeta">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="typeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="typeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="typeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:type">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="nameVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="nameValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="nameValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:name">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="interactivityTypeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityType">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="learningResourceTypeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="learningResourceTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: learningResourceType must be 'IMS Common Cartridge'</xs:documentation>\r
+                </xs:annotation><xs:extension base="ImsCCType">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               \r
+       </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="interactivityLevelValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityLevel">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensityVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="semanticDensityValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="semanticDensityValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:semanticDensity">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRoleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="intendedEndUserRoleValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="intendedEndUserRoleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:intendedEndUserRole">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="contextVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="contextValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="contextValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:context">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficultyVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="difficultyValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="difficultyValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:difficulty">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="costVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="costValue" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="costValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:cost">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictionsVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="copyrightAndOtherRestrictionsValue" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="copyrightAndOtherRestrictionsValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:copyrightAndOtherRestrictions">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kindVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="kindValue" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="kindValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:kind">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purposeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="purposeValue" />\r
+                       <xs:group ref="ex:customElements" minOccurs="0" maxOccurs="0"><xs:annotation>\r
+                    <xs:documentation xml:lang="en">explanation: No custom elements are allowed.</xs:documentation>\r
+                </xs:annotation>\r
+       </xs:group>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="purposeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:purpose">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_1/vocabValues_localised.xsd b/docs/home/ims/domainProfile_1/vocabValues_localised.xsd
new file mode 100644 (file)
index 0000000..8142904
--- /dev/null
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** vocabValues.xsd                                                     **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/imscc/LOM" targetNamespace="http://ltsc.ieee.org/xsd/imscc/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides global type declarations for the standard\r
+         LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from\r
+         a Vocabulary data type.\r
+\r
+         This component schema defintion defines the stanard vocabulary value\r
+         declarations as defined in the LOMv1.0 base schema.  These vocabulary\r
+         value declarations are used in conjunction with both vocab/custom.xsd and\r
+         vocab/loose.xsd.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- LOMv1.0 base schema vocabulary source and value declarations -->\r
+\r
+   <!-- Source -->\r
+   <xs:simpleType name="sourceValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="LOMv1.0" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:simpleType name="structureValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="atomic" />\r
+         <xs:enumeration value="collection" />\r
+         <xs:enumeration value="networked" />\r
+         <xs:enumeration value="hierarchical" />\r
+         <xs:enumeration value="linear" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:simpleType name="aggregationLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="1" />\r
+         <xs:enumeration value="2" />\r
+         <xs:enumeration value="3" />\r
+         <xs:enumeration value="4" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:simpleType name="statusValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="draft" />\r
+         <xs:enumeration value="final" />\r
+         <xs:enumeration value="revised" />\r
+         <xs:enumeration value="unavailable" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:simpleType name="roleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="author" />\r
+         <xs:enumeration value="publisher" />\r
+         <xs:enumeration value="unknown" />\r
+         <xs:enumeration value="initiator" />\r
+         <xs:enumeration value="terminator" />\r
+         <xs:enumeration value="validator" />\r
+         <xs:enumeration value="editor" />\r
+         <xs:enumeration value="graphical designer" />\r
+         <xs:enumeration value="technical implementer" />\r
+         <xs:enumeration value="content provider" />\r
+         <xs:enumeration value="technical validator" />\r
+         <xs:enumeration value="educational validator" />\r
+         <xs:enumeration value="script writer" />\r
+         <xs:enumeration value="instructional designer" />\r
+         <xs:enumeration value="subject matter expert" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:simpleType name="roleMetaValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="creator" />\r
+         <xs:enumeration value="validator" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:simpleType name="typeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="operating system" />\r
+         <xs:enumeration value="browser" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:simpleType name="nameValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="pc-dos" />\r
+         <xs:enumeration value="ms-windows" />\r
+         <xs:enumeration value="macos" />\r
+         <xs:enumeration value="unix" />\r
+         <xs:enumeration value="multi-os" />\r
+         <xs:enumeration value="none" />\r
+         <xs:enumeration value="any" />\r
+         <xs:enumeration value="netscape communicator" />\r
+         <xs:enumeration value="ms-internet explorer" />\r
+         <xs:enumeration value="opera" />\r
+         <xs:enumeration value="amaya" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:simpleType name="interactivityTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="active" />\r
+         <xs:enumeration value="expositive" />\r
+         <xs:enumeration value="mixed" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:simpleType name="learningResourceTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="exercise" />\r
+         <xs:enumeration value="simulation" />\r
+         <xs:enumeration value="questionnaire" />\r
+         <xs:enumeration value="diagram" />\r
+         <xs:enumeration value="figure" />\r
+         <xs:enumeration value="graph" />\r
+         <xs:enumeration value="index" />\r
+         <xs:enumeration value="slide" />\r
+         <xs:enumeration value="table" />\r
+         <xs:enumeration value="narrative text" />\r
+         <xs:enumeration value="exam" />\r
+         <xs:enumeration value="experiment" />\r
+         <xs:enumeration value="problem statement" />\r
+         <xs:enumeration value="self assessment" />\r
+         <xs:enumeration value="lecture" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:simpleType name="interactivityLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low" />\r
+         <xs:enumeration value="low" />\r
+         <xs:enumeration value="medium" />\r
+         <xs:enumeration value="high" />\r
+         <xs:enumeration value="very high" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:simpleType name="semanticDensityValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low" />\r
+         <xs:enumeration value="low" />\r
+         <xs:enumeration value="medium" />\r
+         <xs:enumeration value="high" />\r
+         <xs:enumeration value="very high" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:simpleType name="intendedEndUserRoleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="teacher" />\r
+         <xs:enumeration value="author" />\r
+         <xs:enumeration value="learner" />\r
+         <xs:enumeration value="manager" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:simpleType name="contextValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="school" />\r
+         <xs:enumeration value="higher education" />\r
+         <xs:enumeration value="training" />\r
+         <xs:enumeration value="other" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:simpleType name="difficultyValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very easy" />\r
+         <xs:enumeration value="easy" />\r
+         <xs:enumeration value="medium" />\r
+         <xs:enumeration value="difficult" />\r
+         <xs:enumeration value="very difficult" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:simpleType name="costValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes" />\r
+         <xs:enumeration value="no" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:simpleType name="copyrightAndOtherRestrictionsValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes" />\r
+         <xs:enumeration value="no" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:simpleType name="kindValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="ispartof" />\r
+         <xs:enumeration value="haspart" />\r
+         <xs:enumeration value="isversionof" />\r
+         <xs:enumeration value="hasversion" />\r
+         <xs:enumeration value="isformatof" />\r
+         <xs:enumeration value="hasformat" />\r
+         <xs:enumeration value="references" />\r
+         <xs:enumeration value="isreferencedby" />\r
+         <xs:enumeration value="isbasedon" />\r
+         <xs:enumeration value="isbasisfor" />\r
+         <xs:enumeration value="requires" />\r
+         <xs:enumeration value="isrequiredby" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:simpleType name="purposeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="discipline" />\r
+         <xs:enumeration value="idea" />\r
+         <xs:enumeration value="prerequisite" />\r
+         <xs:enumeration value="educational objective" />\r
+         <xs:enumeration value="accessibility restrictions" />\r
+         <xs:enumeration value="educational level" />\r
+         <xs:enumeration value="skill level" />\r
+         <xs:enumeration value="security level" />\r
+         <xs:enumeration value="competency" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/anyElement.xsd b/docs/home/ims/domainProfile_2/anyElement.xsd
new file mode 100644 (file)
index 0000000..de01fb9
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides the element group declaration and the\r
+         attribute group declaration used for extension XML elements and attributes.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <xs:group name="customElements">\r
+      <xs:choice>\r
+         <xs:any namespace="##other" processContents="lax" />\r
+      </xs:choice>\r
+   </xs:group>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/anyElement_localised.xsd b/docs/home/ims/domainProfile_2/anyElement_localised.xsd
new file mode 100644 (file)
index 0000000..df66c7f
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** anyElement.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_mR_definition.xsd" />\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides the element group declaration and the\r
+         attribute group declaration used for extension XML elements and attributes.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <xs:group name="customElements">\r
+      <xs:choice>\r
+         <xs:any namespace="##other" processContents="lax" />\r
+      </xs:choice>\r
+   </xs:group>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/common/anyElement.xsd b/docs/home/ims/domainProfile_2/common/anyElement.xsd
new file mode 100644 (file)
index 0000000..936f372
--- /dev/null
@@ -0,0 +1,39 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides the element group declaration and the\r
+         attribute group declaration used for extension XML elements and attributes.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <xs:group name="customElements">\r
+      <xs:choice>\r
+         <xs:any namespace="##other" processContents="lax"/>\r
+      </xs:choice>\r
+   </xs:group>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/common/dataTypes.xsd b/docs/home/ims/domainProfile_2/common/dataTypes.xsd
new file mode 100644 (file)
index 0000000..fbd3e10
--- /dev/null
@@ -0,0 +1,118 @@
+<xs:schema xmlns="http://ltsc.ieee.org/xsd/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion defines global schema data type declarations\r
+         for data types defined in the LOMv1.0 base schema.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="../unique/loose.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="../extend/custom.xsd"/>\r
+        <xs:include schemaLocation="elementTypes.xsd"/>\r
+       <!-- Data type declarations -->\r
+       <!-- CharacterString -->\r
+       <xs:simpleType name="CharacterString">\r
+               <xs:restriction base="xs:string"/>\r
+       </xs:simpleType>\r
+       <!-- LanguageId -->\r
+       <xs:complexType name="LanguageId">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:language">\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- VCard -->\r
+       <xs:complexType name="VCard">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- MimeType -->\r
+       <xs:simpleType name="MimeType">\r
+               <xs:restriction base="CharacterString"/>\r
+       </xs:simpleType>\r
+       <!-- Size -->\r
+       <xs:simpleType name="Size">\r
+               <xs:restriction base="xs:nonNegativeInteger"/>\r
+       </xs:simpleType>\r
+       <!-- LanguageString -->\r
+       <xs:complexType name="LanguageString">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="string" type="LangString"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="LangString">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attribute name="language" type="xs:language"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- DateTime -->\r
+       <xs:complexType name="DateTime">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="dateTime" type="DateTimeValue"/>\r
+                       <xs:element name="description" type="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DateTimeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DateTimeString">\r
+                               <xs:attributeGroup ref="ag:DateTimeValue"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DateTimeString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]|[0-9][1-9][0-9]{2}|[1-9][0-9]{3})(\-(0[1-9]|1[0-2])(\-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9](:[0-5][0-9](\.[0-9]{1,}(Z|((\+|\-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?)?)?)?)?)?)?"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- Duration -->\r
+       <xs:complexType name="Duration">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="duration" type="DurationValue"/>\r
+                       <xs:element name="description" type="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DurationValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DurationString">\r
+                               <xs:attributeGroup ref="ag:DurationValue"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DurationString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="P([0-9]{1,}Y){0,1}([0-9]{1,}M){0,1}([0-9]{1,}D){0,1}(T([0-9]{1,}H){0,1}([0-9]{1,}M){0,1}([0-9]{1,}(\.[0-9]{1,}){0,1}S){0,1}){0,1}"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/common/elementNames.xsd b/docs/home/ims/domainProfile_2/common/elementNames.xsd
new file mode 100644 (file)
index 0000000..bc20ce0
--- /dev/null
@@ -0,0 +1,783 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion defines global element declarations for\r
+         each of the data elements defined in the LOMv1.0 base schema.  This component\r
+         schema definition is used to check for the uniqueness of elements declared\r
+         to be unique within their parent elements by the presence of the\r
+         "uniqueElementName" attribute.  The XML Schema constraint "unique" is used\r
+         to enforce uniqueness constraints.\r
+\r
+         Duplicate declarations are included as comments for completeness.  These\r
+         declarations should remain commented out or they can be removed completely.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Duplicate declarations are included as comments. -->\r
+\r
+   <!-- 1 General -->\r
+   <xs:group name="general">\r
+      <xs:sequence>\r
+         <xs:element name="general" type="general">\r
+            <xs:unique name="generalUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1 Identifier -->\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.1 Catalog -->\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.2 Entry -->\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.2 Title -->\r
+   <xs:group name="title">\r
+      <xs:sequence>\r
+         <xs:element name="title" type="title"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.3 Language-->\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.4 Description -->\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.5 Keyword -->\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.6 Coverage -->\r
+   <xs:group name="coverage">\r
+      <xs:sequence>\r
+         <xs:element name="coverage" type="coverage"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:group name="structure">\r
+      <xs:sequence>\r
+         <xs:element name="structure" type="structure">\r
+            <xs:unique name="structureUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:group name="aggregationLevel">\r
+      <xs:sequence>\r
+         <xs:element name="aggregationLevel" type="aggregationLevel">\r
+            <xs:unique name="aggregationLevelUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2 Life Cycle -->\r
+   <xs:group name="lifeCycle">\r
+      <xs:sequence>\r
+         <xs:element name="lifeCycle" type="lifeCycle">\r
+            <xs:unique name="lifeCycleUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.1 Version -->\r
+   <xs:group name="version">\r
+      <xs:sequence>\r
+         <xs:element name="version" type="version"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:group name="status">\r
+      <xs:sequence>\r
+         <xs:element name="status" type="status">\r
+            <xs:unique name="statusUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3 Contribute -->\r
+   <xs:group name="contribute">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contribute">\r
+            <xs:unique name="contributeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:group name="role">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="role">\r
+            <xs:unique name="roleUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.2 Entity -->\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:group name="date">\r
+     <xs:sequence>\r
+        <xs:element name="date" type="date">\r
+           <xs:unique name="dateUnique">\r
+              <xs:selector xpath="*"/>\r
+              <xs:field xpath="@uniqueElementName"/>\r
+           </xs:unique>\r
+        </xs:element>\r
+     </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3 Meta-Metadata -->\r
+   <xs:group name="metaMetadata">\r
+      <xs:sequence>\r
+         <xs:element name="metaMetadata" type="metaMetadata">\r
+            <xs:unique name="metaMetadataUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2 Contribute -->\r
+   <xs:group name="contributeMeta">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contributeMeta">\r
+            <xs:unique name="contributeMetaUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:group name="roleMeta">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="roleMeta">\r
+            <xs:unique name="roleMetaUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.2 Entity\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2.3 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.3 Metadata Schema -->\r
+   <xs:group name="metadataSchema">\r
+      <xs:sequence>\r
+         <xs:element name="metadataSchema" type="metadataSchema"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.4 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 4 Technical -->\r
+   <xs:group name="technical">\r
+      <xs:sequence>\r
+         <xs:element name="technical" type="technical">\r
+            <xs:unique name="technicalUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.1 Format -->\r
+  <xs:group name="format">\r
+      <xs:sequence>\r
+         <xs:element name="format" type="format"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.2 Size -->\r
+   <xs:group name="size">\r
+      <xs:sequence>\r
+         <xs:element name="size" type="size"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.3 Location -->\r
+   <xs:group name="location">\r
+      <xs:sequence>\r
+         <xs:element name="location" type="location"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4 Requirement -->\r
+   <xs:group name="requirement">\r
+      <xs:sequence>\r
+         <xs:element name="requirement" type="requirement"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1 OrComposite -->\r
+   <xs:group name="orComposite">\r
+      <xs:sequence>\r
+         <xs:element name="orComposite" type="orComposite">\r
+            <xs:unique name="orCompositeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:group name="type">\r
+      <xs:sequence>\r
+         <xs:element name="type" type="type">\r
+            <xs:unique name="typeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:group name="name">\r
+      <xs:sequence>\r
+         <xs:element name="name" type="name">\r
+            <xs:unique name="nameUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.3 Minimum Version -->\r
+   <xs:group name="minimumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="minimumVersion" type="minimumVersion"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.4 Maximum Version -->\r
+   <xs:group name="maximumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="maximumVersion" type="maximumVersion"/>\r
+      </xs:sequence>\r
+    </xs:group>\r
+\r
+   <!-- 4.5 Installation Remarks -->\r
+   <xs:group name="installationRemarks">\r
+      <xs:sequence>\r
+         <xs:element name="installationRemarks" type="installationRemarks"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.6 Other Platform Requirements -->\r
+   <xs:group name="otherPlatformRequirements">\r
+      <xs:sequence>\r
+         <xs:element name="otherPlatformRequirements" type="otherPlatformRequirements"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.7 Duration -->\r
+   <xs:group name="duration">\r
+      <xs:sequence>\r
+         <xs:element name="duration" type="duration">\r
+            <xs:unique name="durationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5 Educational -->\r
+   <xs:group name="educational">\r
+      <xs:sequence>\r
+         <xs:element name="educational" type="educational">\r
+            <xs:unique name="educationalUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:group name="interactivityType">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityType" type="interactivityType">\r
+            <xs:unique name="interactivityTypeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:group name="learningResourceType">\r
+      <xs:sequence>\r
+         <xs:element name="learningResourceType" type="learningResourceType">\r
+            <xs:unique name="learningResourceTypeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:group name="interactivityLevel">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityLevel" type="interactivityLevel">\r
+            <xs:unique name="interactivityLevelUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:group name="semanticDensity">\r
+      <xs:sequence>\r
+         <xs:element name="semanticDensity" type="semanticDensity">\r
+            <xs:unique name="semanticDensityUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:group name="intendedEndUserRole">\r
+      <xs:sequence>\r
+         <xs:element name="intendedEndUserRole" type="intendedEndUserRole">\r
+            <xs:unique name="intendedEndUserRoleUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:group name="context">\r
+      <xs:sequence>\r
+         <xs:element name="context" type="context">\r
+            <xs:unique name="contextUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.7 Typical Age Range -->\r
+   <xs:group name="typicalAgeRange">\r
+      <xs:sequence>\r
+         <xs:element name="typicalAgeRange" type="typicalAgeRange"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:group name="difficulty">\r
+      <xs:sequence>\r
+         <xs:element name="difficulty" type="difficulty">\r
+            <xs:unique name="difficultyUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.9 Typical Learning Time -->\r
+   <xs:group name="typicalLearningTime">\r
+      <xs:sequence>\r
+         <xs:element name="typicalLearningTime" type="typicalLearningTime">\r
+            <xs:unique name="typicalLearningTimeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.10 Description\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 5.11 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group>-->\r
+\r
+   <!-- 6 Rights -->\r
+   <xs:group name="rights">\r
+      <xs:sequence>\r
+         <xs:element name="rights" type="rights">\r
+            <xs:unique name="rightsUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:group name="cost">\r
+      <xs:sequence>\r
+         <xs:element name="cost" type="cost">\r
+            <xs:unique name="costUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:group name="copyrightAndOtherRestrictions">\r
+      <xs:sequence>\r
+         <xs:element name="copyrightAndOtherRestrictions" type="copyrightAndOtherRestrictions">\r
+            <xs:unique name="copyrightAndOtherRestrictionsUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.3 Description -->\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7 Relation -->\r
+   <xs:group name="relation">\r
+      <xs:sequence>\r
+         <xs:element name="relation" type="relation">\r
+            <xs:unique name="relationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:group name="kind">\r
+      <xs:sequence>\r
+         <xs:element name="kind" type="kind">\r
+            <xs:unique name="kindUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2 Resource -->\r
+   <xs:group name="resource">\r
+      <xs:sequence>\r
+         <xs:element name="resource" type="resource"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.2 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8 Annotation -->\r
+   <xs:group name="annotation">\r
+      <xs:sequence>\r
+         <xs:element name="annotation" type="annotation">\r
+            <xs:unique name="annotationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.1 Entity -->\r
+   <xs:group name="entity">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="entity"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.2 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9 Classification -->\r
+   <xs:group name="classification">\r
+      <xs:sequence>\r
+         <xs:element name="classification" type="classification">\r
+            <xs:unique name="classificationUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:group name="purpose">\r
+      <xs:sequence>\r
+         <xs:element name="purpose" type="purpose">\r
+            <xs:unique name="purposeUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2 Taxon Path -->\r
+   <xs:group name="taxonPath">\r
+      <xs:sequence>\r
+         <xs:element name="taxonPath" type="taxonPath">\r
+            <xs:unique name="taxonPathUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.1 Source -->\r
+   <xs:group name="source">\r
+      <xs:sequence>\r
+         <xs:element name="source" type="source"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2 Taxon -->\r
+   <xs:group name="taxon">\r
+      <xs:sequence>\r
+         <xs:element name="taxon" type="taxon">\r
+            <xs:unique name="taxonUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.1 Id -->\r
+   <xs:group name="id">\r
+      <xs:sequence>\r
+         <xs:element name="id" type="id"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.2 Entry -->\r
+   <xs:group name="entryTaxon">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entryTaxon"/>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9.4 Keyword\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/common/elementTypes.xsd b/docs/home/ims/domainProfile_2/common/elementTypes.xsd
new file mode 100644 (file)
index 0000000..b7731c1
--- /dev/null
@@ -0,0 +1,779 @@
+<xs:schema xmlns="http://ltsc.ieee.org/xsd/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+               <xs:documentation>\r
+       This component schema defintion defines global schema data type declarations\r
+       for data elements defined in the LOMv1.0 base schema.  This component XSD\r
+       defines the aggregation relationship among the LOM data elements.  These aggregation\r
+       relationships enforce the LOMv1.0 base schema requirement that elements can only\r
+       be present in a LOM XML instance as elements of the aggregate element to which they\r
+       belong.\r
+\r
+       Duplicate declarations are included as comments for completeness.  These declarations\r
+       should remain commented out or they can be removed completely.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="../unique/loose.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="../extend/custom.xsd"/>\r
+       <!-- Element type declarations -->\r
+       <!-- Learning Object Metadata -->\r
+       <xs:complexType name="lom">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="general"/>\r
+                       <xs:group ref="lifeCycle"/>\r
+                       <xs:group ref="metaMetadata"/>\r
+                       <xs:group ref="technical"/>\r
+                       <xs:group ref="educational"/>\r
+                       <xs:group ref="rights"/>\r
+                       <xs:group ref="relation"/>\r
+                       <xs:group ref="annotation"/>\r
+                       <xs:group ref="classification"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lom"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 1 General -->\r
+       <xs:complexType name="general">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier"/>\r
+                       <xs:group ref="title"/>\r
+                       <xs:group ref="language"/>\r
+                       <xs:group ref="descriptionUnbounded"/>\r
+                       <xs:group ref="keyword"/>\r
+                       <xs:group ref="coverage"/>\r
+                       <xs:group ref="structure"/>\r
+                       <xs:group ref="aggregationLevel"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:general"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 1.1 Identifier -->\r
+       <xs:complexType name="identifier">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="catalog"/>\r
+                       <xs:group ref="entry"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:identifier"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 1.1.1 Catalog -->\r
+       <xs:complexType name="catalog">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:catalog"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.1.2 Entry -->\r
+       <xs:complexType name="entry">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:entry"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.2 Title -->\r
+       <xs:complexType name="title">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:title"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.3 Language -->\r
+       <xs:complexType name="language">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageId">\r
+                               <xs:attributeGroup ref="ag:language"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.4 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 1.5 Keyword -->\r
+       <xs:complexType name="keyword">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:keyword"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.6 Coverage -->\r
+       <xs:complexType name="coverage">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:coverage"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structure">\r
+               <xs:complexContent>\r
+                       <xs:extension base="structureVocab">\r
+                               <xs:attributeGroup ref="ag:structure"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="aggregationLevelVocab">\r
+                               <xs:attributeGroup ref="ag:aggregationLevel"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2 Life Cycle -->\r
+       <xs:complexType name="lifeCycle">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="version"/>\r
+                       <xs:group ref="status"/>\r
+                       <xs:group ref="contribute"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lifeCycle"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 2.1 Version -->\r
+       <xs:complexType name="version">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:version"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="status">\r
+               <xs:complexContent>\r
+                       <xs:extension base="statusVocab">\r
+                               <xs:attributeGroup ref="ag:status"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3 Contribute -->\r
+       <xs:complexType name="contribute">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="role"/>\r
+                       <xs:group ref="entityUnbounded"/>\r
+                       <xs:group ref="date"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="role">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleVocab">\r
+                               <xs:attributeGroup ref="ag:role"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 2.3.3 Date -->\r
+       <xs:complexType name="date">\r
+               <xs:complexContent>\r
+                       <xs:extension base="DateTime">\r
+                               <xs:attributeGroup ref="ag:date"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3 Meta-Metadata -->\r
+       <xs:complexType name="metaMetadata">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier"/>\r
+                       <xs:group ref="contributeMeta"/>\r
+                       <xs:group ref="metadataSchema"/>\r
+                       <xs:group ref="language"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:metaMetadata"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 3.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2 Contribute -->\r
+       <xs:complexType name="contributeMeta">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="roleMeta"/>\r
+                       <xs:group ref="entityUnbounded"/>\r
+                       <xs:group ref="date"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMeta">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleMetaVocab">\r
+                               <xs:attributeGroup ref="ag:role"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2.3 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.3 Metadata Schema -->\r
+       <xs:complexType name="metadataSchema">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:metadataSchema"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.4 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>-->\r
+       <!-- 4 Technical -->\r
+       <xs:complexType name="technical">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="format"/>\r
+                       <xs:group ref="size"/>\r
+                       <xs:group ref="location"/>\r
+                       <xs:group ref="requirement"/>\r
+                       <xs:group ref="installationRemarks"/>\r
+                       <xs:group ref="otherPlatformRequirements"/>\r
+                       <xs:group ref="duration"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:technical"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 4.1 Format -->\r
+       <xs:complexType name="format">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="MimeType">\r
+                               <xs:attributeGroup ref="ag:format"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.2 Size -->\r
+       <xs:complexType name="size">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="Size">\r
+                               <xs:attributeGroup ref="ag:size"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.3 Location -->\r
+       <xs:complexType name="location">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:location"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4 Requirement -->\r
+       <xs:complexType name="requirement">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="orComposite"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:requirement"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 4.4.1 OrComposite -->\r
+       <xs:complexType name="orComposite">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="type"/>\r
+                       <xs:group ref="name"/>\r
+                       <xs:group ref="minimumVersion"/>\r
+                       <xs:group ref="maximumVersion"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:orComposite"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="type">\r
+               <xs:complexContent>\r
+                       <xs:extension base="typeVocab">\r
+                               <xs:attributeGroup ref="ag:type"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="name">\r
+               <xs:complexContent>\r
+                       <xs:extension base="nameVocab">\r
+                               <xs:attributeGroup ref="ag:name"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.3 Minimum Version -->\r
+       <xs:complexType name="minimumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:minimumVersion"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.4 Maximum Version -->\r
+       <xs:complexType name="maximumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:maximumVersion"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.5 Installation Remarks -->\r
+       <xs:complexType name="installationRemarks">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:installationRemarks"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.6 Other Platform Requirements -->\r
+       <xs:complexType name="otherPlatformRequirements">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:otherPlatformRequirements"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.7 Duration -->\r
+       <xs:complexType name="duration">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:duration"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5 Educational -->\r
+       <xs:complexType name="educational">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="interactivityType"/>\r
+                       <xs:group ref="learningResourceType"/>\r
+                       <xs:group ref="interactivityLevel"/>\r
+                       <xs:group ref="semanticDensity"/>\r
+                       <xs:group ref="intendedEndUserRole"/>\r
+                       <xs:group ref="context"/>\r
+                       <xs:group ref="typicalAgeRange"/>\r
+                       <xs:group ref="difficulty"/>\r
+                       <xs:group ref="typicalLearningTime"/>\r
+                       <xs:group ref="descriptionUnbounded"/>\r
+                       <xs:group ref="language"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:educational"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityTypeVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityType"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="learningResourceTypeVocab">\r
+                               <xs:attributeGroup ref="ag:learningResourceType"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityLevelVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityLevel"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="semanticDensityVocab">\r
+                               <xs:attributeGroup ref="ag:semanticDensity"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRole">\r
+               <xs:complexContent>\r
+                       <xs:extension base="intendedEndUserRoleVocab">\r
+                               <xs:attributeGroup ref="ag:intendedEndUserRole"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="context">\r
+               <xs:complexContent>\r
+                       <xs:extension base="contextVocab">\r
+                               <xs:attributeGroup ref="ag:context"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.7 Typical Age Range -->\r
+       <xs:complexType name="typicalAgeRange">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:typicalAgeRange"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficulty">\r
+               <xs:complexContent>\r
+                       <xs:extension base="difficultyVocab">\r
+                               <xs:attributeGroup ref="ag:difficulty"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.9 Typical Learning Time -->\r
+       <xs:complexType name="typicalLearningTime">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:typicalLearningTime"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.10 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 5.11 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 6 Rights -->\r
+       <xs:complexType name="rights">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="cost"/>\r
+                       <xs:group ref="copyrightAndOtherRestrictions"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:rights"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="cost">\r
+               <xs:complexContent>\r
+                       <xs:extension base="costVocab">\r
+                               <xs:attributeGroup ref="ag:cost"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictions">\r
+               <xs:complexContent>\r
+                       <xs:extension base="copyrightAndOtherRestrictionsVocab">\r
+                               <xs:attributeGroup ref="ag:copyrightAndOtherRestrictions"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.3 Description -->\r
+       <xs:complexType name="description">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:description"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7 Relation -->\r
+       <xs:complexType name="relation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="kind"/>\r
+                       <xs:group ref="resource"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:relation"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kind">\r
+               <xs:complexContent>\r
+                       <xs:extension base="kindVocab">\r
+                               <xs:attributeGroup ref="ag:kind"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7.2 Resource -->\r
+       <xs:complexType name="resource">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:resource"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 7.2.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.2 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8 Annotation -->\r
+       <xs:complexType name="annotation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="entity"/>\r
+                       <xs:group ref="date"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:annotation"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 8.1 Entity -->\r
+       <xs:complexType name="entity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="VCard">\r
+                               <xs:attributeGroup ref="ag:entity"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 8.2 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9 Classification -->\r
+       <xs:complexType name="classification">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="purpose"/>\r
+                       <xs:group ref="taxonPath"/>\r
+                       <xs:group ref="description"/>\r
+                       <xs:group ref="keyword"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:classification"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purpose">\r
+               <xs:complexContent>\r
+                       <xs:extension base="purposeVocab">\r
+                               <xs:attributeGroup ref="ag:purpose"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2 Taxon Path -->\r
+       <xs:complexType name="taxonPath">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="source"/>\r
+                       <xs:group ref="taxon"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxonPath"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 9.2.1 Source -->\r
+       <xs:complexType name="source">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:source"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2 Taxon -->\r
+       <xs:complexType name="taxon">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="id"/>\r
+                       <xs:group ref="entryTaxon"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxon"/>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <!-- 9.2.2.1 Id -->\r
+       <xs:complexType name="id">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:id"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2.2 Entry -->\r
+       <xs:complexType name="entryTaxon">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:entry"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9.4 Keyword\r
+  <xs:complexType name="keyword">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:keyword"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/common/rootElement.xsd b/docs/home/ims/domainProfile_2/common/rootElement.xsd
new file mode 100644 (file)
index 0000000..70bd42a
--- /dev/null
@@ -0,0 +1,43 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion provides the element name declaration for the\r
+         root element for all LOM XML instances.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Learning Object Metadata -->\r
+   <xs:element name="lom" type="lom">\r
+      <xs:unique name="lomUnique">\r
+         <xs:selector xpath="*"/>\r
+         <xs:field xpath="@uniqueElementName"/>\r
+      </xs:unique>\r
+   </xs:element>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/common/vocabTypes.xsd b/docs/home/ims/domainProfile_2/common/vocabTypes.xsd
new file mode 100644 (file)
index 0000000..55d4287
--- /dev/null
@@ -0,0 +1,355 @@
+<xs:schema xmlns="http://ltsc.ieee.org/xsd/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns:voc="http://ltsc.ieee.org/xsd/LOM/vocab" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion provides global type declarations for those\r
+         LOM data elements whose values are taken from a Vocabulary data type.\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:annotation>\r
+               <xs:documentation>This component XSD requires schema components from other\r
+       schemas that are defined in other namespaces.  These statements import the\r
+       appropriate components. The xsi:schemaLocation attribute is used to specify\r
+       the location of the file that contains the schema that defines the namespace.\r
+       The xsi:schemaLocation attribute is optional and is ommitted.  By definition of\r
+       the composite schemas the appropriate namespaces and related files where those\r
+       namespaces are defined are brought into scope.  Some XML parsers may require\r
+       these import statements to contain the optional xsi:schemaLocation attribute.</xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="../unique/loose.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="../extend/custom.xsd"/>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab" schemaLocation="../vocab/loose.xsd"/>\r
+       <!-- Vocabulary type declarations -->\r
+       <!-- Source -->\r
+       <xs:complexType name="sourceValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:source">\r
+                               <xs:attributeGroup ref="ag:source"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structureVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="structureValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="structureValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:structure">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="aggregationLevelValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="aggregationLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:aggregationLevel">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="statusVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="statusValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="statusValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:status">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="roleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="roleValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="roleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:role">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMetaVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="roleMetaValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="roleMetaValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:roleMeta">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="typeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="typeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="typeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:type">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="nameVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="nameValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="nameValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:name">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="interactivityTypeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityType">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="learningResourceTypeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="learningResourceTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:learningResourceType">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="interactivityLevelValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityLevel">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensityVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="semanticDensityValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="semanticDensityValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:semanticDensity">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRoleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="intendedEndUserRoleValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="intendedEndUserRoleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:intendedEndUserRole">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="contextVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="contextValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="contextValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:context">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficultyVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="difficultyValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="difficultyValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:difficulty">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="costVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="costValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="costValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:cost">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictionsVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="copyrightAndOtherRestrictionsValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="copyrightAndOtherRestrictionsValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:copyrightAndOtherRestrictions">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kindVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="kindValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="kindValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:kind">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purposeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue"/>\r
+                       <xs:element name="value" type="purposeValue"/>\r
+                       <xs:group ref="ex:customElements"/>\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes"/>\r
+       </xs:complexType>\r
+       <xs:complexType name="purposeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:purpose">\r
+                               <xs:attributeGroup ref="ag:value"/>\r
+                               <xs:attributeGroup ref="ex:customAttributes"/>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/common/vocabValues.xsd b/docs/home/ims/domainProfile_2/common/vocabValues.xsd
new file mode 100644 (file)
index 0000000..f31f18e
--- /dev/null
@@ -0,0 +1,266 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides global type declarations for the standard\r
+         LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from\r
+         a Vocabulary data type.\r
+\r
+         This component schema defintion defines the stanard vocabulary value\r
+         declarations as defined in the LOMv1.0 base schema.  These vocabulary\r
+         value declarations are used in conjunction with both vocab/custom.xsd and\r
+         vocab/loose.xsd.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- LOMv1.0 base schema vocabulary source and value declarations -->\r
+\r
+   <!-- Source -->\r
+   <xs:simpleType name="sourceValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="LOMv1.0"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:simpleType name="structureValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="atomic"/>\r
+         <xs:enumeration value="collection"/>\r
+         <xs:enumeration value="networked"/>\r
+         <xs:enumeration value="hierarchical"/>\r
+         <xs:enumeration value="linear"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:simpleType name="aggregationLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="1"/>\r
+         <xs:enumeration value="2"/>\r
+         <xs:enumeration value="3"/>\r
+         <xs:enumeration value="4"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:simpleType name="statusValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="draft"/>\r
+         <xs:enumeration value="final"/>\r
+         <xs:enumeration value="revised"/>\r
+         <xs:enumeration value="unavailable"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:simpleType name="roleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="author"/>\r
+         <xs:enumeration value="publisher"/>\r
+         <xs:enumeration value="unknown"/>\r
+         <xs:enumeration value="initiator"/>\r
+         <xs:enumeration value="terminator"/>\r
+         <xs:enumeration value="validator"/>\r
+         <xs:enumeration value="editor"/>\r
+         <xs:enumeration value="graphical designer"/>\r
+         <xs:enumeration value="technical implementer"/>\r
+         <xs:enumeration value="content provider"/>\r
+         <xs:enumeration value="technical validator"/>\r
+         <xs:enumeration value="educational validator"/>\r
+         <xs:enumeration value="script writer"/>\r
+         <xs:enumeration value="instructional designer"/>\r
+         <xs:enumeration value="subject matter expert"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:simpleType name="roleMetaValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="creator"/>\r
+         <xs:enumeration value="validator"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:simpleType name="typeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="operating system"/>\r
+         <xs:enumeration value="browser"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:simpleType name="nameValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="pc-dos"/>\r
+         <xs:enumeration value="ms-windows"/>\r
+         <xs:enumeration value="macos"/>\r
+         <xs:enumeration value="unix"/>\r
+         <xs:enumeration value="multi-os"/>\r
+         <xs:enumeration value="none"/>\r
+         <xs:enumeration value="any"/>\r
+         <xs:enumeration value="netscape communicator"/>\r
+         <xs:enumeration value="ms-internet explorer"/>\r
+         <xs:enumeration value="opera"/>\r
+         <xs:enumeration value="amaya"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:simpleType name="interactivityTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="active"/>\r
+         <xs:enumeration value="expositive"/>\r
+         <xs:enumeration value="mixed"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:simpleType name="learningResourceTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="exercise"/>\r
+         <xs:enumeration value="simulation"/>\r
+         <xs:enumeration value="questionnaire"/>\r
+         <xs:enumeration value="diagram"/>\r
+         <xs:enumeration value="figure"/>\r
+         <xs:enumeration value="graph"/>\r
+         <xs:enumeration value="index"/>\r
+         <xs:enumeration value="slide"/>\r
+         <xs:enumeration value="table"/>\r
+         <xs:enumeration value="narrative text"/>\r
+         <xs:enumeration value="exam"/>\r
+         <xs:enumeration value="experiment"/>\r
+         <xs:enumeration value="problem statement"/>\r
+         <xs:enumeration value="self assessment"/>\r
+         <xs:enumeration value="lecture"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:simpleType name="interactivityLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low"/>\r
+         <xs:enumeration value="low"/>\r
+         <xs:enumeration value="medium"/>\r
+         <xs:enumeration value="high"/>\r
+         <xs:enumeration value="very high"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:simpleType name="semanticDensityValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low"/>\r
+         <xs:enumeration value="low"/>\r
+         <xs:enumeration value="medium"/>\r
+         <xs:enumeration value="high"/>\r
+         <xs:enumeration value="very high"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:simpleType name="intendedEndUserRoleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="teacher"/>\r
+         <xs:enumeration value="author"/>\r
+         <xs:enumeration value="learner"/>\r
+         <xs:enumeration value="manager"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:simpleType name="contextValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="school"/>\r
+         <xs:enumeration value="higher education"/>\r
+         <xs:enumeration value="training"/>\r
+         <xs:enumeration value="other"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:simpleType name="difficultyValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very easy"/>\r
+         <xs:enumeration value="easy"/>\r
+         <xs:enumeration value="medium"/>\r
+         <xs:enumeration value="difficult"/>\r
+         <xs:enumeration value="very difficult"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:simpleType name="costValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes"/>\r
+         <xs:enumeration value="no"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:simpleType name="copyrightAndOtherRestrictionsValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes"/>\r
+         <xs:enumeration value="no"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:simpleType name="kindValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="ispartof"/>\r
+         <xs:enumeration value="haspart"/>\r
+         <xs:enumeration value="isversionof"/>\r
+         <xs:enumeration value="hasversion"/>\r
+         <xs:enumeration value="isformatof"/>\r
+         <xs:enumeration value="hasformat"/>\r
+         <xs:enumeration value="references"/>\r
+         <xs:enumeration value="isreferencedby"/>\r
+         <xs:enumeration value="isbasedon"/>\r
+         <xs:enumeration value="isbasisfor"/>\r
+         <xs:enumeration value="requires"/>\r
+         <xs:enumeration value="isrequiredby"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:simpleType name="purposeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="discipline"/>\r
+         <xs:enumeration value="idea"/>\r
+         <xs:enumeration value="prerequisite"/>\r
+         <xs:enumeration value="educational objective"/>\r
+         <xs:enumeration value="accessibility restrictions"/>\r
+         <xs:enumeration value="educational level"/>\r
+         <xs:enumeration value="skill level"/>\r
+         <xs:enumeration value="security level"/>\r
+         <xs:enumeration value="competency"/>\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/dataTypes_localised.xsd b/docs/home/ims/domainProfile_2/dataTypes_localised.xsd
new file mode 100644 (file)
index 0000000..35ea033
--- /dev/null
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** dataTypes.xsd                                                       **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_mR_definition.xsd" />\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion defines global schema data type declarations\r
+         for data types defined in the LOMv1.0 base schema.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="./unique/loose.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="./extend/custom.xsd" />\r
+        <xs:include schemaLocation="elementTypes_localised.xsd" />\r
+       <!-- Data type declarations -->\r
+       <!-- CharacterString -->\r
+       <xs:simpleType name="CharacterString">\r
+               <xs:restriction base="xs:string" />\r
+       </xs:simpleType>\r
+       <!-- LanguageId -->\r
+       <xs:complexType name="LanguageId">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:language">\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- VCard -->\r
+       <xs:complexType name="VCard">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- MimeType -->\r
+       <xs:simpleType name="MimeType">\r
+               <xs:restriction base="CharacterString" />\r
+       </xs:simpleType>\r
+       <!-- Size -->\r
+       <xs:simpleType name="Size">\r
+               <xs:restriction base="xs:nonNegativeInteger" />\r
+       </xs:simpleType>\r
+       <!-- LanguageString -->\r
+       <xs:complexType name="LanguageString">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="string" type="LangString" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="LangString">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attribute name="language" type="xs:language" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- DateTime -->\r
+       <xs:complexType name="DateTime">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="dateTime" type="DateTimeValue" />\r
+                       <xs:element name="description" type="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DateTimeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DateTimeString">\r
+                               <xs:attributeGroup ref="ag:DateTimeValue" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DateTimeString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]|[0-9][1-9][0-9]{2}|[1-9][0-9]{3})(\-(0[1-9]|1[0-2])(\-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9](:[0-5][0-9](\.[0-9]{1,}(Z|((\+|\-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?)?)?)?)?)?)?" />\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       <!-- Duration -->\r
+       <xs:complexType name="Duration">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="duration" type="DurationValue" />\r
+                       <xs:element name="description" type="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <xs:complexType name="DurationValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="DurationString">\r
+                               <xs:attributeGroup ref="ag:DurationValue" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- Regular expresion from Christian Klaue -->\r
+       <xs:simpleType name="DurationString">\r
+               <xs:restriction base="CharacterString">\r
+                       <xs:pattern value="P([0-9]{1,}Y){0,1}([0-9]{1,}M){0,1}([0-9]{1,}D){0,1}(T([0-9]{1,}H){0,1}([0-9]{1,}M){0,1}([0-9]{1,}(\.[0-9]{1,}){0,1}S){0,1}){0,1}" />\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/elementNames_localised.xsd b/docs/home/ims/domainProfile_2/elementNames_localised.xsd
new file mode 100644 (file)
index 0000000..dd1b9ee
--- /dev/null
@@ -0,0 +1,787 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** elementNames.xsd                                                    **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion defines global element declarations for\r
+         each of the data elements defined in the LOMv1.0 base schema.  This component\r
+         schema definition is used to check for the uniqueness of elements declared\r
+         to be unique within their parent elements by the presence of the\r
+         "uniqueElementName" attribute.  The XML Schema constraint "unique" is used\r
+         to enforce uniqueness constraints.\r
+\r
+         Duplicate declarations are included as comments for completeness.  These\r
+         declarations should remain commented out or they can be removed completely.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Duplicate declarations are included as comments. -->\r
+\r
+   <!-- 1 General -->\r
+   <xs:group name="general">\r
+      <xs:sequence>\r
+         <xs:element name="general" type="general">\r
+            <xs:unique name="generalUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1 Identifier -->\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.1 Catalog -->\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.1.2 Entry -->\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.2 Title -->\r
+   <xs:group name="title">\r
+      <xs:sequence>\r
+         <xs:element name="title" type="title" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.3 Language-->\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.4 Description -->\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.5 Keyword -->\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.6 Coverage -->\r
+   <xs:group name="coverage">\r
+      <xs:sequence>\r
+         <xs:element name="coverage" type="coverage" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:group name="structure">\r
+      <xs:sequence>\r
+         <xs:element name="structure" type="structure">\r
+            <xs:unique name="structureUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:group name="aggregationLevel">\r
+      <xs:sequence>\r
+         <xs:element name="aggregationLevel" type="aggregationLevel">\r
+            <xs:unique name="aggregationLevelUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2 Life Cycle -->\r
+   <xs:group name="lifeCycle">\r
+      <xs:sequence>\r
+         <xs:element name="lifeCycle" type="lifeCycle">\r
+            <xs:unique name="lifeCycleUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.1 Version -->\r
+   <xs:group name="version">\r
+      <xs:sequence>\r
+         <xs:element name="version" type="version" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:group name="status">\r
+      <xs:sequence>\r
+         <xs:element name="status" type="status">\r
+            <xs:unique name="statusUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3 Contribute -->\r
+   <xs:group name="contribute">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contribute">\r
+            <xs:unique name="contributeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:group name="role">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="role">\r
+            <xs:unique name="roleUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 2.3.2 Entity -->\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:group name="date">\r
+     <xs:sequence>\r
+        <xs:element name="date" type="date">\r
+           <xs:unique name="dateUnique">\r
+              <xs:selector xpath="*" />\r
+              <xs:field xpath="@uniqueElementName" />\r
+           </xs:unique>\r
+        </xs:element>\r
+     </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3 Meta-Metadata -->\r
+   <xs:group name="metaMetadata">\r
+      <xs:sequence>\r
+         <xs:element name="metaMetadata" type="metaMetadata">\r
+            <xs:unique name="metaMetadataUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2 Contribute -->\r
+   <xs:group name="contributeMeta">\r
+      <xs:sequence>\r
+         <xs:element name="contribute" type="contributeMeta">\r
+            <xs:unique name="contributeMetaUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:group name="roleMeta">\r
+      <xs:sequence>\r
+         <xs:element name="role" type="roleMeta">\r
+            <xs:unique name="roleMetaUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.2.2 Entity\r
+   <xs:group name="entityUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="VCard"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.2.3 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 3.3 Metadata Schema -->\r
+   <xs:group name="metadataSchema">\r
+      <xs:sequence>\r
+         <xs:element name="metadataSchema" type="metadataSchema" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 3.4 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 4 Technical -->\r
+   <xs:group name="technical">\r
+      <xs:sequence>\r
+         <xs:element name="technical" type="technical">\r
+            <xs:unique name="technicalUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.1 Format -->\r
+  <xs:group name="format">\r
+      <xs:sequence>\r
+         <xs:element name="format" type="format" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.2 Size -->\r
+   <xs:group name="size">\r
+      <xs:sequence>\r
+         <xs:element name="size" type="size" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.3 Location -->\r
+   <xs:group name="location">\r
+      <xs:sequence>\r
+         <xs:element name="location" type="location" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4 Requirement -->\r
+   <xs:group name="requirement">\r
+      <xs:sequence>\r
+         <xs:element name="requirement" type="requirement" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1 OrComposite -->\r
+   <xs:group name="orComposite">\r
+      <xs:sequence>\r
+         <xs:element name="orComposite" type="orComposite">\r
+            <xs:unique name="orCompositeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:group name="type">\r
+      <xs:sequence>\r
+         <xs:element name="type" type="type">\r
+            <xs:unique name="typeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:group name="name">\r
+      <xs:sequence>\r
+         <xs:element name="name" type="name">\r
+            <xs:unique name="nameUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.3 Minimum Version -->\r
+   <xs:group name="minimumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="minimumVersion" type="minimumVersion" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.4.1.4 Maximum Version -->\r
+   <xs:group name="maximumVersion">\r
+      <xs:sequence>\r
+         <xs:element name="maximumVersion" type="maximumVersion" />\r
+      </xs:sequence>\r
+    </xs:group>\r
+\r
+   <!-- 4.5 Installation Remarks -->\r
+   <xs:group name="installationRemarks">\r
+      <xs:sequence>\r
+         <xs:element name="installationRemarks" type="installationRemarks" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.6 Other Platform Requirements -->\r
+   <xs:group name="otherPlatformRequirements">\r
+      <xs:sequence>\r
+         <xs:element name="otherPlatformRequirements" type="otherPlatformRequirements" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 4.7 Duration -->\r
+   <xs:group name="duration">\r
+      <xs:sequence>\r
+         <xs:element name="duration" type="duration">\r
+            <xs:unique name="durationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5 Educational -->\r
+   <xs:group name="educational">\r
+      <xs:sequence>\r
+         <xs:element name="educational" type="educational">\r
+            <xs:unique name="educationalUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:group name="interactivityType">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityType" type="interactivityType">\r
+            <xs:unique name="interactivityTypeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:group name="learningResourceType">\r
+      <xs:sequence>\r
+         <xs:element name="learningResourceType" type="learningResourceType">\r
+            <xs:unique name="learningResourceTypeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:group name="interactivityLevel">\r
+      <xs:sequence>\r
+         <xs:element name="interactivityLevel" type="interactivityLevel">\r
+            <xs:unique name="interactivityLevelUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:group name="semanticDensity">\r
+      <xs:sequence>\r
+         <xs:element name="semanticDensity" type="semanticDensity">\r
+            <xs:unique name="semanticDensityUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:group name="intendedEndUserRole">\r
+      <xs:sequence>\r
+         <xs:element name="intendedEndUserRole" type="intendedEndUserRole">\r
+            <xs:unique name="intendedEndUserRoleUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:group name="context">\r
+      <xs:sequence>\r
+         <xs:element name="context" type="context">\r
+            <xs:unique name="contextUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.7 Typical Age Range -->\r
+   <xs:group name="typicalAgeRange">\r
+      <xs:sequence>\r
+         <xs:element name="typicalAgeRange" type="typicalAgeRange" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:group name="difficulty">\r
+      <xs:sequence>\r
+         <xs:element name="difficulty" type="difficulty">\r
+            <xs:unique name="difficultyUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.9 Typical Learning Time -->\r
+   <xs:group name="typicalLearningTime">\r
+      <xs:sequence>\r
+         <xs:element name="typicalLearningTime" type="typicalLearningTime">\r
+            <xs:unique name="typicalLearningTimeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 5.10 Description\r
+   <xs:group name="descriptionUnbounded">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="LanguageString"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 5.11 Language\r
+   <xs:group name="language">\r
+      <xs:sequence>\r
+         <xs:element name="language" type="LanguageId"/>\r
+      </xs:sequence>\r
+   </xs:group>-->\r
+\r
+   <!-- 6 Rights -->\r
+   <xs:group name="rights">\r
+      <xs:sequence>\r
+         <xs:element name="rights" type="rights">\r
+            <xs:unique name="rightsUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:group name="cost">\r
+      <xs:sequence>\r
+         <xs:element name="cost" type="cost">\r
+            <xs:unique name="costUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:group name="copyrightAndOtherRestrictions">\r
+      <xs:sequence>\r
+         <xs:element name="copyrightAndOtherRestrictions" type="copyrightAndOtherRestrictions">\r
+            <xs:unique name="copyrightAndOtherRestrictionsUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 6.3 Description -->\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7 Relation -->\r
+   <xs:group name="relation">\r
+      <xs:sequence>\r
+         <xs:element name="relation" type="relation">\r
+            <xs:unique name="relationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:group name="kind">\r
+      <xs:sequence>\r
+         <xs:element name="kind" type="kind">\r
+            <xs:unique name="kindUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2 Resource -->\r
+   <xs:group name="resource">\r
+      <xs:sequence>\r
+         <xs:element name="resource" type="resource" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 7.2.1 Identifier\r
+   <xs:group name="identifier">\r
+      <xs:sequence>\r
+         <xs:element name="identifier" type="identifier">\r
+            <xs:unique name="identifierUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.1 Catalog\r
+   <xs:group name="catalog">\r
+      <xs:sequence>\r
+         <xs:element name="catalog" type="catalog"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.1.2 Entry\r
+   <xs:group name="entry">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entry"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 7.2.2 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8 Annotation -->\r
+   <xs:group name="annotation">\r
+      <xs:sequence>\r
+         <xs:element name="annotation" type="annotation">\r
+            <xs:unique name="annotationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.1 Entity -->\r
+   <xs:group name="entity">\r
+      <xs:sequence>\r
+         <xs:element name="entity" type="entity" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 8.2 Date\r
+   <xs:group name="date">\r
+      <xs:sequence>\r
+         <xs:element name="date" type="date">\r
+            <xs:unique name="dateUnique">\r
+               <xs:selector xpath="*"/>\r
+               <xs:field xpath="@uniqueElementName"/>\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 8.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9 Classification -->\r
+   <xs:group name="classification">\r
+      <xs:sequence>\r
+         <xs:element name="classification" type="classification">\r
+            <xs:unique name="classificationUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:group name="purpose">\r
+      <xs:sequence>\r
+         <xs:element name="purpose" type="purpose">\r
+            <xs:unique name="purposeUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2 Taxon Path -->\r
+   <xs:group name="taxonPath">\r
+      <xs:sequence>\r
+         <xs:element name="taxonPath" type="taxonPath">\r
+            <xs:unique name="taxonPathUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.1 Source -->\r
+   <xs:group name="source">\r
+      <xs:sequence>\r
+         <xs:element name="source" type="source" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2 Taxon -->\r
+   <xs:group name="taxon">\r
+      <xs:sequence>\r
+         <xs:element name="taxon" type="taxon">\r
+            <xs:unique name="taxonUnique">\r
+               <xs:selector xpath="*" />\r
+               <xs:field xpath="@uniqueElementName" />\r
+            </xs:unique>\r
+         </xs:element>\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.1 Id -->\r
+   <xs:group name="id">\r
+      <xs:sequence>\r
+         <xs:element name="id" type="id" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.2.2.2 Entry -->\r
+   <xs:group name="entryTaxon">\r
+      <xs:sequence>\r
+         <xs:element name="entry" type="entryTaxon" />\r
+      </xs:sequence>\r
+   </xs:group>\r
+\r
+   <!-- 9.3 Description\r
+   <xs:group name="description">\r
+      <xs:sequence>\r
+         <xs:element name="description" type="description"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+   <!-- 9.4 Keyword\r
+   <xs:group name="keyword">\r
+      <xs:sequence>\r
+         <xs:element name="keyword" type="keyword"/>\r
+      </xs:sequence>\r
+   </xs:group> -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/elementTypes_localised.xsd b/docs/home/ims/domainProfile_2/elementTypes_localised.xsd
new file mode 100644 (file)
index 0000000..9b9f77b
--- /dev/null
@@ -0,0 +1,806 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** elementTypes.xsd                                                    **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_mR_definition.xsd" />\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+               <xs:documentation>\r
+       This component schema defintion defines global schema data type declarations\r
+       for data elements defined in the LOMv1.0 base schema.  This component XSD\r
+       defines the aggregation relationship among the LOM data elements.  These aggregation\r
+       relationships enforce the LOMv1.0 base schema requirement that elements can only\r
+       be present in a LOM XML instance as elements of the aggregate element to which they\r
+       belong.\r
+\r
+       Duplicate declarations are included as comments for completeness.  These declarations\r
+       should remain commented out or they can be removed completely.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="./unique/loose.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="./extend/custom.xsd" />\r
+       <!-- Element type declarations -->\r
+       <!-- Learning Object Metadata -->\r
+       <xs:complexType name="lom">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="general" />\r
+                       <xs:group ref="lifeCycle" />\r
+                       <xs:group ref="metaMetadata" />\r
+                       <xs:group ref="technical" />\r
+                       <xs:group ref="educational" />\r
+                       <xs:group ref="rights" />\r
+                       <xs:group ref="relation" />\r
+                       <xs:group ref="annotation" />\r
+                       <xs:group ref="classification" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lom" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 1 General -->\r
+       <xs:complexType name="general">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier" />\r
+                       <xs:group ref="title" />\r
+                       <xs:group ref="language" />\r
+                       <xs:group ref="descriptionUnbounded" />\r
+                       <xs:group ref="keyword" />\r
+                       <xs:group ref="coverage" />\r
+                       <xs:group ref="structure" />\r
+                       <xs:group ref="aggregationLevel" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:general" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 1.1 Identifier -->\r
+       <xs:complexType name="identifier">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="catalog" />\r
+                       <xs:group ref="entry" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:identifier" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 1.1.1 Catalog -->\r
+       <xs:complexType name="catalog">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:catalog" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.1.2 Entry -->\r
+       <xs:complexType name="entry">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:entry" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.2 Title -->\r
+       <xs:complexType name="title">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:title" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.3 Language -->\r
+       <xs:complexType name="language">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageId">\r
+                               <xs:attributeGroup ref="ag:language" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.4 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 1.5 Keyword -->\r
+       <xs:complexType name="keyword">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:keyword" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.6 Coverage -->\r
+       <xs:complexType name="coverage">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:coverage" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structure">\r
+               <xs:complexContent>\r
+                       <xs:extension base="structureVocab">\r
+                               <xs:attributeGroup ref="ag:structure" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="aggregationLevelVocab">\r
+                               <xs:attributeGroup ref="ag:aggregationLevel" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2 Life Cycle -->\r
+       <xs:complexType name="lifeCycle">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="version" />\r
+                       <xs:group ref="status" />\r
+                       <xs:group ref="contribute" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:lifeCycle" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 2.1 Version -->\r
+       <xs:complexType name="version">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:version" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="status">\r
+               <xs:complexContent>\r
+                       <xs:extension base="statusVocab">\r
+                               <xs:attributeGroup ref="ag:status" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3 Contribute -->\r
+       <xs:complexType name="contribute">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="role" />\r
+                       <xs:group ref="entityUnbounded" />\r
+                       <xs:group ref="date" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="role">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleVocab">\r
+                               <xs:attributeGroup ref="ag:role" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 2.3.3 Date -->\r
+       <xs:complexType name="date">\r
+               <xs:complexContent>\r
+                       <xs:extension base="DateTime">\r
+                               <xs:attributeGroup ref="ag:date" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3 Meta-Metadata -->\r
+       <xs:complexType name="metaMetadata">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier" />\r
+                       <xs:group ref="contributeMeta" />\r
+                       <xs:group ref="metadataSchema" />\r
+                       <xs:group ref="language" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:metaMetadata" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 3.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2 Contribute -->\r
+       <xs:complexType name="contributeMeta">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="roleMeta" />\r
+                       <xs:group ref="entityUnbounded" />\r
+                       <xs:group ref="date" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:contribute" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMeta">\r
+               <xs:complexContent>\r
+                       <xs:extension base="roleMetaVocab">\r
+                               <xs:attributeGroup ref="ag:role" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.2 Entity\r
+  <xs:complexType name="entity">\r
+    <xs:simpleContent>\r
+      <xs:extension base="VCard">\r
+        <xs:attributeGroup ref="ag:entity"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.2.3 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 3.3 Metadata Schema -->\r
+       <xs:complexType name="metadataSchema">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:metadataSchema" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.4 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>-->\r
+       <!-- 4 Technical -->\r
+       <xs:complexType name="technical">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="format" />\r
+                       <xs:group ref="size" />\r
+                       <xs:group ref="location" />\r
+                       <xs:group ref="requirement" />\r
+                       <xs:group ref="installationRemarks" />\r
+                       <xs:group ref="otherPlatformRequirements" />\r
+                       <xs:group ref="duration" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:technical" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 4.1 Format -->\r
+       <xs:complexType name="format">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="MimeType">\r
+                               <xs:attributeGroup ref="ag:format" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.2 Size -->\r
+       <xs:complexType name="size">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="Size">\r
+                               <xs:attributeGroup ref="ag:size" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.3 Location -->\r
+       <xs:complexType name="location">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:location" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4 Requirement -->\r
+       <xs:complexType name="requirement">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="orComposite" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:requirement" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 4.4.1 OrComposite -->\r
+       <xs:complexType name="orComposite">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="type" />\r
+                       <xs:group ref="name" />\r
+                       <xs:group ref="minimumVersion" />\r
+                       <xs:group ref="maximumVersion" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:orComposite" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="type">\r
+               <xs:complexContent>\r
+                       <xs:extension base="typeVocab">\r
+                               <xs:attributeGroup ref="ag:type" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="name">\r
+               <xs:complexContent>\r
+                       <xs:extension base="nameVocab">\r
+                               <xs:attributeGroup ref="ag:name" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.3 Minimum Version -->\r
+       <xs:complexType name="minimumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:minimumVersion" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.4 Maximum Version -->\r
+       <xs:complexType name="maximumVersion">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:maximumVersion" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.5 Installation Remarks -->\r
+       <xs:complexType name="installationRemarks">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:installationRemarks" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.6 Other Platform Requirements -->\r
+       <xs:complexType name="otherPlatformRequirements">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:otherPlatformRequirements" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 4.7 Duration -->\r
+       <xs:complexType name="duration">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:duration" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5 Educational -->\r
+       <xs:complexType name="educational">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="interactivityType" />\r
+                       <xs:group ref="learningResourceType" />\r
+                       <xs:group ref="interactivityLevel" />\r
+                       <xs:group ref="semanticDensity" />\r
+                       <xs:group ref="intendedEndUserRole" />\r
+                       <xs:group ref="context" />\r
+                       <xs:group ref="typicalAgeRange" />\r
+                       <xs:group ref="difficulty" />\r
+                       <xs:group ref="typicalLearningTime" />\r
+                       <xs:group ref="descriptionUnbounded" />\r
+                       <xs:group ref="language" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:educational" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityTypeVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityType" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceType">\r
+               <xs:complexContent>\r
+                       <xs:extension base="learningResourceTypeVocab">\r
+                               <xs:attributeGroup ref="ag:learningResourceType" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevel">\r
+               <xs:complexContent>\r
+                       <xs:extension base="interactivityLevelVocab">\r
+                               <xs:attributeGroup ref="ag:interactivityLevel" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="semanticDensityVocab">\r
+                               <xs:attributeGroup ref="ag:semanticDensity" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRoleVocab_copy">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue18311" />\r
+                       <xs:element name="value" type="intendedEndUserRoleValue18313" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+\r
+<xs:complexType name="intendedEndUserRole">\r
+               <xs:complexContent>\r
+                       <xs:extension base="intendedEndUserRoleVocab_copy">\r
+                               <xs:attributeGroup ref="ag:intendedEndUserRole" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="contextVocab_copy">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue18711" />\r
+                       <xs:element name="value" type="contextValue18713" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+\r
+<xs:complexType name="context">\r
+               <xs:complexContent>\r
+                       <xs:extension base="contextVocab_copy">\r
+                               <xs:attributeGroup ref="ag:context" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.7 Typical Age Range -->\r
+       <xs:complexType name="typicalAgeRange">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:typicalAgeRange" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficulty">\r
+               <xs:complexContent>\r
+                       <xs:extension base="difficultyVocab">\r
+                               <xs:attributeGroup ref="ag:difficulty" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.9 Typical Learning Time -->\r
+       <xs:complexType name="typicalLearningTime">\r
+               <xs:complexContent>\r
+                       <xs:extension base="Duration">\r
+                               <xs:attributeGroup ref="ag:typicalLearningTime" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 5.10 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 5.11 Language\r
+  <xs:complexType name="language">\r
+    <xs:simpleContent>\r
+      <xs:extension base="LanguageId">\r
+        <xs:attributeGroup ref="ag:language"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 6 Rights -->\r
+       <xs:complexType name="rights">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="cost" />\r
+                       <xs:group ref="copyrightAndOtherRestrictions" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:rights" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="cost">\r
+               <xs:complexContent>\r
+                       <xs:extension base="costVocab">\r
+                               <xs:attributeGroup ref="ag:cost" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictions">\r
+               <xs:complexContent>\r
+                       <xs:extension base="copyrightAndOtherRestrictionsVocab">\r
+                               <xs:attributeGroup ref="ag:copyrightAndOtherRestrictions" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 6.3 Description -->\r
+       <xs:complexType name="description">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:description" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7 Relation -->\r
+       <xs:complexType name="relation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="kind" />\r
+                       <xs:group ref="resource" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:relation" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kind">\r
+               <xs:complexContent>\r
+                       <xs:extension base="kindVocab">\r
+                               <xs:attributeGroup ref="ag:kind" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 7.2 Resource -->\r
+       <xs:complexType name="resource">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="identifier" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:resource" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 7.2.1 Identifier\r
+  <xs:complexType name="identifier">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:group ref="catalog"/>\r
+      <xs:group ref="entry"/>\r
+      <xs:group ref="ex:customElements"/>\r
+    </xs:choice>\r
+    <xs:attributeGroup ref="ag:identifier"/>\r
+    <xs:attributeGroup ref="ex:customAttributes"/>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.1 Catalog\r
+  <xs:complexType name="catalog">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:catalog"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.1.2 Entry\r
+  <xs:complexType name="entry">\r
+    <xs:simpleContent>\r
+      <xs:extension base="CharacterString">\r
+        <xs:attributeGroup ref="ag:entry"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType> -->\r
+       <!-- 7.2.2 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8 Annotation -->\r
+       <xs:complexType name="annotation">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="entity" />\r
+                       <xs:group ref="date" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:annotation" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 8.1 Entity -->\r
+       <xs:complexType name="entity">\r
+               <xs:complexContent>\r
+                       <xs:extension base="VCard">\r
+                               <xs:attributeGroup ref="ag:entity" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 8.2 Date\r
+  <xs:complexType name="date">\r
+    <xs:complexContent>\r
+      <xs:extension base="DateTime">\r
+        <xs:attributeGroup ref="ag:date"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 8.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9 Classification -->\r
+       <xs:complexType name="classification">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="purpose" />\r
+                       <xs:group ref="taxonPath" />\r
+                       <xs:group ref="description" />\r
+                       <xs:group ref="keyword" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:classification" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purpose">\r
+               <xs:complexContent>\r
+                       <xs:extension base="purposeVocab">\r
+                               <xs:attributeGroup ref="ag:purpose" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2 Taxon Path -->\r
+       <xs:complexType name="taxonPath">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="source" />\r
+                       <xs:group ref="taxon" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxonPath" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 9.2.1 Source -->\r
+       <xs:complexType name="source">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:source" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2 Taxon -->\r
+       <xs:complexType name="taxon">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:group ref="id" />\r
+                       <xs:group ref="entryTaxon" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ag:taxon" />\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <!-- 9.2.2.1 Id -->\r
+       <xs:complexType name="id">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="CharacterString">\r
+                               <xs:attributeGroup ref="ag:id" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.2.2.2 Entry -->\r
+       <xs:complexType name="entryTaxon">\r
+               <xs:complexContent>\r
+                       <xs:extension base="LanguageString">\r
+                               <xs:attributeGroup ref="ag:entry" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:complexContent>\r
+       </xs:complexType>\r
+       <!-- 9.3 Description\r
+  <xs:complexType name="description">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:description"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+       <!-- 9.4 Keyword\r
+  <xs:complexType name="keyword">\r
+    <xs:complexContent>\r
+      <xs:extension base="LanguageString">\r
+        <xs:attributeGroup ref="ag:keyword"/>\r
+        <xs:attributeGroup ref="ex:customAttributes"/>\r
+      </xs:extension>\r
+    </xs:complexContent>\r
+  </xs:complexType> -->\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/extend/custom.xsd b/docs/home/ims/domainProfile_2/extend/custom.xsd
new file mode 100644 (file)
index 0000000..611012e
--- /dev/null
@@ -0,0 +1,52 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM/extend"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM/extend"\r
+           xmlns:lom="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema defines the XML Schema content model groups customElements\r
+       and customAttributes to support validation of extension XML elements and attributes.\r
+\r
+       This component XSD should be used if extensions are to be supported in LOM\r
+       XML instances.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+\r
+  </xs:annotation>\r
+\r
+  <xs:import namespace="http://ltsc.ieee.org/xsd/LOM" schemaLocation="../lomLoose_localised.xsd"/>\r
+\r
+  <!-- Model group declarations -->\r
+\r
+  <xs:group name="customElements">\r
+    <xs:choice>\r
+      <xs:group ref="lom:customElements"/>\r
+    </xs:choice>\r
+  </xs:group>\r
+\r
+  <xs:attributeGroup name="customAttributes">\r
+     <xs:anyAttribute namespace="##other" processContents="lax" />\r
+  </xs:attributeGroup>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/imscc_mR_definition.xsd b/docs/home/ims/domainProfile_2/imscc_mR_definition.xsd
new file mode 100644 (file)
index 0000000..9b82a7b
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:voc="http://ltsc.ieee.org/xsd/LOM/vocab" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM">\r
+<xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab" schemaLocation="vocab/loose.xsd"/>\r
+  <!--****************************************************************************************-->\r
+  <!--** Definition document - this document holds AP defined simpleType elements that have **-->\r
+  <!--** been referenced through a type attribute in one of the modified, resultant schema. **-->\r
+  <!--****************************************************************************************-->\r
+  <xs:simpleType name="RolesValues">\r
+    <xs:restriction base="voc:intendedEndUserRole">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="Learner" />\r
+      <xs:enumeration value="Instructor" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="RoleVocab">\r
+    <xs:restriction base="voc:source">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="IMSGLC_CC_Rolesv1p0" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="HEContext">\r
+    <xs:restriction base="voc:context">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="higher education" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="SourceIEELOM">\r
+    <xs:restriction base="voc:source">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="LOMv1.0" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xsd:schema>\r
+\r
diff --git a/docs/home/ims/domainProfile_2/lomLoose.xsd b/docs/home/ims/domainProfile_2/lomLoose.xsd
new file mode 100644 (file)
index 0000000..791eb7c
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:voc="http://ltsc.ieee.org/xsd/LOM/vocab" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+        <xs:documentation>\r
+         This file represents a composite schema for validating\r
+         LOM XML Instances.  This file is built by default to represent a\r
+         composite schema for validation of the following:\r
+\r
+         1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary\r
+            source/value pairs only\r
+         2) Uniqueness constraints defined by LOMv1.0 base schema\r
+         3) No existenace of any defined extensions:\r
+            LOMv1.0 base schema XML element extension,\r
+            LOMv1.0 base schema XML attribute extension and\r
+            LOMv1.0 base schema vocabulary data type extension\r
+\r
+         Alternative composite schemas can be assembled by selecting\r
+         from the various alternative component schema listed below.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+    </xs:annotation>\r
+    <!-- Learning Object Metadata -->\r
+    <xs:include schemaLocation="common/anyElement.xsd" />\r
+    <!-- LOM data element uniqueness constraints:  use one of the following         -->\r
+    <!-- Use unique/loose.xsd to relax element uniqueness constraints               -->\r
+    <!-- Use unique/strict.xsd to enforce element uniqueness constraints            -->\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique"
+              schemaLocation="unique/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="unique/loose.xsd" />\r
+\r
+    <!-- Vocabulary value validation:  use one of the following                     -->\r
+    <!-- Use vocab/loose.xsd to relax vocabulary value constraints                  -->\r
+    <!-- Use vocab/strict.xsd to enforce the LOMv1.0 base schema vocabulary values  -->\r
+    <!-- Use vocab/custom.xsd to enforce custom vocabulary values                   -->\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab"
+              schemaLocation="vocab/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab" schemaLocation="vocab/loose.xsd" />\r
+\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab"
+              schemaLocation="vocab/custom.xsd"/> -->\r
+    <!-- Extension elements/attributes support:  use one of the following           -->\r
+    <!-- Use extend/strict.xsd to enforce no element/attribute extension            -->\r
+    <!-- Use extend/custom.xsd to allow element/attribute extension                 -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="extend/custom.xsd" />\r
+\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend"
+              schemaLocation="extend/custom.xsd"/> -->\r
+    <xs:include schemaLocation="common/dataTypes.xsd" />\r
+    <xs:include schemaLocation="common/elementNames.xsd" />\r
+    <xs:include schemaLocation="common/elementTypes.xsd" />\r
+    <xs:include schemaLocation="common/rootElement.xsd" />\r
+    <xs:include schemaLocation="common/vocabValues.xsd" />\r
+    <xs:include schemaLocation="common/vocabTypes.xsd" />\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/lomLoose_localised.xsd b/docs/home/ims/domainProfile_2/lomLoose_localised.xsd
new file mode 100644 (file)
index 0000000..81ea05a
--- /dev/null
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** lomLoose_localised.xsd                                                        **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:voc="http://ltsc.ieee.org/xsd/LOM/vocab" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns="http://ltsc.ieee.org/xsd/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_mR_definition.xsd" />\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+        <xs:documentation>\r
+         This file represents a composite schema for validating\r
+         LOM XML Instances.  This file is built by default to represent a\r
+         composite schema for validation of the following:\r
+\r
+         1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary\r
+            source/value pairs only\r
+         2) Uniqueness constraints defined by LOMv1.0 base schema\r
+         3) No existenace of any defined extensions:\r
+            LOMv1.0 base schema XML element extension,\r
+            LOMv1.0 base schema XML attribute extension and\r
+            LOMv1.0 base schema vocabulary data type extension\r
+\r
+         Alternative composite schemas can be assembled by selecting\r
+         from the various alternative component schema listed below.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+    </xs:annotation>\r
+    <!-- Learning Object Metadata -->\r
+    <xs:include schemaLocation="anyElement_localised.xsd" />\r
+    <!-- LOM data element uniqueness constraints:  use one of the following         -->\r
+    <!-- Use unique/loose.xsd to relax element uniqueness constraints               -->\r
+    <!-- Use unique/strict.xsd to enforce element uniqueness constraints            -->\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique"\r
+              schemaLocation="unique/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="unique/loose.xsd" />\r
+\r
+    <!-- Vocabulary value validation:  use one of the following                     -->\r
+    <!-- Use vocab/loose.xsd to relax vocabulary value constraints                  -->\r
+    <!-- Use vocab/strict.xsd to enforce the LOMv1.0 base schema vocabulary values  -->\r
+    <!-- Use vocab/custom.xsd to enforce custom vocabulary values                   -->\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab"\r
+              schemaLocation="vocab/loose.xsd"/> -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab" schemaLocation="vocab/loose.xsd" />\r
+\r
+    <!-- <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab"\r
+              schemaLocation="vocab/custom.xsd"/> -->\r
+    <!-- Extension elements/attributes support:  use one of the following           -->\r
+    <!-- Use extend/strict.xsd to enforce no element/attribute extension            -->\r
+    <!-- Use extend/custom.xsd to allow element/attribute extension                 -->\r
+    <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="extend/custom.xsd" />\r
+\r
+    <!--<xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend"\r
+              schemaLocation="extend/custom.xsd"/> -->\r
+    <xs:include schemaLocation="dataTypes_localised.xsd" />\r
+    <xs:include schemaLocation="elementNames_localised.xsd" />\r
+    <xs:include schemaLocation="elementTypes_localised.xsd" />\r
+    <xs:include schemaLocation="rootElement_localised.xsd" />\r
+    <xs:include schemaLocation="vocabValues_localised.xsd" />\r
+    <xs:include schemaLocation="vocabTypes_localised.xsd" />\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/loose.xsd b/docs/home/ims/domainProfile_2/loose.xsd
new file mode 100644 (file)
index 0000000..a41244a
--- /dev/null
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM/unique" targetNamespace="http://ltsc.ieee.org/xsd/LOM/unique" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema definition provides attribute group declarations for\r
+       LOM data elements to support schema-based validation of uniqueness constraints\r
+       within a LOM XML instance where the exact set of attributes associated with each\r
+       element has to be as specified by the LOM XML Schema binding (i.e., where extra\r
+       attributes to enforce uniqueness have to be avoided).\r
+\r
+       Duplicate declarations are included as comments for completeness.  These\r
+       declarations should remain commented out or they can be removed completely.\r
+\r
+       NOTE: The absence of the enforcement of the uniqueness constraints does not\r
+       relieve a particular LOM XML instance from satisfying the uniqueness constraints\r
+       described in the LOMv1.0 base schema. Applications that require the use of\r
+       the unique/loose.xsd component XSD have to enforce those uniqueness constraints\r
+       by other means.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the\r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported\r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the\r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+\r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+  </xs:annotation>\r
+\r
+  <!-- Attribute group declarations -->\r
+\r
+  <!-- Duplicate declarations are included as comments. -->\r
+\r
+  <!-- Learning Object Metadata -->\r
+  <xs:attributeGroup name="lom" />\r
+\r
+  <!-- DateTime -->\r
+  <xs:attributeGroup name="DateTimeValue" />\r
+\r
+  <!-- Duration -->\r
+  <xs:attributeGroup name="DurationValue" />\r
+\r
+  <!-- Source -->\r
+  <xs:attributeGroup name="source" />\r
+\r
+  <!-- Value -->\r
+  <xs:attributeGroup name="value" />\r
+\r
+  <!-- 1 General -->\r
+  <xs:attributeGroup name="general" />\r
+\r
+  <!-- 1.1 Identifier -->\r
+  <xs:attributeGroup name="identifier" />\r
+\r
+  <!-- 1.1.1 Catalog -->\r
+  <xs:attributeGroup name="catalog" />\r
+\r
+  <!-- 1.1.2 Entry -->\r
+  <xs:attributeGroup name="entry" />\r
+\r
+  <!-- 1.2 Title -->\r
+  <xs:attributeGroup name="title" />\r
+\r
+  <!-- 1.3 Language -->\r
+  <xs:attributeGroup name="language" />\r
+\r
+  <!-- 1.4 Description -->\r
+  <xs:attributeGroup name="description" />\r
+\r
+  <!-- 1.5 Keyword -->\r
+  <xs:attributeGroup name="keyword" />\r
+\r
+  <!-- 1.6 Coverage -->\r
+  <xs:attributeGroup name="coverage" />\r
+\r
+  <!-- 1.7 Structure -->\r
+  <xs:attributeGroup name="structure" />\r
+\r
+  <!-- 1.8 Aggregation Level -->\r
+  <xs:attributeGroup name="aggregationLevel" />\r
+\r
+  <!-- 2 Life Cycle -->\r
+  <xs:attributeGroup name="lifeCycle" />\r
+\r
+  <!-- 2.1 Version -->\r
+  <xs:attributeGroup name="version" />\r
+\r
+  <!-- 2.2 Status -->\r
+  <xs:attributeGroup name="status" />\r
+\r
+  <!-- 2.3 Contribute -->\r
+  <xs:attributeGroup name="contribute" />\r
+\r
+  <!-- 2.3.1 Role -->\r
+  <xs:attributeGroup name="role" />\r
+\r
+  <!-- 2.3.2 Entity -->\r
+  <xs:attributeGroup name="entity" />\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:attributeGroup name="date" />\r
+\r
+  <!-- 3 Meta-Metadata -->\r
+  <xs:attributeGroup name="metaMetadata" />\r
+\r
+  <!-- 3.1 Identifier
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 3.1.1 Catalog
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 3.1.2 Entry
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 3.2 Contribute
+  <xs:attributeGroup name="contribute"/> -->\r
+\r
+  <!-- 3.2.1 Role
+  <xs:attributeGroup name="role"/> -->\r
+\r
+  <!-- 3.2.2 Entity
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 3.2.3 Date
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 3.3 Metadata Schema -->\r
+  <xs:attributeGroup name="metadataSchema" />\r
+\r
+  <!-- 3.4 Language
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 4 Technical -->\r
+  <xs:attributeGroup name="technical" />\r
+\r
+  <!-- 4.1 Format -->\r
+  <xs:attributeGroup name="format" />\r
+\r
+  <!-- 4.2 Size -->\r
+  <xs:attributeGroup name="size" />\r
+\r
+  <!-- 4.3 Location -->\r
+  <xs:attributeGroup name="location" />\r
+\r
+  <!-- 4.4 Requirement -->\r
+  <xs:attributeGroup name="requirement" />\r
+\r
+  <!-- 4.4.1 OrComposite -->\r
+  <xs:attributeGroup name="orComposite" />\r
+\r
+  <!-- 4.4.1.1 Type -->\r
+  <xs:attributeGroup name="type" />\r
+\r
+  <!-- 4.4.1.2 Name -->\r
+  <xs:attributeGroup name="name" />\r
+\r
+  <!-- 4.4.1.3 Minimum Version -->\r
+  <xs:attributeGroup name="minimumVersion" />\r
+\r
+  <!-- 4.4.1.4 Maximum Version -->\r
+  <xs:attributeGroup name="maximumVersion" />\r
+\r
+  <!-- 4.5 Installation Remarks -->\r
+  <xs:attributeGroup name="installationRemarks" />\r
+\r
+  <!-- 4.6 Other Platform Requirements -->\r
+  <xs:attributeGroup name="otherPlatformRequirements" />\r
+\r
+  <!-- 4.7 Duration -->\r
+  <xs:attributeGroup name="duration" />\r
+\r
+  <!-- 5 Educational -->\r
+  <xs:attributeGroup name="educational" />\r
+\r
+  <!-- 5.1 Interactivity Type -->\r
+  <xs:attributeGroup name="interactivityType" />\r
+\r
+  <!-- 5.2 Learning Resource Type -->\r
+  <xs:attributeGroup name="learningResourceType" />\r
+\r
+  <!-- 5.3 Interactivity Level -->\r
+  <xs:attributeGroup name="interactivityLevel" />\r
+\r
+  <!-- 5.4 Semantic Density -->\r
+  <xs:attributeGroup name="semanticDensity" />\r
+\r
+  <!-- 5.5 Intended End User Role -->\r
+  <xs:attributeGroup name="intendedEndUserRole" />\r
+\r
+  <!-- 5.6 Context -->\r
+  <xs:attributeGroup name="context" />\r
+\r
+  <!-- 5.7 Typical Age Range -->\r
+  <xs:attributeGroup name="typicalAgeRange" />\r
+\r
+  <!-- 5.8 Difficulty -->\r
+  <xs:attributeGroup name="difficulty" />\r
+\r
+  <!-- 5.9 Typical Learning Time -->\r
+  <xs:attributeGroup name="typicalLearningTime" />\r
+\r
+  <!-- 5.10 Description
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 5.11 Language
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 6 Rights -->\r
+  <xs:attributeGroup name="rights" />\r
+\r
+  <!-- 6.1 Cost -->\r
+  <xs:attributeGroup name="cost" />\r
+\r
+  <!-- 6.2 Copyright and Other Restrictions -->\r
+  <xs:attributeGroup name="copyrightAndOtherRestrictions" />\r
+\r
+  <!-- 6.3 Description
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 7 Relation -->\r
+  <xs:attributeGroup name="relation" />\r
+\r
+  <!-- 7.1 Kind -->\r
+  <xs:attributeGroup name="kind" />\r
+\r
+  <!-- 7.2 Resource -->\r
+  <xs:attributeGroup name="resource" />\r
+\r
+  <!-- 7.2.1 Identifier
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 7.2.1.1 Catalog
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 7.2.1.2 Entry
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 7.2.2 Description
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 8 Annotation -->\r
+  <xs:attributeGroup name="annotation" />\r
+\r
+  <!-- 8.1 Entity
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 8.2 Date
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 8.3 Description
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9 Classification -->\r
+  <xs:attributeGroup name="classification" />\r
+\r
+  <!-- 9.1 Purpose -->\r
+  <xs:attributeGroup name="purpose" />\r
+\r
+  <!-- 9.2 Taxon Path -->\r
+  <xs:attributeGroup name="taxonPath" />\r
+\r
+  <!-- 9.2.1 Source
+  <xs:attributeGroup name="source"/> -->\r
+\r
+  <!-- 9.2.2 Taxon -->\r
+  <xs:attributeGroup name="taxon" />\r
+\r
+  <!-- 9.2.2.1 Id -->\r
+  <xs:attributeGroup name="id" />\r
+\r
+  <!-- 9.2.2.2 Entry
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 9.3 Description
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9.4 Keyword
+  <xs:attributeGroup name="keyword"/> -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/rootElement_localised.xsd b/docs/home/ims/domainProfile_2/rootElement_localised.xsd
new file mode 100644 (file)
index 0000000..8101ec3
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** rootElement.xsd                                                     **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema defintion provides the element name declaration for the\r
+         root element for all LOM XML instances.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- Element declarations -->\r
+\r
+   <!-- Learning Object Metadata -->\r
+   <xs:element name="lom" type="lom">\r
+      <xs:unique name="lomUnique">\r
+         <xs:selector xpath="*" />\r
+         <xs:field xpath="@uniqueElementName" />\r
+      </xs:unique>\r
+   </xs:element>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/unique/loose.xsd b/docs/home/ims/domainProfile_2/unique/loose.xsd
new file mode 100644 (file)
index 0000000..0defa03
--- /dev/null
@@ -0,0 +1,295 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM/unique"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM/unique"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema definition provides attribute group declarations for\r
+       LOM data elements to support schema-based validation of uniqueness constraints\r
+       within a LOM XML instance where the exact set of attributes associated with each\r
+       element has to be as specified by the LOM XML Schema binding (i.e., where extra\r
+       attributes to enforce uniqueness have to be avoided).\r
+\r
+       Duplicate declarations are included as comments for completeness.  These\r
+       declarations should remain commented out or they can be removed completely.\r
+\r
+       NOTE: The absence of the enforcement of the uniqueness constraints does not\r
+       relieve a particular LOM XML instance from satisfying the uniqueness constraints\r
+       described in the LOMv1.0 base schema. Applications that require the use of\r
+       the unique/loose.xsd component XSD have to enforce those uniqueness constraints\r
+       by other means.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the\r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported\r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the\r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+\r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+  </xs:annotation>\r
+\r
+  <!-- Attribute group declarations -->\r
+\r
+  <!-- Duplicate declarations are included as comments. -->\r
+\r
+  <!-- Learning Object Metadata -->\r
+  <xs:attributeGroup name="lom"/>\r
+\r
+  <!-- DateTime -->\r
+  <xs:attributeGroup name="DateTimeValue"/>\r
+\r
+  <!-- Duration -->\r
+  <xs:attributeGroup name="DurationValue"/>\r
+\r
+  <!-- Source -->\r
+  <xs:attributeGroup name="source"/>\r
+\r
+  <!-- Value -->\r
+  <xs:attributeGroup name="value"/>\r
+\r
+  <!-- 1 General -->\r
+  <xs:attributeGroup name="general"/>\r
+\r
+  <!-- 1.1 Identifier -->\r
+  <xs:attributeGroup name="identifier"/>\r
+\r
+  <!-- 1.1.1 Catalog -->\r
+  <xs:attributeGroup name="catalog"/>\r
+\r
+  <!-- 1.1.2 Entry -->\r
+  <xs:attributeGroup name="entry"/>\r
+\r
+  <!-- 1.2 Title -->\r
+  <xs:attributeGroup name="title"/>\r
+\r
+  <!-- 1.3 Language -->\r
+  <xs:attributeGroup name="language"/>\r
+\r
+  <!-- 1.4 Description -->\r
+  <xs:attributeGroup name="description"/>\r
+\r
+  <!-- 1.5 Keyword -->\r
+  <xs:attributeGroup name="keyword"/>\r
+\r
+  <!-- 1.6 Coverage -->\r
+  <xs:attributeGroup name="coverage"/>\r
+\r
+  <!-- 1.7 Structure -->\r
+  <xs:attributeGroup name="structure"/>\r
+\r
+  <!-- 1.8 Aggregation Level -->\r
+  <xs:attributeGroup name="aggregationLevel"/>\r
+\r
+  <!-- 2 Life Cycle -->\r
+  <xs:attributeGroup name="lifeCycle"/>\r
+\r
+  <!-- 2.1 Version -->\r
+  <xs:attributeGroup name="version"/>\r
+\r
+  <!-- 2.2 Status -->\r
+  <xs:attributeGroup name="status"/>\r
+\r
+  <!-- 2.3 Contribute -->\r
+  <xs:attributeGroup name="contribute"/>\r
+\r
+  <!-- 2.3.1 Role -->\r
+  <xs:attributeGroup name="role"/>\r
+\r
+  <!-- 2.3.2 Entity -->\r
+  <xs:attributeGroup name="entity"/>\r
+\r
+  <!-- 2.3.3 Date -->\r
+  <xs:attributeGroup name="date"/>\r
+\r
+  <!-- 3 Meta-Metadata -->\r
+  <xs:attributeGroup name="metaMetadata"/>\r
+\r
+  <!-- 3.1 Identifier\r
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 3.1.1 Catalog\r
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 3.1.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 3.2 Contribute\r
+  <xs:attributeGroup name="contribute"/> -->\r
+\r
+  <!-- 3.2.1 Role\r
+  <xs:attributeGroup name="role"/> -->\r
+\r
+  <!-- 3.2.2 Entity\r
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 3.2.3 Date\r
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 3.3 Metadata Schema -->\r
+  <xs:attributeGroup name="metadataSchema"/>\r
+\r
+  <!-- 3.4 Language\r
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 4 Technical -->\r
+  <xs:attributeGroup name="technical"/>\r
+\r
+  <!-- 4.1 Format -->\r
+  <xs:attributeGroup name="format"/>\r
+\r
+  <!-- 4.2 Size -->\r
+  <xs:attributeGroup name="size"/>\r
+\r
+  <!-- 4.3 Location -->\r
+  <xs:attributeGroup name="location"/>\r
+\r
+  <!-- 4.4 Requirement -->\r
+  <xs:attributeGroup name="requirement"/>\r
+\r
+  <!-- 4.4.1 OrComposite -->\r
+  <xs:attributeGroup name="orComposite"/>\r
+\r
+  <!-- 4.4.1.1 Type -->\r
+  <xs:attributeGroup name="type"/>\r
+\r
+  <!-- 4.4.1.2 Name -->\r
+  <xs:attributeGroup name="name"/>\r
+\r
+  <!-- 4.4.1.3 Minimum Version -->\r
+  <xs:attributeGroup name="minimumVersion"/>\r
+\r
+  <!-- 4.4.1.4 Maximum Version -->\r
+  <xs:attributeGroup name="maximumVersion"/>\r
+\r
+  <!-- 4.5 Installation Remarks -->\r
+  <xs:attributeGroup name="installationRemarks"/>\r
+\r
+  <!-- 4.6 Other Platform Requirements -->\r
+  <xs:attributeGroup name="otherPlatformRequirements"/>\r
+\r
+  <!-- 4.7 Duration -->\r
+  <xs:attributeGroup name="duration"/>\r
+\r
+  <!-- 5 Educational -->\r
+  <xs:attributeGroup name="educational"/>\r
+\r
+  <!-- 5.1 Interactivity Type -->\r
+  <xs:attributeGroup name="interactivityType"/>\r
+\r
+  <!-- 5.2 Learning Resource Type -->\r
+  <xs:attributeGroup name="learningResourceType"/>\r
+\r
+  <!-- 5.3 Interactivity Level -->\r
+  <xs:attributeGroup name="interactivityLevel"/>\r
+\r
+  <!-- 5.4 Semantic Density -->\r
+  <xs:attributeGroup name="semanticDensity"/>\r
+\r
+  <!-- 5.5 Intended End User Role -->\r
+  <xs:attributeGroup name="intendedEndUserRole"/>\r
+\r
+  <!-- 5.6 Context -->\r
+  <xs:attributeGroup name="context"/>\r
+\r
+  <!-- 5.7 Typical Age Range -->\r
+  <xs:attributeGroup name="typicalAgeRange"/>\r
+\r
+  <!-- 5.8 Difficulty -->\r
+  <xs:attributeGroup name="difficulty"/>\r
+\r
+  <!-- 5.9 Typical Learning Time -->\r
+  <xs:attributeGroup name="typicalLearningTime"/>\r
+\r
+  <!-- 5.10 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 5.11 Language\r
+  <xs:attributeGroup name="language"/> -->\r
+\r
+  <!-- 6 Rights -->\r
+  <xs:attributeGroup name="rights"/>\r
+\r
+  <!-- 6.1 Cost -->\r
+  <xs:attributeGroup name="cost"/>\r
+\r
+  <!-- 6.2 Copyright and Other Restrictions -->\r
+  <xs:attributeGroup name="copyrightAndOtherRestrictions"/>\r
+\r
+  <!-- 6.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 7 Relation -->\r
+  <xs:attributeGroup name="relation"/>\r
+\r
+  <!-- 7.1 Kind -->\r
+  <xs:attributeGroup name="kind"/>\r
+\r
+  <!-- 7.2 Resource -->\r
+  <xs:attributeGroup name="resource"/>\r
+\r
+  <!-- 7.2.1 Identifier\r
+  <xs:attributeGroup name="identifier"/> -->\r
+\r
+  <!-- 7.2.1.1 Catalog\r
+  <xs:attributeGroup name="catalog"/> -->\r
+\r
+  <!-- 7.2.1.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 7.2.2 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 8 Annotation -->\r
+  <xs:attributeGroup name="annotation"/>\r
+\r
+  <!-- 8.1 Entity\r
+  <xs:attributeGroup name="entity"/> -->\r
+\r
+  <!-- 8.2 Date\r
+  <xs:attributeGroup name="date"/> -->\r
+\r
+  <!-- 8.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9 Classification -->\r
+  <xs:attributeGroup name="classification"/>\r
+\r
+  <!-- 9.1 Purpose -->\r
+  <xs:attributeGroup name="purpose"/>\r
+\r
+  <!-- 9.2 Taxon Path -->\r
+  <xs:attributeGroup name="taxonPath"/>\r
+\r
+  <!-- 9.2.1 Source\r
+  <xs:attributeGroup name="source"/> -->\r
+\r
+  <!-- 9.2.2 Taxon -->\r
+  <xs:attributeGroup name="taxon"/>\r
+\r
+  <!-- 9.2.2.1 Id -->\r
+  <xs:attributeGroup name="id"/>\r
+\r
+  <!-- 9.2.2.2 Entry\r
+  <xs:attributeGroup name="entry"/> -->\r
+\r
+  <!-- 9.3 Description\r
+  <xs:attributeGroup name="description"/> -->\r
+\r
+  <!-- 9.4 Keyword\r
+  <xs:attributeGroup name="keyword"/> -->\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/vocab/loose.xsd b/docs/home/ims/domainProfile_2/vocab/loose.xsd
new file mode 100644 (file)
index 0000000..b216d83
--- /dev/null
@@ -0,0 +1,147 @@
+<xs:schema targetNamespace="http://ltsc.ieee.org/xsd/LOM/vocab"\r
+           xmlns="http://ltsc.ieee.org/xsd/LOM/vocab"\r
+           xmlns:lom="http://ltsc.ieee.org/xsd/LOM"\r
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           elementFormDefault="qualified"\r
+           version="IEEE LTSC LOM XML 1.0">\r
+\r
+  <xs:annotation>\r
+    <xs:documentation>\r
+       This work is licensed under the Creative Commons Attribution-ShareAlike\r
+       License.  To view a copy of this license, see the file license.txt,\r
+       visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+       Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+    </xs:documentation>\r
+\r
+    <xs:documentation>\r
+       This component schema definition provides simple type declarations for LOM\r
+       data elements that are defined as Vocabulary data types.\r
+\r
+       This component schema definition enforces that vocabulary sources and values\r
+       are character strings, which simplifies the schema validation process for those\r
+       applications that perform vocabulary source/value validation using\r
+       post-schema-validation.\r
+\r
+       This component schema definition relaxes the validation constraints by\r
+       allowing both sources and values to be arbitrary character strings.\r
+\r
+       NOTE: The absence of the enforcement of vocabulary values does not relieve a\r
+       particular LOM XML instance from satisfying vocabulary requirements defined\r
+       in the LOMv1.0 base schema. Applications that require the use of vocab/loose.xsd\r
+       component XSD should enforce those vocabulary requirements by other means.\r
+    </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+\r
+  </xs:annotation>\r
+\r
+  <xs:import namespace="http://ltsc.ieee.org/xsd/LOM" schemaLocation="../lomLoose_localised.xsd"/>\r
+\r
+  <!-- Vocabulary data type declarations -->\r
+\r
+  <!-- Source -->\r
+  <xs:simpleType name="source">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 1.7 Structure -->\r
+  <xs:simpleType name="structure">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 1.8 Aggregation Level -->\r
+  <xs:simpleType name="aggregationLevel">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 2.2 Status -->\r
+  <xs:simpleType name="status">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 2.3.1 Role -->\r
+  <xs:simpleType name="role">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 3.2.1 Role -->\r
+  <xs:simpleType name="roleMeta">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 4.4.1.1 Type -->\r
+  <xs:simpleType name="type">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 4.4.1.2 Name -->\r
+  <xs:simpleType name="name">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.1 Interactivity Type -->\r
+  <xs:simpleType name="interactivityType">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.2 Learning Resource Type -->\r
+  <xs:simpleType name="learningResourceType">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.3 Interactivity Level -->\r
+  <xs:simpleType name="interactivityLevel">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.4 Semantic Density -->\r
+  <xs:simpleType name="semanticDensity">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.5 Intended End User Role -->\r
+  <xs:simpleType name="intendedEndUserRole">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.6 Context -->\r
+  <xs:simpleType name="context">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 5.8 Difficulty -->\r
+  <xs:simpleType name="difficulty">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 6.1 Cost -->\r
+  <xs:simpleType name="cost">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 6.2 Copyright and Other Restrictions -->\r
+  <xs:simpleType name="copyrightAndOtherRestrictions">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 7.1 Kind -->\r
+  <xs:simpleType name="kind">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+  <!-- 9.1 Purpose -->\r
+  <xs:simpleType name="purpose">\r
+    <xs:restriction base="lom:CharacterString"/>\r
+  </xs:simpleType>\r
+\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/domainProfile_2/vocabTypes_localised.xsd b/docs/home/ims/domainProfile_2/vocabTypes_localised.xsd
new file mode 100644 (file)
index 0000000..c44208c
--- /dev/null
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** vocabTypes.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ag="http://ltsc.ieee.org/xsd/LOM/unique" xmlns:ex="http://ltsc.ieee.org/xsd/LOM/extend" xmlns:voc="http://ltsc.ieee.org/xsd/LOM/vocab" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_mR_definition.xsd" />\r
+       <xs:annotation>\r
+               <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+               <xs:documentation>\r
+         This component schema defintion provides global type declarations for those\r
+         LOM data elements whose values are taken from a Vocabulary data type.\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:annotation>\r
+               <xs:documentation>This component XSD requires schema components from other\r
+       schemas that are defined in other namespaces.  These statements import the\r
+       appropriate components. The xsi:schemaLocation attribute is used to specify\r
+       the location of the file that contains the schema that defines the namespace.\r
+       The xsi:schemaLocation attribute is optional and is ommitted.  By definition of\r
+       the composite schemas the appropriate namespaces and related files where those\r
+       namespaces are defined are brought into scope.  Some XML parsers may require\r
+       these import statements to contain the optional xsi:schemaLocation attribute.</xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+       </xs:annotation>\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/unique" schemaLocation="./unique/loose.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/extend" schemaLocation="./extend/custom.xsd" />\r
+       <xs:import namespace="http://ltsc.ieee.org/xsd/LOM/vocab" schemaLocation="./vocab/loose.xsd" />\r
+       <!-- Vocabulary type declarations -->\r
+       <!-- Source -->\r
+       <xs:complexType name="sourceValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:source">\r
+                               <xs:attributeGroup ref="ag:source" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+<xs:complexType name="sourceValue18311">\r
+               <xs:simpleContent>\r
+                       <xs:annotation>\r
+                            <xs:documentation xml:lang="en">explanation: The vocabulary for intendedEndUserRole is 'IMSGLC_CC_Rolesv1p0'.</xs:documentation>\r
+                        </xs:annotation><xs:extension base="RoleVocab">\r
+                               <xs:attributeGroup ref="ag:source" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               \r
+       </xs:simpleContent>\r
+       </xs:complexType>\r
+<xs:complexType name="sourceValue18711">\r
+               <xs:simpleContent>\r
+                       <xs:annotation>\r
+                            <xs:documentation xml:lang="en">explanation: The source for a context object is fixed to 'LOMv1.0'</xs:documentation>\r
+                        </xs:annotation><xs:extension base="SourceIEELOM">\r
+                               <xs:attributeGroup ref="ag:source" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               \r
+       </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.7 Structure -->\r
+       <xs:complexType name="structureVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="structureValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="structureValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:structure">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 1.8 Aggregation Level -->\r
+       <xs:complexType name="aggregationLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="aggregationLevelValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="aggregationLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:aggregationLevel">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.2 Status -->\r
+       <xs:complexType name="statusVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="statusValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="statusValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:status">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 2.3.1 Role -->\r
+       <xs:complexType name="roleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="roleValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="roleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:role">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 3.2.1 Role -->\r
+       <xs:complexType name="roleMetaVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="roleMetaValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="roleMetaValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:roleMeta">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.1 Type -->\r
+       <xs:complexType name="typeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="typeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="typeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:type">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 4.4.1.2 Name -->\r
+       <xs:complexType name="nameVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="nameValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="nameValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:name">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.1 Interactivity Type -->\r
+       <xs:complexType name="interactivityTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="interactivityTypeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityType">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.2 Learning Resource Type -->\r
+       <xs:complexType name="learningResourceTypeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="learningResourceTypeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="learningResourceTypeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:learningResourceType">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.3 Interactivity Level -->\r
+       <xs:complexType name="interactivityLevelVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="interactivityLevelValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="interactivityLevelValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:interactivityLevel">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.4 Semantic Density -->\r
+       <xs:complexType name="semanticDensityVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="semanticDensityValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="semanticDensityValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:semanticDensity">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.5 Intended End User Role -->\r
+       <xs:complexType name="intendedEndUserRoleVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="intendedEndUserRoleValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="intendedEndUserRoleValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:intendedEndUserRole">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+<xs:complexType name="intendedEndUserRoleValue18313">\r
+               <xs:simpleContent>\r
+                       <xs:annotation>\r
+                            <xs:documentation xml:lang="en">explanation: Possible intendedEndUserRoles are only 'Learner' and 'Instructor'.</xs:documentation>\r
+                        </xs:annotation><xs:extension base="RolesValues">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               \r
+       </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.6 Context -->\r
+       <xs:complexType name="contextVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="contextValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="contextValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:context">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+<xs:complexType name="contextValue18713">\r
+               <xs:simpleContent>\r
+                       <xs:annotation>\r
+                            <xs:documentation xml:lang="en">explanation: The value of context is fixed to 'higher education'.</xs:documentation>\r
+                        </xs:annotation><xs:extension base="HEContext">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               \r
+       </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 5.8 Difficulty -->\r
+       <xs:complexType name="difficultyVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="difficultyValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="difficultyValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:difficulty">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.1 Cost -->\r
+       <xs:complexType name="costVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="costValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="costValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:cost">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 6.2 Copyright and Other Restrictions -->\r
+       <xs:complexType name="copyrightAndOtherRestrictionsVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="copyrightAndOtherRestrictionsValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="copyrightAndOtherRestrictionsValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:copyrightAndOtherRestrictions">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 7.1 Kind -->\r
+       <xs:complexType name="kindVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="kindValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="kindValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:kind">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- 9.1 Purpose -->\r
+       <xs:complexType name="purposeVocab">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="source" type="sourceValue" />\r
+                       <xs:element name="value" type="purposeValue" />\r
+                       <xs:group ref="ex:customElements" />\r
+               </xs:choice>\r
+               <xs:attributeGroup ref="ex:customAttributes" />\r
+       </xs:complexType>\r
+       <xs:complexType name="purposeValue">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="voc:purpose">\r
+                               <xs:attributeGroup ref="ag:value" />\r
+                               <xs:attributeGroup ref="ex:customAttributes" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_2/vocabValues_localised.xsd b/docs/home/ims/domainProfile_2/vocabValues_localised.xsd
new file mode 100644 (file)
index 0000000..42128ac
--- /dev/null
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** vocabValues.xsd                                                     **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ltsc.ieee.org/xsd/LOM" targetNamespace="http://ltsc.ieee.org/xsd/LOM" elementFormDefault="qualified" version="IEEE LTSC LOM XML 1.0 localised_Schema_2008_6_30">\r
+\r
+   <xs:annotation>\r
+      <xs:documentation>\r
+         This work is licensed under the Creative Commons Attribution-ShareAlike\r
+         License.  To view a copy of this license, see the file license.txt,\r
+         visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to\r
+         Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.\r
+      </xs:documentation>\r
+\r
+      <xs:documentation>\r
+         This component schema definition provides global type declarations for the standard\r
+         LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from\r
+         a Vocabulary data type.\r
+\r
+         This component schema defintion defines the stanard vocabulary value\r
+         declarations as defined in the LOMv1.0 base schema.  These vocabulary\r
+         value declarations are used in conjunction with both vocab/custom.xsd and\r
+         vocab/loose.xsd.\r
+      </xs:documentation>\r
+      <xs:documentation>\r
+         This file has been modified by the Knowledge Media Institute of the \r
+         University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the\r
+         following changes:\r
+         1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported \r
+            because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3)\r
+         2) In all component XSDs the schemaLocation attribute was amended to the \r
+            xs:import and xs:include statements. This enables the usage of the schemas\r
+            with tools which don't deal well with missing schemaLocation informations.\r
+            \r
+         This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose"\r
+      </xs:documentation>\r
+   </xs:annotation>\r
+\r
+   <!-- LOMv1.0 base schema vocabulary source and value declarations -->\r
+\r
+   <!-- Source -->\r
+   <xs:simpleType name="sourceValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="LOMv1.0" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+\r
+   <!-- 1.7 Structure -->\r
+   <xs:simpleType name="structureValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="atomic" />\r
+         <xs:enumeration value="collection" />\r
+         <xs:enumeration value="networked" />\r
+         <xs:enumeration value="hierarchical" />\r
+         <xs:enumeration value="linear" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 1.8 Aggregation Level -->\r
+   <xs:simpleType name="aggregationLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="1" />\r
+         <xs:enumeration value="2" />\r
+         <xs:enumeration value="3" />\r
+         <xs:enumeration value="4" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.2 Status -->\r
+   <xs:simpleType name="statusValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="draft" />\r
+         <xs:enumeration value="final" />\r
+         <xs:enumeration value="revised" />\r
+         <xs:enumeration value="unavailable" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 2.3.1 Role -->\r
+   <xs:simpleType name="roleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="author" />\r
+         <xs:enumeration value="publisher" />\r
+         <xs:enumeration value="unknown" />\r
+         <xs:enumeration value="initiator" />\r
+         <xs:enumeration value="terminator" />\r
+         <xs:enumeration value="validator" />\r
+         <xs:enumeration value="editor" />\r
+         <xs:enumeration value="graphical designer" />\r
+         <xs:enumeration value="technical implementer" />\r
+         <xs:enumeration value="content provider" />\r
+         <xs:enumeration value="technical validator" />\r
+         <xs:enumeration value="educational validator" />\r
+         <xs:enumeration value="script writer" />\r
+         <xs:enumeration value="instructional designer" />\r
+         <xs:enumeration value="subject matter expert" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 3.2.1 Role -->\r
+   <xs:simpleType name="roleMetaValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="creator" />\r
+         <xs:enumeration value="validator" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.1 Type -->\r
+   <xs:simpleType name="typeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="operating system" />\r
+         <xs:enumeration value="browser" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 4.4.1.2 Name -->\r
+   <xs:simpleType name="nameValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="pc-dos" />\r
+         <xs:enumeration value="ms-windows" />\r
+         <xs:enumeration value="macos" />\r
+         <xs:enumeration value="unix" />\r
+         <xs:enumeration value="multi-os" />\r
+         <xs:enumeration value="none" />\r
+         <xs:enumeration value="any" />\r
+         <xs:enumeration value="netscape communicator" />\r
+         <xs:enumeration value="ms-internet explorer" />\r
+         <xs:enumeration value="opera" />\r
+         <xs:enumeration value="amaya" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.1 Interactivity Type -->\r
+   <xs:simpleType name="interactivityTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="active" />\r
+         <xs:enumeration value="expositive" />\r
+         <xs:enumeration value="mixed" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.2 Learning Resource Type -->\r
+   <xs:simpleType name="learningResourceTypeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="exercise" />\r
+         <xs:enumeration value="simulation" />\r
+         <xs:enumeration value="questionnaire" />\r
+         <xs:enumeration value="diagram" />\r
+         <xs:enumeration value="figure" />\r
+         <xs:enumeration value="graph" />\r
+         <xs:enumeration value="index" />\r
+         <xs:enumeration value="slide" />\r
+         <xs:enumeration value="table" />\r
+         <xs:enumeration value="narrative text" />\r
+         <xs:enumeration value="exam" />\r
+         <xs:enumeration value="experiment" />\r
+         <xs:enumeration value="problem statement" />\r
+         <xs:enumeration value="self assessment" />\r
+         <xs:enumeration value="lecture" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.3 Interactivity Level -->\r
+   <xs:simpleType name="interactivityLevelValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low" />\r
+         <xs:enumeration value="low" />\r
+         <xs:enumeration value="medium" />\r
+         <xs:enumeration value="high" />\r
+         <xs:enumeration value="very high" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.4 Semantic Density -->\r
+   <xs:simpleType name="semanticDensityValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very low" />\r
+         <xs:enumeration value="low" />\r
+         <xs:enumeration value="medium" />\r
+         <xs:enumeration value="high" />\r
+         <xs:enumeration value="very high" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.5 Intended End User Role -->\r
+   <xs:simpleType name="intendedEndUserRoleValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="teacher" />\r
+         <xs:enumeration value="author" />\r
+         <xs:enumeration value="learner" />\r
+         <xs:enumeration value="manager" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.6 Context -->\r
+   <xs:simpleType name="contextValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="school" />\r
+         <xs:enumeration value="higher education" />\r
+         <xs:enumeration value="training" />\r
+         <xs:enumeration value="other" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 5.8 Difficulty -->\r
+   <xs:simpleType name="difficultyValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="very easy" />\r
+         <xs:enumeration value="easy" />\r
+         <xs:enumeration value="medium" />\r
+         <xs:enumeration value="difficult" />\r
+         <xs:enumeration value="very difficult" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.1 Cost -->\r
+   <xs:simpleType name="costValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes" />\r
+         <xs:enumeration value="no" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 6.2 Copyright and Other Restrictions -->\r
+   <xs:simpleType name="copyrightAndOtherRestrictionsValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="yes" />\r
+         <xs:enumeration value="no" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 7.1 Kind -->\r
+   <xs:simpleType name="kindValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="ispartof" />\r
+         <xs:enumeration value="haspart" />\r
+         <xs:enumeration value="isversionof" />\r
+         <xs:enumeration value="hasversion" />\r
+         <xs:enumeration value="isformatof" />\r
+         <xs:enumeration value="hasformat" />\r
+         <xs:enumeration value="references" />\r
+         <xs:enumeration value="isreferencedby" />\r
+         <xs:enumeration value="isbasedon" />\r
+         <xs:enumeration value="isbasisfor" />\r
+         <xs:enumeration value="requires" />\r
+         <xs:enumeration value="isrequiredby" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+   <!-- 9.1 Purpose -->\r
+   <xs:simpleType name="purposeValues">\r
+      <xs:restriction base="xs:token">\r
+         <xs:enumeration value="discipline" />\r
+         <xs:enumeration value="idea" />\r
+         <xs:enumeration value="prerequisite" />\r
+         <xs:enumeration value="educational objective" />\r
+         <xs:enumeration value="accessibility restrictions" />\r
+         <xs:enumeration value="educational level" />\r
+         <xs:enumeration value="skill level" />\r
+         <xs:enumeration value="security level" />\r
+         <xs:enumeration value="competency" />\r
+      </xs:restriction>\r
+   </xs:simpleType>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_3/imscp_extensionv1p2.xsd b/docs/home/ims/domainProfile_3/imscp_extensionv1p2.xsd
new file mode 100644 (file)
index 0000000..c0ca9a7
--- /dev/null
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imscp_extensionv1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.imsglobal.org/xsd/imscp_extensionv1p2" version="IMS CPX 1.2" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+    <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.imsglobal.org/xsd/ims_xlink.xsd" />\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+            XSD Data File Information\r
+            -------------------------\r
+            Author:       Colin Smythe (IMS, UK)\r
+            Date:         31st October, 2006\r
+            Version:      2.0\r
+            Status:       Public Draft\r
+            Description:  This is a normative representation of the IMS Packaging Extension 1.0 Information Model for binding \r
+                          purposes.  Read the corresponding IMS Content Packaging Information Model for the Platform \r
+                          Independent Model representation.\r
+\r
+            History:      Version 2 includes the modified definition of LingualTitle.\r
+                          Version 1  of the IMS Packaging Utility v1.2 XSD for public draft release.\r
+                          It has a target namespace of http://www.imsglobal.org/xsd/imscp_extensionv1p2.\r
+                          This Utility uses this general approach to modeling:\r
+                          (1) All of the elements and attributes are defined as local to their host object;\r
+                          (2) There are multiple host objects;\r
+                          (3) Comments have been added to the complexType definitions.\r
+\r
+            Copyright:    2006 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+                          IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information\r
+                          contained in this binding ("Specification") for purposes of scientific\r
+                          experimental and scholarly collaboration only.  IMS/GLC makes no warranty or \r
+                          representation regarding the accuracy or completeness of the Specification.\r
+                          This material is provided on an "As Is" and "As Available basis".\r
+                          The Specification is at all times subject to change and revision without\r
+                          notice. It is your sole responsibility to evaluate the usefulness, accuracy\r
+                          and completeness of the Specification as it relates to you.  IMS/GLC would\r
+                          appreciate receiving your comments and suggestions.  Please contact IMS/GLC\r
+                          through our website at: http://www.imsglobal.org.\r
+\r
+            Source XSLT File Information\r
+            ----------------------------\r
+            XSL Generator:    UMLtoXSDTransformv0p7.xsl\r
+            XSLT Processor:   Xalan\r
+            Release:          1.0 Beta 1\r
+            Date:             30th November, 2005\r
+\r
+            Auto-generation Tool\r
+            --------------------\r
+            This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool.  While every attempt\r
+            has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware\r
+            that this is an experimental tool.  Permission is given to make use of this tool.  IMS makes no\r
+            claim on the materials created by third party users of this tool.  Details on how to use this tool\r
+            are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation"\r
+            available at the IMS web-site.\r
+            Tool Copyright:  2006 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+        </xs:documentation>\r
+    </xs:annotation>\r
+\r
+        <!-- Generate Global Attributes ***********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate Namespaced extension Group  *************************************************************  -->\r
+\r
+            <xs:group name="grpStrict.any">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the enumerated simpleType declarations **************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the simpleType elements based IMS data-types  *******************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the derived data-type elements **********************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the data-type elements ******************************************************************  -->\r
+\r
+            <xs:complexType name="IPointer.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A bound instance of an IPointer object allows a packager to associate\r
+                        a specific XML node set in the same IMS Manifest Document that contains \r
+                        it or an XML node set in a different IMS Manifest Document instance with \r
+                        the parent object containing an IMS Pointer instance.  \r
+                        \r
+                        A referenced node set must be a valid child of the referencing parent element, \r
+                        both as to kind and multiplicity in a referencing parent's context.\r
+\r
+                        <p>Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute ref="xlink:type" use="optional" default="simple" />\r
+                <xs:attribute ref="xlink:href" use="required" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Metadata.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An instance of the metadata element contains data structures that declare descriptive\r
+                        information about a metadata element's parent only.\r
+                        \r
+                        One or more different metadata models may be declared as child extensions of a \r
+                        metadata element.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imMetadata:  Metadata.[ Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Variant.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A variant element is closely analogous to a resource element in the \r
+                        IMS Content Packaging Information Model.  Variant is a container for a \r
+                        an alternative resource.  A resource may contain references \r
+                        to assets that are all of the same type or different types (i.e., file formats).\r
+                        \r
+                        The Variant class points to the alternatibe resource.  Metadata is used to \r
+                        describe the nature of a collection of alternative assets and their intended \r
+                        use.  Examples include, but are not limited to, use as lingual variants, \r
+                        visual or auditory variants, remediation variants, or platform delivery variants.\r
+                        \r
+                        The scope of referenced assets is specific to a Variant object.  Their use is in the\r
+                        context of the parent object containing a variant instance, typically a bound instance\r
+                        of a Resource object from the IMS CP namespace.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="1" maxOccurs="1" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="identifierref" use="required" type="xs:IDREF" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="LingualTitle.Type">\r
+                <xs:simpleContent>\r
+                    <xs:extension base="xs:string">\r
+                        <xs:attribute name="language" use="required" type="xs:string" />\r
+                    </xs:extension>\r
+                </xs:simpleContent>\r
+            </xs:complexType>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the elements **********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the root element(s) ***************************************************************  -->\r
+\r
+            <xs:element name="ipointer" type="IPointer.Type" />\r
+            <xs:element name="variant" type="Variant.Type" />\r
+            <xs:element name="lingualTitle" type="LingualTitle.Type" />\r
+\r
+        <!-- =====================================  -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_3/imscp_extensionv1p2_localised.xsd b/docs/home/ims/domainProfile_3/imscp_extensionv1p2_localised.xsd
new file mode 100644 (file)
index 0000000..ea9129a
--- /dev/null
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imscp_extensionv1p2.xsd                                             **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.imsglobal.org/xsd/imscp_extensionv1p2" targetNamespace="http://www.imsglobal.org/xsd/imscp_extensionv1p2" version="IMS CPX 1.2 localised_Schema_2008_6_30" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+    <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.imsglobal.org/xsd/ims_xlink.xsd" />\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+            XSD Data File Information\r
+            -------------------------\r
+            Author:       Colin Smythe (IMS, UK)\r
+            Date:         31st October, 2006\r
+            Version:      2.0\r
+            Status:       Public Draft\r
+            Description:  This is a normative representation of the IMS Packaging Extension 1.0 Information Model for binding \r
+                          purposes.  Read the corresponding IMS Content Packaging Information Model for the Platform \r
+                          Independent Model representation.\r
+\r
+            History:      Version 2 includes the modified definition of LingualTitle.\r
+                          Version 1  of the IMS Packaging Utility v1.2 XSD for public draft release.\r
+                          It has a target namespace of http://www.imsglobal.org/xsd/imscp_extensionv1p2.\r
+                          This Utility uses this general approach to modeling:\r
+                          (1) All of the elements and attributes are defined as local to their host object;\r
+                          (2) There are multiple host objects;\r
+                          (3) Comments have been added to the complexType definitions.\r
+\r
+            Copyright:    2006 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+                          IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information\r
+                          contained in this binding ("Specification") for purposes of scientific\r
+                          experimental and scholarly collaboration only.  IMS/GLC makes no warranty or \r
+                          representation regarding the accuracy or completeness of the Specification.\r
+                          This material is provided on an "As Is" and "As Available basis".\r
+                          The Specification is at all times subject to change and revision without\r
+                          notice. It is your sole responsibility to evaluate the usefulness, accuracy\r
+                          and completeness of the Specification as it relates to you.  IMS/GLC would\r
+                          appreciate receiving your comments and suggestions.  Please contact IMS/GLC\r
+                          through our website at: http://www.imsglobal.org.\r
+\r
+            Source XSLT File Information\r
+            ----------------------------\r
+            XSL Generator:    UMLtoXSDTransformv0p7.xsl\r
+            XSLT Processor:   Xalan\r
+            Release:          1.0 Beta 1\r
+            Date:             30th November, 2005\r
+\r
+            Auto-generation Tool\r
+            --------------------\r
+            This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool.  While every attempt\r
+            has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware\r
+            that this is an experimental tool.  Permission is given to make use of this tool.  IMS makes no\r
+            claim on the materials created by third party users of this tool.  Details on how to use this tool\r
+            are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation"\r
+            available at the IMS web-site.\r
+            Tool Copyright:  2006 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+        </xs:documentation>\r
+    <xs:documentation xml:lang="en">general: This profile of the extension schema of IMS CP 1.2 restricts extensions to use the variant element only.</xs:documentation>\r
+       </xs:annotation>\r
+\r
+        <!-- Generate Global Attributes ***********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate Namespaced extension Group  *************************************************************  -->\r
+\r
+            <xs:group name="grpStrict.any">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the enumerated simpleType declarations **************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the simpleType elements based IMS data-types  *******************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the derived data-type elements **********************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the data-type elements ******************************************************************  -->\r
+\r
+            <xs:complexType name="IPointer.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A bound instance of an IPointer object allows a packager to associate\r
+                        a specific XML node set in the same IMS Manifest Document that contains \r
+                        it or an XML node set in a different IMS Manifest Document instance with \r
+                        the parent object containing an IMS Pointer instance.  \r
+                        \r
+                        A referenced node set must be a valid child of the referencing parent element, \r
+                        both as to kind and multiplicity in a referencing parent's context.\r
+\r
+                        <p>Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute ref="xlink:type" use="optional" default="simple" />\r
+                <xs:attribute ref="xlink:href" use="required" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Metadata.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An instance of the metadata element contains data structures that declare descriptive\r
+                        information about a metadata element's parent only.\r
+                        \r
+                        One or more different metadata models may be declared as child extensions of a \r
+                        metadata element.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imMetadata:  Metadata.[ Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Variant.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A variant element is closely analogous to a resource element in the \r
+                        IMS Content Packaging Information Model.  Variant is a container for a \r
+                        an alternative resource.  A resource may contain references \r
+                        to assets that are all of the same type or different types (i.e., file formats).\r
+                        \r
+                        The Variant class points to the alternatibe resource.  Metadata is used to \r
+                        describe the nature of a collection of alternative assets and their intended \r
+                        use.  Examples include, but are not limited to, use as lingual variants, \r
+                        visual or auditory variants, remediation variants, or platform delivery variants.\r
+                        \r
+                        The scope of referenced assets is specific to a Variant object.  Their use is in the\r
+                        context of the parent object containing a variant instance, typically a bound instance\r
+                        of a Resource object from the IMS CP namespace.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="1" maxOccurs="1" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="identifierref" use="required" type="xs:IDREF" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="LingualTitle.Type">\r
+                <xs:simpleContent>\r
+                    <xs:extension base="xs:string">\r
+                        <xs:attribute name="language" use="required" type="xs:string" />\r
+                    </xs:extension>\r
+                </xs:simpleContent>\r
+            </xs:complexType>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the elements **********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the root element(s) ***************************************************************  -->\r
+\r
+            <xs:element name="ipointer" type="IPointer.Type" />\r
+            <xs:element name="variant" type="Variant.Type" />\r
+            <xs:element name="lingualTitle" type="LingualTitle.Type" />\r
+\r
+        <!-- =====================================  -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_4/ims_qtiasiv1p2.xsd b/docs/home/ims/domainProfile_4/ims_qtiasiv1p2.xsd
new file mode 100644 (file)
index 0000000..46585ee
--- /dev/null
@@ -0,0 +1,2203 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" targetNamespace="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" elementFormDefault="qualified" version="IMS QTI ASI 1.2">\r
+       <!-- **************************** -->\r
+       <!-- ** Inclusions and Imports ** -->\r
+       <!-- **************************** -->\r
+<!-- ID changed schemaLocation from "http://www.w3.org/2001/03/xml.xsd" to "http://www.w3.org/2001/xml.xsd" -->\r
+       <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />\r
+       <!-- ****************** -->\r
+       <!-- ** Root Element ** -->\r
+       <!-- ****************** -->\r
+       <xs:element name="questestinterop" type="questestinteropType" />\r
+       <!-- ************************** -->\r
+       <!-- ** Element Declarations ** -->\r
+       <!-- ************************** -->\r
+       <xs:element name="altmaterial" type="altmaterialType" />\r
+       <xs:element name="and" type="andType" />\r
+       <xs:element name="and_objects" type="and_objectsType" />\r
+       <xs:element name="and_selection" type="and_selectionType" />\r
+       <xs:element name="and_test" type="and_testType" />\r
+       <xs:element name="assessfeedback" type="assessfeedbackType" />\r
+       <xs:element name="assessment" type="assessmentType" />\r
+       <xs:element name="assessmentcontrol" type="assessmentcontrolType" />\r
+       <xs:element name="assessproc_extension" type="assessproc_extensionType" />\r
+       <xs:element name="conditionvar" type="conditionvarType" />\r
+       <xs:element name="decvar" type="decvarType" />\r
+       <xs:element name="displayfeedback" type="displayfeedbackType" />\r
+       <xs:element name="duration" type="xs:string" />\r
+       <xs:element name="durequal" type="durequalType" />\r
+       <xs:element name="durgt" type="durgtType" />\r
+       <xs:element name="durgte" type="durgteType" />\r
+       <xs:element name="durlt" type="durltType" />\r
+       <xs:element name="durlte" type="durlteType" />\r
+       <xs:element name="fieldentry" type="xs:string" />\r
+       <xs:element name="fieldlabel" type="xs:string" />\r
+       <xs:element name="flow" type="flowType" />\r
+       <xs:element name="flow_label" type="flow_labelType" />\r
+       <xs:element name="flow_mat" type="flow_matType" />\r
+       <xs:element name="hint" type="hintType" />\r
+       <xs:element name="hintmaterial" type="hintmaterialType" />\r
+       <xs:element name="interpretvar" type="interpretvarType" />\r
+       <xs:element name="item" type="itemType" />\r
+       <xs:element name="itemcontrol" type="itemcontrolType" />\r
+       <xs:element name="itemfeedback" type="itemfeedbackType" />\r
+       <xs:element name="itemmetadata" type="itemmetadataType" />\r
+       <xs:element name="itempostcondition" type="xs:string" />\r
+       <xs:element name="itemprecondition" type="xs:string" />\r
+       <xs:element name="itemproc_extension" type="itemproc_extensionType" />\r
+       <xs:element name="itemref" type="itemrefType" />\r
+       <xs:element name="itemrubric" type="itemrubricType" />\r
+       <xs:element name="map_input" type="map_inputType" />\r
+       <xs:element name="map_output" type="map_outputType" />\r
+       <xs:element name="mat_extension" type="mat_extensionType" />\r
+       <xs:element name="matapplet" type="matappletType" />\r
+       <xs:element name="matapplication" type="matapplicationType" />\r
+       <xs:element name="mataudio" type="mataudioType" />\r
+       <xs:element name="matbreak" type="matbreakType" />\r
+       <xs:element name="matemtext" type="matemtextType" />\r
+       <xs:element name="material" type="materialType" />\r
+       <xs:element name="material_ref" type="material_refType" />\r
+       <xs:element name="matimage" type="matimageType" />\r
+       <xs:element name="matref" type="matrefType" />\r
+       <xs:element name="mattext" type="mattextType" />\r
+       <xs:element name="matvideo" type="matvideoType" />\r
+       <xs:element name="not" type="notType" />\r
+       <xs:element name="not_objects" type="not_objectsType" />\r
+       <xs:element name="not_selection" type="not_selectionType" />\r
+       <xs:element name="not_test" type="not_testType" />\r
+       <xs:element name="objectbank" type="objectbankType" />\r
+       <xs:element name="objectives" type="objectivesType" />\r
+       <xs:element name="objects_condition" type="objects_conditionType" />\r
+       <xs:element name="objects_parameter" type="objects_parameterType" />\r
+       <xs:element name="objectscond_extension" type="xs:string" />\r
+       <xs:element name="or" type="orType" />\r
+       <xs:element name="or_objects" type="or_objectsType" />\r
+       <xs:element name="or_selection" type="or_selectionType" />\r
+       <xs:element name="or_test" type="or_testType" />\r
+       <xs:element name="order" type="orderType" />\r
+       <xs:element name="order_extension" type="order_extensionType" />\r
+       <xs:element name="other" type="xs:string" />\r
+       <xs:element name="outcomes" type="outcomesType" />\r
+       <xs:element name="outcomes_feedback_test" type="outcomes_feedback_testType" />\r
+       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+       <xs:element name="outcomes_processing" type="outcomes_processingType" />\r
+       <xs:element name="presentation" type="presentationType" />\r
+       <xs:element name="presentation_material" type="presentation_materialType" />\r
+       <xs:element name="processing_parameter" type="processing_parameterType" />\r
+       <xs:element name="qmd_computerscored" type="xs:string" />\r
+       <xs:element name="qmd_feedbackpermitted" type="xs:string" />\r
+       <xs:element name="qmd_hintspermitted" type="xs:string" />\r
+       <xs:element name="qmd_itemtype" type="xs:string" />\r
+       <xs:element name="qmd_levelofdifficulty" type="xs:string" />\r
+       <xs:element name="qmd_material" type="xs:string" />\r
+       <xs:element name="qmd_maximumscore" type="xs:string" />\r
+       <xs:element name="qmd_renderingtype" type="xs:string" />\r
+       <xs:element name="qmd_responsetype" type="xs:string" />\r
+       <xs:element name="qmd_scoringpermitted" type="xs:string" />\r
+       <xs:element name="qmd_solutionspermitted" type="xs:string" />\r
+       <xs:element name="qmd_status" type="xs:string" />\r
+       <xs:element name="qmd_timedependence" type="xs:string" />\r
+       <xs:element name="qmd_timelimit" type="xs:string" />\r
+       <xs:element name="qmd_toolvendor" type="xs:string" />\r
+       <xs:element name="qmd_topic" type="xs:string" />\r
+       <xs:element name="qmd_typeofsolution" type="xs:string" />\r
+       <xs:element name="qmd_weighting" type="xs:string" />\r
+       <xs:element name="qticomment" type="qticommentType" />\r
+       <xs:element name="qtimetadata" type="qtimetadataType" />\r
+       <xs:element name="qtimetadatafield" type="qtimetadatafieldType" />\r
+       <xs:element name="reference" type="referenceType" />\r
+       <xs:element name="render_choice" type="render_choiceType" />\r
+       <xs:element name="render_fib" type="render_fibType" />\r
+       <xs:element name="render_hotspot" type="render_hotspotType" />\r
+       <xs:element name="render_slider" type="render_sliderType" />\r
+       <xs:element name="respcond_extension" type="respcond_extensionType" />\r
+       <xs:element name="respcondition" type="respconditionType" />\r
+       <xs:element name="render_extension" type="render_extensionType" />\r
+       <xs:element name="response_extension" type="response_extensionType" />\r
+       <xs:element name="response_grp" type="response_grpType" />\r
+       <xs:element name="response_labelType" type="response_labelType" />\r
+       <xs:element name="response_lid" type="response_lidType" />\r
+       <xs:element name="response_na" type="response_naType" />\r
+       <xs:element name="response_num" type="response_numType" />\r
+       <xs:element name="response_str" type="response_strType" />\r
+       <xs:element name="response_xy" type="response_xyType" />\r
+       <xs:element name="resprocessing" type="resprocessingType" />\r
+       <xs:element name="rubric" type="rubricType" />\r
+       <xs:element name="section" type="sectionType" />\r
+       <xs:element name="sectioncontrol" type="sectioncontrolType" />\r
+       <xs:element name="sectionfeedback" type="sectionfeedbackType" />\r
+       <xs:element name="sectionproc_extension" type="sectionproc_extensionType" />\r
+       <xs:element name="sectionpostcondition" type="xs:string" />\r
+       <xs:element name="sectionprecondition" type="xs:string" />\r
+       <xs:element name="sectionref" type="sectionrefType" />\r
+       <xs:element name="selection" type="selectionType" />\r
+       <xs:element name="selection_extension" type="selection_extensionType" />\r
+       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+       <xs:element name="selection_number" type="xs:string" />\r
+       <xs:element name="selection_ordering" type="selection_orderingType" />\r
+       <xs:element name="sequence_parameter" type="sequence_parameterType" />\r
+       <xs:element name="setvar" type="setvarType" />\r
+       <xs:element name="solution" type="solutionType" />\r
+       <xs:element name="solutionmaterial" type="solutionmaterialType" />\r
+       <xs:element name="sourcebank_ref" type="xs:string" />\r
+       <xs:element name="test_variable" type="test_variableType" />\r
+       <xs:element name="unanswered" type="unansweredType" />\r
+       <xs:element name="var_extension" type="var_extensionType" />\r
+       <xs:element name="varequal" type="varequalType" />\r
+       <xs:element name="vargt" type="vargtType" />\r
+       <xs:element name="vargte" type="vargteType" />\r
+       <xs:element name="variable_test" type="variable_testType" />\r
+       <xs:element name="varinside" type="varinsideType" />\r
+       <xs:element name="varlt" type="varltType" />\r
+       <xs:element name="varlte" type="varlteType" />\r
+       <xs:element name="varsubset" type="varsubsetType" />\r
+       <xs:element name="varsubstring" type="varsubstringType" />\r
+       <xs:element name="vocabulary" type="vocabularyType" />\r
+       <!-- ******************************* -->\r
+       <!-- ** Complex Type Declarations ** -->\r
+       <!-- ******************************* -->\r
+       <!-- ***************** -->\r
+       <!-- ** altmaterial ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="altmaterialType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="mattext" type="mattextType" />\r
+                               <xs:element name="matemtext" type="matemtextType" />\r
+                               <xs:element name="matimage" type="matimageType" />\r
+                               <xs:element name="mataudio" type="mataudioType" />\r
+                               <xs:element name="matvideo" type="matvideoType" />\r
+                               <xs:element name="matapplet" type="matappletType" />\r
+                               <xs:element name="matapplication" type="matapplicationType" />\r
+                               <xs:element name="matref" type="matrefType" />\r
+                               <xs:element ref="matbreak" />\r
+                               <xs:element ref="mat_extension" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ********* -->\r
+       <!-- ** and ** -->\r
+       <!-- ********* -->\r
+       <xs:complexType name="andType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="not" type="notType" />\r
+                       <xs:element name="and" type="andType" />\r
+                       <xs:element name="or" type="orType" />\r
+                       <xs:element name="unanswered" type="unansweredType" />\r
+                       <xs:element ref="other" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" />\r
+                       <xs:element name="varlte" type="varlteType" />\r
+                       <xs:element name="vargt" type="vargtType" />\r
+                       <xs:element name="vargte" type="vargteType" />\r
+                       <xs:element name="varsubset" type="varsubsetType" />\r
+                       <xs:element name="varinside" type="varinsideType" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" />\r
+                       <xs:element name="durequal" type="durequalType" />\r
+                       <xs:element name="durlt" type="durltType" />\r
+                       <xs:element name="durlte" type="durlteType" />\r
+                       <xs:element name="durgt" type="durgtType" />\r
+                       <xs:element name="durgte" type="durgteType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** and_objects ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="and_objectsType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                       <xs:element name="and_objects" type="and_objectsType" />\r
+                       <xs:element name="or_objects" type="or_objectsType" />\r
+                       <xs:element name="not_objects" type="not_objectsType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** and_selection ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="and_selectionType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+                       <xs:element name="and_selection" type="and_selectionType" />\r
+                       <xs:element name="or_selection" type="or_selectionType" />\r
+                       <xs:element name="not_selection" type="not_selectionType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** and_test ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="and_testType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** assessfeedback ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="assessfeedbackType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** assessment ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="assessmentType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element ref="duration" minOccurs="0" />\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="assessmentcontrol" type="assessmentcontrolType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="rubric" type="rubricType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="presentation_material" type="presentation_materialType" minOccurs="0" />\r
+                       <xs:element name="outcomes_processing" type="outcomes_processingType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="assessproc_extension" minOccurs="0" />\r
+                       <xs:element name="assessfeedback" type="assessfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="selection_ordering" type="selection_orderingType" minOccurs="0" />\r
+                       <xs:element name="reference" type="referenceType" minOccurs="0" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="sectionref" type="sectionrefType" />\r
+                               <xs:element name="section" type="sectionType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** assessmentcontrol ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="assessmentcontrolType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="hintswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="solutionswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="feedbackswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ************************** -->\r
+       <!-- ** assessproc_extension ** -->\r
+       <!-- ************************** -->\r
+       <xs:complexType name="assessproc_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** conditionvar ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="conditionvarType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="not" type="notType" />\r
+                       <xs:element name="and" type="andType" />\r
+                       <xs:element name="or" type="orType" />\r
+                       <xs:element name="unanswered" type="unansweredType" />\r
+                       <xs:element ref="other" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" />\r
+                       <xs:element name="varlte" type="varlteType" />\r
+                       <xs:element name="vargt" type="vargtType" />\r
+                       <xs:element name="vargte" type="vargteType" />\r
+                       <xs:element name="varsubset" type="varsubsetType" />\r
+                       <xs:element name="varinside" type="varinsideType" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" />\r
+                       <xs:element name="durequal" type="durequalType" />\r
+                       <xs:element name="durlt" type="durltType" />\r
+                       <xs:element name="durlte" type="durlteType" />\r
+                       <xs:element name="durgt" type="durgtType" />\r
+                       <xs:element name="durgte" type="durgteType" />\r
+                       <xs:element ref="var_extension" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** decvar ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="decvarType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                               <xs:attribute name="vartype" default="Integer">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Integer" />\r
+                                                       <xs:enumeration value="String" />\r
+                                                       <xs:enumeration value="Decimal" />\r
+                                                       <xs:enumeration value="Scientific" />\r
+                                                       <xs:enumeration value="Boolean" />\r
+                                                       <xs:enumeration value="Enumerated" />\r
+                                                       <xs:enumeration value="Set" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="defaultval" type="xs:string" />\r
+                               <xs:attribute name="minvalue" type="xs:string" />\r
+                               <xs:attribute name="maxvalue" type="xs:string" />\r
+                               <xs:attribute name="members" type="xs:string" />\r
+                               <xs:attribute name="cutvalue" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** displayfeedback ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="displayfeedbackType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="feedbacktype" default="Response">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Response" />\r
+                                                       <xs:enumeration value="Solution" />\r
+                                                       <xs:enumeration value="Hint" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** durequal ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="durequalType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** durgt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="durgtType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** durgte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="durgteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** durlt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="durltType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** durlte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="durlteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ********** -->\r
+       <!-- ** flow ** -->\r
+       <!-- ********** -->\r
+       <xs:complexType name="flowType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="flow" type="flowType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+                       <xs:element name="response_lid" type="response_lidType" />\r
+                       <xs:element name="response_xy" type="response_xyType" />\r
+                       <xs:element name="response_str" type="response_strType" />\r
+                       <xs:element name="response_num" type="response_numType" />\r
+                       <xs:element name="response_grp" type="response_grpType" />\r
+                       <xs:element ref="response_extension" />\r
+               </xs:choice>\r
+               <xs:attribute name="class" type="xs:string" default="Block" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** flow_label ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="flow_labelType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="flow_label" type="flow_labelType" />\r
+                       <xs:element name="response_label" type="response_labelType" />\r
+               </xs:choice>\r
+               <xs:attribute name="class" type="xs:string" default="Block" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** flow_mat ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="flow_matType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="flow_mat" type="flow_matType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+               </xs:choice>\r
+               <xs:attribute name="class" type="xs:string" default="Block" />\r
+       </xs:complexType>\r
+       <!-- ********** -->\r
+       <!-- ** hint ** -->\r
+       <!-- ********** -->\r
+       <xs:complexType name="hintType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="hintmaterial" type="hintmaterialType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackstyle" default="Complete">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Complete" />\r
+                                       <xs:enumeration value="Incremental" />\r
+                                       <xs:enumeration value="Multilevel" />\r
+                                       <xs:enumeration value="Proprietary" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** hintmaterial ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="hintmaterialType">\r
+               <xs:choice>\r
+                       <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                       <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** interpretvar ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="interpretvarType">\r
+               <xs:choice>\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+               </xs:choice>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+       </xs:complexType>\r
+       <!-- ********** -->\r
+       <!-- ** item ** -->\r
+       <!-- ********** -->\r
+       <xs:complexType name="itemType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element ref="duration" minOccurs="0" />\r
+                       <xs:element name="itemmetadata" type="itemmetadataType" minOccurs="0" />\r
+                       <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="itemcontrol" type="itemcontrolType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="itemprecondition" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="itempostcondition" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="itemrubric" type="itemrubricType" />\r
+                               <xs:element name="rubric" type="rubricType" />\r
+                       </xs:choice>\r
+                       <xs:element name="presentation" type="presentationType" minOccurs="0" />\r
+                       <xs:element name="resprocessing" type="resprocessingType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="itemproc_extension" minOccurs="0" />\r
+                       <xs:element name="itemfeedback" type="itemfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="reference" type="referenceType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="maxattempts" type="xs:string" />\r
+               <xs:attribute name="label" type="xs:string" />\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** itemcontrol ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="itemcontrolType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="hintswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="solutionswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** itemfeedback ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="itemfeedbackType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:choice>\r
+                               <xs:element name="flow_mat" type="flow_matType" />\r
+                               <xs:element name="material" type="materialType" />\r
+                       </xs:choice>\r
+                       <xs:element name="solution" type="solutionType" />\r
+                       <xs:element name="hint" type="hintType" />\r
+               </xs:choice>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** itemmetadata ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="itemmetadataType">\r
+               <xs:sequence>\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="qmd_computerscored" minOccurs="0" />\r
+                       <xs:element ref="qmd_feedbackpermitted" minOccurs="0" />\r
+                       <xs:element ref="qmd_hintspermitted" minOccurs="0" />\r
+                       <xs:element ref="qmd_itemtype" minOccurs="0" />\r
+                       <xs:element ref="qmd_levelofdifficulty" minOccurs="0" />\r
+                       <xs:element ref="qmd_maximumscore" minOccurs="0" />\r
+                       <xs:element ref="qmd_renderingtype" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="qmd_responsetype" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="qmd_scoringpermitted" minOccurs="0" />\r
+                       <xs:element ref="qmd_solutionspermitted" minOccurs="0" />\r
+                       <xs:element ref="qmd_status" minOccurs="0" />\r
+                       <xs:element ref="qmd_timedependence" minOccurs="0" />\r
+                       <xs:element ref="qmd_timelimit" minOccurs="0" />\r
+                       <xs:element ref="qmd_toolvendor" minOccurs="0" />\r
+                       <xs:element ref="qmd_topic" minOccurs="0" />\r
+                       <xs:element ref="qmd_weighting" minOccurs="0" />\r
+                       <xs:element ref="qmd_material" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="qmd_typeofsolution" minOccurs="0" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** itemproc_extension ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="itemproc_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** itemref ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="itemrefType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** itemrubric ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="itemrubricType">\r
+               <xs:sequence>\r
+                       <xs:element name="material" type="materialType" />\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** map_input ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="map_inputType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** map_output ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="map_outputType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** mat_extension ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="mat_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** matapplet ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="matappletType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** matapplication ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="matapplicationType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="apptype" type="xs:string" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** mataudio ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="mataudioType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="audiotype" type="xs:string" default="audio/base" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** matbreak ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="matbreakType" />\r
+       <!-- *************** -->\r
+       <!-- ** matemtext ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="matemtextType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="texttype" type="xs:string" default="text/plain" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute ref="xml:space" default="default" />\r
+                               <xs:attribute ref="xml:lang" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** material ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="materialType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="mattext" type="mattextType" />\r
+                               <xs:element name="matemtext" type="matemtextType" />\r
+                               <xs:element name="matimage" type="matimageType" />\r
+                               <xs:element name="mataudio" type="mataudioType" />\r
+                               <xs:element name="matvideo" type="matvideoType" />\r
+                               <xs:element name="matapplet" type="matappletType" />\r
+                               <xs:element name="matapplication" type="matapplicationType" />\r
+                               <xs:element name="matref" type="matrefType" />\r
+                               <xs:element ref="matbreak" />\r
+                               <xs:element ref="mat_extension" />\r
+                       </xs:choice>\r
+                       <xs:element name="altmaterial" type="altmaterialType" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="label" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** material_ref ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="material_refType">\r
+               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** matimage ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="matimageType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="imagtype" type="xs:string" default="image/jpeg" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** matref ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="matrefType">\r
+               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** mattext ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="mattextType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="texttype" type="xs:string" default="text/plain" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute ref="xml:space" default="default" />\r
+                               <xs:attribute ref="xml:lang" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** matvideo ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="matvideoType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="videotype" type="xs:string" default="video/avi" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ********* -->\r
+       <!-- ** not ** -->\r
+       <!-- ********* -->\r
+       <xs:complexType name="notType">\r
+               <xs:choice>\r
+                       <xs:element name="and" type="andType" />\r
+                       <xs:element name="or" type="orType" />\r
+                       <xs:element name="not" type="notType" />\r
+                       <xs:element name="unanswered" type="unansweredType" />\r
+                       <xs:element ref="other" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" />\r
+                       <xs:element name="varlte" type="varlteType" />\r
+                       <xs:element name="vargt" type="vargtType" />\r
+                       <xs:element name="vargte" type="vargteType" />\r
+                       <xs:element name="varsubset" type="varsubsetType" />\r
+                       <xs:element name="varinside" type="varinsideType" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" />\r
+                       <xs:element name="durequal" type="durequalType" />\r
+                       <xs:element name="durlt" type="durltType" />\r
+                       <xs:element name="durlte" type="durlteType" />\r
+                       <xs:element name="durgt" type="durgtType" />\r
+                       <xs:element name="durgte" type="durgteType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** not_objects ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="not_objectsType">\r
+               <xs:choice>\r
+                       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                       <xs:element name="and_objects" type="and_objectsType" />\r
+                       <xs:element name="or_objects" type="or_objectsType" />\r
+                       <xs:element name="not_objects" type="not_objectsType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** not_selection ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="not_selectionType">\r
+               <xs:choice>\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+                       <xs:element name="and_selection" type="and_selectionType" />\r
+                       <xs:element name="or_selection" type="or_selectionType" />\r
+                       <xs:element name="not_selection" type="not_selectionType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** not_test ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="not_testType">\r
+               <xs:choice>\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** objectbank ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="objectbankType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="section" type="sectionType" />\r
+                               <xs:element name="item" type="itemType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** objectives ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="objectivesType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** objects_condition ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="objects_conditionType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                               <xs:element name="and_objects" type="and_objectsType" />\r
+                               <xs:element name="or_objects" type="or_objectsType" />\r
+                               <xs:element name="not_objects" type="not_objectsType" />\r
+                       </xs:choice>\r
+                       <xs:element name="objects_parameter" type="objects_parameterType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="map_input" type="map_inputType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="objectscond_extension" minOccurs="0" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** objects_parameter ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="objects_parameterType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="pname" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******** -->\r
+       <!-- ** or ** -->\r
+       <!-- ******** -->\r
+       <xs:complexType name="orType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="not" type="notType" />\r
+                       <xs:element name="and" type="andType" />\r
+                       <xs:element name="or" type="orType" />\r
+                       <xs:element name="unanswered" type="unansweredType" />\r
+                       <xs:element ref="other" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" />\r
+                       <xs:element name="varlte" type="varlteType" />\r
+                       <xs:element name="vargt" type="vargtType" />\r
+                       <xs:element name="vargte" type="vargteType" />\r
+                       <xs:element name="varsubset" type="varsubsetType" />\r
+                       <xs:element name="varinside" type="varinsideType" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" />\r
+                       <xs:element name="durequal" type="durequalType" />\r
+                       <xs:element name="durlt" type="durltType" />\r
+                       <xs:element name="durlte" type="durlteType" />\r
+                       <xs:element name="durgt" type="durgtType" />\r
+                       <xs:element name="durgte" type="durgteType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** or_objects ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="or_objectsType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                       <xs:element name="and_objects" type="and_objectsType" />\r
+                       <xs:element name="or_objects" type="or_objectsType" />\r
+                       <xs:element name="not_objects" type="not_objectsType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** or_selection ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="or_selectionType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+                       <xs:element name="and_selection" type="and_selectionType" />\r
+                       <xs:element name="or_selection" type="or_selectionType" />\r
+                       <xs:element name="not_selection" type="not_selectionType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** or_test ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="or_testType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** order ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="orderType">\r
+               <xs:sequence>\r
+                       <xs:element ref="order_extension" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="order_type" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** order_extension ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="order_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** outcomes ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="outcomesType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:sequence maxOccurs="unbounded">\r
+                               <xs:element name="decvar" type="decvarType" />\r
+                               <xs:element name="interpretvar" type="interpretvarType" minOccurs="0" maxOccurs="unbounded" />\r
+                       </xs:sequence>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- **************************** -->\r
+       <!-- ** outcomes_feedback_test ** -->\r
+       <!-- **************************** -->\r
+       <xs:complexType name="outcomes_feedback_testType">\r
+               <xs:sequence>\r
+                       <xs:element name="test_variable" type="test_variableType" />\r
+                       <xs:element name="displayfeedback" type="displayfeedbackType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** outcomes_metadata ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="outcomes_metadataType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="mdname" type="xs:string" use="required" />\r
+                               <xs:attribute name="mdoperator" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="EQ" />\r
+                                                       <xs:enumeration value="NEQ" />\r
+                                                       <xs:enumeration value="LT" />\r
+                                                       <xs:enumeration value="LTE" />\r
+                                                       <xs:enumeration value="GT" />\r
+                                                       <xs:enumeration value="GTE" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************************* -->\r
+       <!-- ** outcomes_processing ** -->\r
+       <!-- ************************* -->\r
+       <xs:complexType name="outcomes_processingType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="outcomes" type="outcomesType" />\r
+                       <xs:element name="objects_condition" type="objects_conditionType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="processing_parameter" type="processing_parameterType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="map_output" type="map_outputType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="outcomes_feedback_test" type="outcomes_feedback_testType" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="scoremodel" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** presentation ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="presentationType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="flow" type="flowType" />\r
+                               <xs:choice maxOccurs="unbounded">\r
+                                       <xs:element name="material" type="materialType" />\r
+                                       <xs:element name="response_lid" type="response_lidType" />\r
+                                       <xs:element name="response_xy" type="response_xyType" />\r
+                                       <xs:element name="response_str" type="response_strType" />\r
+                                       <xs:element name="response_num" type="response_numType" />\r
+                                       <xs:element name="response_grp" type="response_grpType" />\r
+                                       <xs:element ref="response_extension" />\r
+                               </xs:choice>\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="label" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+               <xs:attribute name="y0" type="xs:string" />\r
+               <xs:attribute name="x0" type="xs:string" />\r
+               <xs:attribute name="width" type="xs:string" />\r
+               <xs:attribute name="height" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- *************************** -->\r
+       <!-- ** presentation_material ** -->\r
+       <!-- *************************** -->\r
+       <xs:complexType name="presentation_materialType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ************************** -->\r
+       <!-- ** processing_parameter ** -->\r
+       <!-- ************************** -->\r
+       <xs:complexType name="processing_parameterType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="pname" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** qticomment ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="qticommentType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute ref="xml:lang" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** qtimetadata ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="qtimetadataType">\r
+               <xs:sequence>\r
+                       <xs:element name="vocabulary" type="vocabularyType" minOccurs="0" />\r
+                       <xs:element name="qtimetadatafield" type="qtimetadatafieldType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ********************** -->\r
+       <!-- ** qtimetadatafield ** -->\r
+       <!-- ********************** -->\r
+       <xs:complexType name="qtimetadatafieldType">\r
+               <xs:sequence>\r
+                       <xs:element ref="fieldlabel" />\r
+                       <xs:element ref="fieldentry" />\r
+               </xs:sequence>\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** questestinterop ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="questestinteropType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="objectbank" type="objectbankType" />\r
+                               <xs:element name="assessment" type="assessmentType" />\r
+                               <xs:choice maxOccurs="unbounded">\r
+                                       <xs:element name="section" type="sectionType" />\r
+                                       <xs:element name="item" type="itemType" />\r
+                               </xs:choice>\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** reference ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="referenceType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="qticomment" type="qticommentType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="mattext" type="mattextType" />\r
+                       <xs:element name="matemtext" type="matemtextType" />\r
+                       <xs:element name="matimage" type="matimageType" />\r
+                       <xs:element name="mataudio" type="mataudioType" />\r
+                       <xs:element name="matvideo" type="matvideoType" />\r
+                       <xs:element name="matapplet" type="matappletType" />\r
+                       <xs:element name="matapplication" type="matapplicationType" />\r
+                       <xs:element ref="matbreak" />\r
+                       <xs:element ref="mat_extension" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** render_choice ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="render_choiceType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="shuffle" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ********************** -->\r
+       <!-- ** render_extension ** -->\r
+       <!-- ********************** -->\r
+       <xs:complexType name="render_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** render_fib ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="render_fibType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="encoding" type="xs:string" default="UTF_8" />\r
+               <xs:attribute name="fibtype" default="String">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="String" />\r
+                                       <xs:enumeration value="Integer" />\r
+                                       <xs:enumeration value="Decimal" />\r
+                                       <xs:enumeration value="Scientific" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rows" type="xs:string" />\r
+               <xs:attribute name="maxchars" type="xs:string" />\r
+               <xs:attribute name="prompt">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Box" />\r
+                                       <xs:enumeration value="Dashline" />\r
+                                       <xs:enumeration value="Asterisk" />\r
+                                       <xs:enumeration value="Underline" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="columns" type="xs:string" />\r
+               <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** render_hotspot ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="render_hotspotType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+               <xs:attribute name="showdraw" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** render_slider ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="render_sliderType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="orientation" default="Horizontal">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Horizontal" />\r
+                                       <xs:enumeration value="Vertical" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="lowerbound" type="xs:string" use="required" />\r
+               <xs:attribute name="upperbound" type="xs:string" use="required" />\r
+               <xs:attribute name="step" type="xs:string" />\r
+               <xs:attribute name="startval" type="xs:string" />\r
+               <xs:attribute name="steplabel" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** respcond_extension ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="respcond_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** respcondition ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="respconditionType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="conditionvar" type="conditionvarType" />\r
+                       <xs:element name="setvar" type="setvarType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="displayfeedback" type="displayfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="respcond_extension" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="continue" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** response_extension ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="response_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** response_grp ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_grpType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** response_lableType ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="response_labelType" mixed="true">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="qticomment" type="qticommentType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+                       <xs:element name="flow_mat" type="flow_matType" />\r
+               </xs:choice>\r
+               <xs:attribute name="rshuffle" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rarea" default="Ellipse">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Ellipse" />\r
+                                       <xs:enumeration value="Rectangle" />\r
+                                       <xs:enumeration value="Bounded" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rrange" default="Exact">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Exact" />\r
+                                       <xs:enumeration value="Range" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="labelrefid" type="xs:string" />\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="match_group" type="xs:string" />\r
+               <xs:attribute name="match_max" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** response_lid ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_lidType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** response_na ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="response_naType" />\r
+       <!-- ****************** -->\r
+       <!-- ** response_num ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_numType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="numtype" default="Integer">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Integer" />\r
+                                       <xs:enumeration value="Decimal" />\r
+                                       <xs:enumeration value="Scientific" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** response_str ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_strType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** response_xy ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="response_xyType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** resprocessing ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="resprocessingType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="outcomes" type="outcomesType" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="respcondition" type="respconditionType" />\r
+                               <xs:element ref="itemproc_extension" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="scoremodel" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** rubric ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="rubricType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** section ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="sectionType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element ref="duration" minOccurs="0" />\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="sectioncontrol" type="sectioncontrolType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="sectionprecondition" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="sectionpostcondition" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="rubric" type="rubricType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="presentation_material" type="presentation_materialType" minOccurs="0" />\r
+                       <xs:element name="outcomes_processing" type="outcomes_processingType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="sectionproc_extension" minOccurs="0" />\r
+                       <xs:element name="sectionfeedback" type="sectionfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="selection_ordering" type="selection_orderingType" minOccurs="0" />\r
+                       <xs:element name="reference" type="referenceType" minOccurs="0" />\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="itemref" type="itemrefType" />\r
+                               <xs:element name="item" type="itemType" />\r
+                               <xs:element name="sectionref" type="sectionrefType" />\r
+                               <xs:element name="section" type="sectionType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** sectioncontrol ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="sectioncontrolType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="hintswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="solutionswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** sectionfeedback ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="sectionfeedbackType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- *************************** -->\r
+       <!-- ** sectionproc_extension ** -->\r
+       <!-- *************************** -->\r
+       <xs:complexType name="sectionproc_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** sectionref ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="sectionrefType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** selection ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="selectionType">\r
+               <xs:sequence>\r
+                       <xs:element ref="sourcebank_ref" minOccurs="0" />\r
+                       <xs:element ref="selection_number" minOccurs="0" />\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" minOccurs="0" />\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="and_selection" type="and_selectionType" />\r
+                               <xs:element name="or_selection" type="or_selectionType" />\r
+                               <xs:element name="not_selection" type="not_selectionType" />\r
+                               <xs:element ref="selection_extension" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ************************* -->\r
+       <!-- ** selection_extension ** -->\r
+       <!-- ************************* -->\r
+       <xs:complexType name="selection_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** selection_metadata ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="selection_metadataType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="mdname" type="xs:string" use="required" />\r
+                               <xs:attribute name="mdoperator" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="EQ" />\r
+                                                       <xs:enumeration value="NEQ" />\r
+                                                       <xs:enumeration value="LT" />\r
+                                                       <xs:enumeration value="LTE" />\r
+                                                       <xs:enumeration value="GT" />\r
+                                                       <xs:enumeration value="GTE" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** selection_ordering ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="selection_orderingType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="sequence_parameter" type="sequence_parameterType" minOccurs="0" />\r
+                       <xs:element name="selection" type="selectionType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="order" type="orderType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="sequence_type" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** sequence_parameter ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="sequence_parameterType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="pname" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** setvar ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="setvarType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                               <xs:attribute name="action" default="Set">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Set" />\r
+                                                       <xs:enumeration value="Add" />\r
+                                                       <xs:enumeration value="Subtract" />\r
+                                                       <xs:enumeration value="Multiply" />\r
+                                                       <xs:enumeration value="Divide" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** solution ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="solutionType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="solutionmaterial" type="solutionmaterialType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackstyle" default="Complete">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Complete" />\r
+                                       <xs:enumeration value="Incremental" />\r
+                                       <xs:enumeration value="Multilevel" />\r
+                                       <xs:enumeration value="Proprietary" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ********************** -->\r
+       <!-- ** solutionmaterial ** -->\r
+       <!-- ********************** -->\r
+       <xs:complexType name="solutionmaterialType">\r
+               <xs:choice>\r
+                       <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                       <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** test_variable ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="test_variableType">\r
+               <xs:choice>\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** unanswered ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="unansweredType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** var_extension ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="var_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** varequal ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="varequalType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="case" default="No">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Yes" />\r
+                                                       <xs:enumeration value="No" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** vargt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="vargtType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** vargte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="vargteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** variable_test ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="variable_testType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                               <xs:attribute name="testoperator" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="EQ" />\r
+                                                       <xs:enumeration value="NEQ" />\r
+                                                       <xs:enumeration value="LT" />\r
+                                                       <xs:enumeration value="LTE" />\r
+                                                       <xs:enumeration value="GT" />\r
+                                                       <xs:enumeration value="GTE" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** varinside ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="varinsideType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="areatype" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Ellipse" />\r
+                                                       <xs:enumeration value="Rectangle" />\r
+                                                       <xs:enumeration value="Bounded" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** varlt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="varltType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** varlte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="varlteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** varsubset ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="varsubsetType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="setmatch" default="Exact">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Exact" />\r
+                                                       <xs:enumeration value="Partial" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** varsubstring ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="varsubstringType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="case" default="No">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Yes" />\r
+                                                       <xs:enumeration value="No" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** vocabulary ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="vocabularyType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                               <xs:attribute name="vocab_type" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd b/docs/home/ims/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd
new file mode 100644 (file)
index 0000000..182d5b5
--- /dev/null
@@ -0,0 +1,2218 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+\r
+<!--** This schema has been modified from the original schema named -      **-->\r
+\r
+<!--** ims_qtiasiv1p2.xsd                                                  **-->\r
+\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+\r
+<!--** Commission under contract IST-507128                                **-->\r
+\r
+<!--*************************************************************************-->\r
+\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="ims_qtiasiv1p2_def_copy.xsd" targetNamespace="ims_qtiasiv1p2_def_copy.xsd" elementFormDefault="qualified" version="IMS QTI ASI 1.2">\r
+  <!-- **************************** -->\r
+  <!-- ** Inclusions and Imports ** -->\r
+  <!-- **************************** -->\r
+  <!-- ID changed schemaLocation from "http://www.w3.org/2001/03/xml.xsd" to "http://www.w3.org/2001/xml.xsd" -->\r
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />\r
+  <!-- ****************** -->\r
+  <!-- ** Root Element ** -->\r
+  <!-- ****************** -->\r
+  <xs:element name="questestinterop" type="questestinteropType" />\r
+  <!-- ************************** -->\r
+  <!-- ** Element Declarations ** -->\r
+  <!-- ************************** -->\r
+  <xs:element name="altmaterial" type="altmaterialType" />\r
+  <xs:element name="and" type="andType" />\r
+  <xs:element name="and_objects" type="and_objectsType" />\r
+  <xs:element name="and_selection" type="and_selectionType" />\r
+  <xs:element name="and_test" type="and_testType" />\r
+  <xs:element name="assessfeedback" type="assessfeedbackType" />\r
+  <xs:element name="assessment" type="assessmentType" />\r
+  <xs:element name="assessmentcontrol" type="assessmentcontrolType" />\r
+  <xs:element name="assessproc_extension" type="assessproc_extensionType" />\r
+  <xs:element name="conditionvar" type="conditionvarType" />\r
+  <xs:element name="decvar" type="decvarType" />\r
+  <xs:element name="displayfeedback" type="displayfeedbackType" />\r
+  <xs:element name="duration" type="xs:string" />\r
+  <xs:element name="durequal" type="durequalType" />\r
+  <xs:element name="durgt" type="durgtType" />\r
+  <xs:element name="durgte" type="durgteType" />\r
+  <xs:element name="durlt" type="durltType" />\r
+  <xs:element name="durlte" type="durlteType" />\r
+  <xs:element name="fieldentry" type="xs:string" />\r
+  <xs:element name="fieldlabel" type="xs:string" />\r
+  <xs:element name="flow" type="flowType" />\r
+  <xs:element name="flow_label" type="flow_labelType" />\r
+  <xs:element name="flow_mat" type="flow_matType" />\r
+  <xs:element name="hint" type="hintType" />\r
+  <xs:element name="hintmaterial" type="hintmaterialType" />\r
+  <xs:element name="interpretvar" type="interpretvarType" />\r
+  <xs:element name="item" type="itemType" />\r
+  <xs:element name="itemcontrol" type="itemcontrolType" />\r
+  <xs:element name="itemfeedback" type="itemfeedbackType" />\r
+  <xs:element name="itemmetadata" type="itemmetadataType" />\r
+  <xs:element name="itempostcondition" type="xs:string" />\r
+  <xs:element name="itemprecondition" type="xs:string" />\r
+  <xs:element name="itemproc_extension" type="itemproc_extensionType" />\r
+  <xs:element name="itemref" type="itemrefType" />\r
+  <xs:element name="itemrubric" type="itemrubricType" />\r
+  <xs:element name="map_input" type="map_inputType" />\r
+  <xs:element name="map_output" type="map_outputType" />\r
+  <xs:element name="mat_extension" type="mat_extensionType" />\r
+  <xs:element name="matapplet" type="matappletType" />\r
+  <xs:element name="matapplication" type="matapplicationType" />\r
+  <xs:element name="mataudio" type="mataudioType" />\r
+  <xs:element name="matbreak" type="matbreakType" />\r
+  <xs:element name="matemtext" type="matemtextType" />\r
+  <xs:element name="material" type="materialType" />\r
+  <xs:element name="material_ref" type="material_refType" />\r
+  <xs:element name="matimage" type="matimageType" />\r
+  <xs:element name="matref" type="matrefType" />\r
+  <xs:element name="mattext" type="mattextType" />\r
+  <xs:element name="matvideo" type="matvideoType" />\r
+  <xs:element name="not" type="notType" />\r
+  <xs:element name="not_objects" type="not_objectsType" />\r
+  <xs:element name="not_selection" type="not_selectionType" />\r
+  <xs:element name="not_test" type="not_testType" />\r
+  <xs:element name="objectbank" type="objectbankType" />\r
+  <xs:element name="objectives" type="objectivesType" />\r
+  <xs:element name="objects_condition" type="objects_conditionType" />\r
+  <xs:element name="objects_parameter" type="objects_parameterType" />\r
+  <xs:element name="objectscond_extension" type="xs:string" />\r
+  <xs:element name="or" type="orType" />\r
+  <xs:element name="or_objects" type="or_objectsType" />\r
+  <xs:element name="or_selection" type="or_selectionType" />\r
+  <xs:element name="or_test" type="or_testType" />\r
+  <xs:element name="order" type="orderType" />\r
+  <xs:element name="order_extension" type="order_extensionType" />\r
+  <xs:element name="other" type="xs:string" />\r
+  <xs:element name="outcomes" type="outcomesType" />\r
+  <xs:element name="outcomes_feedback_test" type="outcomes_feedback_testType" />\r
+  <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+  <xs:element name="outcomes_processing" type="outcomes_processingType" />\r
+  <xs:element name="presentation" type="presentationType" />\r
+  <xs:element name="presentation_material" type="presentation_materialType" />\r
+  <xs:element name="processing_parameter" type="processing_parameterType" />\r
+  <xs:element name="qmd_computerscored" type="xs:string" />\r
+  <xs:element name="qmd_feedbackpermitted" type="xs:string" />\r
+  <xs:element name="qmd_hintspermitted" type="xs:string" />\r
+  <xs:element name="qmd_itemtype" type="xs:string" />\r
+  <xs:element name="qmd_levelofdifficulty" type="xs:string" />\r
+  <xs:element name="qmd_material" type="xs:string" />\r
+  <xs:element name="qmd_maximumscore" type="xs:string" />\r
+  <xs:element name="qmd_renderingtype" type="xs:string" />\r
+  <xs:element name="qmd_responsetype" type="xs:string" />\r
+  <xs:element name="qmd_scoringpermitted" type="xs:string" />\r
+  <xs:element name="qmd_solutionspermitted" type="xs:string" />\r
+  <xs:element name="qmd_status" type="xs:string" />\r
+  <xs:element name="qmd_timedependence" type="xs:string" />\r
+  <xs:element name="qmd_timelimit" type="xs:string" />\r
+  <xs:element name="qmd_toolvendor" type="xs:string" />\r
+  <xs:element name="qmd_topic" type="xs:string" />\r
+  <xs:element name="qmd_typeofsolution" type="xs:string" />\r
+  <xs:element name="qmd_weighting" type="xs:string" />\r
+  <xs:element name="qticomment" type="qticommentType" />\r
+  <xs:element name="qtimetadata" type="qtimetadataType" />\r
+  <xs:element name="qtimetadatafield" type="qtimetadatafieldType" />\r
+  <xs:element name="reference" type="referenceType" />\r
+  <xs:element name="render_choice" type="render_choiceType" />\r
+  <xs:element name="render_fib" type="render_fibType" />\r
+  <xs:element name="render_hotspot" type="render_hotspotType" />\r
+  <xs:element name="render_slider" type="render_sliderType" />\r
+  <xs:element name="respcond_extension" type="respcond_extensionType" />\r
+  <xs:element name="respcondition" type="respconditionType" />\r
+  <xs:element name="render_extension" type="render_extensionType" />\r
+  <xs:element name="response_extension" type="response_extensionType" />\r
+  <xs:element name="response_grp" type="response_grpType" />\r
+  <xs:element name="response_labelType" type="response_labelType" />\r
+  <xs:element name="response_lid" type="response_lidType" />\r
+  <xs:element name="response_na" type="response_naType" />\r
+  <xs:element name="response_num" type="response_numType" />\r
+  <xs:element name="response_str" type="response_strType" />\r
+  <xs:element name="response_xy" type="response_xyType" />\r
+  <xs:element name="resprocessing" type="resprocessingType" />\r
+  <xs:element name="rubric" type="rubricType" />\r
+  <xs:element name="section" type="sectionType" />\r
+  <xs:element name="sectioncontrol" type="sectioncontrolType" />\r
+  <xs:element name="sectionfeedback" type="sectionfeedbackType" />\r
+  <xs:element name="sectionproc_extension" type="sectionproc_extensionType" />\r
+  <xs:element name="sectionpostcondition" type="xs:string" />\r
+  <xs:element name="sectionprecondition" type="xs:string" />\r
+  <xs:element name="sectionref" type="sectionrefType" />\r
+  <xs:element name="selection" type="selectionType" />\r
+  <xs:element name="selection_extension" type="selection_extensionType" />\r
+  <xs:element name="selection_metadata" type="selection_metadataType" />\r
+  <xs:element name="selection_number" type="xs:string" />\r
+  <xs:element name="selection_ordering" type="selection_orderingType" />\r
+  <xs:element name="sequence_parameter" type="sequence_parameterType" />\r
+  <xs:element name="setvar" type="setvarType" />\r
+  <xs:element name="solution" type="solutionType" />\r
+  <xs:element name="solutionmaterial" type="solutionmaterialType" />\r
+  <xs:element name="sourcebank_ref" type="xs:string" />\r
+  <xs:element name="test_variable" type="test_variableType" />\r
+  <xs:element name="unanswered" type="unansweredType" />\r
+  <xs:element name="var_extension" type="var_extensionType" />\r
+  <xs:element name="varequal" type="varequalType" />\r
+  <xs:element name="vargt" type="vargtType" />\r
+  <xs:element name="vargte" type="vargteType" />\r
+  <xs:element name="variable_test" type="variable_testType" />\r
+  <xs:element name="varinside" type="varinsideType" />\r
+  <xs:element name="varlt" type="varltType" />\r
+  <xs:element name="varlte" type="varlteType" />\r
+  <xs:element name="varsubset" type="varsubsetType" />\r
+  <xs:element name="varsubstring" type="varsubstringType" />\r
+  <xs:element name="vocabulary" type="vocabularyType" />\r
+  <!-- ******************************* -->\r
+  <!-- ** Complex Type Declarations ** -->\r
+  <!-- ******************************* -->\r
+  <!-- ***************** -->\r
+  <!-- ** altmaterial ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="altmaterialType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice maxOccurs="unbounded">\r
+        <xs:element name="mattext" type="mattextType" />\r
+        <xs:element name="matemtext" type="matemtextType" />\r
+        <xs:element name="matimage" type="matimageType" />\r
+        <xs:element name="mataudio" type="mataudioType" />\r
+        <xs:element name="matvideo" type="matvideoType" />\r
+        <xs:element name="matapplet" type="matappletType" />\r
+        <xs:element name="matapplication" type="matapplicationType" />\r
+        <xs:element name="matref" type="matrefType" />\r
+        <xs:element ref="matbreak" />\r
+        <xs:element ref="mat_extension" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute ref="xml:lang" />\r
+  </xs:complexType>\r
+  <!-- ********* -->\r
+  <!-- ** and ** -->\r
+  <!-- ********* -->\r
+  <xs:complexType name="andType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="not" type="notType" />\r
+      <xs:element name="and" type="andType" />\r
+      <xs:element name="or" type="orType" />\r
+      <xs:element name="unanswered" type="unansweredType" />\r
+      <xs:element ref="other" />\r
+      <xs:element name="varequal" type="varequalType" />\r
+      <xs:element name="varlt" type="varltType" />\r
+      <xs:element name="varlte" type="varlteType" />\r
+      <xs:element name="vargt" type="vargtType" />\r
+      <xs:element name="vargte" type="vargteType" />\r
+      <xs:element name="varsubset" type="varsubsetType" />\r
+      <xs:element name="varinside" type="varinsideType" />\r
+      <xs:element name="varsubstring" type="varsubstringType" />\r
+      <xs:element name="durequal" type="durequalType" />\r
+      <xs:element name="durlt" type="durltType" />\r
+      <xs:element name="durlte" type="durlteType" />\r
+      <xs:element name="durgt" type="durgtType" />\r
+      <xs:element name="durgte" type="durgteType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ***************** -->\r
+  <!-- ** and_objects ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="and_objectsType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+      <xs:element name="and_objects" type="and_objectsType" />\r
+      <xs:element name="or_objects" type="or_objectsType" />\r
+      <xs:element name="not_objects" type="not_objectsType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** and_selection ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="and_selectionType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="selection_metadata" type="selection_metadataType" />\r
+      <xs:element name="and_selection" type="and_selectionType" />\r
+      <xs:element name="or_selection" type="or_selectionType" />\r
+      <xs:element name="not_selection" type="not_selectionType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** and_test ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="and_testType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="variable_test" type="variable_testType" />\r
+      <xs:element name="and_test" type="and_testType" />\r
+      <xs:element name="or_test" type="or_testType" />\r
+      <xs:element name="not_test" type="not_testType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ******************** -->\r
+  <!-- ** assessfeedback ** -->\r
+  <!-- ******************** -->\r
+  <xs:complexType name="assessfeedbackType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice>\r
+        <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+        <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="title" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** assessment ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="assessmentType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element ref="duration" minOccurs="0" />\r
+      <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="assessmentcontrol" type="assessmentcontrolType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="rubric" type="rubricType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="presentation_material" type="presentation_materialType" minOccurs="0" />\r
+      <xs:element name="outcomes_processing" type="outcomes_processingType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="assessproc_extension" minOccurs="0" />\r
+      <xs:element name="assessfeedback" type="assessfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="selection_ordering" type="selection_orderingType" minOccurs="0" />\r
+      <xs:element name="reference" type="referenceType" minOccurs="0" />\r
+      <xs:choice maxOccurs="unbounded">\r
+        <xs:element name="sectionref" type="sectionrefType" />\r
+        <xs:element name="section" type="sectionType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="title" type="xs:string" />\r
+    <xs:attribute ref="xml:lang" />\r
+  </xs:complexType>\r
+  <!-- *********************** -->\r
+  <!-- ** assessmentcontrol ** -->\r
+  <!-- *********************** -->\r
+  <xs:complexType name="assessmentcontrolType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="hintswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="solutionswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="feedbackswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ************************** -->\r
+  <!-- ** assessproc_extension ** -->\r
+  <!-- ************************** -->\r
+  <xs:complexType name="assessproc_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** conditionvar ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="conditionvarType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="not" type="notType" />\r
+      <xs:element name="and" type="andType" />\r
+      <xs:element name="or" type="orType" />\r
+      <xs:element name="unanswered" type="unansweredType" />\r
+      <xs:element ref="other" />\r
+      <xs:element name="varequal" type="varequalType" />\r
+      <xs:element name="varlt" type="varltType" />\r
+      <xs:element name="varlte" type="varlteType" />\r
+      <xs:element name="vargt" type="vargtType" />\r
+      <xs:element name="vargte" type="vargteType" />\r
+      <xs:element name="varsubset" type="varsubsetType" />\r
+      <xs:element name="varinside" type="varinsideType" />\r
+      <xs:element name="varsubstring" type="varsubstringType" />\r
+      <xs:element name="durequal" type="durequalType" />\r
+      <xs:element name="durlt" type="durltType" />\r
+      <xs:element name="durlte" type="durlteType" />\r
+      <xs:element name="durgt" type="durgtType" />\r
+      <xs:element name="durgte" type="durgteType" />\r
+      <xs:element ref="var_extension" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** decvar ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="decvarType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+        <xs:attribute name="vartype" default="Integer">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Integer" />\r
+              <xs:enumeration value="String" />\r
+              <xs:enumeration value="Decimal" />\r
+              <xs:enumeration value="Scientific" />\r
+              <xs:enumeration value="Boolean" />\r
+              <xs:enumeration value="Enumerated" />\r
+              <xs:enumeration value="Set" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+        <xs:attribute name="defaultval" type="xs:string" />\r
+        <xs:attribute name="minvalue" type="xs:string" />\r
+        <xs:attribute name="maxvalue" type="xs:string" />\r
+        <xs:attribute name="members" type="xs:string" />\r
+        <xs:attribute name="cutvalue" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ********************* -->\r
+  <!-- ** displayfeedback ** -->\r
+  <!-- ********************* -->\r
+  <xs:complexType name="displayfeedbackType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="feedbacktype" default="Response">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Response" />\r
+              <xs:enumeration value="Solution" />\r
+              <xs:enumeration value="Hint" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+        <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** durequal ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="durequalType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="index" type="xs:string" />\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *********** -->\r
+  <!-- ** durgt ** -->\r
+  <!-- *********** -->\r
+  <xs:complexType name="durgtType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="index" type="xs:string" />\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** durgte ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="durgteType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="index" type="xs:string" />\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *********** -->\r
+  <!-- ** durlt ** -->\r
+  <!-- *********** -->\r
+  <xs:complexType name="durltType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="index" type="xs:string" />\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** durlte ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="durlteType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="index" type="xs:string" />\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ********** -->\r
+  <!-- ** flow ** -->\r
+  <!-- ********** -->\r
+  <xs:complexType name="flowType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="flow" type="flowType" />\r
+      <xs:element name="material" type="materialType" />\r
+      <xs:element name="material_ref" type="material_refType" />\r
+      <xs:element name="response_lid" type="response_lidType" />\r
+      <xs:element name="response_xy" type="response_xyType" />\r
+      <xs:element name="response_str" type="response_strType" />\r
+      <xs:element name="response_num" type="response_numType" />\r
+      <xs:element name="response_grp" type="response_grpType" />\r
+      <xs:element ref="response_extension" />\r
+    </xs:choice>\r
+    <xs:attribute name="class" type="xs:string" default="Block" />\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** flow_label ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="flow_labelType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="flow_label" type="flow_labelType" />\r
+      <xs:element name="response_label" type="response_labelType" />\r
+    </xs:choice>\r
+    <xs:attribute name="class" type="xs:string" default="Block" />\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** flow_mat ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="flow_matType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="flow_mat" type="flow_matType" />\r
+      <xs:element name="material" type="materialType" />\r
+      <xs:element name="material_ref" type="material_refType" />\r
+    </xs:choice>\r
+    <xs:attribute name="class" type="xs:string" default="Block" />\r
+  </xs:complexType>\r
+  <!-- ********** -->\r
+  <!-- ** hint ** -->\r
+  <!-- ********** -->\r
+  <xs:complexType name="hintType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="hintmaterial" type="hintmaterialType" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:attribute name="feedbackstyle" default="Complete">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Complete" />\r
+          <xs:enumeration value="Incremental" />\r
+          <xs:enumeration value="Multilevel" />\r
+          <xs:enumeration value="Proprietary" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** hintmaterial ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="hintmaterialType">\r
+    <xs:choice>\r
+      <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+      <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** interpretvar ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="interpretvarType">\r
+    <xs:choice>\r
+      <xs:element name="material" type="materialType" />\r
+      <xs:element name="material_ref" type="material_refType" />\r
+    </xs:choice>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+  </xs:complexType>\r
+  <!-- ********** -->\r
+  <!-- ** item ** -->\r
+  <!-- ********** -->\r
+  <xs:complexType name="itemType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element ref="duration" minOccurs="0" />\r
+      <xs:element name="itemmetadata" type="itemmetadataType" minOccurs="0" />\r
+      <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="itemcontrol" type="itemcontrolType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="itemprecondition" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="itempostcondition" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+        <xs:element name="itemrubric" type="itemrubricType" />\r
+        <xs:element name="rubric" type="rubricType" />\r
+      </xs:choice>\r
+      <xs:element name="presentation" type="presentationType" minOccurs="0" />\r
+      <xs:element name="resprocessing" type="resprocessingType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="itemproc_extension" minOccurs="0" />\r
+      <xs:element name="itemfeedback" type="itemfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="reference" type="referenceType" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="maxattempts" type="xs:string" />\r
+    <xs:attribute name="label" type="xs:string" />\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="title" type="xs:string" />\r
+    <xs:attribute ref="xml:lang" />\r
+  </xs:complexType>\r
+  <!-- ***************** -->\r
+  <!-- ** itemcontrol ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="itemcontrolType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="feedbackswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="hintswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="solutionswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** itemfeedback ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="itemfeedbackType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:choice>\r
+        <xs:element name="flow_mat" type="flow_matType" />\r
+        <xs:element name="material" type="materialType" />\r
+      </xs:choice>\r
+      <xs:element name="solution" type="solutionType" />\r
+      <xs:element name="hint" type="hintType" />\r
+    </xs:choice>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="title" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** itemmetadata ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="itemmetadataType">\r
+    <xs:sequence>\r
+      <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="qmd_computerscored" minOccurs="0" />\r
+      <xs:element ref="qmd_feedbackpermitted" minOccurs="0" />\r
+      <xs:element ref="qmd_hintspermitted" minOccurs="0" />\r
+      <xs:element ref="qmd_itemtype" minOccurs="0" />\r
+      <xs:element ref="qmd_levelofdifficulty" minOccurs="0" />\r
+      <xs:element ref="qmd_maximumscore" minOccurs="0" />\r
+      <xs:element ref="qmd_renderingtype" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="qmd_responsetype" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="qmd_scoringpermitted" minOccurs="0" />\r
+      <xs:element ref="qmd_solutionspermitted" minOccurs="0" />\r
+      <xs:element ref="qmd_status" minOccurs="0" />\r
+      <xs:element ref="qmd_timedependence" minOccurs="0" />\r
+      <xs:element ref="qmd_timelimit" minOccurs="0" />\r
+      <xs:element ref="qmd_toolvendor" minOccurs="0" />\r
+      <xs:element ref="qmd_topic" minOccurs="0" />\r
+      <xs:element ref="qmd_weighting" minOccurs="0" />\r
+      <xs:element ref="qmd_material" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="qmd_typeofsolution" minOccurs="0" />\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** itemproc_extension ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="itemproc_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ************* -->\r
+  <!-- ** itemref ** -->\r
+  <!-- ************* -->\r
+  <xs:complexType name="itemrefType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** itemrubric ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="itemrubricType">\r
+    <xs:sequence>\r
+      <xs:element name="material" type="materialType" />\r
+    </xs:sequence>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- *************** -->\r
+  <!-- ** map_input ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="map_inputType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** map_output ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="map_outputType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** mat_extension ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="mat_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- *************** -->\r
+  <!-- ** matapplet ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="matappletType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute name="y0" type="xs:string" />\r
+        <xs:attribute name="height" type="xs:string" />\r
+        <xs:attribute name="width" type="xs:string" />\r
+        <xs:attribute name="x0" type="xs:string" />\r
+        <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ******************** -->\r
+  <!-- ** matapplication ** -->\r
+  <!-- ******************** -->\r
+  <xs:complexType name="matapplicationType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="apptype" type="xs:string" />\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** mataudio ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="mataudioType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="audiotype" type="xs:string" default="audio/base" />\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** matbreak ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="matbreakType" />\r
+  <!-- *************** -->\r
+  <!-- ** matemtext ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="matemtextType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="texttype" type="xs:string" default="text/plain" />\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute ref="xml:space" default="default" />\r
+        <xs:attribute ref="xml:lang" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+        <xs:attribute name="width" type="xs:string" />\r
+        <xs:attribute name="height" type="xs:string" />\r
+        <xs:attribute name="y0" type="xs:string" />\r
+        <xs:attribute name="x0" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** material ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="materialType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice maxOccurs="unbounded">\r
+        <xs:element name="mattext" type="mattextType" />\r
+        <xs:element name="matemtext" type="matemtextType" />\r
+        <xs:element name="matimage" type="matimageType" />\r
+        <xs:element name="mataudio" type="mataudioType" />\r
+        <xs:element name="matvideo" type="matvideoType" />\r
+        <xs:element name="matapplet" type="matappletType" />\r
+        <xs:element name="matapplication" type="matapplicationType" />\r
+        <xs:element name="matref" type="matrefType" />\r
+        <xs:element ref="matbreak" />\r
+        <xs:element ref="mat_extension" />\r
+      </xs:choice>\r
+      <xs:element name="altmaterial" type="altmaterialType" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:attribute name="label" type="xs:string" />\r
+    <xs:attribute ref="xml:lang" />\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** material_ref ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="material_refType">\r
+    <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** matimage ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="matimageType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="imagtype" type="xs:string" default="image/jpeg" />\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="height" type="xs:string" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+        <xs:attribute name="width" type="xs:string" />\r
+        <xs:attribute name="y0" type="xs:string" />\r
+        <xs:attribute name="x0" type="xs:string" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** matref ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="matrefType">\r
+    <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+  </xs:complexType>\r
+  <!-- ************* -->\r
+  <!-- ** mattext ** -->\r
+  <!-- ************* -->\r
+  <xs:complexType name="mattextType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="texttype" type="xs:string" default="text/plain" />\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute ref="xml:space" default="default" />\r
+        <xs:attribute ref="xml:lang" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+        <xs:attribute name="width" type="xs:string" />\r
+        <xs:attribute name="height" type="xs:string" />\r
+        <xs:attribute name="y0" type="xs:string" />\r
+        <xs:attribute name="x0" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** matvideo ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="matvideoType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="videotype" type="xs:string" default="video/avi" />\r
+        <xs:attribute name="label" type="xs:string" />\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute name="width" type="xs:string" />\r
+        <xs:attribute name="height" type="xs:string" />\r
+        <xs:attribute name="y0" type="xs:string" />\r
+        <xs:attribute name="x0" type="xs:string" />\r
+        <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ********* -->\r
+  <!-- ** not ** -->\r
+  <!-- ********* -->\r
+  <xs:complexType name="notType">\r
+    <xs:choice>\r
+      <xs:element name="and" type="andType" />\r
+      <xs:element name="or" type="orType" />\r
+      <xs:element name="not" type="notType" />\r
+      <xs:element name="unanswered" type="unansweredType" />\r
+      <xs:element ref="other" />\r
+      <xs:element name="varequal" type="varequalType" />\r
+      <xs:element name="varlt" type="varltType" />\r
+      <xs:element name="varlte" type="varlteType" />\r
+      <xs:element name="vargt" type="vargtType" />\r
+      <xs:element name="vargte" type="vargteType" />\r
+      <xs:element name="varsubset" type="varsubsetType" />\r
+      <xs:element name="varinside" type="varinsideType" />\r
+      <xs:element name="varsubstring" type="varsubstringType" />\r
+      <xs:element name="durequal" type="durequalType" />\r
+      <xs:element name="durlt" type="durltType" />\r
+      <xs:element name="durlte" type="durlteType" />\r
+      <xs:element name="durgt" type="durgtType" />\r
+      <xs:element name="durgte" type="durgteType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ***************** -->\r
+  <!-- ** not_objects ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="not_objectsType">\r
+    <xs:choice>\r
+      <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+      <xs:element name="and_objects" type="and_objectsType" />\r
+      <xs:element name="or_objects" type="or_objectsType" />\r
+      <xs:element name="not_objects" type="not_objectsType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** not_selection ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="not_selectionType">\r
+    <xs:choice>\r
+      <xs:element name="selection_metadata" type="selection_metadataType" />\r
+      <xs:element name="and_selection" type="and_selectionType" />\r
+      <xs:element name="or_selection" type="or_selectionType" />\r
+      <xs:element name="not_selection" type="not_selectionType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** not_test ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="not_testType">\r
+    <xs:choice>\r
+      <xs:element name="variable_test" type="variable_testType" />\r
+      <xs:element name="and_test" type="and_testType" />\r
+      <xs:element name="or_test" type="or_testType" />\r
+      <xs:element name="not_test" type="not_testType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** objectbank ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="objectbankType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:choice maxOccurs="unbounded">\r
+        <xs:element name="section" type="sectionType" />\r
+        <xs:element name="item" type="itemType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** objectives ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="objectivesType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice>\r
+        <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+        <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- *********************** -->\r
+  <!-- ** objects_condition ** -->\r
+  <!-- *********************** -->\r
+  <xs:complexType name="objects_conditionType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+        <xs:element name="and_objects" type="and_objectsType" />\r
+        <xs:element name="or_objects" type="or_objectsType" />\r
+        <xs:element name="not_objects" type="not_objectsType" />\r
+      </xs:choice>\r
+      <xs:element name="objects_parameter" type="objects_parameterType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="map_input" type="map_inputType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="objectscond_extension" minOccurs="0" />\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- *********************** -->\r
+  <!-- ** objects_parameter ** -->\r
+  <!-- *********************** -->\r
+  <xs:complexType name="objects_parameterType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="pname" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ******** -->\r
+  <!-- ** or ** -->\r
+  <!-- ******** -->\r
+  <xs:complexType name="orType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="not" type="notType" />\r
+      <xs:element name="and" type="andType" />\r
+      <xs:element name="or" type="orType" />\r
+      <xs:element name="unanswered" type="unansweredType" />\r
+      <xs:element ref="other" />\r
+      <xs:element name="varequal" type="varequalType" />\r
+      <xs:element name="varlt" type="varltType" />\r
+      <xs:element name="varlte" type="varlteType" />\r
+      <xs:element name="vargt" type="vargtType" />\r
+      <xs:element name="vargte" type="vargteType" />\r
+      <xs:element name="varsubset" type="varsubsetType" />\r
+      <xs:element name="varinside" type="varinsideType" />\r
+      <xs:element name="varsubstring" type="varsubstringType" />\r
+      <xs:element name="durequal" type="durequalType" />\r
+      <xs:element name="durlt" type="durltType" />\r
+      <xs:element name="durlte" type="durlteType" />\r
+      <xs:element name="durgt" type="durgtType" />\r
+      <xs:element name="durgte" type="durgteType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** or_objects ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="or_objectsType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+      <xs:element name="and_objects" type="and_objectsType" />\r
+      <xs:element name="or_objects" type="or_objectsType" />\r
+      <xs:element name="not_objects" type="not_objectsType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** or_selection ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="or_selectionType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="selection_metadata" type="selection_metadataType" />\r
+      <xs:element name="and_selection" type="and_selectionType" />\r
+      <xs:element name="or_selection" type="or_selectionType" />\r
+      <xs:element name="not_selection" type="not_selectionType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ************* -->\r
+  <!-- ** or_test ** -->\r
+  <!-- ************* -->\r
+  <xs:complexType name="or_testType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="variable_test" type="variable_testType" />\r
+      <xs:element name="and_test" type="and_testType" />\r
+      <xs:element name="or_test" type="or_testType" />\r
+      <xs:element name="not_test" type="not_testType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- *********** -->\r
+  <!-- ** order ** -->\r
+  <!-- *********** -->\r
+  <xs:complexType name="orderType">\r
+    <xs:sequence>\r
+      <xs:element ref="order_extension" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="order_type" type="xs:string" use="required" />\r
+  </xs:complexType>\r
+  <!-- ********************* -->\r
+  <!-- ** order_extension ** -->\r
+  <!-- ********************* -->\r
+  <xs:complexType name="order_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** outcomes ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="outcomesType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:sequence maxOccurs="unbounded">\r
+        <xs:element name="decvar" type="decvarType" />\r
+        <xs:element name="interpretvar" type="interpretvarType" minOccurs="0" maxOccurs="unbounded" />\r
+      </xs:sequence>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- **************************** -->\r
+  <!-- ** outcomes_feedback_test ** -->\r
+  <!-- **************************** -->\r
+  <xs:complexType name="outcomes_feedback_testType">\r
+    <xs:sequence>\r
+      <xs:element name="test_variable" type="test_variableType" />\r
+      <xs:element name="displayfeedback" type="displayfeedbackType" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:attribute name="title" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- *********************** -->\r
+  <!-- ** outcomes_metadata ** -->\r
+  <!-- *********************** -->\r
+  <xs:complexType name="outcomes_metadataType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="mdname" type="xs:string" use="required" />\r
+        <xs:attribute name="mdoperator" use="required">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="EQ" />\r
+              <xs:enumeration value="NEQ" />\r
+              <xs:enumeration value="LT" />\r
+              <xs:enumeration value="LTE" />\r
+              <xs:enumeration value="GT" />\r
+              <xs:enumeration value="GTE" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************************* -->\r
+  <!-- ** outcomes_processing ** -->\r
+  <!-- ************************* -->\r
+  <xs:complexType name="outcomes_processingType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="outcomes" type="outcomesType" />\r
+      <xs:element name="objects_condition" type="objects_conditionType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="processing_parameter" type="processing_parameterType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="map_output" type="map_outputType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="outcomes_feedback_test" type="outcomes_feedback_testType" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:attribute name="scoremodel" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** presentation ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="presentationType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice>\r
+        <xs:element name="flow" type="flowType" />\r
+        <xs:choice maxOccurs="unbounded">\r
+          <xs:element name="material" type="materialType" />\r
+          <xs:element name="response_lid" type="response_lidType" />\r
+          <xs:element name="response_xy" type="response_xyType" />\r
+          <xs:element name="response_str" type="response_strType" />\r
+          <xs:element name="response_num" type="response_numType" />\r
+          <xs:element name="response_grp" type="response_grpType" />\r
+          <xs:element ref="response_extension" />\r
+        </xs:choice>\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="label" type="xs:string" />\r
+    <xs:attribute ref="xml:lang" />\r
+    <xs:attribute name="y0" type="xs:string" />\r
+    <xs:attribute name="x0" type="xs:string" />\r
+    <xs:attribute name="width" type="xs:string" />\r
+    <xs:attribute name="height" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- *************************** -->\r
+  <!-- ** presentation_material ** -->\r
+  <!-- *************************** -->\r
+  <xs:complexType name="presentation_materialType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- ************************** -->\r
+  <!-- ** processing_parameter ** -->\r
+  <!-- ************************** -->\r
+  <xs:complexType name="processing_parameterType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="pname" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** qticomment ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="qticommentType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute ref="xml:lang" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ***************** -->\r
+  <!-- ** qtimetadata ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="qtimetadataType">\r
+    <xs:sequence>\r
+      <xs:element name="vocabulary" type="vocabularyType" minOccurs="0" />\r
+      <xs:element name="qtimetadatafield" type="qtimetadatafieldType" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- ********************** -->\r
+  <!-- ** qtimetadatafield ** -->\r
+  <!-- ********************** -->\r
+  <xs:complexType name="qtimetadatafieldType">\r
+    <xs:sequence>\r
+      <xs:element ref="fieldlabel" />\r
+      <xs:element ref="fieldentry" />\r
+    </xs:sequence>\r
+    <xs:attribute ref="xml:lang" />\r
+  </xs:complexType>\r
+  <!-- ********************* -->\r
+  <!-- ** questestinterop ** -->\r
+  <!-- ********************* -->\r
+  <xs:complexType name="questestinteropType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice>\r
+        <xs:element name="objectbank" type="objectbankType" />\r
+        <xs:element name="assessment" type="assessmentType" />\r
+        <xs:choice maxOccurs="unbounded">\r
+          <xs:element name="section" type="sectionType" />\r
+          <xs:element name="item" type="itemType" />\r
+        </xs:choice>\r
+      </xs:choice>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- *************** -->\r
+  <!-- ** reference ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="referenceType">\r
+    <xs:choice maxOccurs="unbounded">\r
+      <xs:element name="qticomment" type="qticommentType" />\r
+      <xs:element name="material" type="materialType" />\r
+      <xs:element name="mattext" type="mattextType" />\r
+      <xs:element name="matemtext" type="matemtextType" />\r
+      <xs:element name="matimage" type="matimageType" />\r
+      <xs:element name="mataudio" type="mataudioType" />\r
+      <xs:element name="matvideo" type="matvideoType" />\r
+      <xs:element name="matapplet" type="matappletType" />\r
+      <xs:element name="matapplication" type="matapplicationType" />\r
+      <xs:element ref="matbreak" />\r
+      <xs:element ref="mat_extension" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** render_choice ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="render_choiceType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+        <xs:element name="response_label" type="response_labelType" />\r
+        <xs:element name="flow_label" type="flow_labelType" />\r
+      </xs:choice>\r
+      <xs:element ref="response_na" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="shuffle" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="minnumber" type="xs:string" />\r
+    <xs:attribute name="maxnumber" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ********************** -->\r
+  <!-- ** render_extension ** -->\r
+  <!-- ********************** -->\r
+  <xs:complexType name="render_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** render_fib ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="render_fibType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+        <xs:element name="response_label" type="response_labelType" />\r
+        <xs:element name="flow_label" type="flow_labelType" />\r
+      </xs:choice>\r
+      <xs:element ref="response_na" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="encoding" type="xs:string" default="UTF_8" />\r
+    <xs:attribute name="fibtype" default="String">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="String" />\r
+          <xs:enumeration value="Integer" />\r
+          <xs:enumeration value="Decimal" />\r
+          <xs:enumeration value="Scientific" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="rows" type="xs:string" />\r
+    <xs:attribute name="maxchars" type="xs:string" />\r
+    <xs:attribute name="prompt">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Box" />\r
+          <xs:enumeration value="Dashline" />\r
+          <xs:enumeration value="Asterisk" />\r
+          <xs:enumeration value="Underline" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="columns" type="xs:string" />\r
+    <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+    <xs:attribute name="maxnumber" type="xs:string" />\r
+    <xs:attribute name="minnumber" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ******************** -->\r
+  <!-- ** render_hotspot ** -->\r
+  <!-- ******************** -->\r
+  <xs:complexType name="render_hotspotType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+        <xs:element name="response_label" type="response_labelType" />\r
+        <xs:element name="flow_label" type="flow_labelType" />\r
+      </xs:choice>\r
+      <xs:element ref="response_na" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="maxnumber" type="xs:string" />\r
+    <xs:attribute name="minnumber" type="xs:string" />\r
+    <xs:attribute name="showdraw" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** render_slider ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="render_sliderType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+        <xs:element name="response_label" type="response_labelType" />\r
+        <xs:element name="flow_label" type="flow_labelType" />\r
+      </xs:choice>\r
+      <xs:element ref="response_na" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="orientation" default="Horizontal">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Horizontal" />\r
+          <xs:enumeration value="Vertical" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="lowerbound" type="xs:string" use="required" />\r
+    <xs:attribute name="upperbound" type="xs:string" use="required" />\r
+    <xs:attribute name="step" type="xs:string" />\r
+    <xs:attribute name="startval" type="xs:string" />\r
+    <xs:attribute name="steplabel" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="maxnumber" type="xs:string" />\r
+    <xs:attribute name="minnumber" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** respcond_extension ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="respcond_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** respcondition ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="respconditionType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="conditionvar" type="conditionvarType" />\r
+      <xs:element name="setvar" type="setvarType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="displayfeedback" type="displayfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="respcond_extension" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="continue" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="title" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** response_extension ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="response_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** response_grp ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="response_grpType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+      <xs:choice>\r
+        <xs:element name="render_choice" type="render_choiceType" />\r
+        <xs:element name="render_hotspot" type="render_hotspotType" />\r
+        <xs:element name="render_slider" type="render_sliderType" />\r
+        <xs:element name="render_fib" type="render_fibType" />\r
+        <xs:element ref="render_extension" />\r
+      </xs:choice>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="rcardinality" default="Single">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Single" />\r
+          <xs:enumeration value="Multiple" />\r
+          <xs:enumeration value="Ordered" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="rtiming" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** response_lableType ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="response_labelType" mixed="true">\r
+    <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+      <xs:element name="qticomment" type="qticommentType" />\r
+      <xs:element name="material" type="materialType" />\r
+      <xs:element name="material_ref" type="material_refType" />\r
+      <xs:element name="flow_mat" type="flow_matType" />\r
+    </xs:choice>\r
+    <xs:attribute name="rshuffle" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="rarea" default="Ellipse">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Ellipse" />\r
+          <xs:enumeration value="Rectangle" />\r
+          <xs:enumeration value="Bounded" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="rrange" default="Exact">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Exact" />\r
+          <xs:enumeration value="Range" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="labelrefid" type="xs:string" />\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="match_group" type="xs:string" />\r
+    <xs:attribute name="match_max" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** response_lid ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="response_lidType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+      <xs:choice>\r
+        <xs:element name="render_choice" type="render_choiceType" />\r
+        <xs:element name="render_hotspot" type="render_hotspotType" />\r
+        <xs:element name="render_slider" type="render_sliderType" />\r
+        <xs:element name="render_fib" type="render_fibType" />\r
+        <xs:element ref="render_extension" />\r
+      </xs:choice>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="rcardinality" default="Single">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Single" />\r
+          <xs:enumeration value="Multiple" />\r
+          <xs:enumeration value="Ordered" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="rtiming" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+  </xs:complexType>\r
+  <!-- ***************** -->\r
+  <!-- ** response_na ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="response_naType" />\r
+  <!-- ****************** -->\r
+  <!-- ** response_num ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="response_numType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+      <xs:choice>\r
+        <xs:element name="render_choice" type="render_choiceType" />\r
+        <xs:element name="render_hotspot" type="render_hotspotType" />\r
+        <xs:element name="render_slider" type="render_sliderType" />\r
+        <xs:element name="render_fib" type="render_fibType" />\r
+        <xs:element ref="render_extension" />\r
+      </xs:choice>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="numtype" default="Integer">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Integer" />\r
+          <xs:enumeration value="Decimal" />\r
+          <xs:enumeration value="Scientific" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="rcardinality" default="Single">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Single" />\r
+          <xs:enumeration value="Multiple" />\r
+          <xs:enumeration value="Ordered" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="rtiming" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** response_str ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="response_strType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+      <xs:choice>\r
+        <xs:element name="render_choice" type="render_choiceType" />\r
+        <xs:element name="render_hotspot" type="render_hotspotType" />\r
+        <xs:element name="render_slider" type="render_sliderType" />\r
+        <xs:element name="render_fib" type="render_fibType" />\r
+        <xs:element ref="render_extension" />\r
+      </xs:choice>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="rcardinality" default="Single">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Single" />\r
+          <xs:enumeration value="Multiple" />\r
+          <xs:enumeration value="Ordered" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="rtiming" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ***************** -->\r
+  <!-- ** response_xy ** -->\r
+  <!-- ***************** -->\r
+  <xs:complexType name="response_xyType">\r
+    <xs:sequence>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+      <xs:choice>\r
+        <xs:element name="render_choice" type="render_choiceType" />\r
+        <xs:element name="render_hotspot" type="render_hotspotType" />\r
+        <xs:element name="render_slider" type="render_sliderType" />\r
+        <xs:element name="render_fib" type="render_fibType" />\r
+        <xs:element ref="render_extension" />\r
+      </xs:choice>\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="material" type="materialType" />\r
+        <xs:element name="material_ref" type="material_refType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="rcardinality" default="Single">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Single" />\r
+          <xs:enumeration value="Multiple" />\r
+          <xs:enumeration value="Ordered" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="rtiming" default="No">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** resprocessing ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="resprocessingType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="outcomes" type="outcomesType" />\r
+      <xs:choice maxOccurs="unbounded">\r
+        <xs:element name="respcondition" type="respconditionType" />\r
+        <xs:element ref="itemproc_extension" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="scoremodel" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** rubric ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="rubricType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice>\r
+        <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+        <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ************* -->\r
+  <!-- ** section ** -->\r
+  <!-- ************* -->\r
+  <xs:complexType name="sectionType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element ref="duration" minOccurs="0" />\r
+      <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="sectioncontrol" type="sectioncontrolType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="sectionprecondition" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="sectionpostcondition" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="rubric" type="rubricType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="presentation_material" type="presentation_materialType" minOccurs="0" />\r
+      <xs:element name="outcomes_processing" type="outcomes_processingType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element ref="sectionproc_extension" minOccurs="0" />\r
+      <xs:element name="sectionfeedback" type="sectionfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="selection_ordering" type="selection_orderingType" minOccurs="0" />\r
+      <xs:element name="reference" type="referenceType" minOccurs="0" />\r
+      <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+        <xs:element name="itemref" type="itemrefType" />\r
+        <xs:element name="item" type="itemType" />\r
+        <xs:element name="sectionref" type="sectionrefType" />\r
+        <xs:element name="section" type="sectionType" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="title" type="xs:string" />\r
+    <xs:attribute ref="xml:lang" />\r
+  </xs:complexType>\r
+  <!-- ******************** -->\r
+  <!-- ** sectioncontrol ** -->\r
+  <!-- ******************** -->\r
+  <xs:complexType name="sectioncontrolType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="feedbackswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="hintswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="solutionswitch" default="Yes">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Yes" />\r
+          <xs:enumeration value="No" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ********************* -->\r
+  <!-- ** sectionfeedback ** -->\r
+  <!-- ********************* -->\r
+  <xs:complexType name="sectionfeedbackType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:choice>\r
+        <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+        <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+    <xs:attribute name="view" default="All">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+    <xs:attribute name="ident" type="xs:string" use="required" />\r
+    <xs:attribute name="title" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- *************************** -->\r
+  <!-- ** sectionproc_extension ** -->\r
+  <!-- *************************** -->\r
+  <xs:complexType name="sectionproc_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** sectionref ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="sectionrefType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *************** -->\r
+  <!-- ** selection ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="selectionType">\r
+    <xs:sequence>\r
+      <xs:element ref="sourcebank_ref" minOccurs="0" />\r
+      <xs:element ref="selection_number" minOccurs="0" />\r
+      <xs:element name="selection_metadata" type="selection_metadataType" minOccurs="0" />\r
+      <xs:choice minOccurs="0">\r
+        <xs:element name="and_selection" type="and_selectionType" />\r
+        <xs:element name="or_selection" type="or_selectionType" />\r
+        <xs:element name="not_selection" type="not_selectionType" />\r
+        <xs:element ref="selection_extension" />\r
+      </xs:choice>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <!-- ************************* -->\r
+  <!-- ** selection_extension ** -->\r
+  <!-- ************************* -->\r
+  <xs:complexType name="selection_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** selection_metadata ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="selection_metadataType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="mdname" type="xs:string" use="required" />\r
+        <xs:attribute name="mdoperator" use="required">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="EQ" />\r
+              <xs:enumeration value="NEQ" />\r
+              <xs:enumeration value="LT" />\r
+              <xs:enumeration value="LTE" />\r
+              <xs:enumeration value="GT" />\r
+              <xs:enumeration value="GTE" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** selection_ordering ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="selection_orderingType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="sequence_parameter" type="sequence_parameterType" minOccurs="0" />\r
+      <xs:element name="selection" type="selectionType" minOccurs="0" maxOccurs="unbounded" />\r
+      <xs:element name="order" type="orderType" minOccurs="0" />\r
+    </xs:sequence>\r
+    <xs:attribute name="sequence_type" type="xs:string" />\r
+  </xs:complexType>\r
+  <!-- ************************ -->\r
+  <!-- ** sequence_parameter ** -->\r
+  <!-- ************************ -->\r
+  <xs:complexType name="sequence_parameterType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="pname" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** setvar ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="setvarType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+        <xs:attribute name="action" default="Set">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Set" />\r
+              <xs:enumeration value="Add" />\r
+              <xs:enumeration value="Subtract" />\r
+              <xs:enumeration value="Multiply" />\r
+              <xs:enumeration value="Divide" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** solution ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="solutionType">\r
+    <xs:sequence>\r
+      <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+      <xs:element name="solutionmaterial" type="solutionmaterialType" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:attribute name="feedbackstyle" default="Complete">\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Complete" />\r
+          <xs:enumeration value="Incremental" />\r
+          <xs:enumeration value="Multilevel" />\r
+          <xs:enumeration value="Proprietary" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+    </xs:attribute>\r
+  </xs:complexType>\r
+  <!-- ********************** -->\r
+  <!-- ** solutionmaterial ** -->\r
+  <!-- ********************** -->\r
+  <xs:complexType name="solutionmaterialType">\r
+    <xs:choice>\r
+      <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+      <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** test_variable ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="test_variableType">\r
+    <xs:choice>\r
+      <xs:element name="variable_test" type="variable_testType" />\r
+      <xs:element name="and_test" type="and_testType" />\r
+      <xs:element name="or_test" type="or_testType" />\r
+      <xs:element name="not_test" type="not_testType" />\r
+    </xs:choice>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** unanswered ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="unansweredType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** var_extension ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="var_extensionType" mixed="true">\r
+    <xs:sequence>\r
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+    </xs:sequence>\r
+    <xs:anyAttribute processContents="lax" />\r
+  </xs:complexType>\r
+  <!-- ************** -->\r
+  <!-- ** varequal ** -->\r
+  <!-- ************** -->\r
+  <xs:complexType name="varequalType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="case" default="No">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Yes" />\r
+              <xs:enumeration value="No" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *********** -->\r
+  <!-- ** vargt ** -->\r
+  <!-- *********** -->\r
+  <xs:complexType name="vargtType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** vargte ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="vargteType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ******************* -->\r
+  <!-- ** variable_test ** -->\r
+  <!-- ******************* -->\r
+  <xs:complexType name="variable_testType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+        <xs:attribute name="testoperator" use="required">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="EQ" />\r
+              <xs:enumeration value="NEQ" />\r
+              <xs:enumeration value="LT" />\r
+              <xs:enumeration value="LTE" />\r
+              <xs:enumeration value="GT" />\r
+              <xs:enumeration value="GTE" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *************** -->\r
+  <!-- ** varinside ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="varinsideType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="areatype" use="required">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Ellipse" />\r
+              <xs:enumeration value="Rectangle" />\r
+              <xs:enumeration value="Bounded" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *********** -->\r
+  <!-- ** varlt ** -->\r
+  <!-- *********** -->\r
+  <xs:complexType name="varltType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ************ -->\r
+  <!-- ** varlte ** -->\r
+  <!-- ************ -->\r
+  <xs:complexType name="varlteType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- *************** -->\r
+  <!-- ** varsubset ** -->\r
+  <!-- *************** -->\r
+  <xs:complexType name="varsubsetType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="setmatch" default="Exact">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Exact" />\r
+              <xs:enumeration value="Partial" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+        <xs:attribute name="index" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- ****************** -->\r
+  <!-- ** varsubstring ** -->\r
+  <!-- ****************** -->\r
+  <xs:complexType name="varsubstringType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="index" type="xs:string" />\r
+        <xs:attribute name="respident" type="xs:string" use="required" />\r
+        <xs:attribute name="case" default="No">\r
+          <xs:simpleType>\r
+            <xs:restriction base="xs:NMTOKEN">\r
+              <xs:enumeration value="Yes" />\r
+              <xs:enumeration value="No" />\r
+            </xs:restriction>\r
+          </xs:simpleType>\r
+        </xs:attribute>\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+  <!-- **************** -->\r
+  <!-- ** vocabulary ** -->\r
+  <!-- **************** -->\r
+  <xs:complexType name="vocabularyType">\r
+    <xs:simpleContent>\r
+      <xs:extension base="xs:string">\r
+        <xs:attribute name="uri" type="xs:string" />\r
+        <xs:attribute name="entityref" type="xs:ENTITY" />\r
+        <xs:attribute name="vocab_type" type="xs:string" />\r
+      </xs:extension>\r
+    </xs:simpleContent>\r
+  </xs:complexType>\r
+</xs:schema>\r
+\r
diff --git a/docs/home/ims/domainProfile_4/ims_qtiasiv1p2_localised.xsd b/docs/home/ims/domainProfile_4/ims_qtiasiv1p2_localised.xsd
new file mode 100644 (file)
index 0000000..13e07f4
--- /dev/null
@@ -0,0 +1,2148 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** ims_qtiasiv1p2.xsd                                                  **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" elementFormDefault="qualified" version="IMS QTI ASI 1.2 localised_Schema_2008_6_10">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_q_definition.xsd" />\r
+       <!-- **************************** -->\r
+       <!-- ** Inclusions and Imports ** -->\r
+       <!-- **************************** -->\r
+<!-- ID changed schemaLocation from "http://www.w3.org/2001/03/xml.xsd" to "http://www.w3.org/2001/xml.xsd" -->\r
+       <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />\r
+       <!-- ****************** -->\r
+       <!-- ** Root Element ** -->\r
+       <!-- ****************** -->\r
+       <xs:element name="questestinterop" type="questestinteropType" />\r
+       <!-- ************************** -->\r
+       <!-- ** Element Declarations ** -->\r
+       <!-- ************************** -->\r
+       <xs:element name="altmaterial" type="altmaterialType" />\r
+       <xs:element name="and" type="andType" />\r
+       <xs:element name="and_objects" type="and_objectsType" />\r
+       <xs:element name="and_selection" type="and_selectionType" />\r
+       <xs:element name="and_test" type="and_testType" />\r
+       <xs:element name="assessfeedback" type="assessfeedbackType" />\r
+       <xs:element name="assessment" type="assessmentType" />\r
+       <xs:element name="assessmentcontrol" type="assessmentcontrolType" />\r
+       <xs:element name="assessproc_extension" type="assessproc_extensionType" />\r
+       <xs:element name="conditionvar" type="conditionvarType" />\r
+       <xs:element name="decvar" type="decvarType" />\r
+       <xs:element name="displayfeedback" type="displayfeedbackType" />\r
+       <xs:element name="duration" type="xs:string" />\r
+       <xs:element name="durequal" type="durequalType" />\r
+       <xs:element name="durgt" type="durgtType" />\r
+       <xs:element name="durgte" type="durgteType" />\r
+       <xs:element name="durlt" type="durltType" />\r
+       <xs:element name="durlte" type="durlteType" />\r
+       <xs:element name="fieldentry" type="xs:string" />\r
+       <xs:element name="fieldlabel" type="xs:string" />\r
+       <xs:element name="flow" type="flowType" />\r
+       <xs:element name="flow_label" type="flow_labelType" />\r
+       <xs:element name="flow_mat" type="flow_matType" />\r
+       <xs:element name="hint" type="hintType" />\r
+       <xs:element name="hintmaterial" type="hintmaterialType" />\r
+       <xs:element name="interpretvar" type="interpretvarType" />\r
+       <xs:element name="item" type="itemType" />\r
+       <xs:element name="itemcontrol" type="itemcontrolType" />\r
+       <xs:element name="itemfeedback" type="itemfeedbackType" />\r
+       <xs:element name="itemmetadata" type="itemmetadataType" />\r
+       <xs:element name="itempostcondition" type="xs:string" />\r
+       <xs:element name="itemprecondition" type="xs:string" />\r
+       <xs:element name="itemproc_extension" type="itemproc_extensionType" />\r
+       <xs:element name="itemref" type="itemrefType" />\r
+       <xs:element name="itemrubric" type="itemrubricType" />\r
+       <xs:element name="map_input" type="map_inputType" />\r
+       <xs:element name="map_output" type="map_outputType" />\r
+       <xs:element name="mat_extension" type="mat_extensionType" />\r
+       <xs:element name="matapplet" type="matappletType" />\r
+       <xs:element name="matapplication" type="matapplicationType" />\r
+       <xs:element name="mataudio" type="mataudioType" />\r
+       <xs:element name="matbreak" type="matbreakType" />\r
+       <xs:element name="matemtext" type="matemtextType" />\r
+       <xs:element name="material" type="materialType" />\r
+       <xs:element name="material_ref" type="material_refType" />\r
+       <xs:element name="matimage" type="matimageType" />\r
+       <xs:element name="matref" type="matrefType" />\r
+       <xs:element name="mattext" type="mattextType" />\r
+       <xs:element name="matvideo" type="matvideoType" />\r
+       <xs:element name="not" type="notType" />\r
+       <xs:element name="not_objects" type="not_objectsType" />\r
+       <xs:element name="not_selection" type="not_selectionType" />\r
+       <xs:element name="not_test" type="not_testType" />\r
+       <xs:element name="objectbank" type="objectbankType" />\r
+       <xs:element name="objectives" type="objectivesType" />\r
+       <xs:element name="objects_condition" type="objects_conditionType" />\r
+       <xs:element name="objects_parameter" type="objects_parameterType" />\r
+       <xs:element name="objectscond_extension" type="xs:string" />\r
+       <xs:element name="or" type="orType" />\r
+       <xs:element name="or_objects" type="or_objectsType" />\r
+       <xs:element name="or_selection" type="or_selectionType" />\r
+       <xs:element name="or_test" type="or_testType" />\r
+       <xs:element name="order" type="orderType" />\r
+       <xs:element name="order_extension" type="order_extensionType" />\r
+       <xs:element name="other" type="xs:string" />\r
+       <xs:element name="outcomes" type="outcomesType" />\r
+       <xs:element name="outcomes_feedback_test" type="outcomes_feedback_testType" />\r
+       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+       <xs:element name="outcomes_processing" type="outcomes_processingType" />\r
+       <xs:element name="presentation" type="presentationType" />\r
+       <xs:element name="presentation_material" type="presentation_materialType" />\r
+       <xs:element name="processing_parameter" type="processing_parameterType" />\r
+       <xs:element name="qmd_computerscored" type="xs:string" />\r
+       <xs:element name="qmd_feedbackpermitted" type="xs:string" />\r
+       <xs:element name="qmd_hintspermitted" type="xs:string" />\r
+       <xs:element name="qmd_itemtype" type="xs:string" />\r
+       <xs:element name="qmd_levelofdifficulty" type="xs:string" />\r
+       <xs:element name="qmd_material" type="xs:string" />\r
+       <xs:element name="qmd_maximumscore" type="xs:string" />\r
+       <xs:element name="qmd_renderingtype" type="xs:string" />\r
+       <xs:element name="qmd_responsetype" type="xs:string" />\r
+       <xs:element name="qmd_scoringpermitted" type="xs:string" />\r
+       <xs:element name="qmd_solutionspermitted" type="xs:string" />\r
+       <xs:element name="qmd_status" type="xs:string" />\r
+       <xs:element name="qmd_timedependence" type="xs:string" />\r
+       <xs:element name="qmd_timelimit" type="xs:string" />\r
+       <xs:element name="qmd_toolvendor" type="xs:string" />\r
+       <xs:element name="qmd_topic" type="xs:string" />\r
+       <xs:element name="qmd_typeofsolution" type="xs:string" />\r
+       <xs:element name="qmd_weighting" type="xs:string" />\r
+       <xs:element name="qticomment" type="qticommentType" />\r
+       <xs:element name="qtimetadata" type="qtimetadataType" />\r
+       <xs:element name="qtimetadatafield" type="qtimetadatafieldType" />\r
+       <xs:element name="reference" type="referenceType" />\r
+       <xs:element name="render_choice" type="render_choiceType" />\r
+       <xs:element name="render_fib" type="render_fibType" />\r
+       <xs:element name="render_hotspot" type="render_hotspotType" />\r
+       <xs:element name="render_slider" type="render_sliderType" />\r
+       <xs:element name="respcond_extension" type="respcond_extensionType" />\r
+       <xs:element name="respcondition" type="respconditionType" />\r
+       <xs:element name="render_extension" type="render_extensionType" />\r
+       <xs:element name="response_extension" type="response_extensionType" />\r
+       <xs:element name="response_grp" type="response_grpType" />\r
+       <xs:element name="response_labelType" type="response_labelType" />\r
+       <xs:element name="response_lid" type="response_lidType" />\r
+       <xs:element name="response_na" type="response_naType" />\r
+       <xs:element name="response_num" type="response_numType" />\r
+       <xs:element name="response_str" type="response_strType" />\r
+       <xs:element name="response_xy" type="response_xyType" />\r
+       <xs:element name="resprocessing" type="resprocessingType" />\r
+       <xs:element name="rubric" type="rubricType" />\r
+       <xs:element name="section" type="sectionType" />\r
+       <xs:element name="sectioncontrol" type="sectioncontrolType" />\r
+       <xs:element name="sectionfeedback" type="sectionfeedbackType" />\r
+       <xs:element name="sectionproc_extension" type="sectionproc_extensionType" />\r
+       <xs:element name="sectionpostcondition" type="xs:string" />\r
+       <xs:element name="sectionprecondition" type="xs:string" />\r
+       <xs:element name="sectionref" type="sectionrefType" />\r
+       <xs:element name="selection" type="selectionType" />\r
+       <xs:element name="selection_extension" type="selection_extensionType" />\r
+       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+       <xs:element name="selection_number" type="xs:string" />\r
+       <xs:element name="selection_ordering" type="selection_orderingType" />\r
+       <xs:element name="sequence_parameter" type="sequence_parameterType" />\r
+       <xs:element name="setvar" type="setvarType" />\r
+       <xs:element name="solution" type="solutionType" />\r
+       <xs:element name="solutionmaterial" type="solutionmaterialType" />\r
+       <xs:element name="sourcebank_ref" type="xs:string" />\r
+       <xs:element name="test_variable" type="test_variableType" />\r
+       <xs:element name="unanswered" type="unansweredType" />\r
+       <xs:element name="var_extension" type="var_extensionType" />\r
+       <xs:element name="varequal" type="varequalType" />\r
+       <xs:element name="vargt" type="vargtType" />\r
+       <xs:element name="vargte" type="vargteType" />\r
+       <xs:element name="variable_test" type="variable_testType" />\r
+       <xs:element name="varinside" type="varinsideType" />\r
+       <xs:element name="varlt" type="varltType" />\r
+       <xs:element name="varlte" type="varlteType" />\r
+       <xs:element name="varsubset" type="varsubsetType" />\r
+       <xs:element name="varsubstring" type="varsubstringType" />\r
+       <xs:element name="vocabulary" type="vocabularyType" />\r
+       <!-- ******************************* -->\r
+       <!-- ** Complex Type Declarations ** -->\r
+       <!-- ******************************* -->\r
+       <!-- ***************** -->\r
+       <!-- ** altmaterial ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="altmaterialType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="mattext" type="mattextType" />\r
+                               <xs:element name="matemtext" type="matemtextType" />\r
+                               <xs:element name="matimage" type="matimageType" />\r
+                               <xs:element name="mataudio" type="mataudioType" />\r
+                               <xs:element name="matvideo" type="matvideoType" />\r
+                               <xs:element name="matapplet" type="matappletType" />\r
+                               <xs:element name="matapplication" type="matapplicationType" />\r
+                               <xs:element name="matref" type="matrefType" />\r
+                               <xs:element ref="matbreak" />\r
+                               <xs:element ref="mat_extension" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="attribute3" type="xs:language" />\r
+       </xs:complexType>\r
+       <!-- ********* -->\r
+       <!-- ** and ** -->\r
+       <!-- ********* -->\r
+       <xs:complexType name="andType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="not" type="notType" />\r
+                       <xs:element name="and" type="andType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="or" type="orType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="unanswered" type="unansweredType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="other" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varlte" type="varlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="vargt" type="vargtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="vargte" type="vargteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubset" type="varsubsetType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varinside" type="varinsideType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durequal" type="durequalType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlt" type="durltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlte" type="durlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgt" type="durgtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgte" type="durgteType" minOccurs="0" maxOccurs="0" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** and_objects ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="and_objectsType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                       <xs:element name="and_objects" type="and_objectsType" />\r
+                       <xs:element name="or_objects" type="or_objectsType" />\r
+                       <xs:element name="not_objects" type="not_objectsType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** and_selection ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="and_selectionType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+                       <xs:element name="and_selection" type="and_selectionType" />\r
+                       <xs:element name="or_selection" type="or_selectionType" />\r
+                       <xs:element name="not_selection" type="not_selectionType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** and_test ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="and_testType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** assessfeedback ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="assessfeedbackType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** assessment ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="assessmentType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="1" />\r
+                       <xs:element ref="duration" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="1" />\r
+                       <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="assessmentcontrol" type="assessmentcontrolType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="rubric" type="rubricType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="presentation_material" type="presentation_materialType" minOccurs="0" />\r
+                       <xs:element name="outcomes_processing" type="outcomes_processingType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="assessproc_extension" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="assessfeedback" type="assessfeedbackType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="selection_ordering" type="selection_orderingType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="reference" type="referenceType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice maxOccurs="1" minOccurs="1">\r
+                               <xs:element name="sectionref" type="sectionrefType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="section" type="sectionType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** assessmentcontrol ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="assessmentcontrolType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="hintswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="solutionswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="feedbackswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ************************** -->\r
+       <!-- ** assessproc_extension ** -->\r
+       <!-- ************************** -->\r
+       <xs:complexType name="assessproc_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** conditionvar ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="conditionvarType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="not" type="notType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="and" type="andType" />\r
+                       <xs:element name="or" type="orType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="unanswered" type="unansweredType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="other" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varlte" type="varlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="vargt" type="vargtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="vargte" type="vargteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubset" type="varsubsetType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varinside" type="varinsideType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" />\r
+                       <xs:element name="durequal" type="durequalType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlt" type="durltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlte" type="durlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgt" type="durgtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgte" type="durgteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="var_extension" minOccurs="0" maxOccurs="0" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** decvar ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="decvarType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="ScoreOnlyType" default="SCORE" />\r
+                               <xs:attribute name="vartype" default="Integer" type="DecimalIntegerOnly">\r
+                                       </xs:attribute>\r
+                               <xs:attribute name="defaultval" type="xs:string" use="prohibited" />\r
+                               <xs:attribute name="minvalue" type="xs:string" />\r
+                               <xs:attribute name="maxvalue" type="xs:string" />\r
+                               <xs:attribute name="members" type="xs:string" use="prohibited" />\r
+                               <xs:attribute name="cutvalue" type="xs:string" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** displayfeedback ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="displayfeedbackType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="feedbacktype" default="Response">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Response" />\r
+                                                       <xs:enumeration value="Solution" />\r
+                                                       <xs:enumeration value="Hint" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** durequal ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="durequalType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** durgt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="durgtType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** durgte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="durgteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** durlt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="durltType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** durlte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="durlteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ********** -->\r
+       <!-- ** flow ** -->\r
+       <!-- ********** -->\r
+       <xs:complexType name="flowType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="flow" type="flowType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+                       <xs:element name="response_lid" type="response_lidType" />\r
+                       <xs:element name="response_xy" type="response_xyType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="response_str" type="response_strType" />\r
+                       <xs:element name="response_num" type="response_numType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="response_grp" type="response_grpType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="response_extension" minOccurs="0" maxOccurs="0" />\r
+               </xs:choice>\r
+               <xs:attribute name="class" type="xs:string" default="Block" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** flow_label ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="flow_labelType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="flow_label" type="flow_labelType" />\r
+                       <xs:element name="response_label" type="response_labelType" />\r
+               </xs:choice>\r
+               <xs:attribute name="class" type="xs:string" default="Block" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** flow_mat ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="flow_matType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="flow_mat" type="flow_matType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+               </xs:choice>\r
+               <xs:attribute name="class" type="xs:string" default="Block" />\r
+       </xs:complexType>\r
+       <!-- ********** -->\r
+       <!-- ** hint ** -->\r
+       <!-- ********** -->\r
+       <xs:complexType name="hintType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="hintmaterial" type="hintmaterialType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackstyle" default="Complete" type="CompleteOnly">\r
+                       </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** hintmaterial ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="hintmaterialType">\r
+               <xs:choice>\r
+                       <xs:element name="material" type="materialType" maxOccurs="0" minOccurs="0" />\r
+                       <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** interpretvar ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="interpretvarType">\r
+               <xs:choice>\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+               </xs:choice>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+       </xs:complexType>\r
+       <!-- ********** -->\r
+       <!-- ** item ** -->\r
+       <!-- ********** -->\r
+       <xs:complexType name="itemType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="duration" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="itemmetadata" type="itemmetadataType" minOccurs="0" />\r
+                       <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="itemcontrol" type="itemcontrolType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="itemprecondition" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="itempostcondition" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice minOccurs="0" maxOccurs="0">\r
+                               <xs:element name="itemrubric" type="itemrubricType" />\r
+                               <xs:element name="rubric" type="rubricType" />\r
+                       </xs:choice>\r
+                       <xs:element name="presentation" type="presentationType" minOccurs="0" />\r
+                       <xs:element name="resprocessing" type="resprocessingType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="itemproc_extension" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="itemfeedback" type="itemfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="reference" type="referenceType" minOccurs="0" maxOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="maxattempts" type="xs:string" use="prohibited" />\r
+               <xs:attribute name="label" type="xs:string" use="prohibited" />\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** itemcontrol ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="itemcontrolType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="hintswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="solutionswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** itemfeedback ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="itemfeedbackType">\r
+               <xs:choice maxOccurs="unbounded" minOccurs="1">\r
+                       <xs:choice>\r
+                               <xs:element name="flow_mat" type="flow_matType" />\r
+                               <xs:element name="material" type="materialType" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+                       <xs:element name="solution" type="solutionType" />\r
+                       <xs:element name="hint" type="hintType" />\r
+               </xs:choice>\r
+               <xs:attribute name="view" default="All" type="AllOnlyValue">\r
+                       </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** itemmetadata ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="itemmetadataType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="1" maxOccurs="unbounded" />\r
+                       <xs:element ref="qmd_computerscored" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_feedbackpermitted" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_hintspermitted" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_itemtype" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_levelofdifficulty" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_maximumscore" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_renderingtype" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_responsetype" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_scoringpermitted" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_solutionspermitted" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_status" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_timedependence" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_timelimit" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_toolvendor" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_topic" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_weighting" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_material" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="qmd_typeofsolution" minOccurs="0" maxOccurs="0" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** itemproc_extension ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="itemproc_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** itemref ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="itemrefType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** itemrubric ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="itemrubricType">\r
+               <xs:sequence>\r
+                       <xs:element name="material" type="materialType" />\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** map_input ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="map_inputType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** map_output ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="map_outputType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** mat_extension ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="mat_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** matapplet ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="matappletType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** matapplication ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="matapplicationType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="apptype" type="xs:string" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** mataudio ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="mataudioType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="audiotype" type="xs:string" default="audio/base" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** matbreak ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="matbreakType" />\r
+       <!-- *************** -->\r
+       <!-- ** matemtext ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="matemtextType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="texttype" type="xs:string" default="text/plain" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute ref="xml:space" default="default" />\r
+                               <xs:attribute name="attribute11" type="xs:language" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** material ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="materialType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="mattext" type="mattextType" />\r
+                               <xs:element name="matemtext" type="matemtextType" />\r
+                               <xs:element name="matimage" type="matimageType" />\r
+                               <xs:element name="mataudio" type="mataudioType" />\r
+                               <xs:element name="matvideo" type="matvideoType" />\r
+                               <xs:element name="matapplet" type="matappletType" />\r
+                               <xs:element name="matapplication" type="matapplicationType" />\r
+                               <xs:element name="matref" type="matrefType" />\r
+                               <xs:element ref="matbreak" />\r
+                               <xs:element ref="mat_extension" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+                       <xs:element name="altmaterial" type="altmaterialType" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="label" type="string256" />\r
+               <xs:attribute name="attribute5" type="xs:language" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** material_ref ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="material_refType">\r
+               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** matimage ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="matimageType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="imagtype" type="xs:string" default="image/jpeg" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** matref ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="matrefType">\r
+               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** mattext ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="mattextType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="texttype" type="xs:string" default="text/plain" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute ref="xml:space" default="default" />\r
+                               <xs:attribute name="attribute11" type="xs:language" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** matvideo ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="matvideoType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="videotype" type="xs:string" default="video/avi" />\r
+                               <xs:attribute name="label" type="xs:string" />\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="width" type="xs:string" />\r
+                               <xs:attribute name="height" type="xs:string" />\r
+                               <xs:attribute name="y0" type="xs:string" />\r
+                               <xs:attribute name="x0" type="xs:string" />\r
+                               <xs:attribute name="embedded" type="xs:string" default="base64" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ********* -->\r
+       <!-- ** not ** -->\r
+       <!-- ********* -->\r
+       <xs:complexType name="notType">\r
+               <xs:choice>\r
+                       <xs:element name="and" type="andType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="or" type="orType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="not" type="notType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="unanswered" type="unansweredType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="other" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varlte" type="varlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="vargt" type="vargtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="vargte" type="vargteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubset" type="varsubsetType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varinside" type="varinsideType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durequal" type="durequalType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlt" type="durltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlte" type="durlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgt" type="durgtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgte" type="durgteType" minOccurs="0" maxOccurs="0" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** not_objects ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="not_objectsType">\r
+               <xs:choice>\r
+                       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                       <xs:element name="and_objects" type="and_objectsType" />\r
+                       <xs:element name="or_objects" type="or_objectsType" />\r
+                       <xs:element name="not_objects" type="not_objectsType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** not_selection ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="not_selectionType">\r
+               <xs:choice>\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+                       <xs:element name="and_selection" type="and_selectionType" />\r
+                       <xs:element name="or_selection" type="or_selectionType" />\r
+                       <xs:element name="not_selection" type="not_selectionType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** not_test ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="not_testType">\r
+               <xs:choice>\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** objectbank ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="objectbankType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="section" type="sectionType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="item" type="itemType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** objectives ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="objectivesType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** objects_condition ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="objects_conditionType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                               <xs:element name="and_objects" type="and_objectsType" />\r
+                               <xs:element name="or_objects" type="or_objectsType" />\r
+                               <xs:element name="not_objects" type="not_objectsType" />\r
+                       </xs:choice>\r
+                       <xs:element name="objects_parameter" type="objects_parameterType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="map_input" type="map_inputType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="objectscond_extension" minOccurs="0" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** objects_parameter ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="objects_parameterType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="pname" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******** -->\r
+       <!-- ** or ** -->\r
+       <!-- ******** -->\r
+       <xs:complexType name="orType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="not" type="notType" />\r
+                       <xs:element name="and" type="andType" />\r
+                       <xs:element name="or" type="orType" />\r
+                       <xs:element name="unanswered" type="unansweredType" />\r
+                       <xs:element ref="other" />\r
+                       <xs:element name="varequal" type="varequalType" />\r
+                       <xs:element name="varlt" type="varltType" />\r
+                       <xs:element name="varlte" type="varlteType" />\r
+                       <xs:element name="vargt" type="vargtType" />\r
+                       <xs:element name="vargte" type="vargteType" />\r
+                       <xs:element name="varsubset" type="varsubsetType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varinside" type="varinsideType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="varsubstring" type="varsubstringType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durequal" type="durequalType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlt" type="durltType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durlte" type="durlteType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgt" type="durgtType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="durgte" type="durgteType" minOccurs="0" maxOccurs="0" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** or_objects ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="or_objectsType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="outcomes_metadata" type="outcomes_metadataType" />\r
+                       <xs:element name="and_objects" type="and_objectsType" />\r
+                       <xs:element name="or_objects" type="or_objectsType" />\r
+                       <xs:element name="not_objects" type="not_objectsType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** or_selection ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="or_selectionType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" />\r
+                       <xs:element name="and_selection" type="and_selectionType" />\r
+                       <xs:element name="or_selection" type="or_selectionType" />\r
+                       <xs:element name="not_selection" type="not_selectionType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** or_test ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="or_testType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** order ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="orderType">\r
+               <xs:sequence>\r
+                       <xs:element ref="order_extension" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="order_type" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** order_extension ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="order_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** outcomes ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="outcomesType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:sequence maxOccurs="1" minOccurs="1">\r
+                               <xs:element name="decvar" type="decvarType" />\r
+                               <xs:element name="interpretvar" type="interpretvarType" minOccurs="0" maxOccurs="0" />\r
+                       </xs:sequence>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- **************************** -->\r
+       <!-- ** outcomes_feedback_test ** -->\r
+       <!-- **************************** -->\r
+       <xs:complexType name="outcomes_feedback_testType">\r
+               <xs:sequence>\r
+                       <xs:element name="test_variable" type="test_variableType" />\r
+                       <xs:element name="displayfeedback" type="displayfeedbackType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- *********************** -->\r
+       <!-- ** outcomes_metadata ** -->\r
+       <!-- *********************** -->\r
+       <xs:complexType name="outcomes_metadataType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="mdname" type="xs:string" use="required" />\r
+                               <xs:attribute name="mdoperator" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="EQ" />\r
+                                                       <xs:enumeration value="NEQ" />\r
+                                                       <xs:enumeration value="LT" />\r
+                                                       <xs:enumeration value="LTE" />\r
+                                                       <xs:enumeration value="GT" />\r
+                                                       <xs:enumeration value="GTE" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************************* -->\r
+       <!-- ** outcomes_processing ** -->\r
+       <!-- ************************* -->\r
+       <xs:complexType name="outcomes_processingType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="outcomes" type="outcomesType" />\r
+                       <xs:element name="objects_condition" type="objects_conditionType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="processing_parameter" type="processing_parameterType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="map_output" type="map_outputType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="outcomes_feedback_test" type="outcomes_feedback_testType" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="scoremodel" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** presentation ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="presentationType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="flow" type="flowType" />\r
+                               <xs:choice maxOccurs="unbounded">\r
+                                       <xs:element name="material" type="materialType" />\r
+                                       <xs:element name="response_lid" type="response_lidType" />\r
+                                       <xs:element name="response_xy" type="response_xyType" minOccurs="0" maxOccurs="0" />\r
+                                       <xs:element name="response_str" type="response_strType" />\r
+                                       <xs:element name="response_num" type="response_numType" minOccurs="0" maxOccurs="0" />\r
+                                       <xs:element name="response_grp" type="response_grpType" minOccurs="0" maxOccurs="0" />\r
+                                       <xs:element ref="response_extension" minOccurs="0" maxOccurs="0" />\r
+                               </xs:choice>\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="label" type="xs:string" />\r
+               <xs:attribute name="attribute5" type="xs:language" />\r
+               <xs:attribute name="y0" type="xs:string" />\r
+               <xs:attribute name="x0" type="xs:string" />\r
+               <xs:attribute name="width" type="xs:string" />\r
+               <xs:attribute name="height" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- *************************** -->\r
+       <!-- ** presentation_material ** -->\r
+       <!-- *************************** -->\r
+       <xs:complexType name="presentation_materialType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ************************** -->\r
+       <!-- ** processing_parameter ** -->\r
+       <!-- ************************** -->\r
+       <xs:complexType name="processing_parameterType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="pname" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** qticomment ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="qticommentType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute ref="xml:lang" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** qtimetadata ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="qtimetadataType">\r
+               <xs:sequence>\r
+                       <xs:element name="vocabulary" type="vocabularyType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="qtimetadatafield" type="qtimetadatafieldType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ********************** -->\r
+       <!-- ** qtimetadatafield ** -->\r
+       <!-- ********************** -->\r
+       <xs:complexType name="qtimetadatafieldType">\r
+               <xs:sequence>\r
+                       <xs:element ref="fieldlabel" />\r
+                       <xs:element ref="fieldentry" />\r
+               </xs:sequence>\r
+               <xs:attribute ref="xml:lang" />\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** questestinterop ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="questestinteropType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="objectbank" type="objectbankType" />\r
+                               <xs:element name="assessment" type="assessmentType" />\r
+                               <xs:choice maxOccurs="0" minOccurs="0">\r
+                                       <xs:element name="section" type="sectionType" />\r
+                                       <xs:element name="item" type="itemType" />\r
+                               </xs:choice>\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** reference ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="referenceType">\r
+               <xs:choice maxOccurs="unbounded">\r
+                       <xs:element name="qticomment" type="qticommentType" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="mattext" type="mattextType" />\r
+                       <xs:element name="matemtext" type="matemtextType" />\r
+                       <xs:element name="matimage" type="matimageType" />\r
+                       <xs:element name="mataudio" type="mataudioType" />\r
+                       <xs:element name="matvideo" type="matvideoType" />\r
+                       <xs:element name="matapplet" type="matappletType" />\r
+                       <xs:element name="matapplication" type="matapplicationType" />\r
+                       <xs:element ref="matbreak" />\r
+                       <xs:element ref="mat_extension" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** render_choice ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="render_choiceType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" maxOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="shuffle" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ********************** -->\r
+       <!-- ** render_extension ** -->\r
+       <!-- ********************** -->\r
+       <xs:complexType name="render_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** render_fib ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="render_fibType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" maxOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="encoding" type="xs:string" default="UTF_8" />\r
+               <xs:attribute name="fibtype" default="String">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="String" />\r
+                                       <xs:enumeration value="Integer" />\r
+                                       <xs:enumeration value="Decimal" />\r
+                                       <xs:enumeration value="Scientific" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rows" type="xs:string" />\r
+               <xs:attribute name="maxchars" type="xs:string" />\r
+               <xs:attribute name="prompt">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Box" />\r
+                                       <xs:enumeration value="Dashline" />\r
+                                       <xs:enumeration value="Asterisk" />\r
+                                       <xs:enumeration value="Underline" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="columns" type="xs:string" />\r
+               <xs:attribute name="charset" type="xs:string" default="ascii-us" />\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** render_hotspot ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="render_hotspotType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+               <xs:attribute name="showdraw" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** render_slider ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="render_sliderType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                               <xs:element name="response_label" type="response_labelType" />\r
+                               <xs:element name="flow_label" type="flow_labelType" />\r
+                       </xs:choice>\r
+                       <xs:element ref="response_na" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="orientation" default="Horizontal">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Horizontal" />\r
+                                       <xs:enumeration value="Vertical" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="lowerbound" type="xs:string" use="required" />\r
+               <xs:attribute name="upperbound" type="xs:string" use="required" />\r
+               <xs:attribute name="step" type="xs:string" />\r
+               <xs:attribute name="startval" type="xs:string" />\r
+               <xs:attribute name="steplabel" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="maxnumber" type="xs:string" />\r
+               <xs:attribute name="minnumber" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** respcond_extension ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="respcond_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** respcondition ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="respconditionType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="conditionvar" type="conditionvarType" />\r
+                       <xs:element name="setvar" type="setvarType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="displayfeedback" type="displayfeedbackType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element ref="respcond_extension" minOccurs="0" maxOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="continue" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** response_extension ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="response_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** response_grp ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_grpType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** response_lableType ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="response_labelType" mixed="true">\r
+               <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="material" type="materialType" />\r
+                       <xs:element name="material_ref" type="material_refType" />\r
+                       <xs:element name="flow_mat" type="flow_matType" />\r
+               </xs:choice>\r
+               <xs:attribute name="rshuffle" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rarea" default="Ellipse" type="EclipseOnlyType">\r
+                       </xs:attribute>\r
+               <xs:attribute name="rrange" default="Exact" type="ExactOnlyType">\r
+                       </xs:attribute>\r
+               <xs:attribute name="labelrefid" type="xs:string" />\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="match_group" type="xs:string" />\r
+               <xs:attribute name="match_max" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** response_lid ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_lidType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="render_slider" type="render_sliderType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** response_na ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="response_naType" />\r
+       <!-- ****************** -->\r
+       <!-- ** response_num ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_numType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="numtype" default="Integer">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Integer" />\r
+                                       <xs:enumeration value="Decimal" />\r
+                                       <xs:enumeration value="Scientific" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** response_str ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="response_strType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="render_slider" type="render_sliderType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ***************** -->\r
+       <!-- ** response_xy ** -->\r
+       <!-- ***************** -->\r
+       <xs:complexType name="response_xyType">\r
+               <xs:sequence>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+                       <xs:choice>\r
+                               <xs:element name="render_choice" type="render_choiceType" />\r
+                               <xs:element name="render_hotspot" type="render_hotspotType" />\r
+                               <xs:element name="render_slider" type="render_sliderType" />\r
+                               <xs:element name="render_fib" type="render_fibType" />\r
+                               <xs:element ref="render_extension" />\r
+                       </xs:choice>\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="material" type="materialType" />\r
+                               <xs:element name="material_ref" type="material_refType" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="rcardinality" default="Single">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Single" />\r
+                                       <xs:enumeration value="Multiple" />\r
+                                       <xs:enumeration value="Ordered" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="rtiming" default="No">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** resprocessing ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="resprocessingType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="outcomes" type="outcomesType" />\r
+                       <xs:choice maxOccurs="unbounded">\r
+                               <xs:element name="respcondition" type="respconditionType" />\r
+                               <xs:element ref="itemproc_extension" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="scoremodel" type="xs:string" use="prohibited" />\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** rubric ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="rubricType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ************* -->\r
+       <!-- ** section ** -->\r
+       <!-- ************* -->\r
+       <xs:complexType name="sectionType">\r
+               <xs:sequence minOccurs="1" maxOccurs="1">\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="duration" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="qtimetadata" type="qtimetadataType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="objectives" type="objectivesType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="sectioncontrol" type="sectioncontrolType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="sectionprecondition" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="sectionpostcondition" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="rubric" type="rubricType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="presentation_material" type="presentation_materialType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="outcomes_processing" type="outcomes_processingType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element ref="sectionproc_extension" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="sectionfeedback" type="sectionfeedbackType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="selection_ordering" type="selection_orderingType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="reference" type="referenceType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:choice minOccurs="0" maxOccurs="unbounded">\r
+                               <xs:element name="itemref" type="itemrefType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="item" type="itemType" />\r
+                               <xs:element name="sectionref" type="sectionrefType" minOccurs="0" maxOccurs="0" />\r
+                               <xs:element name="section" type="sectionType" minOccurs="0" maxOccurs="0" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+               <xs:attribute name="attribute7" type="xs:language" />\r
+       </xs:complexType>\r
+       <!-- ******************** -->\r
+       <!-- ** sectioncontrol ** -->\r
+       <!-- ******************** -->\r
+       <xs:complexType name="sectioncontrolType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="hintswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="solutionswitch" default="Yes">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="Yes" />\r
+                                       <xs:enumeration value="No" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ********************* -->\r
+       <!-- ** sectionfeedback ** -->\r
+       <!-- ********************* -->\r
+       <xs:complexType name="sectionfeedbackType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:choice>\r
+                               <xs:element name="material" type="materialType" maxOccurs="unbounded" />\r
+                               <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+               <xs:attribute name="view" default="All">\r
+                       <xs:simpleType>\r
+                               <xs:restriction base="xs:NMTOKEN">\r
+                                       <xs:enumeration value="All" />\r
+                                       <xs:enumeration value="Administrator" />\r
+                                       <xs:enumeration value="AdminAuthority" />\r
+                                       <xs:enumeration value="Assessor" />\r
+                                       <xs:enumeration value="Author" />\r
+                                       <xs:enumeration value="Candidate" />\r
+                                       <xs:enumeration value="InvigilatorProctor" />\r
+                                       <xs:enumeration value="Psychometrician" />\r
+                                       <xs:enumeration value="Scorer" />\r
+                                       <xs:enumeration value="Tutor" />\r
+                               </xs:restriction>\r
+                       </xs:simpleType>\r
+               </xs:attribute>\r
+               <xs:attribute name="ident" type="xs:string" use="required" />\r
+               <xs:attribute name="title" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- *************************** -->\r
+       <!-- ** sectionproc_extension ** -->\r
+       <!-- *************************** -->\r
+       <xs:complexType name="sectionproc_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** sectionref ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="sectionrefType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="linkrefid" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** selection ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="selectionType">\r
+               <xs:sequence>\r
+                       <xs:element ref="sourcebank_ref" minOccurs="0" />\r
+                       <xs:element ref="selection_number" minOccurs="0" />\r
+                       <xs:element name="selection_metadata" type="selection_metadataType" minOccurs="0" />\r
+                       <xs:choice minOccurs="0">\r
+                               <xs:element name="and_selection" type="and_selectionType" />\r
+                               <xs:element name="or_selection" type="or_selectionType" />\r
+                               <xs:element name="not_selection" type="not_selectionType" />\r
+                               <xs:element ref="selection_extension" />\r
+                       </xs:choice>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       <!-- ************************* -->\r
+       <!-- ** selection_extension ** -->\r
+       <!-- ************************* -->\r
+       <xs:complexType name="selection_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** selection_metadata ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="selection_metadataType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="mdname" type="xs:string" use="required" />\r
+                               <xs:attribute name="mdoperator" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="EQ" />\r
+                                                       <xs:enumeration value="NEQ" />\r
+                                                       <xs:enumeration value="LT" />\r
+                                                       <xs:enumeration value="LTE" />\r
+                                                       <xs:enumeration value="GT" />\r
+                                                       <xs:enumeration value="GTE" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** selection_ordering ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="selection_orderingType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" />\r
+                       <xs:element name="sequence_parameter" type="sequence_parameterType" minOccurs="0" />\r
+                       <xs:element name="selection" type="selectionType" minOccurs="0" maxOccurs="unbounded" />\r
+                       <xs:element name="order" type="orderType" minOccurs="0" />\r
+               </xs:sequence>\r
+               <xs:attribute name="sequence_type" type="xs:string" />\r
+       </xs:complexType>\r
+       <!-- ************************ -->\r
+       <!-- ** sequence_parameter ** -->\r
+       <!-- ************************ -->\r
+       <xs:complexType name="sequence_parameterType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="pname" type="xs:string" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** setvar ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="setvarType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                               <xs:attribute name="action" default="Set" type="SetAddSubtractOnly">\r
+                                       </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** solution ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="solutionType">\r
+               <xs:sequence>\r
+                       <xs:element name="qticomment" type="qticommentType" minOccurs="0" maxOccurs="0" />\r
+                       <xs:element name="solutionmaterial" type="solutionmaterialType" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:attribute name="feedbackstyle" default="Complete" type="CompleteOnly">\r
+                       </xs:attribute>\r
+       </xs:complexType>\r
+       <!-- ********************** -->\r
+       <!-- ** solutionmaterial ** -->\r
+       <!-- ********************** -->\r
+       <xs:complexType name="solutionmaterialType">\r
+               <xs:choice>\r
+                       <xs:element name="material" type="materialType" maxOccurs="0" minOccurs="0" />\r
+                       <xs:element name="flow_mat" type="flow_matType" maxOccurs="unbounded" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** test_variable ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="test_variableType">\r
+               <xs:choice>\r
+                       <xs:element name="variable_test" type="variable_testType" />\r
+                       <xs:element name="and_test" type="and_testType" />\r
+                       <xs:element name="or_test" type="or_testType" />\r
+                       <xs:element name="not_test" type="not_testType" />\r
+               </xs:choice>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** unanswered ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="unansweredType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="string32" use="required" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** var_extension ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="var_extensionType" mixed="true">\r
+               <xs:sequence>\r
+                       <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />\r
+               </xs:sequence>\r
+               <xs:anyAttribute processContents="lax" />\r
+       </xs:complexType>\r
+       <!-- ************** -->\r
+       <!-- ** varequal ** -->\r
+       <!-- ************** -->\r
+       <xs:complexType name="varequalType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="case" default="No">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Yes" />\r
+                                                       <xs:enumeration value="No" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" use="prohibited" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** vargt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="vargtType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="string32" use="required" />\r
+                               <xs:attribute name="index" type="string2" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** vargte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="vargteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="string32" use="required" />\r
+                               <xs:attribute name="index" type="string2" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ******************* -->\r
+       <!-- ** variable_test ** -->\r
+       <!-- ******************* -->\r
+       <xs:complexType name="variable_testType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="varname" type="xs:string" default="SCORE" />\r
+                               <xs:attribute name="testoperator" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="EQ" />\r
+                                                       <xs:enumeration value="NEQ" />\r
+                                                       <xs:enumeration value="LT" />\r
+                                                       <xs:enumeration value="LTE" />\r
+                                                       <xs:enumeration value="GT" />\r
+                                                       <xs:enumeration value="GTE" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** varinside ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="varinsideType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="areatype" use="required">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Ellipse" />\r
+                                                       <xs:enumeration value="Rectangle" />\r
+                                                       <xs:enumeration value="Bounded" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="index" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *********** -->\r
+       <!-- ** varlt ** -->\r
+       <!-- *********** -->\r
+       <xs:complexType name="varltType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="string32" use="required" />\r
+                               <xs:attribute name="index" type="string2" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ************ -->\r
+       <!-- ** varlte ** -->\r
+       <!-- ************ -->\r
+       <xs:complexType name="varlteType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="string32" use="required" />\r
+                               <xs:attribute name="index" type="string2" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- *************** -->\r
+       <!-- ** varsubset ** -->\r
+       <!-- *************** -->\r
+       <xs:complexType name="varsubsetType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="respident" type="string32" use="required" />\r
+                               <xs:attribute name="setmatch" default="Exact">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Exact" />\r
+                                                       <xs:enumeration value="Partial" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                               <xs:attribute name="index" type="string2" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- ****************** -->\r
+       <!-- ** varsubstring ** -->\r
+       <!-- ****************** -->\r
+       <xs:complexType name="varsubstringType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="index" type="xs:string" use="prohibited" />\r
+                               <xs:attribute name="respident" type="xs:string" use="required" />\r
+                               <xs:attribute name="case" default="No">\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="xs:NMTOKEN">\r
+                                                       <xs:enumeration value="Yes" />\r
+                                                       <xs:enumeration value="No" />\r
+                                               </xs:restriction>\r
+                                       </xs:simpleType>\r
+                               </xs:attribute>\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+       <!-- **************** -->\r
+       <!-- ** vocabulary ** -->\r
+       <!-- **************** -->\r
+       <xs:complexType name="vocabularyType">\r
+               <xs:simpleContent>\r
+                       <xs:extension base="xs:string">\r
+                               <xs:attribute name="uri" type="xs:string" />\r
+                               <xs:attribute name="entityref" type="xs:ENTITY" />\r
+                               <xs:attribute name="vocab_type" type="xs:string" />\r
+                       </xs:extension>\r
+               </xs:simpleContent>\r
+       </xs:complexType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_4/imscc_q_definition.xsd b/docs/home/ims/domainProfile_4/imscc_q_definition.xsd
new file mode 100644 (file)
index 0000000..0541296
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" targetNamespace="http://www.imsglobal.org/xsd/ims_qtiasiv1p2">\r
+  <xsd:import namespace="ims_qtiasiv1p2_def_copy.xsd" schemaLocation="ims_qtiasiv1p2_def_copy.xsd" />\r
+  <!--****************************************************************************************-->\r
+  <!--** Definition document - this document holds AP defined simpleType elements that have **-->\r
+  <!--** been referenced through a type attribute in one of the modified, resultant schema. **-->\r
+  <!--****************************************************************************************-->\r
+  <xs:simpleType name="ExactOnlyType">\r
+    <xs:restriction>\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Exact" />\r
+          <xs:enumeration value="Range" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+      <xs:whiteSpace value="collapse" />\r
+      <xs:enumeration value="Exact" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="EclipseOnlyType">\r
+    <xs:restriction>\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Ellipse" />\r
+          <xs:enumeration value="Rectangle" />\r
+          <xs:enumeration value="Bounded" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+      <xs:whiteSpace value="collapse" />\r
+      <xs:enumeration value="Ellipse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="string4">\r
+    <xs:restriction base="xs:string">\r
+      <xs:maxLength value="4" />\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="string32">\r
+    <xs:restriction base="xs:string">\r
+      <xs:maxLength value="32" />\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="string256">\r
+    <xs:restriction base="xs:string">\r
+      <xs:maxLength value="256" />\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="string2">\r
+    <xs:restriction base="xs:string">\r
+      <xs:maxLength value="2" />\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="string16">\r
+    <xs:restriction base="xs:string">\r
+      <xs:maxLength value="16" />\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="string1024">\r
+    <xs:restriction base="xs:string">\r
+      <xs:maxLength value="1024" />\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="SetAddSubtractOnly">\r
+    <xs:restriction>\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Set" />\r
+          <xs:enumeration value="Add" />\r
+          <xs:enumeration value="Subtract" />\r
+          <xs:enumeration value="Multiply" />\r
+          <xs:enumeration value="Divide" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+      <xs:whiteSpace value="collapse" />\r
+      <xs:enumeration value="Set" />\r
+      <xs:enumeration value="Add" />\r
+      <xs:enumeration value="Subtract" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="ScoreOnlyType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="SCORE" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="DummyType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="DecimalIntegerOnly">\r
+    <xs:restriction>\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Integer" />\r
+          <xs:enumeration value="String" />\r
+          <xs:enumeration value="Decimal" />\r
+          <xs:enumeration value="Scientific" />\r
+          <xs:enumeration value="Boolean" />\r
+          <xs:enumeration value="Enumerated" />\r
+          <xs:enumeration value="Set" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+      <xs:whiteSpace value="collapse" />\r
+      <xs:enumeration value="Integer" />\r
+      <xs:enumeration value="Decimal" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="CompleteOnly">\r
+    <xs:restriction>\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="Complete" />\r
+          <xs:enumeration value="Incremental" />\r
+          <xs:enumeration value="Multilevel" />\r
+          <xs:enumeration value="Proprietary" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+      <xs:whiteSpace value="collapse" />\r
+      <xs:enumeration value="Complete" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="AllOnlyValue">\r
+    <xs:restriction>\r
+      <xs:simpleType>\r
+        <xs:restriction base="xs:NMTOKEN">\r
+          <xs:enumeration value="All" />\r
+          <xs:enumeration value="Administrator" />\r
+          <xs:enumeration value="AdminAuthority" />\r
+          <xs:enumeration value="Assessor" />\r
+          <xs:enumeration value="Author" />\r
+          <xs:enumeration value="Candidate" />\r
+          <xs:enumeration value="InvigilatorProctor" />\r
+          <xs:enumeration value="Psychometrician" />\r
+          <xs:enumeration value="Scorer" />\r
+          <xs:enumeration value="Tutor" />\r
+        </xs:restriction>\r
+      </xs:simpleType>\r
+      <xs:whiteSpace value="collapse" />\r
+      <xs:enumeration value="All" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xsd:schema>\r
+\r
diff --git a/docs/home/ims/domainProfile_4/xml.xsd b/docs/home/ims/domainProfile_4/xml.xsd
new file mode 100644 (file)
index 0000000..aec62fc
--- /dev/null
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/XML/1998/namespace" xml:lang="en">\r
+\r
+ <xs:annotation>\r
+  <xs:documentation>\r
+   See http://www.w3.org/XML/1998/namespace.html and\r
+   http://www.w3.org/TR/REC-xml for information about this namespace.\r
+\r
+    This schema document describes the XML namespace, in a form\r
+    suitable for import by other schema documents.  \r
+\r
+    Note that local names in this namespace are intended to be defined\r
+    only by the World Wide Web Consortium or its subgroups.  The\r
+    following names are currently defined in this namespace and should\r
+    not be used with conflicting semantics by any Working Group,\r
+    specification, or document instance:\r
+\r
+    base (as an attribute name): denotes an attribute whose value\r
+         provides a URI to be used as the base for interpreting any\r
+         relative URIs in the scope of the element on which it\r
+         appears; its value is inherited.  This name is reserved\r
+         by virtue of its definition in the XML Base specification.\r
+\r
+    id   (as an attribute name): denotes an attribute whose value\r
+         should be interpreted as if declared to be of type ID.\r
+         This name is reserved by virtue of its definition in the\r
+         xml:id specification.\r
+\r
+    lang (as an attribute name): denotes an attribute whose value\r
+         is a language code for the natural language of the content of\r
+         any element; its value is inherited.  This name is reserved\r
+         by virtue of its definition in the XML specification.\r
+  \r
+    space (as an attribute name): denotes an attribute whose\r
+         value is a keyword indicating what whitespace processing\r
+         discipline is intended for the content of the element; its\r
+         value is inherited.  This name is reserved by virtue of its\r
+         definition in the XML specification.\r
+\r
+    Father (in any context at all): denotes Jon Bosak, the chair of \r
+         the original XML Working Group.  This name is reserved by \r
+         the following decision of the W3C XML Plenary and \r
+         XML Coordination groups:\r
+\r
+             In appreciation for his vision, leadership and dedication\r
+             the W3C XML Plenary on this 10th day of February, 2000\r
+             reserves for Jon Bosak in perpetuity the XML name\r
+             xml:Father\r
+  </xs:documentation>\r
+ </xs:annotation>\r
+\r
+ <xs:annotation>\r
+  <xs:documentation>This schema defines attributes and an attribute group\r
+        suitable for use by\r
+        schemas wishing to allow xml:base, xml:lang, xml:space or xml:id\r
+        attributes on elements they define.\r
+\r
+        To enable this, such a schema must import this schema\r
+        for the XML namespace, e.g. as follows:\r
+        &lt;schema . . .&gt;\r
+         . . .\r
+         &lt;import namespace="http://www.w3.org/XML/1998/namespace"\r
+                    schemaLocation="http://www.w3.org/2001/xml.xsd"/&gt;\r
+\r
+        Subsequently, qualified reference to any of the attributes\r
+        or the group defined below will have the desired effect, e.g.\r
+\r
+        &lt;type . . .&gt;\r
+         . . .\r
+         &lt;attributeGroup ref="xml:specialAttrs"/&gt;\r
\r
+         will define a type which will schema-validate an instance\r
+         element with any of those attributes</xs:documentation>\r
+ </xs:annotation>\r
+\r
+ <xs:annotation>\r
+  <xs:documentation>In keeping with the XML Schema WG's standard versioning\r
+   policy, this schema document will persist at\r
+   http://www.w3.org/2007/08/xml.xsd.\r
+   At the date of issue it can also be found at\r
+   http://www.w3.org/2001/xml.xsd.\r
+   The schema document at that URI may however change in the future,\r
+   in order to remain compatible with the latest version of XML Schema\r
+   itself, or with the XML namespace itself.  In other words, if the XML\r
+   Schema or XML namespaces change, the version of this document at\r
+   http://www.w3.org/2001/xml.xsd will change\r
+   accordingly; the version at\r
+   http://www.w3.org/2007/08/xml.xsd will not change.\r
+  </xs:documentation>\r
+ </xs:annotation>\r
+\r
+ <xs:attribute name="lang">\r
+  <xs:annotation>\r
+   <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter\r
+         codes as the enumerated possible values is probably never\r
+         going to be a realistic possibility.  See\r
+         RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry\r
+         at http://www.iana.org/assignments/lang-tag-apps.htm for\r
+         further information.\r
+\r
+         The union allows for the 'un-declaration' of xml:lang with\r
+         the empty string.</xs:documentation>\r
+  </xs:annotation>\r
+  <xs:simpleType>\r
+   <xs:union memberTypes="xs:language">\r
+    <xs:simpleType>    \r
+     <xs:restriction base="xs:string">\r
+      <xs:enumeration value="" />\r
+     </xs:restriction>\r
+    </xs:simpleType>\r
+   </xs:union>\r
+  </xs:simpleType>\r
+ </xs:attribute>\r
+\r
+ <xs:attribute name="space">\r
+  <xs:simpleType>\r
+   <xs:restriction base="xs:NCName">\r
+    <xs:enumeration value="default" />\r
+    <xs:enumeration value="preserve" />\r
+   </xs:restriction>\r
+  </xs:simpleType>\r
+ </xs:attribute>\r
+\r
+ <xs:attribute name="base" type="xs:anyURI">\r
+  <xs:annotation>\r
+   <xs:documentation>See http://www.w3.org/TR/xmlbase/ for\r
+                     information about this attribute.</xs:documentation>\r
+  </xs:annotation>\r
+ </xs:attribute>\r
\r
+ <xs:attribute name="id" type="xs:ID">\r
+  <xs:annotation>\r
+   <xs:documentation>See http://www.w3.org/TR/xml-id/ for\r
+                     information about this attribute.</xs:documentation>\r
+  </xs:annotation>\r
+ </xs:attribute>\r
+\r
+ <xs:attributeGroup name="specialAttrs">\r
+  <xs:attribute ref="xml:base" />\r
+  <xs:attribute ref="xml:lang" />\r
+  <xs:attribute ref="xml:space" />\r
+  <xs:attribute ref="xml:id" />\r
+ </xs:attributeGroup>\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_5/imswl_v1p0.xsd b/docs/home/ims/domainProfile_5/imswl_v1p0.xsd
new file mode 100644 (file)
index 0000000..076005a
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imswl_v1p0" targetNamespace="http://www.imsglobal.org/xsd/imswl_v1p0" elementFormDefault="unqualified">\r
+  <xs:element name="webLink" type="webLinkType" />\r
+  <xs:complexType name="webLinkType">\r
+    <xs:sequence>\r
+      <xs:element name="title" type="xs:string" />\r
+      <xs:element name="url">\r
+        <xs:complexType>\r
+          <xs:attribute name="href" type="xs:string" use="required" />\r
+          <xs:attribute name="target" type="xs:string" />\r
+          <xs:attribute name="windowFeatures" type="xs:string" />\r
+        </xs:complexType>\r
+      </xs:element>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_5/imswl_v1p0_localised.xsd b/docs/home/ims/domainProfile_5/imswl_v1p0_localised.xsd
new file mode 100644 (file)
index 0000000..5f97a95
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imswl_v1p0.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imswl_v1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/imswl_v1p0" elementFormDefault="unqualified">\r
+  <xs:element name="webLink" type="webLinkType" />\r
+  <xs:complexType name="webLinkType">\r
+    <xs:sequence>\r
+      <xs:element name="title" type="xs:string" />\r
+      <xs:element name="url">\r
+        <xs:complexType>\r
+          <xs:attribute name="href" type="xs:string" use="required" />\r
+          <xs:attribute name="target" type="xs:string" />\r
+          <xs:attribute name="windowFeatures" type="xs:string" />\r
+        </xs:complexType>\r
+      </xs:element>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_6/imsdt_v1p0.xsd b/docs/home/ims/domainProfile_6/imsdt_v1p0.xsd
new file mode 100644 (file)
index 0000000..8ad75a8
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imsdt_v1p0" targetNamespace="http://www.imsglobal.org/xsd/imsdt_v1p0" elementFormDefault="unqualified">\r
+\r
+  <xs:element name="topic" type="topicType" />\r
+  <xs:complexType name="topicType">\r
+    <xs:sequence>\r
+      <xs:element name="title" type="xs:string" />\r
+      <xs:element name="text">\r
+        <xs:complexType>\r
+          <xs:simpleContent>\r
+            <xs:extension base="xs:string">\r
+              <xs:attribute name="texttype" type="textTypeType" default="text/plain" />\r
+            </xs:extension>\r
+          </xs:simpleContent>\r
+        </xs:complexType>\r
+      </xs:element>\r
+      <xs:element name="attachments" minOccurs="0">\r
+        <xs:complexType>\r
+          <xs:sequence>\r
+            <xs:element name="attachment" minOccurs="1" maxOccurs="unbounded">\r
+              <xs:complexType>\r
+                <xs:attribute name="href" type="xs:string" use="required" />\r
+              </xs:complexType>\r
+            </xs:element>\r
+          </xs:sequence>\r
+        </xs:complexType>\r
+      </xs:element>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <xs:simpleType name="textTypeType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:enumeration value="text/html" />\r
+      <xs:enumeration value="text/plain" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/domainProfile_6/imsdt_v1p0_localised.xsd b/docs/home/ims/domainProfile_6/imsdt_v1p0_localised.xsd
new file mode 100644 (file)
index 0000000..5364cef
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imsdt_v1p0.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imsdt_v1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/imsdt_v1p0" elementFormDefault="unqualified">\r
+\r
+  <xs:element name="topic" type="topicType" />\r
+  <xs:complexType name="topicType">\r
+    <xs:sequence>\r
+      <xs:element name="title" type="xs:string" />\r
+      <xs:element name="text">\r
+        <xs:complexType>\r
+          <xs:simpleContent>\r
+            <xs:extension base="xs:string">\r
+              <xs:attribute name="texttype" type="textTypeType" default="text/plain" />\r
+            </xs:extension>\r
+          </xs:simpleContent>\r
+        </xs:complexType>\r
+      </xs:element>\r
+      <xs:element name="attachments" minOccurs="0">\r
+        <xs:complexType>\r
+          <xs:sequence>\r
+            <xs:element name="attachment" minOccurs="1" maxOccurs="unbounded">\r
+              <xs:complexType>\r
+                <xs:attribute name="href" type="xs:string" use="required" />\r
+              </xs:complexType>\r
+            </xs:element>\r
+          </xs:sequence>\r
+        </xs:complexType>\r
+      </xs:element>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <xs:simpleType name="textTypeType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:enumeration value="text/html" />\r
+      <xs:enumeration value="text/plain" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/glossary.xsd b/docs/home/ims/glossary.xsd
new file mode 100644 (file)
index 0000000..bc78ddb
--- /dev/null
@@ -0,0 +1,14 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.atutor.ca/xsd/glossary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.atutor.ca/xsd/glossary" elementFormDefault="unqualified">
+  <xs:complexType name="glossaryItem">
+    <xs:sequence>
+       <xs:element name="term" type="xs:string"/>
+       <xs:element name="definition" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="glossary" type="glossaryType"/>
+  <xs:complexType name="glossaryType">
+    <xs:sequence>
+      <xs:element name="item" type="glossaryItem" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
diff --git a/docs/home/ims/ims_export.php b/docs/home/ims/ims_export.php
new file mode 100644 (file)
index 0000000..704121b
--- /dev/null
@@ -0,0 +1,348 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/** Commented by Cindy Li on Feb 2, 2010
+ * Modified from ATutor mods/_core/imscp/ims_export.php, SVN revision 9126
+ */
+
+define('TR_INCLUDE_PATH', '../../include/');
+
+/* content id of an optional chapter */
+$cid = isset($_REQUEST['cid']) ? intval($_REQUEST['cid']) : 0;
+$c   = isset($_REQUEST['c'])   ? intval($_REQUEST['c'])   : 0;
+
+if (isset($_REQUEST['to_tile']) && !isset($_POST['cancel'])) {
+       /* for TILE */
+
+       /* redirect to TILE import servlet */
+       if (!authenticate(TR_PRIV_ADMIN, TR_PRIV_RETURN)) {
+               /* user can't be authenticated */
+               header('HTTP/1.1 404 Not Found');
+               echo 'Document not found.';
+               exit;
+       }
+
+       $m = md5(DB_PASSWORD . 'x' . ADMIN_PASSWORD . 'x' . $_SERVER['SERVER_ADDR'] . 'x' . $cid . 'x' . $_SESSION['course_id'] . 'x' . date('Ymd'));
+
+       header('Location: '.TR_TILE_IMPORT. '?cp='.urlencode(TR_BASE_HREF. 'home/ims/ims_export.php?cid='.$cid.'&c='.$_SESSION['course_id'].'&m='.$m));
+       exit;
+} else if (isset($_GET['m'])) {
+       /* for TILE */
+
+       /* request (hopefully) coming from a TILE server, send the content package */
+
+       $_user_location = 'public';
+       require(TR_INCLUDE_PATH.'vitals.inc.php');
+       $m = md5(DB_PASSWORD . 'x' . ADMIN_PASSWORD . 'x' . $_SERVER['SERVER_ADDR'] . 'x' . $cid . 'x' . $c . 'x' . date('Ymd'));
+       if (($m != $_GET['m']) || !$c) {
+               header('HTTP/1.1 404 Not Found');
+               echo 'Document not found.';
+               exit;
+       }
+       
+       $course_id = $c;
+
+} else {
+       $use_a4a = false;
+       if (isset($_REQUEST['to_a4a'])){
+               $use_a4a = true;
+       }
+       require(TR_INCLUDE_PATH.'vitals.inc.php');
+       $course_id = $_SESSION['course_id'];
+}
+//load the following after vitals is included
+require(TR_INCLUDE_PATH.'classes/testQuestions.class.php');
+require(TR_INCLUDE_PATH.'classes/A4a/A4aExport.class.php');
+
+$instructor_id   = $system_courses[$course_id]['member_id'];
+$course_desc     = htmlspecialchars($system_courses[$course_id]['description'], ENT_QUOTES, 'UTF-8');
+$course_title    = htmlspecialchars($system_courses[$course_id]['title'], ENT_QUOTES, 'UTF-8');
+$course_language = $system_courses[$course_id]['primary_language'];
+
+$courseLanguage =& $languageManager->getLanguage($course_language);
+//If course language cannot be found, use UTF-8 English
+//@author harris, Oct 30,2008
+if ($courseLanguage == null){
+       $courseLanguage =& $languageManager->getLanguage('en');
+}
+
+$course_language_charset = $courseLanguage->getCharacterSet();
+$course_language_code = $courseLanguage->getCode();
+
+require(TR_INCLUDE_PATH.'classes/zipfile.class.php');                          /* for zipfile */
+require(TR_INCLUDE_PATH.'classes/vcard.php');                                          /* for vcard */
+require(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');    /* for XML_HTMLSax */
+require(TR_INCLUDE_PATH.'ims/ims_template.inc.php');                           /* for ims templates + print_organizations() */
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('EXPORT_CANCELLED');
+       header('Location: ../index.php');
+       exit;
+}
+
+
+$zipfile = new zipfile(); 
+$zipfile->create_dir('resources/');
+
+/*
+       the following resources are to be identified:
+       even if some of these can't be images, they can still be files in the content dir.
+       theoretically the only urls we wouldn't deal with would be for a <!DOCTYPE and <form>
+
+       img             => src
+       a               => href                         // ignore if href doesn't exist (ie. <a name>)
+       object  => data | classid       // probably only want data
+       applet  => classid | archive                    // whatever these two are should double check to see if it's a valid file (not a dir)
+       link    => href
+       script  => src
+       form    => action
+       input   => src
+       iframe  => src
+
+*/
+class MyHandler {
+    function MyHandler(){}
+    function openHandler(& $parser,$name,$attrs) {
+               global $my_files;
+
+               $name = strtolower($name);
+               $attrs = array_change_key_case($attrs, CASE_LOWER);
+
+               $elements = array(      'img'           => 'src',
+                                                       'a'                     => 'href',                              
+                                                       'object'        => array('data', 'classid'),
+                                                       'applet'        => array('classid', 'archive'),
+                                                       'link'          => 'href',
+                                                       'script'        => 'src',
+                                                       'form'          => 'action',
+                                                       'input'         => 'src',
+                                                       'iframe'        => 'src',
+                                                       'embed'         => 'src',
+                                                       'param'         => 'value');
+       
+               /* check if this attribute specifies the files in different ways: (ie. java) */
+               if (is_array($elements[$name])) {
+                       $items = $elements[$name];
+
+                       foreach ($items as $item) {
+                               if ($attrs[$item] != '') {
+
+                                       /* some attributes allow a listing of files to include seperated by commas (ie. applet->archive). */
+                                       if (strpos($attrs[$item], ',') !== false) {
+                                               $files = explode(',', $attrs[$item]);
+                                               foreach ($files as $file) {
+                                                       $my_files[] = trim($file);
+                                               }
+                                       } else {
+                                               $my_files[] = $attrs[$item];
+                                       }
+                               }
+                       }
+               } else if (isset($elements[$name]) && ($attrs[$elements[$name]] != '')) {
+                       /* we know exactly which attribute contains the reference to the file. */
+                       $my_files[] = $attrs[$elements[$name]];
+               }
+    }
+    function closeHandler(& $parser,$name) { }
+}
+
+/* get all the content */
+$content = array();
+$paths  = array();
+$top_content_parent_id = 0;
+
+$handler=new MyHandler();
+$parser = new XML_HTMLSax();
+$parser->set_object($handler);
+$parser->set_element_handler('openHandler','closeHandler');
+
+if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN)) {
+       $sql = "SELECT *, UNIX_TIMESTAMP(last_modified) AS u_ts FROM ".TABLE_PREFIX."content WHERE course_id=$course_id ORDER BY content_parent_id, ordering";
+} else {
+       $sql = "SELECT *, UNIX_TIMESTAMP(last_modified) AS u_ts FROM ".TABLE_PREFIX."content WHERE course_id=$course_id ORDER BY content_parent_id, ordering";
+}
+$result = mysql_query($sql, $db);
+while ($row = mysql_fetch_assoc($result)) {
+       if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN) || $contentManager->isReleased($row['content_id']) === TRUE) {
+               $content[$row['content_parent_id']][] = $row;
+               if ($cid == $row['content_id']) {
+                       $top_content = $row;
+                       $top_content_parent_id = $row['content_parent_id'];
+               }
+       }
+}
+
+if ($cid) {
+       /* filter out the top level sections that we don't want */
+       $top_level = $content[$top_content_parent_id];
+       foreach($top_level as $page) {
+               if ($page['content_id'] == $cid) {
+                       $content[$top_content_parent_id] = array($page);
+               } else {
+                       /* this is a page we don't want, so might as well remove it's children too */
+                       unset($content[$page['content_id']]);
+               }
+       }
+       $ims_course_title = $course_title . ' - ' . $content[$top_content_parent_id][0]['title'];
+} else {
+       $ims_course_title = $course_title;
+}
+
+
+/* generate the imsmanifest.xml header attributes */
+$imsmanifest_xml = str_replace(array('{COURSE_TITLE}', '{COURSE_DESCRIPTION}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}'), 
+                                                         array($ims_course_title, $course_desc, $course_language_charset, $course_language_code),
+                                                         $ims_template_xml['header']);
+//debug($imsmanifest_xml);
+//exit;
+
+/* get the first content page to default the body frame to */
+$first = $content[$top_content_parent_id][0];
+
+$test_ids = array();   //global array to store all the test ids
+//if ($my_files == null) 
+//$my_files = array();
+
+/* generate the IMS QTI resource and files */
+/*
+/* in print_organizations
+foreach ($content[0] as $content_box){
+       $content_test_rs = $contentManager->getContentTestsAssoc($content_box['content_id']);   
+       while ($content_test_row = mysql_fetch_assoc($content_test_rs)){
+               //export
+               $test_ids[] = $content_test_row['test_id'];
+               //the 'added_files' is for adding into the manifest file in this zip
+               $added_files = test_qti_export($content_test_row['test_id'], '', $zipfile);
+
+               //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
+               foreach($added_files as $filename=>$file_array){
+                       $my_files[] = $filename;
+                       foreach ($file_array as $garbage=>$filename2){
+                               $my_files[] = $filename2;
+                       }
+               }
+       }
+}
+*/
+
+/* generate the resources and save the HTML files */
+$used_glossary_terms = array();
+ob_start();
+print_organizations($top_content_parent_id, $content, 0, '', array(), $toc_html);
+$organizations_str = ob_get_contents();
+ob_end_clean();
+
+if (count($used_glossary_terms)) {
+       $used_glossary_terms = array_unique($used_glossary_terms);
+       sort($used_glossary_terms);
+       reset($used_glossary_terms);
+
+       $terms_xml = '';
+       foreach ($used_glossary_terms as $term) {
+               $term_key = urlencode($term);
+               $glossary[$term_key] = htmlentities($glossary[$term_key], ENT_QUOTES, 'UTF-8');
+               $glossary[$term_key] = str_replace('&', '&amp;', $glossary[$term_key]);
+               $escaped_term = str_replace('&', '&amp;', $term);
+               $terms_xml .= str_replace(      array('{TERM}', '{DEFINITION}'),
+                                                                       array($escaped_term, $glossary[$term_key]),
+                                                                       $glossary_term_xml);
+
+               $terms_html .= str_replace(     array('{ENCODED_TERM}', '{TERM}', '{DEFINITION}'),
+                                                                       array($term_key, $term, $glossary[$term_key]),
+                                                                       $glossary_term_html);
+       }
+
+       $glossary_body_html = str_replace('{BODY}', $terms_html, $glossary_body_html);
+
+       $glossary_xml = str_replace(array('{GLOSSARY_TERMS}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}'),
+                                                           array($terms_xml, $course_language_charset),
+                                                               $glossary_xml);
+       $glossary_html = str_replace(   array('{CONTENT}', '{KEYWORDS}', '{TITLE}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}'),
+                                                                       array($glossary_body_html, '', 'Glossary', $course_language_charset, $course_language_code),
+                                                                       $html_template);
+       $toc_html .= '<ul><li><a href="glossary.html" target="body">'._AT('glossary').'</a></li></ul>';
+} else {
+       unset($glossary_xml);
+}
+
+$toc_html = str_replace(array('{TOC}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}'),
+                                           array($toc_html, $course_language_charset, $course_language_code),
+                                               $html_toc);
+
+if ($first['content_path']) {
+       $first['content_path'] .= '/';
+}
+$frame = str_replace(  array('{COURSE_TITLE}',         '{FIRST_ID}', '{PATH}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}'),
+                                               array($ims_course_title, $first['content_id'], $first['content_path'], $course_language_charset, $course_language_code),
+                                               $html_frame);
+
+$html_mainheader = str_replace(array('{COURSE_TITLE}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}'),
+                                                          array($ims_course_title, $course_language_charset, $course_language_code),
+                                                          $html_mainheader);
+
+
+
+/* append the Organizations and Resources to the imsmanifest */
+$imsmanifest_xml .= str_replace(       array('{ORGANIZATIONS}',        '{RESOURCES}', '{COURSE_TITLE}'),
+                                                                       array($organizations_str,       $resources, $ims_course_title),
+                                                                       $ims_template_xml['final']);
+
+/* generate the vcard for the instructor/author */
+$sql = "SELECT first_name, last_name, email, website, login, phone FROM ".TABLE_PREFIX."members WHERE member_id=$instructor_id";
+$result = mysql_query($sql, $db);
+$vcard = new vCard();
+if ($row = mysql_fetch_assoc($result)) {
+       $vcard->setName($row['last_name'], $row['first_name'], $row['login']);
+       $vcard->setEmail($row['email']);
+       $vcard->setNote('Originated from an ATutor at '.TR_BASE_HREF.'. See ATutor.ca for additional information.');
+       $vcard->setURL($row['website']);
+
+       $imsmanifest_xml = str_replace('{VCARD}', $vcard->getVCard(), $imsmanifest_xml);
+} else {
+       $imsmanifest_xml = str_replace('{VCARD}', '', $imsmanifest_xml);
+}
+
+/* save the imsmanifest.xml file */
+
+$zipfile->add_file($frame,                      'index.html');
+$zipfile->add_file($toc_html,           'toc.html');
+$zipfile->add_file($imsmanifest_xml, 'imsmanifest.xml');
+$zipfile->add_file($html_mainheader, 'header.html');
+if ($glossary_xml) {
+       $zipfile->add_file($glossary_xml,  'glossary.xml');
+       $zipfile->add_file($glossary_html, 'glossary.html');
+}
+$zipfile->add_file(file_get_contents(TR_INCLUDE_PATH.'ims/adlcp_rootv1p2.xsd'), 'adlcp_rootv1p2.xsd');
+$zipfile->add_file(file_get_contents(TR_INCLUDE_PATH.'ims/ims_xml.xsd'), 'ims_xml.xsd');
+$zipfile->add_file(file_get_contents(TR_INCLUDE_PATH.'ims/imscp_rootv1p1p2.xsd'), 'imscp_rootv1p1p2.xsd');
+$zipfile->add_file(file_get_contents(TR_INCLUDE_PATH.'ims/imsmd_rootv1p2p1.xsd'), 'imsmd_rootv1p2p1.xsd');
+$zipfile->add_file(file_get_contents(TR_INCLUDE_PATH.'ims/ims.css'), 'ims.css');
+$zipfile->add_file(file_get_contents(TR_INCLUDE_PATH.'ims/footer.html'), 'footer.html');
+$zipfile->add_file(file_get_contents('../../images/logo.gif'), 'logo.gif');
+
+$zipfile->close(); // this is optional, since send_file() closes it anyway
+
+$ims_course_title = str_replace(array(' ', ':'), '_', $ims_course_title);
+/**
+ * A problem here with the preg_replace below.
+ * Originally was designed to remove all werid symbols to avoid file corruptions.
+ * In UTF-8, all non-english chars are considered to be 'werid symbols'
+ * We can still replace it as is, or add fileid to the filename to avoid these problems
+ * Well then again people won't be able to tell what this file is about
+ * If we are going to take out the preg_replace, some OS might not be able to understand
+ * these characters and will have problems importing.
+ */
+$ims_course_title = preg_replace("{[^a-zA-Z0-9._-]}","", trim($ims_course_title));
+$zipfile->send_file($ims_course_title . '_ims');
+
+exit;
+?>
\ No newline at end of file
diff --git a/docs/home/ims/ims_import.old.php b/docs/home/ims/ims_import.old.php
new file mode 100644 (file)
index 0000000..ab7c987
--- /dev/null
@@ -0,0 +1,1145 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'classes/DAO/UsersDAO.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'lib/filemanager.inc.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+require_once(TR_INCLUDE_PATH.'lib/pclzip.lib.php');
+require_once(TR_INCLUDE_PATH.'lib/qti.inc.php'); 
+//require(TR_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');  
+require_once(TR_INCLUDE_PATH.'classes/QTI/QTIImport.class.php');
+require_once(TR_INCLUDE_PATH.'classes/A4a/A4aImport.class.php');
+//require(TR_INCLUDE_PATH.'../tools/ims/ns.inc.php');  //namespace, no longer needs, delete it after it's stable.
+require_once(TR_INCLUDE_PATH.'classes/Weblinks/WeblinksParser.class.php');
+
+global $_current_user;
+/* make sure the user has author privilege */
+if (!isset($_current_user) || !$_current_user->isAuthor())
+{
+       $msg->addError('NO_PRIV');
+       include(TR_INCLUDE_PATH.'header.inc.php');
+       $msg->printAll(); 
+       include(TR_INCLUDE_PATH.'footer.inc.php');
+       exit;
+}
+
+/* to avoid timing out on large files */
+@set_time_limit(0);
+$_SESSION['done'] = 1;
+
+$html_head_tags = array("style", "script");
+
+$package_base_path = '';
+$xml_base_path = '';
+$element_path = array();
+$imported_glossary = array();
+$character_data = '';
+$test_message = '';
+$content_type = '';
+$skip_ims_validation = false;
+
+
+/**
+ * Validate all the XML in the package, including checking XSDs, missing data.
+ * @param      string          the path of the directory that contains all the package files
+ * @return     boolean         true if every file exists in the manifest, false if any is missing.
+ */
+function checkResources($import_path){
+       global $items, $msg, $skip_ims_validation;
+
+       if (!is_dir($import_path)){
+               return;
+       }
+
+       //if the package has access for all content, skip validation for now. 
+       //todo: import the XSD into our validator
+       if ($skip_ims_validation){
+               return true;
+       }
+
+       //generate a file tree
+       $data = rscandir($import_path);
+
+       //check if every file is presented in the manifest
+       foreach($data as $filepath){
+               $filepath = substr($filepath, strlen($import_path));
+
+               //validate xml via its xsd/dtds
+               if (preg_match('/(.*)\.xml/', $filepath)){
+                       $dom = new DOMDocument();
+                       $dom->load(realpath($import_path.$filepath));
+
+                       if (!@$dom->schemaValidate('main.xsd')){
+                               $msg->addError('MANIFEST_FAILED_VALIDATION - '.$filepath);
+                       }
+                       //if this is the manifest file, we do not have to check for its existance.
+                       if (preg_match('/(.*)imsmanifest\.xml/', $filepath)){
+                               continue;
+                       }
+               }
+
+               $flag = false;
+               $file_exists_in_manifest = false;
+
+               //check if every file in manifest indeed exists
+               foreach($items as $name=>$fileinfo){
+                       if (is_array($fileinfo['file'])){
+                               if(in_array($filepath, $fileinfo['file'])){
+                                       $file_exists_in_manifest = true;
+
+                                       //validate the xml by its schema
+                                       if (preg_match('/imsqti\_(.*)/', $fileinfo['type'])){
+                                               $qti = new QTIParser($fileinfo['type']);
+                                               $xml_content = @file_get_contents($import_path . $fileinfo['href']);
+                                               $qti->parse($xml_content);
+                                               if ($msg->containsErrors()){
+                                                       $flag = false;
+                                               } else {
+                                                       $flag = true;
+                                               }
+                                       } else {
+                                               $flag = true;
+                                       }
+                               }
+                       }
+               }
+
+               //check if all the files exists in the manifest, if not, throw error.
+               if (!$file_exists_in_manifest){
+                       $msg->addError('MANIFEST_NOT_WELLFORM: MISSING REFERENCES');
+                       break;
+               }
+
+               if ($flag == false){
+                       //add an error message if it doesn't have any. 
+                       if (!$msg->containsErrors()){
+                               $msg->addError('MANIFEST_NOT_WELLFORM: MISSING REFERENCES');
+                       }
+                       return false;
+               }
+       }
+       return true;
+}
+
+/*
+ * @example rscandir(dirname(__FILE__).'/'));
+ * @param string $base
+ * @param array $omit
+ * @param array $data
+ * @return array
+ */
+function rscandir($base='', &$data=array()) {
+  $array = array_diff(scandir($base), array('.', '..')); # remove ' and .. from the array */
+  
+  foreach($array as $value) : /* loop through the array at the level of the supplied $base */
+    if (is_dir($base.$value)) : /* if this is a directory */
+//       don't save the directory name
+//       $data[] = $base.$value.'/'; /* add it to the $data array */
+      $data = rscandir($base.$value.'/', $data); /* then make a recursive call with the
+      current $value as the $base supplying the $data array to carry into the recursion */
+     
+    elseif (is_file($base.$value)) : /* else if the current $value is a file */
+      $data[] = $base.$value; /* just add the current $value to the $data array */
+     
+    endif;
+   
+  endforeach;
+  return $data; // return the $data array
+}
+
+/**
+ * Function to restructure the $items.  So that old import will merge the top page into its children, and
+ * create a new folder on top of it
+ */
+function rehash($items){
+       global $order;
+       $parent_page_maps = array();    //old=>new
+       $temp_popped_items = array();
+       $rehashed_items = array();      //the reconstructed array
+       foreach($items as $id => $content){
+               $parent_obj = $items[$content['parent_content_id']];
+               $rehashed_items[$id] = $content;        //copy
+
+               //first check if there exists a mapping for this item, if so, simply replace is and next.
+               if (isset($parent_page_maps[$content['parent_content_id']])){
+                       $rehashed_items [$id]['parent_content_id'] = $parent_page_maps[$content['parent_content_id']];
+                       $rehashed_items [$id]['ordering']++;
+               } 
+               //If its parent page is a top page and have an identiferref
+               else if (isset($parent_obj) && isset($parent_obj['href'])){                     
+                       if (!isset($parent_obj['href'])){
+                               //check if this top page is already a folder, if so, next.
+                               continue;
+                       }
+                       //else, make its parent page to a folder
+                       $new_item['title'] = $parent_obj['title'];
+                       $new_item['parent_content_id'] = $parent_obj['parent_content_id'];
+                       $new_item['ordering'] = $parent_obj['ordering'];
+
+               //assign this new parent folder to the pending items array
+                       $new_item_name = $content['parent_content_id'].'_FOLDER';
+                       //a not so brilliant way to append the folder in its appropriate position
+                       $reordered_hashed_items = array();  //use to store the new rehashed item with the correct item order
+                       foreach($rehashed_items as $rh_id=>$rh_content){
+                           if ($rh_id == $content['parent_content_id']){
+                               //add the folder in before the parent subpage.
+                               $reordered_hashed_items[$new_item_name] = $new_item;
+                           }
+                           $reordered_hashed_items[$rh_id] = $rh_content;  //clone
+                       }
+                       $rehashed_items = $reordered_hashed_items;  //replace it back
+                       unset($reordered_hashed_items);
+                       $parent_page_maps[$content['parent_content_id']] = $new_item_name;  //save this page on the hash map
+
+                       //reconstruct the parent
+                       $rehashed_items[$content['parent_content_id']]['parent_content_id'] = $parent_page_maps[$content['parent_content_id']];
+                       $rehashed_items[$content['parent_content_id']]['ordering'] = 0; //always the first one.
+
+                       //reconstruct itself
+                       $rehashed_items[$id]['parent_content_id'] = $parent_page_maps[$content['parent_content_id']];
+                       $rehashed_items[$id]['ordering']++;
+
+               }
+       }
+
+       return $rehashed_items;
+}
+
+
+/** 
+ * This function will take the test accessment XML and add these to the database.
+ * @param      string  The path of the XML, without the import_path.
+ * @param      mixed   An item singleton.  Contains the info of this item, namely, the accessment details.
+ *                                     The item must be an object created by the ims class.
+ * @param      string  the import path
+ * @return     mixed   An Array that contains all the question IDs that have been imported.
+ */
+ function addQuestions($xml, $item, $import_path){
+       $qti_import = new QTIImport($import_path);
+
+       $tests_xml = $import_path.$xml;
+       
+       //Mimic the array for now.
+       $test_attributes['resource']['href'] = $item['href'];
+       $test_attributes['resource']['type'] = preg_match('/imsqti_xmlv1p2/', $item['type'])==1?'imsqti_xmlv1p2':'imsqti_xmlv1p1';
+       $test_attributes['resource']['file'] = $item['file'];
+
+       //Get the XML file out and start importing them into our database.
+       //TODO: See question_import.php 287-289.
+       $qids = $qti_import->importQuestions($test_attributes);
+
+       return $qids;
+ }
+
+
+
+       /* called at the start of en element */
+       /* builds the $path array which is the path from the root to the current element */
+       function startElement($parser, $name, $attrs) {
+               global $items, $path, $package_base_path, $import_path;
+               global $element_path;
+               global $xml_base_path, $test_message, $content_type;
+               global $current_identifier, $msg;
+
+               if ($element_path === array('manifest', 'metadata', 'imsmd:lom', 'imsmd:general', 'imsmd:title') && $name == 'imsmd:langstring') {
+                       global $package_primay_lang;
+                       $package_primay_lang = trim($attrs['xml:lang']);
+               }
+               
+               if ($name == 'manifest' && isset($attrs['xml:base']) && $attrs['xml:base']) {
+                       $xml_base_path = $attrs['xml:base'];
+               } else if ($name == 'file') {
+                       // check if it misses file references
+                       if(!isset($attrs['href']) || $attrs['href']==''){
+                               $msg->addError('MANIFEST_NOT_WELLFORM');
+                       }
+
+                       // special case for webCT content packages that don't specify the `href` attribute 
+                       // with the `<resource>` element.
+                       // we take the `href` from the first `<file>` element.
+                       if (isset($items[$current_identifier]) && ($items[$current_identifier]['href'] == '')) {
+                               $attrs['href'] = urldecode($attrs['href']);
+                               $items[$current_identifier]['href'] = $attrs['href'];
+                       }
+
+                       $temp_path = pathinfo($attrs['href']);
+                       $temp_path = explode('/', $temp_path['dirname']);
+
+                       //for IMSCC, assume that all resources lies in the same folder, except styles.css
+                       if ($items[$current_identifier]['type']=='webcontent'){
+                               if ($package_base_path=="") {
+                                       $package_base_path = $temp_path;
+                               } 
+                               elseif (is_array($package_base_path) && $content_type != 'IMS Common Cartridge') {
+                                       //if this is a content package, we want only intersection
+                                       $package_base_path = array_intersect($package_base_path, $temp_path);
+                                       $temp_path = $package_base_path;
+                               }
+                               //added these 2 lines in so that pictures would load.  making the elseif above redundant.
+                               //if there is a bug for pictures not load, then it's the next 2 lines.
+                               $package_base_path = array_intersect($package_base_path, $temp_path);
+                               $temp_path = $package_base_path;
+                       }
+                       $items[$current_identifier]['new_path'] = implode('/', $temp_path);     
+                       if (    isset($_POST['allow_test_import']) && isset($items[$current_identifier]) 
+                                               && preg_match('/((.*)\/)*tests\_[0-9]+\.xml$/', $attrs['href'])) {
+                               $items[$current_identifier]['tests'][] = $attrs['href'];
+                       } 
+                       if (    isset($_POST['allow_a4a_import']) && isset($items[$current_identifier])) {
+                               $items[$current_identifier]['a4a_import_enabled'] = true;
+                       }
+               } else if (($name == 'item') && ($attrs['identifierref'] != '')) {
+                       $path[] = $attrs['identifierref'];
+               } else if (($name == 'item') && ($attrs['identifier'])) {
+                       $path[] = $attrs['identifier'];
+//             } else if (($name == 'resource') && is_array($items[$attrs['identifier']]))  {
+               } else if (($name == 'resource')) {
+                       $current_identifier = $attrs['identifier'];
+                       $items[$current_identifier]['type'] = $attrs['type'];
+                       if ($attrs['href']) {
+                               $attrs['href'] = urldecode($attrs['href']);
+
+                               $items[$attrs['identifier']]['href'] = $attrs['href'];
+
+                               // href points to a remote url
+                               if (preg_match('/^http.*:\/\//', trim($attrs['href'])))
+                                       $items[$attrs['identifier']]['new_path'] = '';
+                               else // href points to local file
+                               {
+                                       $temp_path = pathinfo($attrs['href']);
+                                       $temp_path = explode('/', $temp_path['dirname']);
+                                       if (empty($package_base_path)) {
+                                               $package_base_path = $temp_path;
+                                       } 
+                                       $items[$attrs['identifier']]['new_path'] = implode('/', $temp_path);
+                               }
+                       }
+               } else if ($name=='dependency' && $attrs['identifierref']!='') {
+                       //if there is a dependency, attach it to the item array['file']
+                       $items[$current_identifier]['dependency'][] = $attrs['identifierref'];
+               }
+               if (($name == 'item') && ($attrs['parameters'] != '')) {
+                       $items[$attrs['identifierref']]['test_message'] = $attrs['parameters'];
+               }
+               if ($name=='file'){
+                       if(!isset($items[$current_identifier]) && $attrs['href']!=''){
+                               $items[$current_identifier]['href']      = $attrs['href'];
+                       }
+                       if (file_exists($import_path.$attrs['href'])){
+                               $items[$current_identifier]['file'][] = $attrs['href'];
+                       } else {
+                               $msg->addError('IMS_FILES_MISSING');
+                       }
+               }               
+               if ($name=='cc:authorizations'){
+                       //don't have authorization setup.
+                       $msg->addError('IMS_AUTHORIZATION_NOT_SUPPORT');
+               }
+       array_push($element_path, $name);
+}
+
+       /* called when an element ends */
+       /* removed the current element from the $path */
+       function endElement($parser, $name) {
+               global $path, $element_path, $my_data, $items;
+               global $current_identifier, $skip_ims_validation;
+               global $msg, $content_type;             
+               static $resource_num = 0;
+               
+               if ($name == 'item') {
+                       array_pop($path);
+               } 
+
+               //check if this is a test import
+               if ($name == 'schema'){
+                       if (trim($my_data)=='IMS Question and Test Interoperability'){                  
+                               $msg->addError('IMPORT_FAILED');debug('1');exit;
+                       } 
+                       $content_type = trim($my_data);
+               }
+
+               //Handles A4a
+               if ($current_identifier != ''){
+                       $my_data = trim($my_data);
+                       $last_file_name = $items[$current_identifier]['file'][(sizeof($items[$current_identifier]['file']))-1];
+
+                       if ($name=='originalAccessMode'){                               
+                               if (in_array('accessModeStatement', $element_path)){
+                                       $items[$current_identifier]['a4a'][$last_file_name][$resource_num]['access_stmt_originalAccessMode'][] = $my_data;
+                               } elseif (in_array('adaptationStatement', $element_path)){
+                                       $items[$current_identifier]['a4a'][$last_file_name][$resource_num]['adapt_stmt_originalAccessMode'][] = $my_data;
+                               }                       
+                       } elseif (($name=='language') && in_array('accessModeStatement', $element_path)){
+                               $items[$current_identifier]['a4a'][$last_file_name][$resource_num]['language'][] = $my_data;
+                       } elseif ($name=='hasAdaptation') {
+                               $items[$current_identifier]['a4a'][$last_file_name][$resource_num]['hasAdaptation'][] = $my_data;
+                       } elseif ($name=='isAdaptationOf'){
+                               $items[$current_identifier]['a4a'][$last_file_name][$resource_num]['isAdaptationOf'][] = $my_data;
+                       } elseif ($name=='accessForAllResource'){
+                               /* the head node of accessForAll Metadata, if this exists in the manifest. Skip XSD validation,
+                                * because A4a doesn't have a xsd yet.  Our access for all is based on ISO which will not pass 
+                                * the current IMS validation.  
+                                * Also, since ATutor is the only one (as of Oct 21, 2009) that exports IMS with access for all
+                                * content, we can almost assume that any ims access for all content is by us, and is valid. 
+                                */
+                               $skip_ims_validation = true;
+                               $resource_num++;
+                       } elseif($name=='file'){
+                               $resource_num = 0;      //reset resournce number to 0 when the file tags ends
+                       }
+               }
+
+               if ($element_path === array('manifest', 'metadata', 'imsmd:lom', 'imsmd:general', 'imsmd:title', 'imsmd:langstring')) {
+                       global $package_base_name;
+                       $package_base_name = trim($my_data);
+               }
+
+               if ($element_path === array('manifest', 'metadata', 'imsmd:lom', 'imsmd:general', 'imsmd:description', 'imsmd:langstring')) {
+                       global $package_base_description;
+                       $package_base_description = trim($my_data);
+               }
+
+               array_pop($element_path);
+               $my_data = '';
+       }
+
+       /* called when there is character data within elements */
+       /* constructs the $items array using the last entry in $path as the parent element */
+       function characterData($parser, $data){
+               global $path, $items, $order, $my_data, $element_path;
+               global $current_identifier;
+
+               $str_trimmed_data = trim($data);
+                               
+               if (!empty($str_trimmed_data)) {
+                       $size = count($path);
+                       if ($size > 0) {
+                               $current_item_id = $path[$size-1];
+                               if ($size > 1) {
+                                       $parent_item_id = $path[$size-2];
+                               } else {
+                                       $parent_item_id = 0;
+                               }
+
+                               if (isset($items[$current_item_id]['parent_content_id']) && is_array($items[$current_item_id])) {
+
+                                       /* this item already exists, append the title           */
+                                       /* this fixes {\n, \t, `, &} characters in elements */
+
+                                       /* horible kludge to fix the <ns2:objectiveDesc xmlns:ns2="http://www.utoronto.ca/atrc/tile/xsd/tile_objective"> */
+                                       /* from TILE */
+                                       if (in_array('accessForAllResource', $element_path)){
+                                               //skip this tag
+                                       } elseif ($element_path[count($element_path)-1] != 'ns1:objectiveDesc') {
+                                               $items[$current_item_id]['title'] .= $data;
+                                       }
+       
+                               } else {
+                                       $order[$parent_item_id]++;
+                                       $item_tmpl = array(     'title'                 => $data,
+                                                                               'parent_content_id' => $parent_item_id,
+                                                                               'ordering'                      => $order[$parent_item_id]-1);
+                                       //append other array values if it exists
+                                       if (is_array($items[$current_item_id])){
+                                               $items[$current_item_id] = array_merge($items[$current_item_id], $item_tmpl);
+                                       } else {
+                                               $items[$current_item_id] = $item_tmpl;
+                                       }
+                               }
+                       }
+               }
+
+               $my_data .= $data;
+       }
+
+       /* glossary parser: */
+       function glossaryStartElement($parser, $name, $attrs) {
+               global $element_path;
+
+               array_push($element_path, $name);
+       }
+
+       /* called when an element ends */
+       /* removed the current element from the $path */
+       function glossaryEndElement($parser, $name) {
+               global $element_path, $my_data, $imported_glossary;
+               static $current_term;
+
+               if ($element_path === array('glossary', 'item', 'term')) {
+                       $current_term = $my_data;
+
+               } else if ($element_path === array('glossary', 'item', 'definition')) {
+                       $imported_glossary[trim($current_term)] = trim($my_data);
+               }
+
+               array_pop($element_path);
+               $my_data = '';
+       }
+
+       function glossaryCharacterData($parser, $data){
+               global $my_data;
+
+               $my_data .= $data;
+       }
+
+if (!isset($_POST['submit']) && !isset($_POST['cancel'])) {
+       /* just a catch all */
+       
+       $errors = array('FILE_MAX_SIZE', ini_get('post_max_size'));
+       $msg->addError($errors);
+
+       header('Location: ../index.php');
+       exit;
+} else if (isset($_POST['cancel'])) {
+       $msg->addFeedback('IMPORT_CANCELLED');
+
+       header('Location: ../index.php');
+       exit;
+}
+
+if (isset($_POST['url']) && ($_POST['url'] != 'http://') ) {
+       if ($content = @file_get_contents($_POST['url'])) {
+
+               // save file to /content/
+               $filename = substr(time(), -6). '.zip';
+               $full_filename = TR_TEMP_DIR . $filename;
+
+               if (!$fp = fopen($full_filename, 'w+b')) {
+                       echo "Cannot open file ($filename)";
+                       exit;
+               }
+
+               if (fwrite($fp, $content, strlen($content) ) === FALSE) {
+                       echo "Cannot write to file ($filename)";
+                       exit;
+               }
+               fclose($fp);
+       }       
+       $_FILES['file']['name']     = $filename;
+       $_FILES['file']['tmp_name'] = $full_filename;
+       $_FILES['file']['size']     = strlen($content);
+       unset($content);
+       $url_parts = pathinfo($_POST['url']);
+       $package_base_name_url = $url_parts['basename'];
+}
+$ext = pathinfo($_FILES['file']['name']);
+$ext = $ext['extension'];
+
+if ($ext != 'zip') {
+       $msg->addError('IMPORTDIR_IMS_NOTVALID');
+} else if ($_FILES['file']['error'] == 1) {
+       $errors = array('FILE_MAX_SIZE', ini_get('upload_max_filesize'));
+       $msg->addError($errors);
+} else if ( !$_FILES['file']['name'] || (!is_uploaded_file($_FILES['file']['tmp_name']) && !$_POST['url'])) {
+       $msg->addError('FILE_NOT_SELECTED');
+} else if ($_FILES['file']['size'] == 0) {
+       $msg->addError('IMPORTFILE_EMPTY');
+} 
+
+if ($msg->containsErrors()) {
+       if (isset($_GET['tile'])) {
+               header('Location: '.$_base_path.'tools/tile/index.php');
+       } else {
+               header('Location: ../index.php');
+       }
+       exit;
+}
+
+/* check if ../content/import/ exists */
+$import_path = TR_TEMP_DIR . 'import/';
+$content_path = TR_TEMP_DIR;
+
+if (!is_dir($import_path)) {
+       if (!@mkdir($import_path, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+}
+
+$import_path .= Utility::getRandomStr(16).'/';
+if (is_dir($import_path)) {
+       clr_dir($import_path);
+}
+
+if (!@mkdir($import_path, 0700)) {
+       $msg->addError('IMPORTDIR_FAILED');
+}
+
+if ($msg->containsErrors()) {
+       if (isset($_GET['tile'])) {
+               header('Location: '.$_base_path.'tools/tile/index.php');
+       } else {
+               header('Location: ../index.php');
+       }
+       exit;
+}
+
+/* extract the entire archive into TR_COURSE_CONTENT . import/$course using the call back function to filter out php files */
+error_reporting(0);
+$archive = new PclZip($_FILES['file']['tmp_name']);
+if ($archive->extract( PCLZIP_OPT_PATH,        $import_path,
+                                               PCLZIP_CB_PRE_EXTRACT,  'preImportCallBack') == 0) {
+       $msg->addError('IMPORT_FAILED');debug('2');exit;
+       echo 'Error : '.$archive->errorInfo(true);
+       clr_dir($import_path);
+       header('Location: ../index.php');
+       exit;
+}
+error_reporting(TR_ERROR_REPORTING);
+
+/* get the course's max_quota */
+//$sql = "SELECT max_quota FROM ".TABLE_PREFIX."courses WHERE course_id=$course_id";
+//$result = mysql_query($sql, $db);
+//$q_row       = mysql_fetch_assoc($result);
+//
+//if ($q_row['max_quota'] != TR_COURSESIZE_UNLIMITED) {
+//
+//     if ($q_row['max_quota'] == TR_COURSESIZE_DEFAULT) {
+//             $q_row['max_quota'] = $MaxCourseSize;
+//     }
+//     $totalBytes   = dirsize($import_path);
+//     $course_total = dirsize($import_path);
+//     $total_after  = $q_row['max_quota'] - $course_total - $totalBytes + $MaxCourseFloat;
+//
+//     if ($total_after < 0) {
+//             /* remove the content dir, since there's no space for it */
+//             $errors = array('NO_CONTENT_SPACE', number_format(-1*($total_after/TR_KBYTE_SIZE), 2 ) );
+//             $msg->addError($errors);
+//             
+//             clr_dir($import_path);
+//
+//             if (isset($_GET['tile'])) {
+//                     header('Location: '.$_base_path.'tools/tile/index.php');
+//             } else {
+//                     header('Location: index.php');
+//             }
+//             exit;
+//     }
+//}
+
+
+$items = array(); /* all the content pages */
+$order = array(); /* keeps track of the ordering for each content page */
+$path  = array();  /* the hierarchy path taken in the menu to get to the current item in the manifest */
+$dependency_files = array(); /* the file path for the dependency files */
+
+/*
+$items[content_id/resource_id] = array(
+                                                                       'title'
+                                                                       'real_content_id' // calculated after being inserted
+                                                                       'parent_content_id'
+                                                                       'href'
+                                                                       'ordering'
+                                                                       );
+*/
+
+$ims_manifest_xml = @file_get_contents($import_path.'imsmanifest.xml');
+
+if ($ims_manifest_xml === false) {
+       $msg->addError('NO_IMSMANIFEST');
+
+       if (file_exists($import_path . 'atutor_backup_version')) {
+               $msg->addError('NO_IMS_BACKUP');
+       }
+
+       clr_dir($import_path);
+
+       if (isset($_GET['tile'])) {
+               header('Location: '.$_base_path.'tools/tile/index.php');
+       } else {
+               header('Location: ../index.php');
+       }
+       exit;
+}
+
+$xml_parser = xml_parser_create();
+
+xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); /* conform to W3C specs */
+xml_set_element_handler($xml_parser, 'startElement', 'endElement');
+xml_set_character_data_handler($xml_parser, 'characterData');
+
+if (!xml_parse($xml_parser, $ims_manifest_xml, true)) {
+       die(sprintf("XML error: %s at line %d",
+                               xml_error_string(xml_get_error_code($xml_parser)),
+                               xml_get_current_line_number($xml_parser)));
+}
+
+xml_parser_free($xml_parser);
+// skip glossary
+/* check if the glossary terms exist */
+//$glossary_path = '';
+//if ($content_type == 'IMS Common Cartridge'){
+//     $glossary_path = 'GlossaryItem/';
+//}
+//if (file_exists($import_path . $glossary_path . 'glossary.xml')){
+//     $glossary_xml = @file_get_contents($import_path.$glossary_path.'glossary.xml');
+//     $element_path = array();
+//
+//     $xml_parser = xml_parser_create();
+//
+//     /* insert the glossary terms into the database (if they're not in there already) */
+//     /* parse the glossary.xml file and insert the terms */
+//     xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); /* conform to W3C specs */
+//     xml_set_element_handler($xml_parser, 'glossaryStartElement', 'glossaryEndElement');
+//     xml_set_character_data_handler($xml_parser, 'glossaryCharacterData');
+//
+//     if (!xml_parse($xml_parser, $glossary_xml, true)) {
+//             die(sprintf("XML error: %s at line %d",
+//                                     xml_error_string(xml_get_error_code($xml_parser)),
+//                                     xml_get_current_line_number($xml_parser)));
+//     }
+//     xml_parser_free($xml_parser);
+//     $contains_glossary_terms = true;
+//     foreach ($imported_glossary as $term => $defn) {
+//             if (!$glossary[urlencode($term)]) {
+//                     $sql = "INSERT INTO ".TABLE_PREFIX."glossary VALUES (NULL, $_SESSION[course_id], '$term', '$defn', 0)";
+//                     mysql_query($sql, $db); 
+//             }
+//     }
+//}
+
+// Check if all the files exists in the manifest, iff it's a IMS CC package.
+if ($content_type == 'IMS Common Cartridge') {
+       checkResources($import_path);
+}
+
+// Check if there are any errors during parsing.
+if ($msg->containsErrors()) {
+       if (isset($_GET['tile'])) {
+               header('Location: '.$_base_path.'tools/tile/index.php');
+       } else {
+               header('Location: ../index.php');
+       }
+       exit;
+}
+
+/* initialize DAO objects */
+$coursesDAO = new CoursesDAO();
+$contentDAO = new ContentDAO();
+
+/* generate a unique new package base path based on the package file name and date as needed. */
+/* the package name will be the dir where the content for this package will be put, as a result */
+/* the 'content_path' field in the content table will be set to this path. */
+/* $package_base_name_url comes from the URL file name (NOT the file name of the actual file we open)*/
+if (!$package_base_name && $package_base_name_url) {
+       $package_base_name = substr($package_base_name_url, 0, -4);
+} else if (!$package_base_name) {
+       $package_base_name = substr($_FILES['file']['name'], 0, -4);
+}
+
+// create course
+if (isset($_POST['hide_course']))
+       $access = 'private';
+else
+       $access = 'public';
+
+$course_id = $coursesDAO->Create($_SESSION['user_id'], 'top', $access, $package_base_name, $package_base_description, 
+             '', '', '', '', $package_primay_lang, '', '');
+
+$package_base_name = strtolower($package_base_name);
+$package_base_name = str_replace(array('\'', '"', ' ', '|', '\\', '/', '<', '>', ':'), '_' , $package_base_name);
+$package_base_name = preg_replace("/[^A-Za-z0-9._\-]/", '', $package_base_name);
+
+if (is_dir(TR_TEMP_DIR . $course_id.'/'.$package_base_name)) {
+       $package_base_name .= '_'.date('ymdHis');
+}
+
+if ($package_base_path) {
+       $package_base_path = implode('/', $package_base_path);
+} elseif (empty($package_base_path)){
+       $package_base_path = '';
+}
+
+if ($xml_base_path) {
+       $package_base_path = $xml_base_path . $package_base_path;
+
+       mkdir(TR_TEMP_DIR .$course_id.'/'.$xml_base_path);
+       $package_base_name = $xml_base_path . $package_base_name;
+}
+
+/* get the top level content ordering offset */
+//$sql = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content WHERE course_id=$_SESSION[course_id] AND content_parent_id=$cid";
+//$result = mysql_query($sql, $db);
+//$row = mysql_fetch_assoc($result);
+$order_offset = $contentDAO->getMaxOrdering($course_id, 0); /* it's nice to have a real number to deal with */
+$lti_offset = array(); //since we don't need lti tools, the ordering needs to be subtracted
+//reorder the items stack
+$items = rehash($items);
+
+foreach ($items as $item_id => $content_info) 
+{      
+       //formatting field, default 1
+       $content_formatting = 1;        //CONTENT_TYPE_CONTENT
+
+       //if this is any of the LTI tools, skip it. (ie. Discussion Tools, Weblinks, etc)
+       //take this condition out once the LTI tool kit is implemented.
+       if ($content_info['type']=='imsdt_xmlv1p0'){
+               $lti_offset[$content_info['parent_content_id']]++;
+               continue;
+       }
+
+       //don't want to display glossary as a page
+       if ($content_info['href']== $glossary_path . 'glossary.xml'){
+               continue;
+       }
+
+       //handle the special case of cc import, where there is no content association. The resource should
+       //still be imported.
+       if(!isset($content_info['parent_content_id'])){
+               //if this is a question bank 
+               if ($content_info['type']=="imsqti_xmlv1p2/imscc_xmlv1p0/question-bank"){
+                       addQuestions($content_info['href'], $content_info, $import_path);
+               }
+       }
+
+       //if it has no title, most likely it is not a page but just a normal item, skip it
+       if (!isset($content_info['title'])){
+               continue;
+       }
+       
+       //check dependency immediately, then handles it
+       $head = '';
+       if (is_array($content_info['dependency']) && !empty($content_info['dependency'])){
+               foreach($content_info['dependency'] as $dependency_ref){
+                       //handle styles 
+                       if (preg_match('/(.*)\.css$/', $items[$dependency_ref]['href'])){
+                               //calculate where this is based on our current base_href. 
+                               //assuming the dependency folders are siblings of the item
+                               $head = '<link rel="stylesheet" type="text/css" href="../'.$items[$dependency_ref]['href'].'" />';
+                       }
+               }
+       }
+       
+       // remote href
+       if (preg_match('/^http.*:\/\//', trim($content_info['href'])) )
+       {
+               $content = '<a href="'.$content_info['href'].'" target="_blank">'.$content_info['title'].'</a>';
+       }
+       else
+       {
+               if (isset($content_info['href'], $xml_base_path)) {
+                       $content_info['href'] = $xml_base_path . $content_info['href'];
+               }
+               if (!isset($content_info['href'])) {
+                       // this item doesn't have an identifierref. so create an empty page.
+                       // what we called a folder according to v1.2 Content Packaging spec
+                       // Hop over
+                       $content = '';
+                       $ext = '';
+                       $last_modified = date('Y-m-d H:i:s');
+               } else {
+                       $file_info = @stat($import_path.$content_info['href']);
+                       if ($file_info === false) {
+                               continue;
+                       }
+               
+                       $path_parts = pathinfo($import_path.$content_info['href']);
+                       $ext = strtolower($path_parts['extension']);
+
+                       $last_modified = date('Y-m-d H:i:s', $file_info['mtime']);
+               }
+               if (in_array($ext, array('gif', 'jpg', 'bmp', 'png', 'jpeg'))) {
+                       /* this is an image */
+                       $content = '<img src="'.$content_info['href'].'" alt="'.$content_info['title'].'" />';
+               } else if ($ext == 'swf') {
+                       /* this is flash */
+            /* Using default size of 550 x 400 */
+
+                       $content = '<object type="application/x-shockwave-flash" data="' . $content_info['href'] . '" width="550" height="400"><param name="movie" value="'. $content_info['href'] .'" /></object>';
+
+               } else if ($ext == 'mov') {
+                       /* this is a quicktime movie  */
+            /* Using default size of 550 x 400 */
+
+                       $content = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="550" height="400" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" value="'. $content_info['href'] . '" /><param name="autoplay" value="true" /><param name="controller" value="true" /><embed src="' . $content_info['href'] .'" width="550" height="400" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';
+
+               /* Oct 19, 2009
+                * commenting this whole chunk out.  It's part of my test import codes, not sure why it's here, 
+                * and I don't think it should be here.  Remove this whole comment after further testing and confirmation.
+                * @harris
+                *
+                       //Mimic the array for now.
+                       $test_attributes['resource']['href'] = $test_xml_file;
+                       $test_attributes['resource']['type'] = isset($items[$item_id]['type'])?'imsqti_xmlv1p2':'imsqti_xmlv1p1';
+                       $test_attributes['resource']['file'] = $items[$item_id]['file'];
+//                     $test_attributes['resource']['file'] = array($test_xml_file);
+
+                       //Get the XML file out and start importing them into our database.
+                       //TODO: See question_import.php 287-289.
+                       $qids = $qti_import->importQuestions($test_attributes);
+               
+                */
+               } else if ($ext == 'mp3') {
+                       $content = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="200" height="15" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" value="'. $content_info['href'] . '" /><param name="autoplay" value="false" /><embed src="' . $content_info['href'] .'" width="200" height="15" autoplay="false" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';
+               } else if (in_array($ext, array('wav', 'au'))) {
+                       $content = '<embed SRC="'.$content_info['href'].'" autostart="false" width="145" height="60"><noembed><bgsound src="'.$content_info['href'].'"></noembed></embed>';
+
+               } else if (in_array($ext, array('txt', 'css', 'html', 'htm', 'csv', 'asc', 'tsv', 'xml', 'xsl'))) {
+                       /* this is a plain text file */
+                       $content = file_get_contents($import_path.$content_info['href']);
+                       if ($content === false) {
+                               /* if we can't stat() it then we're unlikely to be able to read it */
+                               /* so we'll never get here. */
+                               continue;
+                       }
+
+                       // get the contents of the 'head' element
+                       $head .= ContentUtility::getHtmlHeadByTag($content, $html_head_tags);
+                       
+                       // Specifically handle eXe package
+                       // NOTE: THIS NEEDS WORK! TO FIND A WAY APPLY EXE .CSS FILES ONLY ON COURSE CONTENT PART.
+                       // NOW USE OUR OWN .CSS CREATED SOLELY FOR EXE
+                       $isExeContent = false;
+
+                       // check xml file in eXe package
+                       if (preg_match("/<organization[ ]*identifier=\"eXe*>*/", $ims_manifest_xml))
+                       {
+                               $isExeContent = true;
+                       }
+
+                       // use ATutor's eXe style sheet as the ones from eXe conflicts with ATutor's style sheets
+                       if ($isExeContent)
+                       {
+                               $head = preg_replace ('/(<style.*>)(.*)(<\/style>)/ms', '\\1@import url(/docs/exestyles.css);\\3', $head);
+                       }
+
+                       // end of specifically handle eXe package
+
+                       $content = ContentUtility::getHtmlBody($content);
+                       if ($contains_glossary_terms) 
+                       {
+                               // replace glossary content package links to real glossary mark-up using [?] [/?]
+                               // refer to bug 3641, edited by Harris
+                               $content = preg_replace('/<a href="([.\w\d\s]+[^"]+)" target="body" class="at-term">([.\w\d\s&;"]+|.*)<\/a>/i', '[?]\\2[/?]', $content);
+                       }
+
+                       /* potential security risk? */
+                       if ( strpos($content_info['href'], '..') === false && !preg_match('/((.*)\/)*tests\_[0-9]+\.xml$/', $content_info['href'])) {
+//                             @unlink($import_path.$content_info['href']);
+                       }
+               } else if ($ext) {
+                       /* non text file, and can't embed (example: PDF files) */
+                       $content = '<a href="'.$content_info['href'].'">'.$content_info['title'].'</a>';
+               }       
+       }
+       $content_parent_id = $cid;
+       if ($content_info['parent_content_id'] !== 0) {
+               $content_parent_id = $items[$content_info['parent_content_id']]['real_content_id'];
+               //if it's not there, use $cid
+               if (!$content_parent_id){
+                       $content_parent_id = $cid;
+               }
+       }
+
+       $my_offset = 0;
+       if ($content_parent_id == $cid) {
+               $my_offset = $order_offset;
+       }
+
+       /* replace the old path greatest common denomiator with the new package path. */
+       /* we don't use str_replace, b/c there's no knowing what the paths may be         */
+       /* we only want to replace the first part of the path.  
+       */
+       if ($package_base_path != '') {
+               $content_info['new_path'] = $package_base_name . substr($content_info['new_path'], strlen($package_base_path));
+       } else {
+               $content_info['new_path'] = $package_base_name . '/' . $content_info['new_path'];
+       }
+
+       //handles weblinks
+       if ($content_info['type']=='imswl_xmlv1p0'){
+               $weblinks_parser = new WeblinksParser();
+               $xml_content = @file_get_contents($import_path . $content_info['href']);
+               $weblinks_parser->parse($xml_content);
+               $content_info['title'] = $weblinks_parser->getTitle();
+               $content = $weblinks_parser->getUrl();
+               $content_folder_type = CONTENT_TYPE_WEBLINK;
+               $content_formatting = 2;
+       }
+       $head = addslashes($head);
+       $content_info['title'] = addslashes($content_info['title']);
+       $content_info['test_message'] = addslashes($content_info['test_message']);
+
+       //if this file is a test_xml, create a blank page instead, for imscc.
+       if (preg_match('/((.*)\/)*tests\_[0-9]+\.xml$/', $content_info['href']) 
+               || preg_match('/imsqti\_(.*)/', $content_info['type'])) {
+               $content = '';
+       } else {
+               $content = addslashes($content);
+       }
+
+       //check for content_type
+       if ($content_formatting!=CONTENT_TYPE_WEBLINK){
+               $content_folder_type = ($content==''?CONTENT_TYPE_FOLDER:CONTENT_TYPE_CONTENT);
+       }
+
+       $items[$item_id]['real_content_id'] = $contentDAO->Create($course_id, intval($content_parent_id), 
+                           ($content_info['ordering'] + $my_offset - $lti_offset[$content_info['parent_content_id']] + 1),
+                           $last_modified, 0, $content_formatting, "", $content_info['new_path'], $content_info['title'],
+                           $content, $head, 1, $content_info['test_message'], 0, $content_folder_type);
+//     $sql= 'INSERT INTO '.TABLE_PREFIX.'content'
+//           . '(course_id, 
+//               content_parent_id, 
+//               ordering,
+//               last_modified, 
+//               revision, 
+//               formatting, 
+//               head,
+//               use_customized_head,
+//               keywords, 
+//               content_path, 
+//               title, 
+//               text,
+//                       test_message,
+//                       content_type) 
+//            VALUES 
+//                          ('.$_SESSION['course_id'].','                                                                                                                      
+//                          .intval($content_parent_id).','            
+//                          .($content_info['ordering'] + $my_offset - $lti_offset[$content_info['parent_content_id']] + 1).','
+//                          .'"'.$last_modified.'",                                                                                                    
+//                           0,'
+//                          .$content_formatting.' ,"'
+//                          . $head .'",
+//                          1,
+//                           "",'
+//                          .'"'.$content_info['new_path'].'",'
+//                          .'"'.$content_info['title'].'",'
+//                          .'"'.$content.'",'
+//                              .'"'.$content_info['test_message'].'",'
+//                              .$content_folder_type.')';
+//
+//     $result = mysql_query($sql, $db) or die(mysql_error());
+
+       /* get the content id and update $items */
+//     $items[$item_id]['real_content_id'] = mysql_insert_id($db);
+
+       /* get the tests associated with this content */
+       if (!empty($items[$item_id]['tests']) || strpos($items[$item_id]['type'], 'imsqti_xmlv1p2/imscc_xmlv1p0') !== false){
+               $qti_import = new QTIImport($import_path);
+
+               if (isset($items[$item_id]['tests'])){
+                       $loop_var = $items[$item_id]['tests'];
+               } else {
+                       $loop_var = $items[$item_id]['file'];
+               }
+
+               foreach ($loop_var as $array_id => $test_xml_file){
+                       //call subrountine to add the questions.
+                       $qids = addQuestions($test_xml_file, $items[$item_id], $import_path);
+                       
+                       //import test
+                       $tid = $qti_import->importTest($content_info['title']);
+
+                       //associate question and tests
+                       foreach ($qids as $order=>$qid){
+                               if (isset($qti_import->weights[$order])){
+                                       $weight = round($qti_import->weights[$order]);
+                               } else {
+                                       $weight = 0;
+                               }
+                               $new_order = $order + 1;
+                               $sql = "INSERT INTO " . TABLE_PREFIX . "tests_questions_assoc" . 
+                                               "(test_id, question_id, weight, ordering, required) " .
+                                               "VALUES ($tid, $qid, $weight, $new_order, 0)";
+                               $result = mysql_query($sql, $db);
+                       }
+
+                       //associate content and test
+                       $sql =  'INSERT INTO ' . TABLE_PREFIX . 'content_tests_assoc' . 
+                                       '(content_id, test_id) ' .
+                                       'VALUES (' . $items[$item_id]['real_content_id'] . ", $tid)";
+                       $result = mysql_query($sql, $db);
+               
+//                     if (!$msg->containsErrors()) {
+//                             $msg->addFeedback('IMPORT_SUCCEEDED');
+//                     }
+               }
+       }
+
+       /* get the a4a related xml */
+       if (isset($items[$item_id]['a4a_import_enabled']) && isset($items[$item_id]['a4a']) && !empty($items[$item_id]['a4a'])) {
+               $a4a_import = new A4aImport($items[$item_id]['real_content_id']);
+               $a4a_import->setRelativePath($items[$item_id]['new_path']);
+               $a4a_import->importA4a($items[$item_id]['a4a']);
+       }
+}
+
+if ($package_base_path == '.') {
+       $package_base_path = '';
+}
+
+// loop through the files outside the package folder, and copy them to its relative path
+if (is_dir(TR_TEMP_DIR . 'import/'.$course_id.'/resources')) {
+       $handler = opendir(TR_TEMP_DIR . 'import/'.$course_id.'/resources');
+       while ($file = readdir($handler)){
+               $filename = TR_TEMP_DIR . 'import/'.$course_id.'/resources/'.$file;
+               if(is_file($filename)){
+                       @rename($filename, TR_TEMP_DIR .$course_id.'/'.$package_base_name.'/'.$file);
+               }
+       }
+       closedir($handler);
+}
+
+$course_dir = TR_TEMP_DIR.$course_id.'/';
+
+if (!is_dir($course_dir)) {
+       if (!@mkdir($course_dir, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+}
+
+
+if (@rename($import_path.$package_base_path, $course_dir.$package_base_name) === false) {
+       if (!$msg->containsErrors()) {
+               $msg->addError('IMPORT_FAILED');debug('3');exit;
+       }
+}
+//check if there are still resources missing
+foreach($items as $idetails){
+       $temp_path = pathinfo($idetails['href']);
+       @rename($import_path.$temp_path['dirname'], $course_dir.$package_base_name . '/' . $temp_path['dirname']);
+}
+clr_dir($import_path);
+
+if (isset($_POST['url'])) {
+       @unlink($full_filename);
+}
+
+
+//if ($_POST['s_cid'] || $course_id){
+       if (!$msg->containsErrors()) {
+               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+       }
+       header('Location: ../course.php?cid='.$course_id);
+       exit;
+//} else {
+//     if (!$msg->containsErrors()) {
+//             $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+//     }
+//     if ($_GET['tile']) {
+//             header('Location: '.TR_BASE_HREF.'tools/tile/index.php');
+//     } else {
+//             header('Location: ../course.php?cid='.$course_id);
+//     }
+//     exit;
+//}
+
+?>
index 64af1b4..cde52f1 100644 (file)
@@ -1,38 +1,45 @@
 <?php
 /************************************************************************/
-/* ATutor                                                               */
+/* Transformable                                                        */
 /************************************************************************/
-/* Copyright (c) 2002 - 2009                                            */
+/* Copyright (c) 2009                                                   */
 /* Adaptive Technology Resource Centre / University of Toronto          */
 /*                                                                      */
 /* 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.                        */
 /************************************************************************/
-// $Id: ims_import.php 9031 2009-12-14 17:33:34Z hwong $
-define('AT_INCLUDE_PATH', '../../include/');
-require(AT_INCLUDE_PATH.'vitals.inc.php');
-
-require_once(TR_INCLUDE_PATH.'classes/Utility.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
-require_once(TR_INCLUDE_PATH.'classes/DAO/UsersDAO.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
-require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
-require_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
-require_once(TR_INCLUDE_PATH.'classes/ContentUtility.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
-
-require(AT_INCLUDE_PATH.'lib/filemanager.inc.php'); /* for clr_dir() and preImportCallBack and dirsize() */
-require(AT_INCLUDE_PATH.'classes/pclzip.lib.php');
-require(AT_INCLUDE_PATH.'lib/qti.inc.php'); 
-//require(AT_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');  
-require(AT_INCLUDE_PATH.'classes/QTI/QTIImport.class.php');
-require(AT_INCLUDE_PATH.'classes/A4a/A4aImport.class.php');
-require(AT_INCLUDE_PATH.'../tools/ims/ns.inc.php');    //namespace, no longer needs, delete it after it's stable.
-require(AT_INCLUDE_PATH.'classes/Weblinks/WeblinksParser.class.php');
-require(AT_INCLUDE_PATH.'classes/DiscussionTools/DiscussionToolsParser.class.php');
-require(AT_INCLUDE_PATH.'classes/DiscussionTools/DiscussionToolsImport.class.php');
-
-
-/* make sure we own this course that we're exporting */
-authenticate(AT_PRIV_CONTENT);
+
+/** Commented by Cindy Li on Feb 2, 2010
+ * Modified from ATutor mods/_core/imscp/ims_import.php, SVN revision 9126
+ */
+
+define('TR_INCLUDE_PATH', '../../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+require_once(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/UsersDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsQuestionsAssocDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/ContentTestsAssocDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/FileUtility.class.php'); /* for clr_dir() and preImportCallBack and dirsize() */
+
+require_once(TR_INCLUDE_PATH.'lib/pclzip.lib.php');
+require_once(TR_INCLUDE_PATH.'lib/pclzip_callback.lib.php');
+require_once(TR_INCLUDE_PATH.'lib/qti.inc.php'); 
+//require(TR_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');  
+require_once(TR_INCLUDE_PATH.'classes/QTI/QTIImport.class.php');
+require_once(TR_INCLUDE_PATH.'classes/A4a/A4aImport.class.php');
+require(TR_INCLUDE_PATH.'../home/ims/ns.inc.php');     //namespace, no longer needs, delete it after it's stable.
+require_once(TR_INCLUDE_PATH.'classes/Weblinks/WeblinksParser.class.php');
+//require(TR_INCLUDE_PATH.'classes/DiscussionTools/DiscussionToolsParser.class.php');
+//require(TR_INCLUDE_PATH.'classes/DiscussionTools/DiscussionToolsImport.class.php');
+
+// make sure the user has author privilege
+Utility::authenticate(TR_PRIV_ISAUTHOR);
 
 /* to avoid timing out on large files */
 @set_time_limit(0);
@@ -54,6 +61,46 @@ $skip_ims_validation = false;
 $added_dt = array();   //the mapping of discussion tools that are added
 $avail_dt = array();   //list of discussion tools that have not been handled
 
+function check_available_size($course_id)
+{
+       global $coursesDAO, $MaxCourseSize, $import_path, $msg;
+
+       $q_row = $coursesDAO->get($course_id);
+       
+       //$sql  = "SELECT max_quota FROM ".TABLE_PREFIX."courses WHERE course_id=$_SESSION[course_id]";
+       //$result = mysql_query($sql, $db);
+       //$q_row        = mysql_fetch_assoc($result);
+       
+       if ($q_row['max_quota'] == AT_COURSESIZE_UNLIMITED) {debug('return');return;}
+       else $zip_size_limit = $MaxCourseSize;
+
+       $totalBytes   = FileUtility::dirsize($import_path);
+       
+       $total_after  = $zip_size_limit - $totalBytes;
+       
+       if (is_dir(TR_CONTENT_DIR . $course_id.'/')) 
+       {
+               $course_total = FileUtility::dirsize(TR_CONTENT_DIR . $course_id.'/');
+               $total_after  -= $course_total;
+       }
+       
+       if ($total_after < 0) {
+               /* remove the content dir, since there's no space for it */
+               $errors = array('NO_CONTENT_SPACE', number_format(-1*($total_after/TR_KBYTE_SIZE), 2 ) );
+               $msg->addError($errors);
+               
+               // Clean up import path and inserted course row
+               FileUtility::clr_dir($import_path);
+               $coursesDAO->Delete($course_id);
+
+               if (isset($_GET['tile'])) {
+                       header('Location: '.$_base_path.'tools/tile/index.php');
+               } else {
+                       header('Location: ../create_course.php');
+               }
+               exit;
+       }
+}
 
 /*
  * return the error messages represented by the given array 
@@ -307,7 +354,8 @@ function rehash($items){
                global $element_path, $import_path;
                global $xml_base_path, $test_message, $content_type;
                global $current_identifier, $msg, $ns, $ns_cp;
-
+               global $course_primary_lang;
+               
                //check if the xml is valid
 /*
                if(isset($attrs['xsi:schemaLocation']) && $name == 'manifest'){
@@ -325,7 +373,11 @@ function rehash($items){
                }
 */
 
-
+               // get language from CONTENT PACKAGE
+               if (substr($element_path[count($element_path)-1], -6) == ':title' && substr($name, -11) == ':langstring') {
+                       $course_primary_lang = trim($attrs['xml:lang']);
+               }
+               
                //validate namespaces
                if(isset($attrs['xsi:schemaLocation']) && $name=='manifest'){
                        $schema_location = array();
@@ -359,7 +411,6 @@ function rehash($items){
                        //throw error           
                }
 
-
                if ($name == 'manifest' && isset($attrs['xml:base']) && $attrs['xml:base']) {
                        $xml_base_path = $attrs['xml:base'];
                } else if ($name == 'file') {
@@ -516,12 +567,35 @@ function rehash($items){
                global $path, $element_path, $my_data, $items;
                global $current_identifier, $skip_ims_validation;
                global $msg, $content_type;             
+               global $course_title, $course_description, $course_primary_lang;  // added by Cindy Li
                static $resource_num = 0;
                
                if ($name == 'item') {
                        array_pop($path);
                } 
 
+               // added by Cindy Li on Jan 10, 2010
+               // Extract course title, description and primary language for a newly-created course
+               if (substr($element_path[count($element_path)-2], -6) == ':title') {
+                       if (substr($element_path[count($element_path)-1], -7) == ':string' ||
+                           substr($element_path[count($element_path)-1], -11) == ':langstring') {
+                               $course_title = trim($my_data);
+                       }
+               }
+               
+               if (substr($element_path[count($element_path)-2], -12) == ':description') {
+                       if (substr($element_path[count($element_path)-1], -7) == ':string' ||
+                           substr($element_path[count($element_path)-1], -11) == ':langstring') {
+                               $course_description = trim($my_data);
+                       }
+               }
+               
+               // get language from COMMON CARTRIDGE
+               if (substr($element_path[count($element_path)-1], -9) == ':language') {
+                       $course_primary_lang = trim($my_data);
+               }
+               // end of added by Cindy Li on Jan 10, 2010
+               
                //check if this is a test import
                if ($name == 'schema'){
                        if (trim($my_data)=='IMS Question and Test Interoperability'){
@@ -577,7 +651,7 @@ function rehash($items){
                global $current_identifier;
 
                $str_trimmed_data = trim($data);
-                               
+               
                if (!empty($str_trimmed_data)) {
                        $size = count($path);
                        if ($size > 0) {
@@ -657,12 +731,12 @@ if (!isset($_POST['submit']) && !isset($_POST['cancel'])) {
        $errors = array('FILE_MAX_SIZE', ini_get('post_max_size'));
        $msg->addError($errors);
 
-       header('Location: ./index.php');
+       header('Location: ../create_course.php');
        exit;
 } else if (isset($_POST['cancel'])) {
        $msg->addFeedback('IMPORT_CANCELLED');
 
-       header('Location: ./index.php');
+       header('Location: ../create_course.php');
        exit;
 }
 
@@ -673,7 +747,7 @@ if (isset($_POST['url']) && ($_POST['url'] != 'http://') ) {
 
                // save file to /content/
                $filename = substr(time(), -6). '.zip';
-               $full_filename = AT_CONTENT_DIR . $filename;
+               $full_filename = TR_CONTENT_DIR . $filename;
 
                if (!$fp = fopen($full_filename, 'w+b')) {
                        echo "Cannot open file ($filename)";
@@ -711,14 +785,14 @@ if ($msg->containsErrors()) {
        if (isset($_GET['tile'])) {
                header('Location: '.$_base_path.'tools/tile/index.php');
        } else {
-               header('Location: index.php');
+               header('Location: ../create_course.php');
        }
        exit;
 }
 
 /* check if ../content/import/ exists */
-$import_path = AT_CONTENT_DIR . 'import/';
-$content_path = AT_CONTENT_DIR;
+$import_path = TR_CONTENT_DIR . 'import/';
+$content_path = TR_CONTENT_DIR;
 
 if (!is_dir($import_path)) {
        if (!@mkdir($import_path, 0700)) {
@@ -726,9 +800,11 @@ if (!is_dir($import_path)) {
        }
 }
 
-$import_path .= $_SESSION['course_id'].'/';
+if (isset($_SESSION['course_id'])) $import_path .= $_SESSION['course_id'].'/';
+else $import_path .= Utility::getRandomStr(16).'/';
+
 if (is_dir($import_path)) {
-       clr_dir($import_path);
+       FileUtility::clr_dir($import_path);
 }
 
 if (!@mkdir($import_path, 0700)) {
@@ -739,7 +815,7 @@ if ($msg->containsErrors()) {
        if (isset($_GET['tile'])) {
                header('Location: '.$_base_path.'tools/tile/index.php');
        } else {
-               header('Location: index.php');
+               header('Location: ../create_course.php');
        }
        exit;
 }
@@ -747,47 +823,29 @@ if ($msg->containsErrors()) {
 /* extract the entire archive into AT_COURSE_CONTENT . import/$course using the call back function to filter out php files */
 error_reporting(0);
 $archive = new PclZip($_FILES['file']['tmp_name']);
+
 if ($archive->extract( PCLZIP_OPT_PATH,        $import_path,
                                                PCLZIP_CB_PRE_EXTRACT,  'preImportCallBack') == 0) {
        $msg->addError('IMPORT_FAILED');
        echo 'Error : '.$archive->errorInfo(true);
-       clr_dir($import_path);
-       header('Location: index.php');
+       FileUtility::clr_dir($import_path);
+       header('Location: ../create_course.php');
        exit;
 }
 error_reporting(AT_ERROR_REPORTING);
 
-/* get the course's max_quota */
-$sql   = "SELECT max_quota FROM ".TABLE_PREFIX."courses WHERE course_id=$_SESSION[course_id]";
-$result = mysql_query($sql, $db);
-$q_row = mysql_fetch_assoc($result);
+/* initialize DAO objects */
+$coursesDAO = new CoursesDAO();
+$contentDAO = new ContentDAO();
+$testsQuestionsAssocDAO = new TestsQuestionsAssocDAO();
+$contentTestsAssocDAO = new ContentTestsAssocDAO();
 
-if ($q_row['max_quota'] != AT_COURSESIZE_UNLIMITED) {
-
-       if ($q_row['max_quota'] == AT_COURSESIZE_DEFAULT) {
-               $q_row['max_quota'] = $MaxCourseSize;
-       }
-       $totalBytes   = dirsize($import_path);
-       $course_total = dirsize(AT_CONTENT_DIR . $_SESSION['course_id'].'/');
-       $total_after  = $q_row['max_quota'] - $course_total - $totalBytes + $MaxCourseFloat;
-
-       if ($total_after < 0) {
-               /* remove the content dir, since there's no space for it */
-               $errors = array('NO_CONTENT_SPACE', number_format(-1*($total_after/AT_KBYTE_SIZE), 2 ) );
-               $msg->addError($errors);
-               
-               clr_dir($import_path);
-
-               if (isset($_GET['tile'])) {
-                       header('Location: '.$_base_path.'tools/tile/index.php');
-               } else {
-                       header('Location: index.php');
-               }
-               exit;
-       }
+// get the course's max_quota
+if (isset($_SESSION['course_id']))
+{
+       check_available_size($_SESSION['course_id']);
 }
 
-
 $items = array(); /* all the content pages */
 $order = array(); /* keeps track of the ordering for each content page */
 $path  = array();  /* the hierarchy path taken in the menu to get to the current item in the manifest */
@@ -832,12 +890,12 @@ if ($ims_manifest_xml === false) {
        if (file_exists($import_path . 'atutor_backup_version')) {
                $msg->addError('NO_IMS_BACKUP');
        }
-       clr_dir($import_path);
+       FileUtility::clr_dir($import_path);
 
        if (isset($_GET['tile'])) {
                header('Location: '.$_base_path.'tools/tile/index.php');
        } else {
-               header('Location: index.php');
+               header('Location: ../create_course.php');
        }
        exit;
 }
@@ -855,6 +913,7 @@ if (!xml_parse($xml_parser, $ims_manifest_xml, true)) {
 }
 xml_parser_free($xml_parser);
 /* check if the glossary terms exist */
+/* Commented by Cindy Li on Jan 7, 2010. Transformable does not include glossary
 $glossary_path = '';
 if ($content_type == 'IMS Common Cartridge'){
        $glossary_path = 'resources/GlossaryItem/';
@@ -865,9 +924,9 @@ if (file_exists($import_path . $glossary_path . 'glossary.xml')){
        $element_path = array();
        $xml_parser = xml_parser_create();
 
-       /* insert the glossary terms into the database (if they're not in there already) */
-       /* parse the glossary.xml file and insert the terms */
-       xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); /* conform to W3C specs */
+       // insert the glossary terms into the database (if they're not in there already)
+       // parse the glossary.xml file and insert the terms
+       xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); // conform to W3C specs
        xml_set_element_handler($xml_parser, 'glossaryStartElement', 'glossaryEndElement');
        xml_set_character_data_handler($xml_parser, 'glossaryCharacterData');
 
@@ -885,7 +944,7 @@ if (file_exists($import_path . $glossary_path . 'glossary.xml')){
                }
        }
 }
-
+*/
 // Check if all the files exists in the manifest, iff it's a IMS CC package.
 if ($content_type == 'IMS Common Cartridge') {
        checkResources($import_path);
@@ -896,11 +955,39 @@ if ($msg->containsErrors()) {
        if (isset($_GET['tile'])) {
                header('Location: '.$_base_path.'tools/tile/index.php');
        } else {
-               header('Location: index.php');
+               header('Location: ../create_course.php');
        }
        exit;
 }
 
+// added by Cindy Li on Jan 10, 2010
+// generate a course_id if the import is not into an existing course
+if (!isset($_SESSION['course_id']))
+{
+       if (isset($_POST['hide_course']))
+               $access = 'private';
+       else
+               $access = 'public';
+       
+       if (isset($course_primary_lang))
+       {
+               $langcode_and_charset = explode('-', $course_primary_lang);
+//             $course_primary_lang = Utility::get3LetterLangCode($langcode_and_charset[0]);
+               $course_primary_lang = $langcode_and_charset[0];
+       }
+       
+       $course_id = $coursesDAO->Create($_SESSION['user_id'], 'top', $access, $course_title, $course_description, 
+                    '', '', '', '', $course_primary_lang, '', '');
+       
+       check_available_size($course_id);
+
+       // insert author role into table "user_courses"
+       $userCoursesDAO = new UserCoursesDAO();
+       $userCoursesDAO->Create($_SESSION['user_id'], $course_id, TR_USERROLE_AUTHOR, 0);
+}
+else $course_id = $_SESSION['course_id'];
+// end of added by Cindy Li on Jan 10, 2010
+
 /* generate a unique new package base path based on the package file name and date as needed. */
 /* the package name will be the dir where the content for this package will be put, as a result */
 /* the 'content_path' field in the content table will be set to this path. */
@@ -915,7 +1002,7 @@ $package_base_name = strtolower($package_base_name);
 $package_base_name = str_replace(array('\'', '"', ' ', '|', '\\', '/', '<', '>', ':'), '_' , $package_base_name);
 $package_base_name = preg_replace("/[^A-Za-z0-9._\-]/", '', $package_base_name);
 
-if (is_dir(AT_CONTENT_DIR . $_SESSION['course_id'].'/'.$package_base_name)) {
+if (is_dir($import_path.$package_base_name)) {
        $package_base_name .= '_'.date('ymdHis');
 }
 
@@ -928,19 +1015,20 @@ if ($package_base_path) {
 if ($xml_base_path) {
        $package_base_path = $xml_base_path . $package_base_path;
 
-       mkdir(AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$xml_base_path);
+       mkdir($import_path.$xml_base_path);
        $package_base_name = $xml_base_path . $package_base_name;
 }
 
 /* get the top level content ordering offset */
-$sql   = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content WHERE course_id=$_SESSION[course_id] AND content_parent_id=$cid";
-$result = mysql_query($sql, $db);
-$row   = mysql_fetch_assoc($result);
-$order_offset = intval($row['ordering']); /* it's nice to have a real number to deal with */
+//$sql = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content WHERE course_id=$_SESSION[course_id] AND content_parent_id=$cid";
+//$result = mysql_query($sql, $db);
+//$row = mysql_fetch_assoc($result);
+//$order_offset = intval($row['ordering']); /* it's nice to have a real number to deal with */
+$order_offset = $contentDAO->getMaxOrdering($course_id, 0);
 $lti_offset = array(); //since we don't need lti tools, the ordering needs to be subtracted
 //reorder the items stack
 $items = rehash($items);
-//debug($items);exit;
+//debug($items);
 foreach ($items as $item_id => $content_info) 
 {      
        //formatting field, default 1
@@ -1037,13 +1125,13 @@ foreach ($items as $item_id => $content_info)
                        $ext = '';
                        $last_modified = date('Y-m-d H:i:s');
                } else {
-                       //$file_info = @stat(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
+                       //$file_info = @stat(TR_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
                        $file_info = @stat($import_path.$content_info['href']);
                        if ($file_info === false) {
                                continue;
                        }
                
-                       //$path_parts = pathinfo(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
+                       //$path_parts = pathinfo(TR_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
                        $path_parts = pathinfo($import_path.$content_info['href']);
                        $ext = strtolower($path_parts['extension']);
 
@@ -1091,7 +1179,7 @@ foreach ($items as $item_id => $content_info)
                        }
 
                        /* this is a plain text file */
-                       //$content = file_get_contents(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
+                       //$content = file_get_contents(TR_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
                        $content = file_get_contents($import_path.$content_info['href']);
                        if ($content === false) {
                                /* if we can't stat() it then we're unlikely to be able to read it */
@@ -1100,7 +1188,7 @@ foreach ($items as $item_id => $content_info)
                        }
 
                        // get the contents of the 'head' element
-                       $head .= get_html_head_by_tag($content, $html_head_tags);
+                       $head .= ContentUtility::getHtmlHeadByTag($content, $html_head_tags);
                        
                        // Specifically handle eXe package
                        // NOTE: THIS NEEDS WORK! TO FIND A WAY APPLY EXE .CSS FILES ONLY ON COURSE CONTENT PART.
@@ -1121,7 +1209,7 @@ foreach ($items as $item_id => $content_info)
 
                        // end of specifically handle eXe package
 
-                       $content = get_html_body($content);
+                       $content = ContentUtility::getHtmlBody($content);
                        if ($contains_glossary_terms) 
                        {
                                // replace glossary content package links to real glossary mark-up using [?] [/?]
@@ -1131,10 +1219,11 @@ foreach ($items as $item_id => $content_info)
 
                        /* potential security risk? */
                        if ( strpos($content_info['href'], '..') === false && !preg_match('/((.*)\/)*tests\_[0-9]+\.xml$/', $content_info['href'])) {
-//                             @unlink(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
+//                             @unlink(TR_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$content_info['href']);
                        }
 
-                       /* overwrite content if this is discussion tool. */
+                       /** Commented by Cindy Qi Li on Jan 6, 2010. Ignore discussion tools
+                       // overwrite content if this is discussion tool.
                        if ($content_info['type']=='imsdt_xmlv1p0'){
                                $dt_parser = new DiscussionToolsParser();
                                $xml_content = @file_get_contents($import_path . $content_info['href']);
@@ -1144,6 +1233,7 @@ foreach ($items as $item_id => $content_info)
                                unset($forum_obj);
                                $dt_parser->close();
                        }
+                       */
                } else if ($ext) {
                        /* non text file, and can't embed (example: PDF files) */
                        $content = '<a href="'.$content_info['href'].'">'.$content_info['title'].'</a>';
@@ -1204,43 +1294,48 @@ foreach ($items as $item_id => $content_info)
                $content_folder_type = (!isset($content_info['type'])?CONTENT_TYPE_FOLDER:CONTENT_TYPE_CONTENT);
        }
 
-       $sql= 'INSERT INTO '.TABLE_PREFIX.'content'
-             . '(course_id, 
-                 content_parent_id, 
-                 ordering,
-                 last_modified, 
-                 revision, 
-                 formatting, 
-                 release_date,
-                 head,
-                 use_customized_head,
-                 keywords, 
-                 content_path, 
-                 title, 
-                 text,
-                         test_message,
-                         content_type) 
-              VALUES 
-                            ('.$_SESSION['course_id'].','                                                                                                                      
-                            .intval($content_parent_id).','            
-                            .($content_info['ordering'] + $my_offset - $lti_offset[$content_info['parent_content_id']] + 1).','
-                            .'"'.$last_modified.'",                                                                                                    
-                             0,'
-                            .$content_formatting.' ,
-                             NOW(),"'
-                            . $head .'",
-                            1,
-                             "",'
-                            .'"'.$content_info['new_path'].'",'
-                            .'"'.$content_info['title'].'",'
-                            .'"'.$content.'",'
-                                .'"'.$content_info['test_message'].'",'
-                                .$content_folder_type.')';
-
-       $result = mysql_query($sql, $db) or die(mysql_error());
-
-       /* get the content id and update $items */
-       $items[$item_id]['real_content_id'] = mysql_insert_id($db);
+       $items[$item_id]['real_content_id'] = $contentDAO->Create($course_id, intval($content_parent_id), 
+                           ($content_info['ordering'] + $my_offset - $lti_offset[$content_info['parent_content_id']] + 1),
+                           $last_modified, 0, $content_formatting, "", $content_info['new_path'], $content_info['title'],
+                           $content, $head, 1, $content_info['test_message'], 0, $content_folder_type);
+       
+//     $sql= 'INSERT INTO '.TABLE_PREFIX.'content'
+//           . '(course_id, 
+//               content_parent_id, 
+//               ordering,
+//               last_modified, 
+//               revision, 
+//               formatting, 
+//               release_date,
+//               head,
+//               use_customized_head,
+//               keywords, 
+//               content_path, 
+//               title, 
+//               text,
+//                       test_message,
+//                       content_type) 
+//            VALUES 
+//                          ('.$_SESSION['course_id'].','                                                                                                                      
+//                          .intval($content_parent_id).','            
+//                          .($content_info['ordering'] + $my_offset - $lti_offset[$content_info['parent_content_id']] + 1).','
+//                          .'"'.$last_modified.'",                                                                                                    
+//                           0,'
+//                          .$content_formatting.' ,
+//                           NOW(),"'
+//                          . $head .'",
+//                          1,
+//                           "",'
+//                          .'"'.$content_info['new_path'].'",'
+//                          .'"'.$content_info['title'].'",'
+//                          .'"'.$content.'",'
+//                              .'"'.$content_info['test_message'].'",'
+//                              .$content_folder_type.')';
+//
+//     $result = mysql_query($sql, $db) or die(mysql_error());
+//
+//     /* get the content id and update $items */
+//     $items[$item_id]['real_content_id'] = mysql_insert_id($db);
 
        /* get the tests associated with this content */
        if (!empty($items[$item_id]['tests']) || strpos($items[$item_id]['type'], 'imsqti_xmlv1p2/imscc_xmlv1p0') !== false){
@@ -1277,17 +1372,19 @@ foreach ($items as $item_id => $content_info)
                                        $weight = 0;
                                }
                                $new_order = $order + 1;
-                               $sql = "INSERT INTO " . TABLE_PREFIX . "tests_questions_assoc" . 
-                                               "(test_id, question_id, weight, ordering, required) " .
-                                               "VALUES ($tid, $qid, $weight, $new_order, 0)";
-                               $result = mysql_query($sql, $db);
+                               $testsQuestionsAssocDAO->Create($tid, $qid, $weight, $new_order, 0);
+//                             $sql = "INSERT INTO " . TABLE_PREFIX . "tests_questions_assoc" . 
+//                                             "(test_id, question_id, weight, ordering, required) " .
+//                                             "VALUES ($tid, $qid, $weight, $new_order, 0)";
+//                             $result = mysql_query($sql, $db);
                        }
 
                        //associate content and test
-                       $sql =  'INSERT INTO ' . TABLE_PREFIX . 'content_tests_assoc' . 
-                                       '(content_id, test_id) ' .
-                                       'VALUES (' . $items[$item_id]['real_content_id'] . ", $tid)";
-                       $result = mysql_query($sql, $db);
+                       $contentTestsAssocDAO->Create($items[$item_id]['real_content_id'], $tid);
+//                     $sql =  'INSERT INTO ' . TABLE_PREFIX . 'content_tests_assoc' . 
+//                                     '(content_id, test_id) ' .
+//                                     'VALUES (' . $items[$item_id]['real_content_id'] . ", $tid)";
+//                     $result = mysql_query($sql, $db);
                
 //                     if (!$msg->containsErrors()) {
 //                             $msg->addFeedback('IMPORT_SUCCEEDED');
@@ -1302,7 +1399,8 @@ foreach ($items as $item_id => $content_info)
                $a4a_import->importA4a($items[$item_id]['a4a']);
        }
 
-       /* get the discussion tools (dependent to content)*/
+       /** Commented by Cindy Qi Li on Jan 6, 2010. Ignore discussion tools
+       // get the discussion tools (dependent to content)
        if (isset($items[$item_id]['forum']) && !empty($items[$item_id]['forum'])){
                foreach($items[$item_id]['forum'] as $forum_ref => $forum_link){
                        $dt_parser = new DiscussionToolsParser();
@@ -1332,19 +1430,29 @@ foreach ($items as $item_id => $content_info)
                //associate the fid and content id
                $dt_import->associateForum($items[$item_id]['real_content_id'], $added_dt[$item_id]);
        }
+       */
 }
+
 //exit;//harris
 if ($package_base_path == '.') {
        $package_base_path = '';
 }
 
+// create course directory
+$course_dir = TR_CONTENT_DIR.$course_id.'/';
+if (!is_dir($course_dir)) {
+       if (!@mkdir($course_dir, 0700)) {
+               $msg->addError('IMPORTDIR_FAILED');
+       }
+}
+
 // loop through the files outside the package folder, and copy them to its relative path
-if (is_dir(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/resources')) {
-       $handler = opendir(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/resources');
+if (is_dir($import_path.'resources')) {
+       $handler = opendir($import_path.'resources');
        while ($file = readdir($handler)){
-               $filename = AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/resources/'.$file;
+               $filename = $import_path.'resources/'.$file;
                if(is_file($filename)){
-                       @rename($filename, AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$package_base_name.'/'.$file);
+                       @rename($filename, $course_dir.$package_base_name.'/'.$file);
                }
        }
        closedir($handler);
@@ -1354,7 +1462,7 @@ if(is_array($all_package_base_path)){
        $all_package_base_path = implode('/', $all_package_base_path);
 }
 
-if (@rename($import_path.$all_package_base_path, AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$package_base_name) === false) {
+if (@rename($import_path.$all_package_base_path, $course_dir.$package_base_name) === false) {
        if (!$msg->containsErrors()) {
                $msg->addError('IMPORT_FAILED');
        }
@@ -1362,31 +1470,38 @@ if (@rename($import_path.$all_package_base_path, AT_CONTENT_DIR .$_SESSION['cour
 //check if there are still resources missing
 foreach($items as $idetails){
        $temp_path = pathinfo($idetails['href']);
-       @rename(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$temp_path['dirname'], AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$package_base_name . '/' . $temp_path['dirname']);
+       @rename($import_path.$temp_path['dirname'], $course_dir.$package_base_name . '/' . $temp_path['dirname']);
 }
-clr_dir(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id']);
+FileUtility::clr_dir($import_path);
 
 if (isset($_POST['url'])) {
        @unlink($full_filename);
 }
 
 
-if ($_POST['s_cid']){
-       if (!$msg->containsErrors()) {
-               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
-       }
-       header('Location: ../../editor/edit_content.php?cid='.intval($_POST['cid']));
-       exit;
-} else {
-       if (!$msg->containsErrors()) {
-               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
-       }
-       if ($_GET['tile']) {
-               header('Location: '.AT_BASE_HREF.'tools/tile/index.php');
-       } else {
-               header('Location: ./index.php?cid='.intval($_POST['cid']));
-       }
-       exit;
+if (!$msg->containsErrors()) {
+       $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
 }
 
+header('Location: ../course/index.php?_course_id='.$course_id);
+exit;
+
+//     if ($_POST['s_cid']){
+//     if (!$msg->containsErrors()) {
+//             $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+//     }
+//     header('Location: ../../editor/edit_content.php?cid='.intval($_POST['cid']));
+//     exit;
+//} else {
+//     if (!$msg->containsErrors()) {
+//             $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
+//     }
+//     if ($_GET['tile']) {
+//             header('Location: '.AT_BASE_HREF.'tools/tile/index.php');
+//     } else {
+//             header('Location: ../index.php?cid='.intval($_POST['cid']));
+//     }
+//     exit;
+//}
+
 ?>
diff --git a/docs/home/ims/imscc_c1p2maeV0p15_definition.xsd b/docs/home/ims/imscc_c1p2maeV0p15_definition.xsd
new file mode 100644 (file)
index 0000000..4f38ca9
--- /dev/null
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" targetNamespace="http://www.imsglobal.org/xsd/imscc/imscp_v1p1">\r
+  <xsd:import namespace="http://www.imsglobal.org/xsd/imscp_v1p1" schemaLocation="imscp_v1p2.xsd" />\r
+  <!--****************************************************************************************-->\r
+  <!--** Definition document - this document holds AP defined simpleType elements that have **-->\r
+  <!--** been referenced through a type attribute in one of the modified, resultant schema. **-->\r
+  <!--****************************************************************************************-->\r
+  <xs:simpleType name="schemaversionFixed">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="schemaFixed">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="rootedHierarchy">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="predefinedContentTypes">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+      <xs:enumeration value="imsdt_xmlv1p0" />\r
+      <xs:enumeration value="imswl_xmlv1p0" />\r
+      <xs:enumeration value="webcontent" />\r
+      <xs:enumeration value="imsqti_xmlv1p2/imscc_xmlv1p0/assessment" />\r
+      <xs:enumeration value="imsqti_xmlv1p2/imscc_xmlv1p0/question-bank" />\r
+      <xs:enumeration value="associatedcontent/imscc_xmlv1p0/learning-application-resource" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="isNotVisible">\r
+    <xs:restriction base="xs:boolean">\r
+      <xs:whiteSpace value="collapse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="defaultOrganizationProhibited">\r
+    <xs:restriction base="xs:IDREF">\r
+      <xs:whiteSpace value="collapse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="RequiredHref">\r
+    <xs:restriction base="xs:anyURI">\r
+      <xs:whiteSpace value="collapse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="ProhibitedHref">\r
+    <xs:restriction base="xs:anyURI">\r
+      <xs:whiteSpace value="collapse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="OptionalHref">\r
+    <xs:restriction base="xs:anyURI">\r
+      <xs:whiteSpace value="collapse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="NoParameters">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="NoParameter">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="NoIsVisible">\r
+    <xs:restriction base="xs:boolean">\r
+      <xs:whiteSpace value="collapse" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+  <xs:simpleType name="NoIdentifierRef">\r
+    <xs:restriction base="xs:string">\r
+      <xs:whiteSpace value="preserve" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xsd:schema>\r
+\r
diff --git a/docs/home/ims/imscp_v1p2.xsd b/docs/home/ims/imscp_v1p2.xsd
new file mode 100644 (file)
index 0000000..3260030
--- /dev/null
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/imscp_v1p1" version="IMS CP 1.2" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+            XSD Data File Information\r
+            -------------------------\r
+            Author:       CP1.2 Project Team\r
+            Date:         31st October, 2006\r
+            Version:      2.0\r
+            Status:       CM/DN Release\r
+            Description:  This is a normative representation of the IMS CP 1.2 Information Model for binding \r
+                          purposes.  Read the corresponding IMS CP Information Model for the Platform \r
+                          Independent Model representation.\r
+\r
+            History:      This is version 1 of the IMS CP v1.2 XSD.  It directly supercedes IMS CP v1.1.4 XSD.\r
+                          Note that the target namespace has NOT been changed.\r
+                          Apart from the functional additions, the main structural changes are:\r
+                          (1) All of the elements and attributes are defined as local to their host object;\r
+                          (2) Comments have been added to the complexType definitions.\r
+\r
+            Copyright:    2006 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+                          IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information\r
+                          contained in this binding ("Specification") for purposes of scientific\r
+                          experimental and scholarly collaboration only.  IMS/GLC makes no warranty or \r
+                          representation regarding the accuracy or completeness of the Specification.\r
+                          This material is provided on an "As Is" and "As Available basis".\r
+                          The Specification is at all times subject to change and revision without\r
+                          notice. It is your sole responsibility to evaluate the usefulness, accuracy\r
+                          and completeness of the Specification as it relates to you.  IMS/GLC would\r
+                          appreciate receiving your comments and suggestions.  Please contact IMS/GLC\r
+                          through our website at: http://www.imsglobal.org.\r
+\r
+            Source XSLT File Information\r
+            ----------------------------\r
+            XSL Generator:    UMLtoXSDTransformv0p7.xsl\r
+            XSLT Processor:   Xalan\r
+            Release:          1.0 Beta 1\r
+            Date:             30th November, 2005\r
+\r
+            Auto-generation Tool\r
+            --------------------\r
+            This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool.  While every attempt\r
+            has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware\r
+            that this is an experimental tool.  Permission is given to make use of this tool.  IMS makes no\r
+            claim on the materials created by third party users of this tool.  Details on how to use this tool\r
+            are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation"\r
+            available at the IMS web-site.\r
+            Tool Copyright:  2005 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+        </xs:documentation>\r
+    </xs:annotation>\r
+\r
+        <!-- Generate Global Attributes ***********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate Namespaced extension Group  *************************************************************  -->\r
+\r
+            <xs:group name="grpStrict.any">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the enumerated simpleType declarations **************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the simpleType elements based IMS data-types  *******************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the derived data-type elements **********************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the data-type elements ******************************************************************  -->\r
+\r
+            <xs:complexType name="Manifest.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A manifest element is a container for data structures whose contents describe a \r
+                        semantically complete instance of the IMS Content Packaging Information Model.  \r
+                        \r
+                        A manifest element may contain and reference child manifest elements \r
+                        in the same IMS Manifest document.  The root manifest element defines an \r
+                        entire IMS Package.  A child manifest element defines a semantically complete \r
+                        subset of that Package.\r
+\r
+                        <p>Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="ManifestMetadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="organizations" type="Organizations.Type" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="resources" type="Resources.Type" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="manifest" type="Manifest.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="version" use="optional" type="xs:string" />\r
+                <xs:attribute ref="xml:base" use="optional" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Metadata.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An instance of the metadata element contains data structures \r
+                        that declare descriptive information about a metadata element's \r
+                        parent only.\r
+                        \r
+                        One or more different metadata models may be declared as\r
+                        child extensions of a metadata element.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imMetadata:  Metadata.[ Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="schema" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="schemaversion" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Organizations.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        The organizations element is a container for all data structures \r
+                        that describe the way or ways that information encapsulated by \r
+                        its parent manifest element is structured. \r
+\r
+                        <p>Represents of binding of the child objects of ims-cp-imOrganizations: Organizations.[ Organization, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="organization" type="Organization.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="default" use="optional" type="xs:IDREF" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Resources.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        The Resources element is a container for data structures containing \r
+                        references  to one or more assets.  Asset references may be grouped \r
+                        within a containing resources element in whatever manner seems best.\r
+                          \r
+                        The scope of referenced assets is specific to a resources element's parent \r
+                        manifest element only. \r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imResources: Resources.[ Resource, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="resource" type="Resource.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute ref="xml:base" use="optional" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Organization.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An organization element is a container for all data structures relating \r
+                        to a particular way or view that information encapsulated by a \r
+                        grandparent manifest object is structured.  \r
+                        \r
+                        Multiple organization elements within the same parent organizations \r
+                        element are equivalent in purpose: Each shows a different way for \r
+                        structuring the same information declared within a grandparent \r
+                        manifest object.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-Organization: Organization[ Title, Item, Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="item" type="Item.Type" minOccurs="1" maxOccurs="unbounded" />\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="structure" use="optional" type="xs:string" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Resource.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A resource element is a container for a particular asset \r
+                        or collection of assets.  A resource may contain references \r
+                        to assets that are all of the same type or different types (i.e., file formats).\r
+                        \r
+                        The scope or boundary of an IMS Package is defined by the asset \r
+                        references collected into all resources containers associated with the\r
+                        root manifest element, whether as a child, direcdt descendant, or externally \r
+                        linked descendant. \r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="file" type="File.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:element name="dependency" type="Dependency.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="type" use="required" type="xs:string" />\r
+                <xs:attribute ref="xml:base" use="optional" />\r
+                <xs:attribute name="href" use="optional" type="xs:anyURI" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Item.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An item element represents a structural node in a particular organization.  \r
+                        An item element may be a parent or sibling of other Item elements, \r
+                        each one representing a unique structural node.\r
+                        \r
+                        An organization has no meaning unless it has at least one Item element.\r
+\r
+                        <p>Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="item" type="Item.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="identifierref" use="optional" type="xs:string" />\r
+                <xs:attribute name="isvisible" use="optional" type="xs:boolean" />\r
+                <xs:attribute name="parameters" use="optional" type="xs:string" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="File.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A file element declares a reference to a single asset.  The reference may\r
+                        be relative to the Package containing the file element or absolute \r
+                        (external to the Package).\r
+                        \r
+                        A file element may contain child extensions declaring alternative references\r
+                         to the same asset as that referenced by the file element's href attribute.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imFile: File.[ Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="href" use="required" type="xs:anyURI" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Dependency.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A dependency element provides a way to associate another collection of \r
+                        asset references within the scope of the dependency element's parent \r
+                        resource element.\r
+                        \r
+                        This element allows the parsimonious declaration of asset references.  \r
+                        Shared asset references can be declared once and associated many \r
+                        times through a Dependency element.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imDependency: Dependency.[ Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifierref" use="required" type="xs:string" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="ManifestMetadata.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        This metadata element contains data structures that declare \r
+                        descriptive information about an entire Package.\r
+                        \r
+                        One or more different metadata models may be declared as\r
+                        child extensions of a metadata element.\r
+                        \r
+                        The schema and schemaversion children define the kind or collection \r
+                        of metadata models being used.\r
+\r
+                        <p>Represents a binding of the kinds of child objects defined for ims-cp-imManifestMetadata:  ManifestMetadata.[ Schema, SchemaVersion, MetadataModel ]..</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="schema" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="schemaversion" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+            </xs:complexType>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the elements **********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the root element(s) ***************************************************************  -->\r
+\r
+            <xs:element name="manifest" type="Manifest.Type" />\r
+\r
+        <!-- =====================================  -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/imscp_v1p2_constraintsDocument.scmt b/docs/home/ims/imscp_v1p2_constraintsDocument.scmt
new file mode 100644 (file)
index 0000000..e23040d
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<schema xmlns="http://www.ascc.net/xml/schematron">\r
+  <ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema" />\r
+  <ns prefix="xsd" uri="http://www.w3.org/2001/XMLSchema" />\r
+  <ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance" />\r
+  <ns prefix="ac" uri="http://iwm.uni-koblenz.de/xsd/tel_addc_v1p1" />\r
+  <ns prefix="ims" uri="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" />\r
+  <!--***********************************************************************************************-->\r
+  <!--** Constraints document - this document holds Schematron rules that have been generated from **-->\r
+  <!--** AP condition and assertion elements. IMPORTANT: If this document exists, it MUST be       **-->\r
+  <!--** used in the validation of instances derived from the resultant schema - failure to do so  **-->\r
+  <!--** can result in an instance that does not conform to either the base schema or the          **-->\r
+  <!--** Application Profile.                                                                      **-->\r
+  <!--***********************************************************************************************-->\r
+\r
+\r
+  <pattern name="pattern_3">\r
+    <rule context="ims:manifest/ims:resources/ims:resource/ims:dependency">\r
+      <assert test="(not(../@type='associatedcontent/imscc_xmlv1p0/learning-application-resource')) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='webcontent']/@identifier)">Assertion failed for pattern_3. A Resource object which is a Learning Object associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_4">\r
+    <rule context="ims:manifest/ims:organizations/ims:organization//ims:item">\r
+      <assert test="count(./@identifierref)=0 or count(./ims:item)=0">Assertion failed for pattern_4. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_5">\r
+       <rule context="ims:manifest/ims:resources/ims:resource">\r
+               <assert test="not((./@type='webcontent' or ./@type='associatedcontent/imscc_xmlv1p0/learning-application-resource') and ./@identifier = //ims:item/@identifierref) or count(./@href)=1">Error: Assertion failed for pattern_5: If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05)</assert>\r
+       </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_6">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imsdt_xmlv1p0') or (count(./ims:file)= 1 and count(./@href)=0)">Error: Assertion failed for pattern_5: For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. Discussion Topic resources must not contain href (#S06)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_7">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imswl_xmlv1p0') or (count(./ims:file) = 1 and count(./ims:dependency)=0 and count(./@href)=0)">Error: Assertion validation failed for pattern_7: For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema.It must contain neither Dependency objects nor an href attribute.(#S07)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+\r
+  <pattern name="pattern_11a">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment') or (count(./ims:file) = 1 and count(./@href)=0)">Error: Assertion validation failed for pattern_11a: For Assessment resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.zip. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11a)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_11b1">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank') or (count(./ims:file) = 1 )">Error: Assertion validation failed for pattern_11b1: For Question Bank resources the Resource object must contain a single File object which references the QTI XML file. (#S11b1)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_11b2">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank') or (count(./@href)=0 )">Error: Assertion validation failed for pattern_11b2: A Question Bank Resource must not have an href attribute. (#S11b2)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_11b3">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank') or ( not(//ims:item[@identifierref]=./@identifier) )">Error: Assertion validation failed for pattern_11b3:  A Question Bank Resource must not be referenced from an item. (#S11b3)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_11b4">\r
+    <rule context="ims:manifest/ims:resources/ims:resource">\r
+      <assert test="not(./@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank') or (count(//ims:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank'])=1)">Error: Assertion validation failed for pattern_11b4: There can be only one Questionbank Resource in a cartridge.(#S11b4)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_12">\r
+    <rule context="ims:manifest/ims:resources/ims:resource/ims:dependency">\r
+      <assert test="(not(../@type='imsdt_xmlv1p0')) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='webcontent']/@identifier) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier)">Assertion failed for pattern_12. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_14">\r
+    <rule context="ims:manifest/ims:resources/ims:resource/ims:dependency">\r
+      <assert test="(not(../@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment')) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='webcontent']/@identifier) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier)">Assertion failed for pattern_14. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  <pattern name="pattern_15">\r
+    <rule context="ims:manifest/ims:resources/ims:resource/ims:dependency">\r
+      <assert test="(not(../@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank')) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='webcontent']/@identifier) or (current()/@identifierref = /ims:manifest/ims:resources/ims:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier)">Assertion failed for pattern_15. A Resource object which is a Question Bank may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S15)</assert>\r
+    </rule>\r
+  </pattern>\r
+\r
+  </schema>
\ No newline at end of file
diff --git a/docs/home/ims/imscp_v1p2_localised.xsd b/docs/home/ims/imscp_v1p2_localised.xsd
new file mode 100644 (file)
index 0000000..c8a87f1
--- /dev/null
@@ -0,0 +1,401 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imscp_v1p2.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" targetNamespace="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" version="IMS CP 1.2 localised_Schema_2008_6_30" elementFormDefault="qualified" attributeFormDefault="unqualified" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsccauth_v1p0 domainProfile_0\imsccauth_v1p0_localised.xsd http://ltsc.ieee.org/xsd/imscc/LOM domainProfile_1\lomLoose_localised.xsd http://ltsc.ieee.org/xsd/LOM domainProfile_2\lomLoose_localised.xsd http://www.imsglobal.org/xsd/imscp_extensionv1p2 domainProfile_3\imscp_extensionv1p2_localised.xsd">\r
+       <xsd:include xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaLocation="imscc_c1p2maeV0p15_definition.xsd" />\r
+    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />\r
+    <xs:annotation>\r
+        <xs:documentation>\r
+            XSD Data File Information\r
+            -------------------------\r
+            Author:       CP1.2 Project Team\r
+            Date:         31st October, 2006\r
+            Version:      2.0\r
+            Status:       CM/DN Release\r
+            Description:  This is a normative representation of the IMS CP 1.2 Information Model for binding \r
+                          purposes.  Read the corresponding IMS CP Information Model for the Platform \r
+                          Independent Model representation.\r
+\r
+            History:      This is version 1 of the IMS CP v1.2 XSD.  It directly supercedes IMS CP v1.1.4 XSD.\r
+                          Note that the target namespace has NOT been changed.\r
+                          Apart from the functional additions, the main structural changes are:\r
+                          (1) All of the elements and attributes are defined as local to their host object;\r
+                          (2) Comments have been added to the complexType definitions.\r
+\r
+            Copyright:    2006 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+                          IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information\r
+                          contained in this binding ("Specification") for purposes of scientific\r
+                          experimental and scholarly collaboration only.  IMS/GLC makes no warranty or \r
+                          representation regarding the accuracy or completeness of the Specification.\r
+                          This material is provided on an "As Is" and "As Available basis".\r
+                          The Specification is at all times subject to change and revision without\r
+                          notice. It is your sole responsibility to evaluate the usefulness, accuracy\r
+                          and completeness of the Specification as it relates to you.  IMS/GLC would\r
+                          appreciate receiving your comments and suggestions.  Please contact IMS/GLC\r
+                          through our website at: http://www.imsglobal.org.\r
+\r
+            Source XSLT File Information\r
+            ----------------------------\r
+            XSL Generator:    UMLtoXSDTransformv0p7.xsl\r
+            XSLT Processor:   Xalan\r
+            Release:          1.0 Beta 1\r
+            Date:             30th November, 2005\r
+\r
+            Auto-generation Tool\r
+            --------------------\r
+            This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool.  While every attempt\r
+            has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware\r
+            that this is an experimental tool.  Permission is given to make use of this tool.  IMS makes no\r
+            claim on the materials created by third party users of this tool.  Details on how to use this tool\r
+            are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation"\r
+            available at the IMS web-site.\r
+            Tool Copyright:  2005 (c) IMS Global Learning Consortium Inc.  All Rights Reserved.\r
+        </xs:documentation>\r
+    </xs:annotation>\r
+\r
+        <!-- Generate Global Attributes ***********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate Namespaced extension Group  *************************************************************  -->\r
+\r
+            <xs:group name="grpStrict.any">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="0" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+<xs:group name="grpStrict.any3535">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace=" http://ltsc.ieee.org/xsd/LOM" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+<xs:group name="grpStrict.any4935">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace=" http://ltsc.ieee.org/xsd/imscc/LOM" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+<xs:group name="grpStrict.any2939">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        Any namespaced element from any namespace may be included within an "any" element.\r
+                        The namespace for the imported element must be defined in the instance, and the schema must be imported.\r
+                        The extension has a definition of "strict" i.e. they must have their own namespace.\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:any namespace=" http://www.imsglobal.org/xsd/imsccauth_v1p0" processContents="strict" minOccurs="0" maxOccurs="unbounded" />\r
+                </xs:sequence>\r
+            </xs:group>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the enumerated simpleType declarations **************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the simpleType elements based IMS data-types  *******************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the derived data-type elements **********************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Generate the data-type elements ******************************************************************  -->\r
+\r
+            <xs:complexType name="Manifest.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A manifest element is a container for data structures whose contents describe a \r
+                        semantically complete instance of the IMS Content Packaging Information Model.  \r
+                        \r
+                        A manifest element may contain and reference child manifest elements \r
+                        in the same IMS Manifest document.  The root manifest element defines an \r
+                        entire IMS Package.  A child manifest element defines a semantically complete \r
+                        subset of that Package.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="ManifestMetadata.Type" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="organizations" type="Organizations.Type" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="resources" type="Resources.Type" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="manifest" type="Manifest.Type" minOccurs="0" maxOccurs="0" />\r
+                    <xs:group ref="grpStrict.any2939" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="version" use="optional" type="xs:string" />\r
+                <xs:attribute ref="xml:base" use="optional" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Metadata.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An instance of the metadata element contains data structures \r
+                        that declare descriptive information about a metadata element's \r
+                        parent only.\r
+                        \r
+                        One or more different metadata models may be declared as\r
+                        child extensions of a metadata element.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-imMetadata:  Metadata.[ Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="schema" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="schemaversion" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any3535" />\r
+                </xs:sequence>\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Organizations.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        The organizations element is a container for all data structures \r
+                        that describe the way or ways that information encapsulated by \r
+                        its parent manifest element is structured. \r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents of binding of the child objects of ims-cp-imOrganizations: Organizations.[ Organization, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="organization" type="Organization.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="default" use="prohibited" type="defaultOrganizationProhibited" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Resources.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        The Resources element is a container for data structures containing \r
+                        references  to one or more assets.  Asset references may be grouped \r
+                        within a containing resources element in whatever manner seems best.\r
+                          \r
+                        The scope of referenced assets is specific to a resources element's parent \r
+                        manifest element only. \r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-imResources: Resources.[ Resource, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="resource" type="Resource.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute ref="xml:base" use="optional" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Organization.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An organization element is a container for all data structures relating \r
+                        to a particular way or view that information encapsulated by a \r
+                        grandparent manifest object is structured.  \r
+                        \r
+                        Multiple organization elements within the same parent organizations \r
+                        element are equivalent in purpose: Each shows a different way for \r
+                        structuring the same information declared within a grandparent \r
+                        manifest object.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-Organization: Organization[ Title, Item, Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="item" type="Item.Type4333" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="structure" use="required" type="rootedHierarchy" fixed="rooted-hierarchy" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <!--**Following element's attribute values altered by AP condition processing**-->\r
+<xs:complexType name="Resource.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A resource element is a container for a particular asset \r
+                        or collection of assets.  A resource may contain references \r
+                        to assets that are all of the same type or different types (i.e., file formats).\r
+                        \r
+                        The scope or boundary of an IMS Package is defined by the asset \r
+                        references collected into all resources containers associated with the\r
+                        root manifest element, whether as a child, direcdt descendant, or externally \r
+                        linked descendant. \r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:element name="file" type="File.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <!--**Following element's attribute values altered by AP condition processing**-->\r
+<xs:element name="dependency" type="Dependency.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="type" use="required" type="predefinedContentTypes" />\r
+                <xs:attribute ref="xml:base" use="optional" />\r
+                <xs:attribute name="href" use="optional" type="xs:anyURI" />\r
+                <xs:anyAttribute namespace="http://www.imsglobal.org/xsd/imsccauth_v1p0 http://www.imsglobal.org/xsd/imscp_extensionv1p2" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <!--**Following element's attribute values altered by AP condition processing**-->\r
+<xs:complexType name="Item.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An item element represents a structural node in a particular organization.  \r
+                        An item element may be a parent or sibling of other Item elements, \r
+                        each one representing a unique structural node.\r
+                        \r
+                        An organization has no meaning unless it has at least one Item element.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1" />\r
+                    <xs:element name="item" type="Item.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="identifierref" use="optional" type="xs:string" />\r
+                <xs:attribute name="isvisible" use="prohibited" type="NoIsVisible" />\r
+                <xs:attribute name="parameters" use="prohibited" type="NoParameters" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+<xs:complexType name="Item.Type4333">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        An item element represents a structural node in a particular organization.  \r
+                        An item element may be a parent or sibling of other Item elements, \r
+                        each one representing a unique structural node.\r
+                        \r
+                        An organization has no meaning unless it has at least one Item element.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="0" />\r
+                    <xs:element name="item" type="Item.Type" minOccurs="0" maxOccurs="unbounded" />\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="identifier" use="required" type="xs:ID" />\r
+                <xs:attribute name="identifierref" use="prohibited" type="NoIdentifierRef" />\r
+                <xs:attribute name="isvisible" use="prohibited" type="NoIsVisible" />\r
+                <xs:attribute name="parameters" use="prohibited" type="NoParameter" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="File.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A file element declares a reference to a single asset.  The reference may\r
+                        be relative to the Package containing the file element or absolute \r
+                        (external to the Package).\r
+                        \r
+                        A file element may contain child extensions declaring alternative references\r
+                         to the same asset as that referenced by the file element's href attribute.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-imFile: File.[ Metadata, Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <xs:attribute name="href" use="required" type="xs:anyURI" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="Dependency.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        A dependency element provides a way to associate another collection of \r
+                        asset references within the scope of the dependency element's parent \r
+                        resource element.\r
+                        \r
+                        This element allows the parsimonious declaration of asset references.  \r
+                        Shared asset references can be declared once and associated many \r
+                        times through a Dependency element.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-imDependency: Dependency.[ Extension ].</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:group ref="grpStrict.any" />\r
+                </xs:sequence>\r
+                <!--**Following element's attribute values altered by AP condition processing**-->\r
+<xs:attribute name="identifierref" use="required" type="xs:string" />\r
+                <xs:anyAttribute namespace="##other" processContents="strict" />\r
+            </xs:complexType>\r
+\r
+            <xs:complexType name="ManifestMetadata.Type">\r
+                <xs:annotation>\r
+                    <xs:documentation>\r
+                        This metadata element contains data structures that declare \r
+                        descriptive information about an entire Package.\r
+                        \r
+                        One or more different metadata models may be declared as\r
+                        child extensions of a metadata element.\r
+                        \r
+                        The schema and schemaversion children define the kind or collection \r
+                        of metadata models being used.\r
+\r
+                        <p xmlns="http://www.imsglobal.org/xsd/imscp_v1p1">Represents a binding of the kinds of child objects defined for ims-cp-imManifestMetadata:  ManifestMetadata.[ Schema, SchemaVersion, MetadataModel ]..</p>\r
+                    </xs:documentation>\r
+                </xs:annotation>\r
+                <xs:sequence>\r
+                    <xs:element name="schema" type="schemaFixed" minOccurs="1" maxOccurs="1" fixed="IMS Common Cartridge" />\r
+                    <xs:element name="schemaversion" type="schemaversionFixed" minOccurs="1" maxOccurs="1" fixed="1.0.0" />\r
+                    <xs:group ref="grpStrict.any4935" />\r
+                </xs:sequence>\r
+            </xs:complexType>\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the elements **********************************************************************  -->\r
+\r
+        <!-- =====================================  -->\r
+\r
+        <!-- Declaration of the root element(s) ***************************************************************  -->\r
+\r
+            <xs:element name="manifest" type="Manifest.Type" />\r
+\r
+        <!-- =====================================  -->\r
+\r
+</xs:schema>\r
diff --git a/docs/home/ims/imsdt_v1p0_localised.xsd b/docs/home/ims/imsdt_v1p0_localised.xsd
new file mode 100644 (file)
index 0000000..4fd9bfd
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  IPR, License and Distribution Notices\r
+  This machine readable file is derived from IMS specification IMS Common Cartridge Version 1.0 found at http://www.imsglobal.org/cc/index.html and the original IMS schema binding or code base       http://www.imsglobal.org/cc/.\r
+  \r
+  Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by the schema binding contained in this document.\r
+  \r
+  IMS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on IMS�s procedures with respect to rights in IMS specifications can be found at the IMS Intellectual Property Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.\r
+  \r
+  Copyright Â© IMS Global Learning Consortium 1999-2008. All Rights Reserved.\r
+  \r
+  License Notice for Users\r
+  Users of products or services that include this document are hereby granted a worldwide, royalty-free, non-exclusive license to use this document.\r
+  \r
+  Distribution Notice for Developers\r
+  Developers of products or services that are not original incorporators of this document and have not changed this document, that is, are distributing a software product that incorporates this document as is from a third-party source other than IMS, are hereby granted permission to copy, display and distribute the contents of this document in any medium for any purpose without fee or royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL copies, or portions thereof.\r
+  \r
+  Developers of products or services that are original incorporators of this document and wish to provide distribution of this document as is or with modifications and developers of products and services that are not original incorporators of this document and have changed this document, are required to register with the IMS community on the IMS website as described in the following two paragraphs:\r
+  \r
+  - If you wish to distribute this document as is, with no modifications, you are hereby granted permission to copy, display and distribute the contents of this document in any medium for any purpose without fee or royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL copies, or portions thereof, that you make and you complete a valid license registration with IMS and receive an email from IMS granting the license. To register, follow the instructions on the IMS website: http://www.imsglobal.org/specificationdownload.cfm. Once registered you are granted permission to transfer unlimited distribution rights of this document for the purposes of third-party or other distribution of your product or service that incorporates this document as long as this IPR, License and Distribution notice remains in place in its entirety.\r
+  \r
+  - If you wish to create and distribute a derived work from this document, you are hereby granted permission to copy, display and distribute the contents of the derived work in any medium for any purpose without fee or royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL copies, or portions thereof, that you make and you complete a valid profile registration with IMS and receive an email from IMS granting the license. To register, follow the instructions on the IMS website: http://www.imsglobal.org/profile/. Once registered you are granted permission to transfer unlimited distribution rights of the derived work for the purposes of third-party or other distribution of your product or service that incorporates the derived work as long as this IPR, License and Distribution notice remains in place in its entirety.\r
+  \r
+  The limited permissions granted above are perpetual and will not be revoked by IMS or its successors or assigns.\r
+  \r
+  THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, \r
+  ANY WARRANTY OF NONINFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION \r
+  SHALL BE MADE ENTIRELY AT THE IMPLEMENTER�S OWN RISK, AND NEITHER THE CONSORTIUM, NOR \r
+  ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER \r
+  OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING \r
+  FROM THE USE OF THIS SPECIFICATION.\r
+-->\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imsdt_v1p0.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imsdt_v1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/imsdt_v1p0" elementFormDefault="unqualified">\r
+\r
+  <xs:element name="topic" type="topicType" />\r
+  <xs:complexType name="topicType">\r
+    <xs:sequence>\r
+      <xs:element name="title" type="xs:string" />\r
+      <xs:element name="text">\r
+        <xs:complexType>\r
+          <xs:simpleContent>\r
+            <xs:extension base="xs:string">\r
+              <xs:attribute name="texttype" type="textTypeType" default="text/plain" />\r
+            </xs:extension>\r
+          </xs:simpleContent>\r
+        </xs:complexType>\r
+      </xs:element>\r
+      <xs:element name="attachments" minOccurs="0">\r
+        <xs:complexType>\r
+          <xs:sequence>\r
+            <xs:element name="attachment" minOccurs="1" maxOccurs="unbounded">\r
+              <xs:complexType>\r
+                <xs:attribute name="href" type="xs:string" use="required" />\r
+              </xs:complexType>\r
+            </xs:element>\r
+          </xs:sequence>\r
+        </xs:complexType>\r
+      </xs:element>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+  <xs:simpleType name="textTypeType">\r
+    <xs:restriction base="xs:string">\r
+      <xs:enumeration value="text/html" />\r
+      <xs:enumeration value="text/plain" />\r
+    </xs:restriction>\r
+  </xs:simpleType>\r
+</xs:schema>\r
diff --git a/docs/home/ims/imsmanifest.xml b/docs/home/ims/imsmanifest.xml
new file mode 100644 (file)
index 0000000..175e7fb
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<manifest identifier="_37634FB7-01E4-C5F3-582A-F55E1A824A63" xmlns="http://www.imsglobal.org/xsd/_imscp_v1p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 http://www.imsglobal.org/xsd/imscp_v1p1.xsd http://ltsc.ieee.org/xsd/LOM domainProfile_0/lomStrict_localised.xsd">\r
+       <metadata>\r
+               <schema>IMS Common Cartridge</schema>\r
+               <schemaversion>1.0.0</schemaversion>\r
+       </metadata>\r
+       <organizations>\r
+               <organization identifier="_FE501A0A-9129-D906-B763-83050C0FA8D5" structure="rooted-hierarchy">\r
+                       <item identifier="_42F6AF00-DA58-4682-104C-26CF58CE5FF0">\r
+                               <item identifier="_0C3A14A9-E414-2C85-3450-33A5DB6B8F3C">\r
+                                       <title>Common Cartridge Sample Course</title>\r
+                                       <item identifier="_4278D199-B977-FBC4-2AA1-0DA6D2975BFB" identifierref="_33C55BF7-B5FC-D87B-7280-42BF7AD8577B">\r
+                                               <title>Generate Unique ID Values</title>\r
+                                       </item>\r
+                                       <item identifier="_2A8C2679-0124-149B-06AA-6E70D16BE38F" identifierref="_74D675B3-AE6D-36E4-841C-C0FE9460725E" isvisible="false">\r
+                                               <title>Test Bank</title>\r
+                                       </item>\r
+                                       <item identifier="_928A181C-113F-B1BA-B3B8-321B4EBF4024" identifierref="_56B1BEDC-A820-7AA8-A21D-F32017189445">\r
+                                               <title>Quiz</title>\r
+                                       </item>\r
+                                       <item identifier="_7B1E5C0E-8102-6D92-6DE0-DD372CF183B8" identifierref="_5923CEF3-7885-E805-59BC-858B9549B80E">\r
+                                               <title>WebLink - Google Site</title>\r
+                                       </item>\r
+                                       <item identifier="_7D7CB887-3570-759B-9E2F-9F6919B67B47" identifierref="_DB2AE381-2B95-D659-859E-ECAA65352912">\r
+                                               <title>Arctic Fox</title>\r
+                                       </item>\r
+                               </item>\r
+                       </item>\r
+               </organization>\r
+       </organizations>\r
+       <resources>\r
+               <resource identifier="_33C55BF7-B5FC-D87B-7280-42BF7AD8577B" type="webcontent" href="33C55BF7-B5FC-D87B-7280-42BF7AD8577B/33C55BF7-B5FC-D87B-7280-42BF7AD8577B.html">\r
+                       <file href="33C55BF7-B5FC-D87B-7280-42BF7AD8577B/33C55BF7-B5FC-D87B-7280-42BF7AD8577B.html"/>\r
+               </resource>\r
+               <resource identifier="_74D675B3-AE6D-36E4-841C-C0FE9460725E" type="imsqti_xmlv1p2/imscc_xmlv1p0/question-bank">\r
+                       <file href="74D675B3-AE6D-36E4-841C-C0FE9460725E/74D675B3-AE6D-36E4-841C-C0FE9460725E.xml"/>\r
+               </resource>\r
+               <resource identifier="_56B1BEDC-A820-7AA8-A21D-F32017189445" type="imsqti_xmlv1p2/imscc_xmlv1p0/assessment">\r
+                       <file href="56B1BEDC-A820-7AA8-A21D-F32017189445/56B1BEDC-A820-7AA8-A21D-F32017189445.xml"/>\r
+               </resource>\r
+               <resource identifier="_5923CEF3-7885-E805-59BC-858B9549B80E" type="imswl_xmlv1p0">\r
+                       <file href="5923CEF3-7885-E805-59BC-858B9549B80E/5923CEF3-7885-E805-59BC-858B9549B80E.xml"/>\r
+               </resource>\r
+               <resource identifier="_DB2AE381-2B95-D659-859E-ECAA65352912" type="imsdt_xmlv1p0">\r
+                       <file href="DB2AE381-2B95-D659-859E-ECAA65352912/DB2AE381-2B95-D659-859E-ECAA65352912.xml"/>\r
+                       <dependency identifierref="_E2F2AA0E-4B4A-9DD1-20A7-90034AF71745"/>\r
+                       <dependency identifierref="_71E08B51-4D95-8FEC-BD8F-D7E3253E9843"/>\r
+               </resource>\r
+               <resource identifier="_E2F2AA0E-4B4A-9DD1-20A7-90034AF71745" type="associatedcontent/imscc_xmlv1p0/learning-application-resource">\r
+                       <file href="images/arcticfoxsmall.jpg"/>\r
+               </resource>\r
+               <resource identifier="_71E08B51-4D95-8FEC-BD8F-D7E3253E9843" type="webcontent">\r
+                       <file href="images/arcticfoxfull.jpg"/>\r
+               </resource>\r
+       </resources>\r
+</manifest>\r
diff --git a/docs/home/ims/imswl_v1p0_localised.xsd b/docs/home/ims/imswl_v1p0_localised.xsd
new file mode 100644 (file)
index 0000000..88f14ba
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imswl_v1p0.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<!--\r
+  IPR, License and Distribution Notices\r
+  This machine readable file is derived from IMS specification IMS Common Cartridge Version 1.0 found at http://www.imsglobal.org/cc/index.html and the original IMS schema binding or code base       http://www.imsglobal.org/cc/.\r
+  \r
+  Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by the schema binding contained in this document.\r
+  \r
+  IMS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on IMS�s procedures with respect to rights in IMS specifications can be found at the IMS Intellectual Property Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.\r
+  \r
+  Copyright Â© IMS Global Learning Consortium 1999-2008. All Rights Reserved.\r
+  \r
+  License Notice for Users\r
+  Users of products or services that include this document are hereby granted a worldwide, royalty-free, non-exclusive license to use this document.\r
+  \r
+  Distribution Notice for Developers\r
+  Developers of products or services that are not original incorporators of this document and have not changed this document, that is, are distributing a software product that incorporates this document as is from a third-party source other than IMS, are hereby granted permission to copy, display and distribute the contents of this document in any medium for any purpose without fee or royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL copies, or portions thereof.\r
+  \r
+  Developers of products or services that are original incorporators of this document and wish to provide distribution of this document as is or with modifications and developers of products and services that are not original incorporators of this document and have changed this document, are required to register with the IMS community on the IMS website as described in the following two paragraphs:\r
+  \r
+  - If you wish to distribute this document as is, with no modifications, you are hereby granted permission to copy, display and distribute the contents of this document in any medium for any purpose without fee or royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL copies, or portions thereof, that you make and you complete a valid license registration with IMS and receive an email from IMS granting the license. To register, follow the instructions on the IMS website: http://www.imsglobal.org/specificationdownload.cfm. Once registered you are granted permission to transfer unlimited distribution rights of this document for the purposes of third-party or other distribution of your product or service that incorporates this document as long as this IPR, License and Distribution notice remains in place in its entirety.\r
+  \r
+  - If you wish to create and distribute a derived work from this document, you are hereby granted permission to copy, display and distribute the contents of the derived work in any medium for any purpose without fee or royalty provided that you include this IPR, License and Distribution notice in its entirety on ALL copies, or portions thereof, that you make and you complete a valid profile registration with IMS and receive an email from IMS granting the license. To register, follow the instructions on the IMS website: http://www.imsglobal.org/profile/. Once registered you are granted permission to transfer unlimited distribution rights of the derived work for the purposes of third-party or other distribution of your product or service that incorporates the derived work as long as this IPR, License and Distribution notice remains in place in its entirety.\r
+  \r
+  The limited permissions granted above are perpetual and will not be revoked by IMS or its successors or assigns.\r
+  \r
+  THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, \r
+  ANY WARRANTY OF NONINFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION \r
+  SHALL BE MADE ENTIRELY AT THE IMPLEMENTER�S OWN RISK, AND NEITHER THE CONSORTIUM, NOR \r
+  ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER \r
+  OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING \r
+  FROM THE USE OF THIS SPECIFICATION.\r
+-->\r
+<!--*************************************************************************-->\r
+<!--** This schema has been modified from the original base schema named - **-->\r
+<!--** imswl_v1p0.xsd                                                      **-->\r
+<!--** using the IMS SchemaProf tool. This tool is based on software from  **-->\r
+<!--** the TELCERT Project which was funded in part by the European        **-->\r
+<!--** Commission under contract IST-507128                                **-->\r
+<!--*************************************************************************-->\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imswl_v1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.imsglobal.org/xsd/imswl_v1p0" elementFormDefault="unqualified">\r
+  <xs:element name="webLink" type="webLinkType"/>\r
+  <xs:complexType name="webLinkType">\r
+    <xs:sequence>\r
+      <xs:element name="title" type="xs:string"/>\r
+      <xs:element name="url">\r
+        <xs:complexType>\r
+          <xs:attribute name="href" type="xs:string" use="required"/>\r
+          <xs:attribute name="target" type="xs:string"/>\r
+          <xs:attribute name="windowFeatures" type="xs:string"/>\r
+        </xs:complexType>\r
+      </xs:element>\r
+    </xs:sequence>\r
+  </xs:complexType>\r
+</xs:schema>
\ No newline at end of file
diff --git a/docs/home/ims/index.php b/docs/home/ims/index.php
new file mode 100644 (file)
index 0000000..5e3814f
--- /dev/null
@@ -0,0 +1,191 @@
+<?php
+/****************************************************************/
+/* ATutor                                                                                                              */
+/****************************************************************/
+/* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg        */
+/* Adaptive Technology Resource Centre / University of Toronto  */
+/* http://atutor.ca                                                                                            */
+/*                                                              */
+/* 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.                               */
+/****************************************************************/
+// $Id: index.php 8901 2009-11-11 19:10:19Z cindy $
+
+define('AT_INCLUDE_PATH', '../../include/');
+require(AT_INCLUDE_PATH.'vitals.inc.php');
+
+require(AT_INCLUDE_PATH.'header.inc.php');
+
+if (!isset($_main_menu)) {
+       $_main_menu = $contentManager->getContent();
+}
+
+function print_menu_sections(&$menu, $parent_content_id = 0, $depth = 0, $ordering = '') {
+       $my_children = $menu[$parent_content_id];
+       $cid = $_GET['cid'];
+
+       if (!is_array($my_children)) {
+               return;
+       }
+       foreach ($my_children as $children) {
+               /* test content association, we don't want to display the test pages
+                * as part of the menu section.  If test, skip it.
+                */
+               if (isset($children['test_id'])){
+                       continue;
+               }
+
+               echo '<option value="'.$children['content_id'].'"';
+               if ($cid == $children['content_id']) {
+                       echo ' selected="selected"';
+               }
+               echo '>';
+               echo str_pad('', $depth, '-') . ' ';
+               if ($parent_content_id == 0) {
+                       $new_ordering = $children['ordering'];
+                       echo $children['ordering'];
+               } else {
+                       $new_ordering = $ordering.'.'.$children['ordering'];
+                       echo $ordering . '.'. $children['ordering'];
+               }
+               echo ' '.$children['title'].'</option>';
+
+               print_menu_sections($menu, $children['content_id'], $depth+1, $new_ordering);
+       }
+}
+
+if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'none')) {
+       echo '<p>'._AT('content_packaging_disabled').'</p>';
+       require (AT_INCLUDE_PATH.'footer.inc.php'); 
+       exit;
+} else if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN) && ($_SESSION['packaging'] == 'top')) {
+       $_main_menu = array($_main_menu[0]);
+}
+?>
+<form name="exportForm" method="post" action="tools/ims/ims_export.php">
+<div class="input-form">
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('export_content'); ?></legend>
+       <div class="row">
+               <p><?php echo _AT('export_content_info'); ?></p>
+       </div>
+
+<?php if ($_main_menu[0]): ?>
+       <div class="row">
+               <label for="select_cid"><?php echo _AT('export_content_package_what'); ?></label><br />
+               <select name="cid" id="select_cid">
+                       <option value="0"><?php echo _AT('export_entire_course_or_chap'); ?></option>
+                       <option value="0"></option>
+                       <?php
+                               print_menu_sections($_main_menu);
+                       ?>
+               </select>
+       </div>
+
+       <?php if (authenticate(AT_PRIV_ADMIN, AT_PRIV_RETURN)): ?>
+                       <div class="row">
+                               <input type="radio" name="export_as" id="to_cp" value="1" checked="checked" onclick="changeFormAction('cp');" />
+                               <label for="to_cp"><?php echo _AT('content_package'); ?></label> <br />
+                               <input type="radio" name="export_as" id="to_cc" value="1" onclick="changeFormAction('cc');" />
+                               <label for="to_cc"><?php echo _AT('common_cartridge'); ?> </label>
+                       </div>
+                       <div class="row">
+                               <!--<input type="checkbox" name="to_tile" id="to_tile" value="1" />
+                               <label for="to_tile"><?php echo _AT('tile_export'); ?></label> <br /> -->
+                               <input type="checkbox" name="to_a4a" id="to_a4a" value="1" />
+                               <label for="to_a4a"><?php echo _AT('a4a_export'); ?></label>
+                       </div>
+       <?php endif; ?>
+       
+       <div class="row buttons">
+               <input type="submit" name="submit" value="<?php echo _AT('export'); ?>" />
+               <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
+       </div>
+       </fieldset>
+<?php else: ?>
+       <div class="row">
+               <strong><?php echo _AT('none_found'); ?></strong>
+       </div>
+<?php endif; ?>
+
+</div>
+</form>
+
+<?php if (!authenticate(AT_PRIV_CONTENT, AT_PRIV_RETURN)) {
+               require (AT_INCLUDE_PATH.'footer.inc.php'); 
+               exit;
+}
+?>
+<br /><br />
+
+
+<form name="form1" method="post" action="tools/ims/ims_import.php" enctype="multipart/form-data" onsubmit="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php');">
+<div class="input-form">
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('import_content'); ?></legend>
+       <div class="row">
+
+               <p><?php echo _AT('import_content_info'); ?></p>
+       </div>
+
+       <div class="row">
+               <label for="select_cid2"><?php echo _AT('import_content_package_where'); ?></label><br />
+               <select name="cid" id="select_cid2">
+                       <option value="0"><?php echo _AT('import_content_package_bottom_subcontent'); ?></option>
+                       <option value="0"></option>
+                       <?php
+                               print_menu_sections($_main_menu);
+                       ?>
+               </select>
+       </div>
+
+       <div class="row">
+               <input type="checkbox" name="allow_test_import" id="allow_test_import" checked="checked" />
+               <label for="allow_test_import"><?php echo _AT('test_import_package'); ?></label> <br />
+               <input type="checkbox" name="allow_a4a_import" id="allow_a4a_import" checked="checked" />
+               <label for="allow_a4a_import"><?php echo _AT('a4a_import_package'); ?></label>          
+       </div>
+       
+       <div class="row">
+               <label for="to_file"><?php echo _AT('upload_content_package'); ?></label><br />
+               <input type="file" name="file" id="to_file" />
+       </div>
+
+       <div class="row">
+               <label for="to_url"><?php echo _AT('specify_url_to_content_package'); ?></label><br />
+               <input type="text" name="url" value="http://" size="40" id="to_url" />
+       </div>
+
+       <div class="row buttons">
+               <input type="submit" name="submit" onclick="setClickSource('submit');" value="<?php echo _AT('import'); ?>" />
+               <input type="submit" name="cancel" onclick="document.form1.enctype='';setClickSource('cancel');" value="<?php echo _AT('cancel'); ?>" />
+       </div>
+</div>
+</form>
+
+<script language="javascript" type="text/javascript">
+
+var but_src;
+function setClickSource(name) {
+       but_src = name;
+}
+
+function openWindow(page) {
+       if (but_src != "cancel") {
+               newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
+               newWindow.focus();
+       }
+}
+
+//Change form action 
+function changeFormAction(type){
+       var obj = document.exportForm;
+       if (type=="cc"){
+               obj.action = "home/imscc/ims_export.php";
+       } else if (type=="cp"){
+               obj.action = "home/ims/ims_export.php";
+       }
+}
+
+</script>
+
+<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/home/ims/main.xsd b/docs/home/ims/main.xsd
new file mode 100644 (file)
index 0000000..bf8511c
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<xs:schema xmlns    ="http://dummy.libxml2.validator"
+    targetNamespace ="http://dummy.libxml2.validator"
+    xmlns:xs        ="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsi       ="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:imscp     ="http://www.imsglobal.org/xsd/imscc/imscp_v1p1"
+    xmlns:imslom    ="http://ltsc.ieee.org/xsd/imscc/LOM"
+    xmlns:lom       ="http://ltsc.ieee.org/xsd/LOM"
+    xmlns:cc        ="http://www.imsglobal.org/xsd/imsccauth_v1p0"
+    xmlns:qti      ="http://www.imsglobal.org/xsd/ims_qtiasiv1p2"
+    xmlns:wl       ="http://www.imsglobal.org/xsd/imswl_v1p0"
+    xmlns:dt       ="http://www.imsglobal.org/xsd/imsdt_v1p0"  
+    xmlns:glossary  ="http://www.atutor.ca/xsd/glossary"       
+    version="1.0"
+    elementFormDefault  ="qualified"
+    attributeFormDefault="unqualified"   
+    >
+   
+    <xs:import namespace ="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" schemaLocation = "imscp_v1p2_localised.xsd"                     />
+    <xs:import namespace ="http://ltsc.ieee.org/xsd/imscc/LOM"            schemaLocation = "domainProfile_1/lomLoose_localised.xsd"       />
+    <xs:import namespace ="http://ltsc.ieee.org/xsd/LOM"                  schemaLocation = "domainProfile_2/lomLoose_localised.xsd"       />
+    <xs:import namespace ="http://www.imsglobal.org/xsd/imsccauth_v1p0"   schemaLocation = "domainProfile_0/imsccauth_v1p0_localised.xsd" />
+    <xs:import namespace ="http://www.imsglobal.org/xsd/ims_qtiasiv1p2"   schemaLocation = "domainProfile_4/ims_qtiasiv1p2_localised.xsd" />
+    <xs:import namespace ="http://www.imsglobal.org/xsd/imswl_v1p0"      schemaLocation = "imswl_v1p0_localised.xsd"                     />    
+    <xs:import namespace ="http://www.imsglobal.org/xsd/imsdt_v1p0"      schemaLocation = "imsdt_v1p0_localised.xsd"                     />    
+    <xs:import namespace ="http://www.atutor.ca/xsd/glossary"            schemaLocation = "glossary.xsd"                                 />    
+</xs:schema>
diff --git a/docs/home/ims/ns.inc.php b/docs/home/ims/ns.inc.php
new file mode 100644 (file)
index 0000000..a0b031a
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/****************************************************************/
+/* ATutor                                                                                                              */
+/****************************************************************/
+/* Copyright (c) 2002-2008                                     */
+/* Adaptive Technology Resource Centre / University of Toronto  */
+/* http://atutor.ca                                                                                            */
+/*                                                              */
+/* 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.                               */
+/****************************************************************/
+// $Id: ims_import.php 8766 2009-08-07 01:39:05Z hwong $
+
+/**
+ * Version 1.0 -IMS Common Cartridge Final Namespaces to Schema Locations
+ * http://www.imsglobal.org/cc/index.html
+ * IMS test packages are different than the ones specified in the specification, which should we follow?  
+ * Following the online specification = failing the test
+ * Following the test = failing the online specification.
+ * Both of them are from IMS CC.
+ */
+
+/*
+$ns['http://www.imsglobal.org/xsd/imscp_v1p1'] =       'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/imscp_v1p2.xsd';
+$ns['http://www.imsglobal.org/xsd/imscc/imscp_v1p1'] = 'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/imscp_v1p2_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/imsccauth_v1p0'] =   'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_0/imsccauth_v1p0_localised.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM'] =            'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_1/lomLoose_localised.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM/unique'] =     'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_1/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM/vocab'] =      'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_1/vocab/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM/extend'] =     'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_1/extend/custom.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM'] =                  'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_2/lomLoose_localised.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM/unique'] =           'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_2/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM/vocab'] =            'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_2/vocab/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM/extend'] =           'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_2/extend/custom.xsd';
+$ns['http://www.imsglobal.org/xsd/imscp_extensionv1p2'] = 'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_3/imscp_extensionv1p2_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/ims_qtiasiv1p2'] =   'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_4/ims_qtiasiv1p2_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/imswl_v1p0'] =       'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_5/imswl_v1p0_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/imsdt_v1p0'] =       'http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_6/imsdt_v1p0_localised.xsd';
+*/
+
+$ns['http://www.imsglobal.org/xsd/imscp_v1p1'] =       'http://www.imsglobal.org/profile/cc/ccv1p0/imscp_v1p2.xsd';
+$ns['http://www.imsglobal.org/xsd/imscc/imscp_v1p1'] = 'http://www.imsglobal.org/profile/cc/ccv1p0/imscp_v1p2_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/imsccauth_v1p0'] =   'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_0/imsccauth_v1p0_localised.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM'] =            'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_2/lomLoose_localised.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM/unique'] =     'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_1/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM/vocab'] =      'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_1/vocab/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/imscc/LOM/extend'] =     'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_1/extend/custom.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM'] =                  'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_1/lomLoose_localised.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM/unique'] =           'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_2/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM/vocab'] =            'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_2/vocab/loose.xsd';
+$ns['http://ltsc.ieee.org/xsd/LOM/extend'] =           'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_2/extend/custom.xsd';
+$ns['http://www.imsglobal.org/xsd/imscp_extensionv1p2'] = 'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_3/imscp_extensionv1p2_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/ims_qtiasiv1p2'] = 'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_4/ims_qtiasiv1p2_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/imswl_v1p0'] =       'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_5/imswl_v1p0_localised.xsd';
+$ns['http://www.imsglobal.org/xsd/imsdt_v1p0'] =       'http://www.imsglobal.org/profile/cc/ccv1p0/domainProfile_6/imsdt_v1p0_localised.xsd';
+
+
+//Content packages
+$ns_cp['http://www.imsproject.org/xsd/imscp_rootv1p1p2'] = 'imscp_rootv1p1p2.xsd';
+$ns_cp['http://www.imsglobal.org/xsd/imsmd_rootv1p2p1'] = 'imsmd_rootv1p2p1.xsd';
+$ns_cp['http://www.adlnet.org/xsd/adlcp_rootv1p2'] = 'adlcp_rootv1p2.xsd';
+$ns_cp['http://www.imsglobal.org/xsd/imscp_v1p1'] = 'http://www.imsglobal.org/xsd/imscp_v1p1p4.xsd';
+$ns_cp['http://www.imsglobal.org/xsd/imsmd_v1p2'] = 'http://www.imsglobal.org/xsd/imsmd_v1p2p2.xsd';
+$ns_cp['http://www.imsglobal.org/xsd/imsqti_item_v2p0'] = 'http://www.imsglobal.org/xsd/imsqti_item_v2p0.xsd';
+
+?>
diff --git a/docs/home/imscc/ims_export.php b/docs/home/imscc/ims_export.php
new file mode 100644 (file)
index 0000000..4f939a7
--- /dev/null
@@ -0,0 +1,343 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../../include/');
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+
+require_once(TR_INCLUDE_PATH.'../home/classes/ContentManager.class.php');  /* content management class */
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/UsersDAO.class.php');
+
+if (!isset($_REQUEST['course_id']))
+{
+       $msg->addError('MISSING_COURSE_ID');
+       header('Location: ../index.php');
+       exit;   
+}
+
+/* content id of an optional chapter */
+$course_id = $_REQUEST['course_id'];
+$cid = isset($_REQUEST['cid']) ? intval($_REQUEST['cid']) : 0;
+$c   = isset($_REQUEST['c'])   ? intval($_REQUEST['c'])   : 0;
+
+if (isset($_REQUEST['to_tile']) && !isset($_POST['cancel'])) {
+       /* for TILE */
+
+       /* redirect to TILE import servlet */
+
+       require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+       if (!authenticate(TR_PRIV_ADMIN, TR_PRIV_RETURN)) {
+               /* user can't be authenticated */
+               header('HTTP/1.1 404 Not Found');
+               echo 'Document not found.';
+               exit;
+       }
+
+       $m = md5(DB_PASSWORD . 'x' . ADMIN_PASSWORD . 'x' . $_SERVER['SERVER_ADDR'] . 'x' . $cid . 'x' . $_SESSION['course_id'] . 'x' . date('Ymd'));
+
+       header('Location: '.TR_TILE_IMPORT. '?cp='.urlencode(TR_BASE_HREF. 'tools/imscc/ims_export.php?cid='.$cid.'&c='.$_SESSION['course_id'].'&m='.$m));
+       exit;
+} else if (isset($_GET['m'])) {
+       /* for TILE */
+
+       /* request (hopefully) coming from a TILE server, send the content package */
+
+       $_user_location = 'public';
+//     require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+       $m = md5(DB_PASSWORD . 'x' . ADMIN_PASSWORD . 'x' . $_SERVER['SERVER_ADDR'] . 'x' . $cid . 'x' . $c . 'x' . date('Ymd'));
+       if (($m != $_GET['m']) || !$c) {
+               header('HTTP/1.1 404 Not Found');
+               echo 'Document not found.';
+               exit;
+       }
+       
+       $course_id = $c;
+} else {
+       $use_a4a = false;
+       if (isset($_REQUEST['to_a4a'])){
+               $use_a4a = true;
+       } 
+//     require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+//     $course_id = $_SESSION['course_id'];
+}
+//load the following after vitals is included
+require_once(TR_INCLUDE_PATH.'classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'classes/A4a/A4aExport.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Weblinks/Weblinks.class.php');
+require_once(TR_INCLUDE_PATH.'classes/Weblinks/WeblinksExport.class.php');
+
+$use_cc                         = true;
+
+$coursesDAO = new CoursesDAO();
+$course_row = $coursesDAO->get($course_id);
+
+$contentManager = new ContentManager($course_id);
+
+$instructor_id   = $course_row['user_id'];
+$course_desc     = htmlspecialchars($course_row['description'], ENT_QUOTES, 'UTF-8');
+$course_title    = htmlspecialchars($course_row['title'], ENT_QUOTES, 'UTF-8');
+$course_language = $course_row['primary_language'];
+
+$courseLanguage =& $languageManager->getLanguage($course_language);
+
+//If course language cannot be found, use UTF-8 English
+//@author harris, Oct 30,2008
+if (!isset($courseLanguage) || $courseLanguage == null){
+       $courseLanguage =& $languageManager->getLanguage(DEFAULT_LANGUAGE_CODE);
+}
+
+$course_language_charset = $courseLanguage->getCharacterSet();
+$course_language_code = $courseLanguage->getCode();
+
+require_once(TR_INCLUDE_PATH.'classes/zipfile.class.php');                             /* for zipfile */
+require_once(TR_INCLUDE_PATH.'classes/vcard.php');                                             /* for vcard */
+require_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');       /* for XML_HTMLSax */
+require_once(TR_INCLUDE_PATH.'imscc/ims_template.inc.php');                            /* for ims templates + print_organizations() */
+
+if (isset($_POST['cancel'])) {
+       $msg->addFeedback('EXPORT_CANCELLED');
+       header('Location: ../index.php');
+       exit;
+}
+
+$zipfile = new zipfile(); 
+$zipfile->create_dir('resources/');
+
+/*
+       the following resources are to be identified:
+       even if some of these can't be images, they can still be files in the content dir.
+       theoretically the only urls we wouldn't deal with would be for a <!DOCTYPE and <form>
+
+       img             => src
+       a               => href                         // ignore if href doesn't exist (ie. <a name>)
+       object  => data | classid       // probably only want data
+       applet  => classid | archive                    // whatever these two are should double check to see if it's a valid file (not a dir)
+       link    => href
+       script  => src
+       form    => action
+       input   => src
+       iframe  => src
+
+*/
+class MyHandler {
+    function MyHandler(){}
+    function openHandler(& $parser,$name,$attrs) {
+               global $my_files;
+
+               $name = strtolower($name);
+               $attrs = array_change_key_case($attrs, CASE_LOWER);
+
+               $elements = array(      'img'           => 'src',
+                                                       'a'                     => 'href',                              
+                                                       'object'        => array('data', 'classid'),
+                                                       'applet'        => array('classid', 'archive'),
+                                                       'link'          => 'href',
+                                                       'script'        => 'src',
+                                                       'form'          => 'action',
+                                                       'input'         => 'src',
+                                                       'iframe'        => 'src',
+                                                       'embed'         => 'src',
+                                                       'param'         => 'value');
+       
+               /* check if this attribute specifies the files in different ways: (ie. java) */
+               if (is_array($elements[$name])) {
+                       $items = $elements[$name];
+
+                       foreach ($items as $item) {
+                               if ($attrs[$item] != '') {
+
+                                       /* some attributes allow a listing of files to include seperated by commas (ie. applet->archive). */
+                                       if (strpos($attrs[$item], ',') !== false) {
+                                               $files = explode(',', $attrs[$item]);
+                                               foreach ($files as $file) {
+                                                       $my_files[] = trim($file);
+                                               }
+                                       } else {
+                                               $my_files[] = $attrs[$item];
+                                       }
+                               }
+                       }
+               } else if (isset($elements[$name]) && ($attrs[$elements[$name]] != '')) {
+                       /* we know exactly which attribute contains the reference to the file. */
+                       $my_files[] = $attrs[$elements[$name]];
+               }
+    }
+    function closeHandler(& $parser,$name) { }
+}
+
+/* get all the content */
+$content = array();
+$paths  = array();
+$top_content_parent_id = 0;
+
+$handler=new MyHandler();
+$parser = new XML_HTMLSax();
+$parser->set_object($handler);
+$parser->set_element_handler('openHandler','closeHandler');
+
+$contentDAO = new ContentDAO();
+$rows = $contentDAO->getContentByCourseID($course_id);
+
+//if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN)) {
+//     $sql = "SELECT *, UNIX_TIMESTAMP(last_modified) AS u_ts FROM ".TABLE_PREFIX."content WHERE course_id=$course_id ORDER BY content_parent_id, ordering";
+//} else {
+//     $sql = "SELECT *, UNIX_TIMESTAMP(last_modified) AS u_ts FROM ".TABLE_PREFIX."content WHERE course_id=$course_id ORDER BY content_parent_id, ordering";
+//}
+//$result = mysql_query($sql, $db);
+
+$cid = $_REQUEST['cid'];  //takes care of some system which lost the REQUEST[cid]
+//while ($row = mysql_fetch_assoc($result)) {
+//     if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN) || $contentManager->isReleased($row['content_id']) === TRUE) {
+if (is_array($rows)) {
+       foreach ($rows as $row) {
+               $content[$row['content_parent_id']][] = $row;
+               if ($cid == $row['content_id']) {
+                       $top_content = $row;
+                       $top_content_parent_id = $row['content_parent_id'];
+               }
+       }
+}
+
+if ($cid) {
+       /* filter out the top level sections that we don't want */
+       $top_level = $content[$top_content_parent_id];
+       foreach($top_level as $page) {
+               if ($page['content_id'] == $cid) {
+                       $content[$top_content_parent_id] = array($page);
+               } else {
+                       /* this is a page we don't want, so might as well remove it's children too */
+                       unset($content[$page['content_id']]);
+               }
+       }
+       $ims_course_title = $course_title . ' - ' . $content[$top_content_parent_id][0]['title'];
+} else {
+       $ims_course_title = $course_title;
+}
+
+$imsmanifest_xml = str_replace(array('{COURSE_TITLE}', '{COURSE_DESCRIPTION}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}'), 
+                                                         array($ims_course_title, $course_desc, $course_language_charset, $course_language_code),
+                                                         $ims_template_xml['header']);
+//debug($imsmanifest_xml);
+//exit;
+
+/* get the first content page to default the body frame to */
+$first = $content[$top_content_parent_id][0];
+
+$test_ids = array();   //global array to store all the test ids
+
+// Modified by Cindy Qi Li on Jan 12, 2010
+// Transformable does not have glossary and forums (discussion tools)
+//TODO**************BOLOGNA***************REMOVE ME***************************/
+/*
+//Exoprt Forum:
+global $forum_list;
+$forum_list = array();
+
+// generate the resources and save the HTML files
+$used_glossary_terms = array();
+ob_start();
+print_organizations($top_content_parent_id, $content, 0, '', array(), $toc_html);
+
+//Exoprt Forum:
+print_resources_forum();
+
+$organizations_str = ob_get_contents();
+ob_end_clean();
+if (count($used_glossary_terms)) {
+       $used_glossary_terms = array_unique($used_glossary_terms);
+       sort($used_glossary_terms);
+       reset($used_glossary_terms);
+       $terms_xml = '';
+       foreach ($used_glossary_terms as $term) {
+               $term_key = htmlspecialchars($term, ENT_QUOTES, 'UTF-8');
+               $glossary[$term_key] = htmlentities($glossary[$term_key], ENT_QUOTES, 'UTF-8');
+               $glossary[$term_key] = str_replace('&', '&amp;', $glossary[$term_key]);
+               $terms_xml .= str_replace(      array('{TERM}', '{DEFINITION}'),
+                                                                       array($term_key, $glossary[$term_key]),
+                                                                       $glossary_term_xml);
+       }
+       $glossary_xml = str_replace(array('{GLOSSARY_TERMS}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}'),
+                                                           array($terms_xml, $course_language_charset),
+                                                               $glossary_xml);
+       //add to resource
+       $resources .= $ims_template_xml['resource_glossary'];
+} else {
+       unset($glossary_xml);
+}
+
+if ($glossary_xml){
+       $glossary_manifest_xml = $ims_template_xml['glossary'];
+} else {
+       $glossary_manifest_xml = '';
+}
+*/
+ob_start();
+print_organizations($top_content_parent_id, $content, 0, '', array(), $toc_html);
+
+//Exoprt Forum:
+//print_resources_forum();
+
+$organizations_str = ob_get_contents();
+ob_end_clean();
+// end of modified by Cindy Qi Li on Jan 12, 2010
+
+/* append the Organizations and Resources to the imsmanifest */
+$imsmanifest_xml .= str_replace(       array('{ORGANIZATIONS}', '{GLOSSARY}',  '{RESOURCES}', '{TEST_ITEMS}', '{COURSE_TITLE}'),
+                                                                       array($organizations_str, $glossary_manifest_xml,       $resources, $test_xml_items, $ims_course_title),
+                                                                       $ims_template_xml['final']);
+
+// generate the vcard for the instructor/author
+$usersDAO = new UsersDAO();
+$row = $usersDAO->getUserByID($instructor_id);
+//$sql = "SELECT first_name, last_name, email, website, login, phone FROM ".TABLE_PREFIX."members WHERE member_id=$instructor_id";
+//$result = mysql_query($sql, $db);
+$vcard = new vCard();
+if (isset($row)) {
+       $vcard->setName($row['last_name'], $row['first_name'], $row['login']);
+       $vcard->setEmail($row['email']);
+       $vcard->setNote('Originated from an ATutor at '.TR_BASE_HREF.'. See ATutor.ca for additional information.');
+       $vcard->setURL($row['website']);
+
+       $imsmanifest_xml = str_replace('{VCARD}', $vcard->getVCard(), $imsmanifest_xml);
+} else {
+       $imsmanifest_xml = str_replace('{VCARD}', '', $imsmanifest_xml);
+}
+
+/* save the imsmanifest.xml file */
+$zipfile->add_file($imsmanifest_xml, 'imsmanifest.xml');
+
+/* Commented by Cindy Qi Li on Jan 12, 2010
+// Transformable does not have glossary and forums (discussion tools)
+if ($glossary_xml) {
+       $zipfile->create_dir('resources/GlossaryItem/');
+       $zipfile->add_file($glossary_xml,  'resources/GlossaryItem/glossary.xml');
+}
+*/
+
+$zipfile->close(); // this is optional, since send_file() closes it anyway
+
+$ims_course_title = str_replace(array(' ', ':'), '_', $ims_course_title);
+/**
+ * A problem here with the preg_replace below.
+ * Originally was designed to remove all werid symbols to avoid file corruptions.
+ * In UTF-8, all non-english chars are considered to be 'werid symbols'
+ * We can still replace it as is, or add fileid to the filename to avoid these problems
+ * Well then again people won't be able to tell what this file is about
+ * If we are going to take out the preg_replace, some OS might not be able to understand
+ * these characters and will have problems importing.
+ */
+$ims_course_title = preg_replace("{[^a-zA-Z0-9._-]}","", trim($ims_course_title));
+$zipfile->send_file($ims_course_title . '_imscc');
+
+exit;
+?>
index 2c8c3d7..482e5b1 100644 (file)
 
 define('TR_INCLUDE_PATH', '../include/');
 require(TR_INCLUDE_PATH.'vitals.inc.php');
-require(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
-require(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');
 
 global $_current_user;
 
-$coursesDAO = new CoursesDAO();
 $userCoursesDAO = new UserCoursesDAO();
 
 if (isset($_GET['action'], $_GET['cid']) && $_SESSION['user_id'] > 0)
@@ -25,46 +23,21 @@ if (isset($_GET['action'], $_GET['cid']) && $_SESSION['user_id'] > 0)
        $cid = intval($_GET['cid']);
        
        if ($_GET['action'] == 'remove') $userCoursesDAO->Delete($_SESSION['user_id'], $cid);
+       if ($_GET['action'] == 'add') $userCoursesDAO->Create($_SESSION['user_id'], $cid, TR_USERROLE_VIEWER, 0);
 }
 
 // retrieve data to display
 if ($_SESSION['user_id'] > 0) {
-       // get my authoring courses
-       $my_authoring_courses = $coursesDAO->getAuthoringCourses($_SESSION['user_id']);
-       if (is_array($my_authoring_courses))
-       {
-               foreach ($my_authoring_courses as $course)
-               {
-                       $course['my_own_course'] = 1;
-                       $my_courses[] = $course;
-               }
-       }
-       
-       // get courses that are authored by others
-       $other_ppl_courses = $userCoursesDAO->getByUserID($_SESSION['user_id']); 
-       if (is_array($other_ppl_courses))
-       {
-               foreach ($other_ppl_courses as $course)
-               {
-                       $course['my_own_course'] = 0;
-                       $other_courses[] = $course;
-               }
-       }
-       
-       // merge my courses and other ppl's courses
-       if (is_array($my_courses) && is_array($other_courses)) $courses = array_merge($my_courses, $other_courses);
-       else if (is_array($my_courses)) $courses = $my_courses;
-       else $courses = $other_courses;
+       $my_courses = $userCoursesDAO->getByUserID($_SESSION['user_id']); 
 }
 
-
-if (is_array($courses))
+if (is_array($my_courses))
 {
        $curr_page_num = intval($_GET['p']);
        if (!$curr_page_num) {
                $curr_page_num = 1;
        }       
-       $savant->assign('courses', $courses);
+       $savant->assign('courses', $my_courses);
        $savant->assign('curr_page_num', $curr_page_num);
        $savant->assign('title', _AT('my_courses'));
        
diff --git a/docs/home/lib/test_result_functions.inc.php b/docs/home/lib/test_result_functions.inc.php
new file mode 100644 (file)
index 0000000..711e4b6
--- /dev/null
@@ -0,0 +1,216 @@
+<?php
+/****************************************************************/
+/* ATutor                                                                                                              */
+/****************************************************************/
+/* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg        */
+/* Adaptive Technology Resource Centre / University of Toronto  */
+/* http://atutor.ca                                                                                            */
+/*                                                              */
+/* 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.                               */
+/****************************************************************/
+// $Id: test_result_functions.inc.php 8901 2009-11-11 19:10:19Z cindy $
+
+if (!defined('AT_INCLUDE_PATH')) { exit; }
+
+// if a valid user, then can come from the DB, otherwise
+// this might come from _POST or even _SESSION
+function get_test_result_id($test_id, &$max_pos) {
+       global $db;
+
+       if ($_SESSION['member_id']) {
+               $sql    = "SELECT result_id, max_pos FROM ".TABLE_PREFIX."tests_results WHERE test_id=$test_id AND member_id='{$_SESSION['member_id']}' AND status=0";
+       } else if ($_SESSION['test_result_id']) {
+               // guest with on-going test
+               $sql    = "SELECT result_id, max_pos FROM ".TABLE_PREFIX."tests_results WHERE test_id=$test_id AND result_id={$_SESSION['test_result_id']} AND status=0";
+       } else {
+               return 0; // new guest
+       }
+
+       $result = mysql_query($sql, $db);
+       if ($row = mysql_fetch_assoc($result)) {
+               $max_pos = $row['max_pos'];
+               return $row['result_id'];
+       }
+
+       return 0;
+}
+
+function init_test_result_questions($test_id, $is_random, $num_questions, $mid) {
+       global $db;
+
+       $sql    = "INSERT INTO ".TABLE_PREFIX."tests_results VALUES (NULL, $test_id, '".$mid."', NOW(), '', 0, NOW(), 0)";
+       $result = mysql_query($sql, $db);
+       $result_id = mysql_insert_id($db);
+
+       if ($is_random) {
+               // Retrieve 'num_questions' question_id randomly from those who are related to this test_id
+
+               $non_required_questions = array();
+               $required_questions     = array();
+
+               $sql    = "SELECT question_id, required FROM ".TABLE_PREFIX."tests_questions_assoc WHERE test_id=$test_id";
+               $result = mysql_query($sql, $db);
+       
+               while ($row = mysql_fetch_assoc($result)) {
+                       if ($row['required'] == 1) {
+                               $required_questions[] = $row['question_id'];
+                       } else {
+                               $non_required_questions[] = $row['question_id'];
+                       }
+               }
+       
+               $num_required = count($required_questions);
+               if ($num_required < max(1, $num_questions)) {
+                       shuffle($non_required_questions);
+                       $required_questions = array_merge($required_questions, array_slice($non_required_questions, 0, $num_questions - $num_required));
+               }
+
+               $random_id_string = implode(',', $required_questions);
+
+               $sql = "SELECT TQ.*, TQA.* FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id={$_SESSION['course_id']} AND TQA.test_id=$test_id AND TQA.question_id IN ($random_id_string) ORDER BY TQ.question_id";
+       } else {
+               $sql = "SELECT TQ.*, TQA.* FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id={$_SESSION['course_id']} AND TQA.test_id=$test_id ORDER BY TQA.ordering, TQA.question_id";
+       }
+
+       // $sql either gets a random set of questions (if $test_row['random']) ordered by 'question_id'
+       // or the set of all questions for this test (sorted by 'ordering').
+       $result = mysql_query($sql, $db);
+       while ($row = mysql_fetch_assoc($result)) {
+               $sql    = "INSERT INTO ".TABLE_PREFIX."tests_answers VALUES ($result_id, {$row['question_id']}, {$_SESSION['member_id']}, '', '', '')";
+               mysql_query($sql, $db);
+       }
+
+       return $result_id;
+}
+
+// $num_questions must be greater than or equal to $row_required['cnt'] + $row_optional['cnt']
+function get_total_weight($tid, $num_questions = null) {
+       global $db;
+    $sql = "SELECT SUM(weight) AS weight, COUNT(*) AS cnt FROM ".TABLE_PREFIX."tests_questions_assoc WHERE test_id=$tid AND required = '1' GROUP BY required";
+    $result = mysql_query($sql, $db);
+    $row_required = mysql_fetch_assoc($result);
+
+    $sql = "SELECT SUM(weight) AS weight, COUNT(*) AS cnt FROM ".TABLE_PREFIX."tests_questions_assoc WHERE test_id=$tid AND required = '0' GROUP BY required";
+    $result = mysql_query($sql, $db);
+       $row_optional = mysql_fetch_assoc($result);
+       
+       $total_weight = 0;
+
+       if ($num_questions == null) {
+               $total_weight = $row_required['weight'] + $row_optional['weight'];
+       } else if ($row_optional['cnt'] > 0) {
+               $total_weight = $row_required['weight'] + ($row_optional['weight'] / $row_optional['cnt']) * min($num_questions - $row_required['cnt'], $row_optional['cnt']);
+       }
+
+       return $total_weight;
+}
+
+// returns T/F whether or not this member can view this test:
+function authenticate_test($tid) {
+       if (authenticate(AT_PRIV_ADMIN, AT_PRIV_RETURN)) {
+               return TRUE;
+       }
+       if (!$_SESSION['enroll']) {
+               return FALSE;
+       }
+       global $db;
+
+       $sql    = "SELECT approved FROM ".TABLE_PREFIX."course_enrollment WHERE member_id=$_SESSION[member_id] AND course_id=$_SESSION[course_id] AND approved='y'";
+       $result = mysql_query($sql, $db);
+       if (!($row = mysql_fetch_assoc($result))) {
+               return FALSE;
+       }
+
+       $sql    = "SELECT group_id FROM ".TABLE_PREFIX."tests_groups WHERE test_id=$tid";
+       $result = mysql_query($sql, $db);
+       if (mysql_num_rows($result) == 0) {
+               // not limited to any group; everyone has access:
+               return TRUE;
+       }
+       while ($row = mysql_fetch_assoc($result)) {
+               $sql     = "SELECT * FROM ".TABLE_PREFIX."groups_members WHERE group_id=$row[group_id] AND member_id=$_SESSION[member_id]";
+               $result2 = mysql_query($sql, $db);
+
+               if ($row2 = mysql_fetch_assoc($result2)) {
+                       return TRUE;
+               }
+       }
+
+       //Check assistants privileges
+       $sql = "SELECT privileges FROM at_course_enrollment a WHERE member_id=$_SESSION[member_id] AND course_id=$_SESSION[course_id]";
+       $result = mysql_query($sql, $db);
+       if ($result){
+               list($privileges) = mysql_fetch_array($result);
+               if (query_bit($privileges, AT_PRIV_GROUPS) && query_bit($privileges, AT_PRIV_TESTS)){
+                       return TRUE;
+               }
+
+       }
+
+       return FALSE;
+}
+
+function print_question_cats($cat_id = 0) {    
+
+       global $db;
+
+       echo '<option value="0"';
+       if ($cat_id == 0) {
+               echo ' selected="selected"';
+       }
+       echo '>'._AT('cats_uncategorized').'</option>' . "\n";
+
+       $sql    = 'SELECT * FROM '.TABLE_PREFIX.'tests_questions_categories WHERE course_id='.$_SESSION['course_id'].' ORDER BY title';
+       $result = mysql_query($sql, $db);
+
+       while ($row = mysql_fetch_array($result)) {
+               echo '<option value="'.$row['category_id'].'"';
+               if ($row['category_id'] == $cat_id) {
+                       echo ' selected="selected"';
+               }
+               echo '>'.$row['title'].'</option>'."\n";
+       }
+}
+
+function print_VE ($area) {
+?>
+       <script type="text/javascript" language="javascript">
+               document.writeln('<a href="#" onclick="javascript:window.open(\'<?php echo AT_BASE_HREF; ?>tools/tests/form_editor.php?area=<?php echo $area; ?>\',\'newWin1\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=640,height=480\'); return false;" style="cursor: pointer; text-decoration: none" ><?php echo _AT('use_visual_editor'); ?></a>');
+       </script>
+
+<?php
+       //possibley add a <noscript> link to filemanager with target="_blank"
+}
+
+function get_random_outof($test_id, $result_id) {      
+       global $db;
+       $total = 0;
+
+       $sql    = 'SELECT SUM(Q.weight) AS weight FROM '.TABLE_PREFIX.'tests_questions_assoc Q, '.TABLE_PREFIX.'tests_answers A WHERE Q.test_id='.$test_id.' AND Q.question_id=A.question_id AND A.result_id='.$result_id;
+
+       $result = mysql_query($sql, $db);
+
+       if ($row = mysql_fetch_assoc($result)) {
+               return $row['weight'];
+       }
+
+       return 0;
+}
+
+// return the next guest id
+function get_next_guest_id()
+{
+       global $db;
+       
+       $sql = "SELECT max(cast(substring(guest_id,3) as unsigned))+1 next_guest_id FROM ".TABLE_PREFIX."guests";
+       $result = mysql_query($sql, $db);
+       $row = mysql_fetch_assoc($result);
+
+       if ($row["next_guest_id"] == "")  // first guest id
+               return "G_0";
+       else
+               return "G_". $row["next_guest_id"];
+}
+?>
\ No newline at end of file
diff --git a/docs/home/prog.php b/docs/home/prog.php
new file mode 100644 (file)
index 0000000..df10ee8
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+sleep(1);
+
+define('TR_INCLUDE_PATH', '../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+session_write_close();
+if ($_GET['tile']) {
+       $lang_variable = 'tile_progress';
+} else {
+       $lang_variable = 'upload_progress';
+}
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html lang="<?php echo $myLang->getCode(); ?>">
+<head>
+       <title><?php echo _AT($lang_variable); ?></title>
+       <?php if ($_GET['frame']) { ?>
+               <META HTTP-EQUIV="refresh" content="3;URL=prog.php?frame=1"> 
+       <?php } ?>
+       <link rel="stylesheet" href="<?php echo $_base_path; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/styles.css" type="text/css" />
+       <meta http-equiv="Content-Type" content="text/html; <?php echo $myLang->getCharacterSet(); ?>" />
+</head>
+<body <?php
+       if ($_SESSION['done']) {
+               echo 'onload="parent.window.close();"';
+       }
+?>>
+<?php 
+if (!$_GET['frame']) {  ?>
+&nbsp;<a href="javascript:window.close();"><?php echo _AT('close'); ?></a>
+<h3><?php echo _AT($lang_variable); ?></h3>
+<p><small><?php echo _AT('window_auto_close'); ?></small></p>
+
+<br /><br />
+<table border="0" align="center">
+<tr>
+       <td><img src="<?php echo TR_BASE_HREF; ?>images/transfer.gif" height="20" width="90" alt="<?php echo _AT($lang_variable); ?>"></td>
+       <td valign="middle"><iframe src="home/prog.php?frame=1" width="100" height="25" frameborder="0" scrolling="no" marginwidth="0" marginheight="1">
+</iframe>
+<?php } else { 
+       $tmp_dir = ini_get('upload_tmp_dir') . DIRECTORY_SEPARATOR;
+       if (!$_GET['t']) {
+               $newest_file_name = '';
+               $newest_file_time = 0;
+               // get the name of the temp file.
+               if ($dir = @opendir($tmp_dir)) {
+                       while (($file = readdir($dir)) !== false) {
+                               if ((strlen($file) == 9) && (substr($file, 0, 3) == 'php')) {
+                                       $filedata = stat($tmp_dir . $file);
+                                       if ($filedata['mtime'] > $newest_file_time) {
+                                               $newest_file_time = $filedata['mtime'];
+                                               $newest_file_name = $file;
+                                               $size = $filedata['size'] / 1024;
+                                       }
+                               }
+                       }
+                       closedir($dir);
+               }
+       } else {
+               $filedata = stat($tmp_dir . $_GET['t']);
+               $size = $filedata['size'] / TR_KBYTE_SIZE;
+       }
+       // not sure where these are displayed in the progress popup
+       echo '<small>';
+       if ($size == '') {
+               echo '<em>'._AT('unknown').' </em>  '._AT('kb');
+       } else {
+               echo number_format($size, 2).' '._AT('kb');
+       }
+       echo '</small>';
+} ?></td>
+</tr>
+</table>
+</body>
+</html>
diff --git a/docs/home/search.php b/docs/home/search.php
new file mode 100644 (file)
index 0000000..66dfa25
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+define('TR_INCLUDE_PATH', '../include/');
+require(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');
+
+global $_current_user;
+
+if (trim($_GET['search_text'] == ''))
+{
+       global $msg;
+       $msg->addError('NO_SEARCH_TEXT');
+       
+       header('Location: index.php?id='.$ids);
+}
+
+$coursesDAO = new CoursesDAO();
+$userCoursesDAO = new UserCoursesDAO();
+
+$my_courses = array();
+$search_text = trim($_GET['search_text']);
+$results = $coursesDAO->getSearchResult($search_text);
+
+// handle submits
+if (isset($_GET['action'], $_GET['cid']) && $_SESSION['user_id'] > 0)
+{
+       $cid = intval($_GET['cid']);
+       
+       if ($_GET['action'] == 'remove') $userCoursesDAO->Delete($_SESSION['user_id'], $cid);
+       if ($_GET['action'] == 'add') $userCoursesDAO->Create($_SESSION['user_id'], $cid, TR_USERROLE_VIEWER, 0);
+}
+
+// -- display results
+// no results found
+if (!is_array($results))
+{
+       $savant->assign('title', _AT("results"));
+       $savant->assign('search_text', $search_text);
+       $savant->assign('courses', '');
+       $savant->display('home/index_course.tmpl.php');
+       exit;
+}
+
+// retrieve data to display
+if ($_SESSION['user_id'] > 0) {
+       // get login user's authoring courses
+       $my_courses = $userCoursesDAO->getByUserID($_SESSION['user_id']);
+       
+       if (is_array($my_courses))
+       {
+               foreach ($my_courses as $course)
+                       $my_courses[$course['course_id']] = $course['role'];
+       }
+}      
+       
+foreach ($results as $result)
+{
+       if (isset($my_courses[$result['course_id']]))
+               $result['role'] = $my_courses[$result['course_id']];
+       else
+               $result['role'] = NULL;
+       
+       $courses[] = $result;
+}
+
+if (is_array($courses))
+{
+       $curr_page_num = intval($_GET['p']);
+       if (!$curr_page_num) {
+               $curr_page_num = 1;
+       }       
+       
+       $savant->assign('title', _AT("results"));
+       $savant->assign('courses', $courses);
+       $savant->assign('curr_page_num', $curr_page_num);
+       $savant->assign('search_text', $search_text);
+       
+       $savant->display('home/index_course.tmpl.php');
+}
+
+?>
\ No newline at end of file
diff --git a/docs/images/action_add.png b/docs/images/action_add.png
deleted file mode 100644 (file)
index d91b835..0000000
Binary files a/docs/images/action_add.png and /dev/null differ
diff --git a/docs/images/action_delete.png b/docs/images/action_delete.png
deleted file mode 100644 (file)
index c779804..0000000
Binary files a/docs/images/action_delete.png and /dev/null differ
diff --git a/docs/images/arrow_back.png b/docs/images/arrow_back.png
new file mode 100644 (file)
index 0000000..2a8890e
Binary files /dev/null and b/docs/images/arrow_back.png differ
diff --git a/docs/images/arrow_next.png b/docs/images/arrow_next.png
new file mode 100644 (file)
index 0000000..a1dafb9
Binary files /dev/null and b/docs/images/arrow_next.png differ
diff --git a/docs/images/medit.gif b/docs/images/medit.gif
new file mode 100644 (file)
index 0000000..4c78649
Binary files /dev/null and b/docs/images/medit.gif differ
diff --git a/docs/images/mfolder.gif b/docs/images/mfolder.gif
new file mode 100644 (file)
index 0000000..e800f88
Binary files /dev/null and b/docs/images/mfolder.gif differ
diff --git a/docs/images/mlock.gif b/docs/images/mlock.gif
new file mode 100644 (file)
index 0000000..079583e
Binary files /dev/null and b/docs/images/mlock.gif differ
diff --git a/docs/images/mpage.gif b/docs/images/mpage.gif
new file mode 100644 (file)
index 0000000..6f2a1aa
Binary files /dev/null and b/docs/images/mpage.gif differ
diff --git a/docs/images/mswitch_minus.gif b/docs/images/mswitch_minus.gif
new file mode 100644 (file)
index 0000000..959a5c2
Binary files /dev/null and b/docs/images/mswitch_minus.gif differ
diff --git a/docs/images/mswitch_plus.gif b/docs/images/mswitch_plus.gif
new file mode 100644 (file)
index 0000000..84ac353
Binary files /dev/null and b/docs/images/mswitch_plus.gif differ
diff --git a/docs/images/tree/Thumbs.db b/docs/images/tree/Thumbs.db
new file mode 100644 (file)
index 0000000..39a20af
Binary files /dev/null and b/docs/images/tree/Thumbs.db differ
diff --git a/docs/images/tree/index.html b/docs/images/tree/index.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/docs/images/tree/tree_collapse.gif b/docs/images/tree/tree_collapse.gif
new file mode 100644 (file)
index 0000000..1f05065
Binary files /dev/null and b/docs/images/tree/tree_collapse.gif differ
diff --git a/docs/images/tree/tree_disabled.gif b/docs/images/tree/tree_disabled.gif
new file mode 100644 (file)
index 0000000..7893680
Binary files /dev/null and b/docs/images/tree/tree_disabled.gif differ
diff --git a/docs/images/tree/tree_end.gif b/docs/images/tree/tree_end.gif
new file mode 100644 (file)
index 0000000..1eead99
Binary files /dev/null and b/docs/images/tree/tree_end.gif differ
diff --git a/docs/images/tree/tree_expand.gif b/docs/images/tree/tree_expand.gif
new file mode 100644 (file)
index 0000000..b25feba
Binary files /dev/null and b/docs/images/tree/tree_expand.gif differ
diff --git a/docs/images/tree/tree_horizontal.gif b/docs/images/tree/tree_horizontal.gif
new file mode 100644 (file)
index 0000000..c654fb6
Binary files /dev/null and b/docs/images/tree/tree_horizontal.gif differ
diff --git a/docs/images/tree/tree_space.gif b/docs/images/tree/tree_space.gif
new file mode 100644 (file)
index 0000000..33c60e5
Binary files /dev/null and b/docs/images/tree/tree_space.gif differ
diff --git a/docs/images/tree/tree_split.gif b/docs/images/tree/tree_split.gif
new file mode 100644 (file)
index 0000000..e89ce80
Binary files /dev/null and b/docs/images/tree/tree_split.gif differ
diff --git a/docs/images/tree/tree_vertline.gif b/docs/images/tree/tree_vertline.gif
new file mode 100644 (file)
index 0000000..5420936
Binary files /dev/null and b/docs/images/tree/tree_vertline.gif differ
diff --git a/docs/images/x.gif b/docs/images/x.gif
new file mode 100644 (file)
index 0000000..2a0056f
Binary files /dev/null and b/docs/images/x.gif differ
index 33b6821..b243bf6 100644 (file)
@@ -32,16 +32,17 @@ class A4a {
 
        // Return resources type hash mapping.
        function getResourcesType($type_id=0){
-               global $db;
-
                $type_id = intval($type_id);
 
                //if this is the first time calling this function, grab the list from db
                if (empty($resource_types)){
-                       $sql = 'SELECT * FROM '.TABLE_PREFIX.'resource_types';
-                       $result = mysql_query($sql, $db);
-                       while ($row = mysql_fetch_assoc($result)){
-                               $this->resource_types[$row['type_id']] = $row['type'];
+                       include(TR_INCLUDE_PATH.'classes/DAO/ResourceTypesDAO.class.php');
+                       $resourceTypesDAO = new ResourceTypesDAO();
+                       $rows = $resourceTypesDAO->getAll();
+                       
+                       if (is_array($rows))
+                       {
+                               foreach ($rows as $row) $this->resource_types[$row['type_id']] = $row['type'];
                        }
                }
 
@@ -54,13 +55,14 @@ class A4a {
        
        // Get primary resources
        function getPrimaryResources(){
-               global $db;
-
                $pri_resources = array(); // cid=>[resource, language code]
-               $sql = 'SELECT * FROM '.TABLE_PREFIX.'primary_resources WHERE content_id='.$this->cid;
-               $result = mysql_query($sql, $db);
-               if (mysql_numrows($result) > 0){
-                       while ($row = mysql_fetch_assoc($result)){
+
+               include(TR_INCLUDE_PATH.'classes/DAO/PrimaryResourcesDAO.class.php');
+               $primaryResourcesDAO = new PrimaryResourcesDAO();
+               $rows = $primaryResourcesDAO->getByContent($this->cid);
+               
+               if (is_array($rows)){
+                       foreach ($rows as $row) {
                                $pri_resources[$row['primary_resource_id']]['resource'] = $row['resource'];
                                if ($row['language_code'] != ''){
                                        $pri_resources[$row['primary_resource_id']]['language_code'] = $row['language_code'];
@@ -73,8 +75,6 @@ class A4a {
 
        // Get primary resources types
        function getPrimaryResourcesTypes($pri_resource_id=0){
-               global $db;
-
                $pri_resource_id = intval($pri_resource_id);
 
                //quit if id not specified
@@ -83,10 +83,13 @@ class A4a {
                }
 
                $pri_resources_types = array(); // cid=>[type id]+
-               $sql = 'SELECT * FROM '.TABLE_PREFIX.'primary_resources_types WHERE primary_resource_id='.$pri_resource_id;
-               $result = mysql_query($sql, $db);
-               if ($result){
-                       while ($row = mysql_fetch_assoc($result)){
+               
+               include(TR_INCLUDE_PATH.'classes/DAO/PrimaryResourcesTypesDAO.class.php');
+               $primaryResourcesTypesDAO = new PrimaryResourcesTypesDAO();
+               $rows = $primaryResourcesTypesDAO->getByResourceID($pri_resource_id);
+               
+               if (is_array($rows)){
+                       foreach ($rows as $row) {
                                $pri_resources_types[$pri_resource_id][] = $row['type_id'];
                        }
                }
@@ -106,10 +109,12 @@ class A4a {
                }
 
                $sec_resources = array(); // cid=>[resource, language code]
-               $sql = 'SELECT * FROM '.TABLE_PREFIX.'secondary_resources WHERE primary_resource_id='.$pri_resource_id;
-               $result = mysql_query($sql, $db);
-               if ($result){
-                       while ($row = mysql_fetch_assoc($result)){
+               include(TR_INCLUDE_PATH.'classes/DAO/SecondaryResourcesDAO.class.php');
+               $secondaryResourcesDAO = new SecondaryResourcesDAO();
+               $rows = $secondaryResourcesDAO->getByPrimaryResourceID($pri_resource_id);
+               
+               if (is_array($rows)){
+                       foreach ($rows as $row) {
                                $sec_resources[$row['secondary_resource_id']]['resource'] = $row['secondary_resource'];
                                if ($row['language_code'] != ''){
                                        $sec_resources[$row['secondary_resource_id']]['language_code'] = $row['language_code'];
@@ -122,8 +127,6 @@ class A4a {
 
        // Get secondary resources types
        function getSecondaryResourcesTypes($sec_resource_id=0){
-               global $db;
-
                $sec_resource_id = intval($sec_resource_id);
 
                //quit if id not specified
@@ -132,10 +135,12 @@ class A4a {
                }
 
                $sec_resources_types = array(); // cid=>[type id]+
-               $sql = 'SELECT * FROM '.TABLE_PREFIX.'secondary_resources_types WHERE secondary_resource_id='.$sec_resource_id;
-               $result = mysql_query($sql, $db);
-               if ($result){
-                       while ($row = mysql_fetch_assoc($result)){
+               include(TR_INCLUDE_PATH.'classes/DAO/SecondaryResourcesTypesDAO.class.php');
+               $secondaryResourcesTypesDAO = new SecondaryResourcesTypesDAO();
+               $rows = $secondaryResourcesTypesDAO->getByResourceID($sec_resource_id);
+               
+               if (is_array($rows)){
+                       foreach ($rows as $row) {
                                $sec_resources_types[] = $row['type_id'];
                        }
                }
@@ -146,15 +151,10 @@ class A4a {
        // Insert primary resources into the db
        // @return primary resource id.
        function setPrimaryResource($content_id, $file_name, $lang){
-               global $addslashes, $db; 
-
-               $content_id = intval($content_id);
-               $file_name = $addslashes($file_name);
-               $lang = $addslashes($lang);
-
-               $sql = "INSERT INTO ".TABLE_PREFIX."primary_resources SET content_id=$content_id, resource='$file_name', language_code='$lang'";
-               $result = mysql_query($sql, $db);
-               if ($result){
+               include(TR_INCLUDE_PATH.'classes/DAO/PrimaryResourcesDAO.class.php');
+               $primaryResourcesDAO = new PrimaryResourcesDAO();
+               
+               if ($primaryResourcesDAO->Create($content_id, $file_name, $lang)){
                        return mysql_insert_id();
                }
                return false;
@@ -162,27 +162,17 @@ class A4a {
 
        // Insert primary resource type
        function setPrimaryResourceType($primary_resource_id, $type_id){
-               global $db; 
-
-               $primary_resource_id= intval($primary_resource_id);
-               $type_id = intval($type_id);
-
-               $sql = "INSERT INTO ".TABLE_PREFIX."primary_resources_types SET primary_resource_id=$primary_resource_id, type_id=$type_id";
-               $result = mysql_query($sql, $db);
+               include(TR_INCLUDE_PATH.'classes/DAO/PrimaryResourcesTypesDAO.class.php');
+               $primaryResourcesTypesDAO = new PrimaryResourcesTypesDAO();
+               $primaryResourcesTypesDAO->Create($primary_resource_id, $type_id);
        }
 
        // Insert secondary resource
        // @return secondary resource id
        function setSecondaryResource($primary_resource_id, $file_name, $lang){
-               global $addslashes, $db; 
-
-               $primary_resource_id = intval($primary_resource_id);
-               $file_name = $addslashes($file_name);
-               $lang = $addslashes($lang);
-
-               $sql = "INSERT INTO ".TABLE_PREFIX."secondary_resources SET primary_resource_id=$primary_resource_id, secondary_resource='$file_name', language_code='$lang'";
-               $result = mysql_query($sql, $db);
-               if ($result){
+               include(TR_INCLUDE_PATH.'classes/DAO/SecondaryResourcesDAO.class.php');
+               $secondaryResourcesDAO = new SecondaryResourcesDAO();
+               if ($secondaryResourcesDAO->Create($primary_resource_id, $file_name, $lang)){
                        return mysql_insert_id();
                }
                return false;
@@ -190,13 +180,9 @@ class A4a {
 
        // Insert secondary resource
        function setSecondaryResourceType($secondary_resource, $type_id){
-               global $db;
-
-               $secondary_resource = intval($secondary_resource);
-               $type_id = intval($type_id);
-
-               $sql = "INSERT INTO ".TABLE_PREFIX."secondary_resources_types SET secondary_resource_id=$secondary_resource, type_id=$type_id";
-               $result = mysql_query($sql, $db);
+               include(TR_INCLUDE_PATH.'classes/DAO/SecondaryResourcesTypesDAO.class.php');
+               $secondaryResourcesTypesDAO = new SecondaryResourcesTypesDAO();
+               $secondaryResourcesTypesDAO->Create($secondary_resource, $type_id);
        }
 
        
@@ -208,32 +194,9 @@ class A4a {
 
        // Delete all materials associated with this content
        function deleteA4a(){
-               global $db; 
-
-               $pri_resource_ids = array();
-
-               // Get all primary resources ID out that're associated with this content
-               $sql = 'SELECT a.primary_resource_id FROM '.TABLE_PREFIX.'primary_resources a LEFT JOIN '.TABLE_PREFIX.'primary_resources_types b ON a.primary_resource_id=b.primary_resource_id WHERE content_id='.$this->cid;
-               $result = mysql_query($sql);
-
-               while($row=mysql_fetch_assoc($result)){
-                       $pri_resource_ids[] = $row['primary_resource_id'];
-               }
-
-               //If the are primary resources found
-               if (!empty($pri_resource_ids)){
-                       $glued_pri_ids = implode(",", $pri_resource_ids);
-
-                       // Delete all secondary a4a
-                       $sql = 'DELETE c, d FROM '.TABLE_PREFIX.'secondary_resources c LEFT JOIN '.TABLE_PREFIX.'secondary_resources_types d ON c.secondary_resource_id=d.secondary_resource_id WHERE primary_resource_id IN ('.$glued_pri_ids.')';
-                       $result = mysql_query($sql);
-
-                       // If successful, remove all primary resources
-                       if ($result){
-                               $sql = 'DELETE a, b FROM '.TABLE_PREFIX.'primary_resources a LEFT JOIN '.TABLE_PREFIX.'primary_resources_types b ON a.primary_resource_id=b.primary_resource_id WHERE content_id='.$this->cid;
-                               mysql_query($sql);
-                       }
-               }
+               include(TR_INCLUDE_PATH.'classes/DAO/PrimaryResourcesDAO.class.php');
+               $primaryResourcesDAO = new PrimaryResourcesDAO();
+               $rows = $primaryResourcesDAO->Delete($this->cid);
        }
 }
 
index 6251ff8..8cf3b34 100644 (file)
@@ -10,8 +10,8 @@
 /* as published by the Free Software Foundation.                        */
 /************************************************************************/
 
-require_once(AT_INCLUDE_PATH.'classes/A4a/A4a.class.php');
-//require(AT_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
+require_once(TR_INCLUDE_PATH.'classes/A4a/A4a.class.php');
+//require(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
 
 /**
  * Accessforall Export class.
@@ -74,11 +74,15 @@ class A4aExport extends A4a {
                global $db;
                $secondary_files = array();
 
-               $sql = "SELECT DISTINCT secondary_resource FROM ".TABLE_PREFIX."primary_resources a LEFT JOIN ".TABLE_PREFIX."secondary_resources s
-                               ON a.primary_resource_id = s.primary_resource_id WHERE content_id=".$this->cid;
-               $result = mysql_query ($sql);
-               if ($result){
-                       while ($row = mysql_fetch_assoc($result)){
+               include(TR_INCLUDE_PATH.'classes/DAO/SecondaryResourcesDAO.class.php');
+               $secondaryResourcesDAO = new SecondaryResourcesDAO();
+               $rows = $secondaryResourcesDAO->getByContent($this->cid);
+//             $sql = "SELECT DISTINCT secondary_resource FROM ".TABLE_PREFIX."primary_resources a LEFT JOIN ".TABLE_PREFIX."secondary_resources s
+//                             ON a.primary_resource_id = s.primary_resource_id WHERE content_id=".$this->cid;
+//             $result = mysql_query ($sql);
+
+               if (is_array($rows)){
+                       foreach ($rows as $row) {
                                if (!empty($row['secondary_resource'])){
                                        $secondary_files[] = $row['secondary_resource'];
                                }
@@ -128,12 +132,12 @@ class A4aExport extends A4a {
                                                $orig_access_mode[] = $this->getResourceNameById($type_id);
                                        }
                                        $savant->assign('orig_access_mode', $orig_access_mode);
-                                       $xml_array[$id.' to '.$uri] = $savant->fetch(AT_INCLUDE_PATH.'classes/A4a/A4a.tmpl.php');
+                                       $xml_array[$id.' to '.$uri] = $savant->fetch(TR_INCLUDE_PATH.'classes/A4a/A4a.tmpl.php');
                                }
                        } else {
                                $savant->assign('primary_resource_uri', '');
                                $savant->assign('primary_resources', '');
-                               $xml_array[$id] = $savant->fetch(AT_INCLUDE_PATH.'classes/A4a/A4a.tmpl.php');
+                               $xml_array[$id] = $savant->fetch(TR_INCLUDE_PATH.'classes/A4a/A4a.tmpl.php');
                        }
                }
                return $xml_array;
index b56d0c7..8c1dc03 100644 (file)
@@ -10,7 +10,7 @@
 /* as published by the Free Software Foundation.                        */
 /************************************************************************/
 
-require_once(AT_INCLUDE_PATH.'classes/A4a/A4a.class.php');
+require_once(TR_INCLUDE_PATH.'classes/A4a/A4a.class.php');
 
 /**
  * Accessforall Import  class.
diff --git a/docs/include/classes/DAO/ContentDAO.class.php b/docs/include/classes/DAO/ContentDAO.class.php
new file mode 100644 (file)
index 0000000..40c15f6
--- /dev/null
@@ -0,0 +1,271 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class ContentDAO extends DAO {
+
+       /**
+        * Create new content
+        * @access  public
+        * @param   
+        * @return  user id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Create($course_id, $content_parent_id, $ordering, $last_modified, $revision, $formatting, $keywords, 
+                              $content_path, $title, $text, $head, $use_customized_head, $test_message, 
+                              $allow_test_export, $content_type)
+       {
+//             global $addslashes;
+//
+//             $keywords = $addslashes(strtolower(trim($keywords)));
+//             $title = $addslashes(strtolower(trim($title)));
+//             $text = $addslashes(strtolower(trim($text)));
+//             $head = $addslashes(strtolower(trim($head)));
+               
+               if ($this->isFieldsValid($course_id, $title))
+               {
+                       /* insert into the db */
+                       $sql = "INSERT INTO ".TABLE_PREFIX."content
+                                     (course_id,
+                                      content_parent_id,
+                                      ordering,
+                                      last_modified,
+                                      revision,
+                                      formatting,
+                                      keywords,
+                                      content_path,
+                                      title,
+                                      text,
+                                      head,
+                                      use_customized_head,
+                                      test_message,
+                                      allow_test_export,
+                                      content_type
+                                      )
+                              VALUES (".$course_id.",
+                                      ".$content_parent_id.",
+                                      ".$ordering.",
+                                      '".$last_modified."', 
+                                      ".$revision.",
+                                      ".$formatting.",
+                                      '".$keywords."',
+                                      '".$content_path."', 
+                                      '".$title."',
+                                      '".$text."',
+                                      '".$head."',
+                                      ".$use_customized_head.",
+                                      '".$test_message."',
+                                      ".$allow_test_export.",
+                                      ".$content_type.")";
+
+                       if (!$this->execute($sql))
+                       {
+                               $msg->addError('DB_NOT_UPDATED');
+                               return false;
+                       }
+                       else
+                       {
+                               return mysql_insert_id();
+                       }
+               }
+               else
+               {
+                       return false;
+               }
+       }
+
+       /**
+        * Update an existing user record
+        * @access  public
+        * @param   userID: user ID (1 [admin] or 2 [user])
+        *          login: login name
+        *          pwd: password
+        *          email: email
+        *          first_name: first name
+        *          last_name: last name
+        *          status
+        * @return  user id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Update($userID, $user_group_id, $login, $email, $first_name, $last_name, 
+                              $is_author, $organization, $phone, $address, $city,
+                              $province, $country, $postal_code, $status)
+       {
+               global $addslashes, $msg;
+
+               /* email check */
+               $login = $addslashes(strtolower(trim($login)));
+               $email = $addslashes(trim($email));
+               $first_name = $addslashes(str_replace('<', '', trim($first_name)));
+               $last_name = $addslashes(str_replace('<', '', trim($last_name)));
+               $organization = $addslashes(trim($organization));
+               $phone = $addslashes(trim($phone));
+               $address = $addslashes(trim($address));
+               $city = $addslashes(trim($city));
+               $province = $addslashes(trim($province));
+               $country = $addslashes(trim($country));
+               $postal_code = $addslashes(trim($postal_code));
+               
+               if ($this->isFieldsValid('update', $user_group_id,$login, $email,$first_name, $last_name,
+                                        $is_author, $organization, $phone, $address, $city,
+                                    $province, $country, $postal_code))
+               {
+                       /* insert into the db */
+                       $sql = "UPDATE ".TABLE_PREFIX."users
+                                  SET login = '".$login."',
+                                      user_group_id = '".$user_group_id."',
+                                      first_name = '".$first_name."',
+                                      last_name = '".$last_name."',
+                                      email = '".$email."',
+                                      is_author = ".$is_author.",
+                                      organization = '".$organization."',
+                                      phone = '".$phone."',
+                                      address = '".$address."',
+                                      city = '".$city."',
+                                      province = '".$province."',
+                                      country = '".$country."',
+                                      postal_code = '".$postal_code."',
+                                      status = '".$status."'
+                                WHERE user_id = ".$userID;
+
+                       return $this->execute($sql);
+               }
+       }
+
+       /**
+        * Update one field of an existing content record
+        * @access  public
+        * @param   contentID
+        *          fieldName: the name of the table field to update
+        *          fieldValue: the value to update
+        * @return  true if successful
+        *          error message array if failed; false if update db failed
+        * @author  Cindy Qi Li
+        */
+       public function UpdateField($contentID, $fieldName, $fieldValue)
+       {
+               global $addslashes;
+               
+               $sql = "UPDATE ".TABLE_PREFIX."content 
+                          SET ".$fieldName."='".$addslashes($fieldValue)."'
+                        WHERE content_id = ".$contentID;
+               
+               return $this->execute($sql);
+       }
+       
+       /**
+        * Delete content
+        * @access  public
+        * @param   content ID
+        * @return  true, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Delete($contentID)
+       {
+               $sql = "DELETE FROM ".TABLE_PREFIX."content WHERE content_id = ".$contentID;
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return content information by given content id
+        * @access  public
+        * @param   content id
+        * @return  content row
+        * @author  Cindy Qi Li
+        */
+       public function get($contentID)
+       {
+               $sql = 'SELECT * FROM '.TABLE_PREFIX.'content WHERE content_id='.$contentID;
+               if ($rows = $this->execute($sql))
+               {
+                       return $rows[0];
+               }
+               else return false;
+       }
+
+       /**
+        * Return all content rows by given course id
+        * @access  public
+        * @param   course id
+        * @return  content rows
+        * @author  Cindy Qi Li
+        */
+       public function getContentByCourseID($courseID)
+       {
+               $sql = "SELECT *, 
+                              UNIX_TIMESTAMP(last_modified) AS u_ts 
+                         FROM ".TABLE_PREFIX."content 
+                        WHERE course_id=$courseID 
+                        ORDER BY content_parent_id, ordering";
+               
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return max ordering based on given course id and content parent id 
+        * @access  public
+        * @param   course_id, content_parent_id
+        * @return  max ordering: int
+        * @author  Cindy Qi Li
+        */
+       public function getMaxOrdering($course_id, $content_parent_id)
+       {
+               $sql = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content 
+                        WHERE course_id=".$course_id." 
+                          AND content_parent_id=".$content_parent_id;
+               $rows = $this->execute($sql);
+               return intval($rows[0]['ordering']);
+       }
+
+       /**
+        * Validate fields preparing for insert and update
+        * @access  private
+        * @param   $course_id, $title
+        * @return  true    if update successfully
+        *          false   if update unsuccessful
+        * @author  Cindy Qi Li
+        */
+       private function isFieldsValid($course_id, $title)
+       {
+               global $msg;
+               
+               $missing_fields = array();
+               
+               if (intval($course_id) == 0)
+               {
+                       $missing_fields[] = _AT('course_id');
+               }
+               if ($title == '')
+               {
+                       $missing_fields[] = _AT('title');
+               }
+               
+               if ($missing_fields)
+               {
+                       $missing_fields = implode(', ', $missing_fields);
+                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+               }
+               
+               if (!$msg->containsErrors())
+                       return true;
+               else
+                       return false;
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/ContentTestsAssocDAO.class.php b/docs/include/classes/DAO/ContentTestsAssocDAO.class.php
new file mode 100644 (file)
index 0000000..ca86cfd
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "content_tests_assoc" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class ContentTestsAssocDAO extends DAO {
+
+       /**
+       * Insert a new row
+       * @access  public
+       * @param   content_id, test_id
+       * @return  true / false
+       * @author  Cindy Qi Li
+       */
+       function Create($content_id, $test_id)
+       {
+               $sql =  'INSERT INTO ' . TABLE_PREFIX . 'content_tests_assoc' . 
+                               '(content_id, test_id) ' .
+                               'VALUES (' . $content_id . ", $test_id)";
+           return $this->execute($sql);
+       }
+       
+       /**
+       * Delete a row
+       * @access  public
+       * @param   name
+       * @return  true or false
+       * @author  Cindy Qi Li
+       function Delete($name)
+       {
+           $sql = "DELETE FROM ".TABLE_PREFIX."config 
+                    WHERE name = '".$name."'";
+           return $this->execute($sql);
+       }
+       */
+       
+       /**
+       * Return rows by content ID
+       * @access  public
+       * @param   name
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getByContent($content_id)
+       {
+           $sql = "SELECT * FROM ".TABLE_PREFIX."content_tests_assoc WHERE content_id = '".$content_id."'";
+           return $this->execute($sql);
+       }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/CoursesDAO.class.php b/docs/include/classes/DAO/CoursesDAO.class.php
new file mode 100644 (file)
index 0000000..4e4fa68
--- /dev/null
@@ -0,0 +1,290 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+ * DAO for "courses" table
+ * @access     public
+ * @author     Cindy Qi Li
+ * @package    DAO
+ */
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class CoursesDAO extends DAO {
+
+       /**
+        * Create new course
+        * @access  public
+        * @param   
+        * @return  user id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Create($user_id, $content_packaging, $access, $title, $description, $course_dir_name, 
+                              $max_quota, $max_file_size, $copyright,
+                              $primary_language, $icon, $side_menu)
+       {
+               global $addslashes;
+
+               $title = $addslashes(trim($title));
+               $decsription = $addslashes(trim($description));
+               $copyright = $addslashes(trim($copyright));
+               
+               if ($this->isFieldsValid($user_id, $title))
+               {
+                       /* insert into the db */
+                       $sql = "INSERT INTO ".TABLE_PREFIX."courses
+                                     (user_id,
+                                      content_packaging,
+                                      access,
+                                      title,
+                                      description,
+                                      course_dir_name,
+                                      max_quota,
+                                      max_file_size,
+                                      copyright,
+                                      primary_language,
+                                      icon,
+                                      side_menu,
+                                      created_date
+                                      )
+                              VALUES (".$user_id.",
+                                      '".$content_packaging."',
+                                      '".$access."',
+                                      '".$title."',
+                                      '".$decsription."', 
+                                      '".$course_dir_name."',
+                                      '".$max_quota."',
+                                      '".$max_file_size."',
+                                      '".$copyright."',
+                                      '".$primary_language."',
+                                      '".$icon."',
+                                      '".$side_menu."',
+                                      now())";
+
+                       if (!$this->execute($sql))
+                       {
+                               $msg->addError('DB_NOT_UPDATED');
+                               return false;
+                       }
+                       else
+                       {
+                               return mysql_insert_id();
+                       }
+               }
+               else
+               {
+                       return false;
+               }
+       }
+
+       /**
+        * Update an existing course record
+        * @access  public
+        * @param   courseID: course ID
+        *          fieldName: the name of the table field to update
+        *          fieldValue: the value to update
+        * @return  true if successful
+        *          error message array if failed; false if update db failed
+        * @author  Cindy Qi Li
+        */
+       public function UpdateField($courseID, $fieldName, $fieldValue)
+       {
+               global $addslashes, $msg;
+               
+               // check if ther courseID is provided
+               if (intval($courseID) == 0)
+               {
+                       $missing_fields[] = _AT('course_id');
+               }
+               
+               if ($missing_fields)
+               {
+                       $missing_fields = implode(', ', $missing_fields);
+                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+               }
+               
+               if ($msg->containsErrors())
+                       return false;
+               
+               // check if the course title is provided
+               if ($fieldName == 'title' && !$this->isFieldsValid($courseID, $fieldValue))
+                       return false;
+               
+               $sql = "UPDATE ".TABLE_PREFIX."courses 
+                          SET ".$fieldName."='".$addslashes($fieldValue)."'
+                        WHERE course_id = ".$courseID;
+               
+               return $this->execute($sql);
+       }
+       
+       /**
+        * Delete course
+        * @access  public
+        * @param   course ID
+        * @return  true, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Delete($courseID)
+       {
+               require_once(TR_INCLUDE_PATH.'classes/FileUtility.class.php');
+               
+               unset($_SESSION['s_cid']);
+               
+               // delete course content dir
+               $content_dir = TR_CONTENT_DIR.$courseID.'/';
+               FileUtility::clr_dir($content_dir);
+               
+               // delete tests and tests related data
+               $sql = "DELETE FROM ".TABLE_PREFIX."content_tests_assoc
+                        WHERE content_id in (SELECT content_id FROM ".TABLE_PREFIX."content WHERE course_id = ".$courseID.")";
+               $this->execute($sql);
+               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_questions_categories WHERE course_id = ".$courseID;
+               $this->execute($sql);
+               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_results 
+                        WHERE test_id in (SELECT test_id FROM ".TABLE_PREFIX."tests WHERE course_id = ".$courseID.")";
+               $this->execute($sql);
+               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_questions_assoc 
+                        WHERE test_id in (SELECT test_id FROM ".TABLE_PREFIX."tests WHERE course_id = ".$courseID.")";
+               $this->execute($sql);
+               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_groups 
+                        WHERE test_id in (SELECT test_id FROM ".TABLE_PREFIX."tests WHERE course_id = ".$courseID.")";
+               $this->execute($sql);
+               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_answers 
+                        WHERE question_id in (SELECT question_id FROM ".TABLE_PREFIX."tests WHERE course_id = ".$courseID.")";
+               $this->execute($sql);
+               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests_questions WHERE course_id = ".$courseID;
+               $this->execute($sql);
+                               
+               $sql = "DELETE FROM ".TABLE_PREFIX."tests WHERE course_id = ".$courseID;
+               $this->execute($sql);
+               
+               // delete content
+               $sql = "DELETE FROM ".TABLE_PREFIX."content WHERE course_id = ".$courseID;
+               $this->execute($sql);
+               
+               // delete user <-> course association
+               $sql = "DELETE FROM ".TABLE_PREFIX."user_courses WHERE course_id = ".$courseID;
+               $this->execute($sql);
+               
+               // delete the course
+               $sql = "DELETE FROM ".TABLE_PREFIX."courses WHERE course_id = ".$courseID;
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return course information by given course id
+        * @access  public
+        * @param   course id
+        * @return  course row
+        * @author  Cindy Qi Li
+        */
+       public function get($courseID)
+       {
+               $sql = 'SELECT * FROM '.TABLE_PREFIX.'courses WHERE course_id='.$courseID;
+               if ($rows = $this->execute($sql))
+               {
+                       return $rows[0];
+               }
+               else return false;
+       }
+
+       /**
+        * Return course information by given course id
+        * @access  public
+        * @param   keywords: for keywords to include, use '+' in front.
+        *                    for keywords to exclude, use '-' in front.
+        *                    for example '+a -b' means find all courses with keyword 'a', without 'b'
+        *          start: start receiving from this record number, 0 if not specified
+        *          maxResults: Number of results desired. If 0, returns all
+        * @return  course row
+        * @author  Cindy Qi Li
+        */
+       public function getSearchResult($keywords, $start=0, $maxResults=0)
+       {
+               // full-text search
+//             $sql = "SELECT DISTINCT course_id, title, description, created_date
+//                       FROM (SELECT cs.course_id as course_id, cs.title as title, cs.description as description
+//                                    MATCH(cs.title, cs.description) AGAINST ('".$keywords."') as score1,
+//                                    MATCH(ct.keywords, ct.title, ct.text) AGAINST ('".$keywords."') score2
+//                               FROM ".TABLE_PREFIX."courses cs, ".TABLE_PREFIX."content ct
+//                              WHERE cs.access='public'
+//                                AND cs.course_id = ct.course_id
+//                                AND (MATCH(cs.title, cs.description) AGAINST ('".$keywords."' in boolean mode)
+//                                 OR MATCH(ct.keywords, ct.title, ct.text) AGAINST ('".$keywords."' in boolean mode))
+//                              ORDER BY score1+score2 desc) a";
+        
+               // sql search
+               $sql = "SELECT DISTINCT cs.course_id, cs.title, cs.description, cs.created_date
+                         FROM ".TABLE_PREFIX."courses cs, ".TABLE_PREFIX."content ct, ".TABLE_PREFIX."users u
+                        WHERE cs.access='public'
+                          AND cs.course_id = ct.course_id
+                          AND cs.user_id = u.user_id
+                          AND (cs.title like '%".$keywords."%'
+                               OR cs.description like '%".$keywords."%'
+                               OR ct.keywords like '%".$keywords."%'
+                               OR ct.title like '%".$keywords."%'
+                               OR ct.text like '%".$keywords."%'
+                               OR u.first_name like '%".$keywords."%'
+                               OR u.last_name like '%".$keywords."%')";
+               
+               if ($maxResults > 0) $sql .= " LIMIT ".$start.", ".$maxResults;
+               
+               return $this->execute($sql);
+       }
+
+       /**
+        * Validate fields preparing for insert and update
+        * @access  private
+        * @param   $courseID, $title
+        * @return  true    if update successfully
+        *          false   if update unsuccessful
+        * @author  Cindy Qi Li
+        */
+       private function isFieldsValid($courseID, $title)
+       {
+               global $msg;
+               
+               $missing_fields = array();
+               
+               if (intval($courseID) == 0)
+               {
+                       $missing_fields[] = _AT('course_id');
+               }
+               if ($title == '')
+               {
+                       $missing_fields[] = _AT('title');
+               }
+               
+               if ($missing_fields)
+               {
+                       $missing_fields = implode(', ', $missing_fields);
+                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+               }
+               
+               if (!$msg->containsErrors())
+                       return true;
+               else
+                       return false;
+       }
+
+}
+?>
\ No newline at end of file
index e62d7f5..9573986 100644 (file)
@@ -48,7 +48,6 @@ class DAO {
        */
        function execute($sql)
        {
-//             debug($sql);
                $sql = trim($sql);
                $result = mysql_query($sql, $this->db) or die($sql . "<br />". mysql_error());
 
index 5b4168f..c3372d8 100644 (file)
@@ -40,11 +40,12 @@ class LanguagesDAO extends DAO {
                // check if the language already exists
                if ($languageManager->exists($langCode)) $msg->addError('LANG_EXISTS');
                
-               if ($msg->containsErrors()) return false;
-               
-               $sql = "INSERT INTO ".TABLE_PREFIX."languages (language_code, charset, reg_exp, native_name, english_name, status) 
-                       VALUES ('".$langCode."', '".$charset."', '".$regExp."', '".$nativeName."', '".$englishName."', ".$status.")";
-               return $this->execute($sql);
+               if (!$msg->containsErrors())
+               {
+                       $sql = "INSERT INTO ".TABLE_PREFIX."languages (language_code, charset, reg_exp, native_name, english_name, status) 
+                               VALUES ('".$langCode."', '".$charset."', '".$regExp."', '".$nativeName."', '".$englishName."', ".$status.")";
+                       return $this->execute($sql);
+               }
        }
 
        /**
diff --git a/docs/include/classes/DAO/PrimaryResourcesDAO.class.php b/docs/include/classes/DAO/PrimaryResourcesDAO.class.php
new file mode 100644 (file)
index 0000000..0ad1dee
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "primary_resources" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class PrimaryResourcesDAO extends DAO {
+
+       /**
+       * Insert a new row
+       * @access  public
+       * @param   content_id, file_name, language_code
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function Create($content_id, $file_name, $lang)
+       {
+               global $addslashes;
+               
+               $content_id = intval($content_id);
+               $file_name = $addslashes($file_name);
+               $lang = $addslashes($lang);
+
+               $sql = "INSERT INTO ".TABLE_PREFIX."primary_resources 
+                          SET content_id=$content_id, 
+                              resource='$file_name', 
+                              language_code='$lang'";
+           
+               return $this->execute($sql);
+       }
+       
+       /**
+       * Delete a config row
+       * @access  public
+       * @param   content_id
+       * @return  true or false
+       * @author  Cindy Qi Li
+       */
+       function Delete($cid)
+       {
+               $pri_resource_ids = array();
+               
+               // Get all primary resources ID out that're associated with this content
+               $rows = $this->getByContent($cid);
+               
+               if (is_array($rows)){
+                       foreach ($rows as $row) $pri_resource_ids[] = $row['primary_resource_id'];
+               }
+               
+               if (!empty($pri_resource_ids)){
+                       $glued_pri_ids = implode(",", $pri_resource_ids);
+
+                       // Delete all secondary a4a
+                       $sql = 'DELETE c, d FROM '.TABLE_PREFIX.'secondary_resources c 
+                            LEFT JOIN '.TABLE_PREFIX.'secondary_resources_types d 
+                                   ON c.secondary_resource_id=d.secondary_resource_id 
+                                WHERE primary_resource_id IN ('.$glued_pri_ids.')';
+
+                       // If successful, remove all primary resources
+                       if ($this->execute($sql)){
+                               $sql = 'DELETE a, b FROM '.TABLE_PREFIX.'primary_resources a 
+                                    LEFT JOIN '.TABLE_PREFIX.'primary_resources_types b 
+                                           ON a.primary_resource_id=b.primary_resource_id 
+                                        WHERE content_id='.$cid;
+                               return $this->execute($sql);
+                       }
+               }
+               return true;
+       }
+       
+       /**
+       * Return a config row by content_id
+       * @access  public
+       * @param   name
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getByContent($cid)
+       {
+           $sql = 'SELECT * FROM '.TABLE_PREFIX.'primary_resources WHERE content_id='.$cid;
+           return $this->execute($sql);
+       }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/PrimaryResourcesTypesDAO.class.php b/docs/include/classes/DAO/PrimaryResourcesTypesDAO.class.php
new file mode 100644 (file)
index 0000000..9b5236d
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "primary_resources_types" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class PrimaryResourcesTypesDAO extends DAO {
+
+       /**
+       * Insert a new row
+       * @access  public
+       * @param   primary_resource_id, type_id
+       * @return  true, if successful; false, otherwise
+       * @author  Cindy Qi Li
+       */
+       function Create($primary_resource_id, $type_id)
+       {
+               $primary_resource_id= intval($primary_resource_id);
+               $type_id = intval($type_id);
+
+               $sql = "INSERT INTO ".TABLE_PREFIX."primary_resources_types 
+                               SET primary_resource_id=$primary_resource_id, 
+                                   type_id=$type_id";
+               return $this->execute($sql);
+       }
+       
+       /**
+       * Return a config row by content_id
+       * @access  public
+       * @param   name
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getByResourceID($resource_id)
+       {
+           $sql = 'SELECT * FROM '.TABLE_PREFIX.'primary_resources_types WHERE primary_resource_id='.$resource_id;
+           return $this->execute($sql);
+       }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/ResourceTypesDAO.class.php b/docs/include/classes/DAO/ResourceTypesDAO.class.php
new file mode 100644 (file)
index 0000000..c725388
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "resource_types" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class ResourceTypesDAO extends DAO {
+
+       /**
+       * Return all rows
+       * @access  public
+       * @param   none
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getAll()
+       {
+           $sql = 'SELECT * FROM '.TABLE_PREFIX.'resource_types ORDER BY type_id';
+           return $this->execute($sql);
+       }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/SecondaryResourcesDAO.class.php b/docs/include/classes/DAO/SecondaryResourcesDAO.class.php
new file mode 100644 (file)
index 0000000..aacbc28
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "secondary_resources" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class SecondaryResourcesDAO extends DAO {
+
+       /**
+       * Insert a new row
+       * @access  public
+       * @param   primary_resource_id, file_name, language_code
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function Create($primary_resource_id, $file_name, $lang)
+       {
+               global $addslashes;
+               
+               $primary_resource_id = intval($primary_resource_id);
+               $file_name = $addslashes($file_name);
+               $lang = $addslashes($lang);
+
+               $sql = "INSERT INTO ".TABLE_PREFIX."secondary_resources 
+                               SET primary_resource_id=$primary_resource_id, 
+                                   secondary_resource='$file_name', 
+                                   language_code='$lang'";
+           return $this->execute($sql);
+       }
+       
+       /**
+       * Return a config row by content_id
+       * @access  public
+       * @param   content_id
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getByContent($content_id)
+       {
+               $sql = "SELECT DISTINCT secondary_resource_id, secondary_resource FROM ".TABLE_PREFIX."primary_resources a 
+                         LEFT JOIN ".TABLE_PREFIX."secondary_resources s
+                                       ON a.primary_resource_id = s.primary_resource_id 
+                                WHERE content_id=".$content_id;
+               return $this->execute($sql);
+       }
+       /**
+       * Return a config row by content_id
+       * @access  public
+       * @param   name
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getByPrimaryResourceID($primary_resource_id)
+       {
+           $sql = 'SELECT * FROM '.TABLE_PREFIX.'secondary_resources WHERE primary_resource_id='.$primary_resource_id;
+           return $this->execute($sql);
+       }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/SecondaryResourcesTypesDAO.class.php b/docs/include/classes/DAO/SecondaryResourcesTypesDAO.class.php
new file mode 100644 (file)
index 0000000..0176845
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "secondary_resources_types" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class SecondaryResourcesTypesDAO extends DAO {
+
+       /**
+       * Insert a new row
+       * @access  public
+       * @param   secondary_resource, type_id
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function Create($secondary_resource, $type_id)
+       {
+               $secondary_resource = intval($secondary_resource);
+               $type_id = intval($type_id);
+
+               $sql = "INSERT INTO ".TABLE_PREFIX."secondary_resources_types 
+                               SET secondary_resource_id=$secondary_resource, 
+                                   type_id=$type_id";
+               return $this->execute($sql);
+       }
+       
+       /**
+       * Return a config row by content_id
+       * @access  public
+       * @param   name
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function getByResourceID($resource_id)
+       {
+           $sql = 'SELECT * FROM '.TABLE_PREFIX.'secondary_resources_types WHERE secondary_resource_id='.$resource_id;
+           return $this->execute($sql);
+       }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/TestsDAO.class.php b/docs/include/classes/DAO/TestsDAO.class.php
new file mode 100644 (file)
index 0000000..5f84cac
--- /dev/null
@@ -0,0 +1,300 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+ * DAO for "tests" table
+ * @access     public
+ * @author     Cindy Qi Li
+ * @package    DAO
+ */
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class TestsDAO extends DAO {
+
+       /**
+        * Create a new record
+        * @access  public
+        * @param   $course_id, $title, $description, $format, $start_date, $end_date,
+                   $order, $num_questions, $instructions, $content_id, $passscore, $passpercent,
+                   $passfeedback, $failfeedback, $result_release, $random, $difficulty,
+                   $num_takes, $anonymous, $out_of, $allow_guests, $display
+        * @return  test id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Create($course_id, $title, $description, $format, $start_date, $end_date,
+                              $order, $num_questions, $instructions, $content_id, $passscore, $passpercent,
+                              $passfeedback, $failfeedback, $result_release, $random, $difficulty,
+                              $num_takes, $anonymous, $out_of, $allow_guests, $display)
+       {
+               global $addslashes;
+
+               if ($this->isFieldsValid($course_id, $title))
+               {
+                       /* insert into the db */
+                       $sql = "INSERT INTO ".TABLE_PREFIX."tests " .
+                                  "(course_id,
+                                        title,
+                                        description,
+                                        `format`,
+                                        start_date,
+                                        end_date,
+                                        randomize_order,
+                                        num_questions,
+                                        instructions,
+                                        content_id,
+                                        passscore,
+                                        passpercent,
+                                        passfeedback,
+                                        failfeedback,
+                                        result_release,
+                                        random,
+                                        difficulty,
+                                        num_takes,
+                                        anonymous,
+                                        out_of,
+                                        guests,
+                                        display) " .
+                               "VALUES 
+                                   (".$course_id.", 
+                                   '".$title."', 
+                                   '".$description."', 
+                                   ".$format.", 
+                                   '".$start_date."', 
+                                   '".$end_date."', 
+                                   ".$order.", 
+                                   ".$num_questions.", 
+                                   '".$instructions."', 
+                                   ".$content_id.", 
+                                   ".$passscore.", 
+                                   ".$passpercent.", 
+                                   '".$passfeedback."', 
+                                   '".$failfeedback."', 
+                                   ".$result_release.", 
+                                   ".$random.", 
+                                   ".$difficulty.", 
+                                   ".$num_takes.", 
+                                   ".$anonymous.", 
+                                   '".$out_of."', 
+                                   ".$allow_guests.", 
+                                   ".$display.")";
+                                               
+                       if (!$this->execute($sql))
+                       {
+                               $msg->addError('DB_NOT_UPDATED');
+                               return false;
+                       }
+                       else
+                       {
+                               return mysql_insert_id();
+                       }
+               }
+               else
+               {
+                       return false;
+               }
+       }
+
+       /**
+        * Update an existing user record
+        * @access  public
+        * @param   userID: user ID (1 [admin] or 2 [user])
+        *          login: login name
+        *          pwd: password
+        *          email: email
+        *          first_name: first name
+        *          last_name: last name
+        *          status
+        * @return  user id, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Update($userID, $user_group_id, $login, $email, $first_name, $last_name, 
+                              $is_author, $organization, $phone, $address, $city,
+                              $province, $country, $postal_code, $status)
+       {
+               global $addslashes, $msg;
+
+               /* email check */
+               $login = $addslashes(strtolower(trim($login)));
+               $email = $addslashes(trim($email));
+               $first_name = $addslashes(str_replace('<', '', trim($first_name)));
+               $last_name = $addslashes(str_replace('<', '', trim($last_name)));
+               $organization = $addslashes(trim($organization));
+               $phone = $addslashes(trim($phone));
+               $address = $addslashes(trim($address));
+               $city = $addslashes(trim($city));
+               $province = $addslashes(trim($province));
+               $country = $addslashes(trim($country));
+               $postal_code = $addslashes(trim($postal_code));
+               
+               if ($this->isFieldsValid('update', $user_group_id,$login, $email,$first_name, $last_name,
+                                        $is_author, $organization, $phone, $address, $city,
+                                    $province, $country, $postal_code))
+               {
+                       /* insert into the db */
+                       $sql = "UPDATE ".TABLE_PREFIX."users
+                                  SET login = '".$login."',
+                                      user_group_id = '".$user_group_id."',
+                                      first_name = '".$first_name."',
+                                      last_name = '".$last_name."',
+                                      email = '".$email."',
+                                      is_author = ".$is_author.",
+                                      organization = '".$organization."',
+                                      phone = '".$phone."',
+                                      address = '".$address."',
+                                      city = '".$city."',
+                                      province = '".$province."',
+                                      country = '".$country."',
+                                      postal_code = '".$postal_code."',
+                                      status = '".$status."'
+                                WHERE user_id = ".$userID;
+
+                       return $this->execute($sql);
+               }
+       }
+
+       /**
+        * Update an existing user record
+        * @access  public
+        * @param   userID: user ID
+        *          fieldName: the name of the table field to update
+        *          fieldValue: the value to update
+        * @return  true if successful
+        *          error message array if failed; false if update db failed
+        * @author  Cindy Qi Li
+        */
+       public function UpdateField($userID, $fieldName, $fieldValue)
+       {
+               global $addslashes;
+               
+               // check if the required fields are filled
+               if ($fieldValue == '') return array(_AT('TR_ERROR_EMPTY_FIELD'));
+               
+               if ($fieldName == 'login')
+               {
+                       if (!$this->isLoginValid($fieldValue))
+                       {
+                               return array(_AT('TR_ERROR_LOGIN_CHARS'));
+                       }
+                       else if ($this->isLoginExists($fieldValue))
+                       {
+                               return array(_AT('TR_ERROR_LOGIN_EXISTS'));
+                       }
+               }
+                               
+               if ($fieldName == 'email')
+               {
+                       if (!$this->isEmailValid($fieldValue))
+                       {
+                               return array(_AT('TR_ERROR_EMAIL_INVALID'));
+                       }
+                       else if ($this->isEmailExists($fieldValue))
+                       {
+                               return array(_AT('TR_ERROR_EMAIL_EXISTS'));
+                       }
+               }
+                                               
+               $sql = "UPDATE ".TABLE_PREFIX."users 
+                          SET ".$fieldName."='".$addslashes($fieldValue)."'
+                        WHERE user_id = ".$userID;
+               
+               return $this->execute($sql);
+       }
+       
+       /**
+        * Delete content
+        * @access  public
+        * @param   content ID
+        * @return  true, if successful
+        *          false and add error into global var $msg, if unsuccessful
+        * @author  Cindy Qi Li
+        */
+       public function Delete($contentID)
+       {
+               $sql = "DELETE FROM ".TABLE_PREFIX."content WHERE content_id = ".$contentID;
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return content information by given content id
+        * @access  public
+        * @param   content id
+        * @return  content row
+        * @author  Cindy Qi Li
+        */
+       public function getContentByID($contentID)
+       {
+               $sql = 'SELECT * FROM '.TABLE_PREFIX.'content WHERE content_id='.$contentID;
+               if ($rows = $this->execute($sql))
+               {
+                       return $rows[0];
+               }
+               else return false;
+       }
+
+       /**
+        * Return max ordering based on given course id and content parent id 
+        * @access  public
+        * @param   course_id, content_parent_id
+        * @return  max ordering: int
+        * @author  Cindy Qi Li
+        */
+       public function getMaxOrdering($course_id, $content_parent_id)
+       {
+               $sql = "SELECT MAX(ordering) AS ordering FROM ".TABLE_PREFIX."content 
+                        WHERE course_id=".$course_id." 
+                          AND content_parent_id=".$content_parent_id;
+               $rows = $this->execute($sql);
+               return intval($rows[0]['ordering']);
+       }
+
+       /**
+        * Validate fields preparing for insert and update
+        * @access  private
+        * @param   $course_id, $title
+        * @return  true    if update successfully
+        *          false   if update unsuccessful
+        * @author  Cindy Qi Li
+        */
+       private function isFieldsValid($course_id, $title)
+       {
+               global $msg;
+               
+               $missing_fields = array();
+               
+               if (intval($course_id) == 0)
+               {
+                       $missing_fields[] = _AT('course_id');
+               }
+               if ($title == '')
+               {
+                       $missing_fields[] = _AT('title');
+               }
+               
+               if ($missing_fields)
+               {
+                       $missing_fields = implode(', ', $missing_fields);
+                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+               }
+               
+               if (!$msg->containsErrors())
+                       return true;
+               else
+                       return false;
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/TestsQuestionsAssocDAO.class.php b/docs/include/classes/DAO/TestsQuestionsAssocDAO.class.php
new file mode 100644 (file)
index 0000000..f4cf1e5
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* DAO for "tests_questions_assoc" table
+* @access      public
+* @author      Cindy Qi Li
+* @package     DAO
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class TestsQuestionsAssocDAO extends DAO {
+
+       /**
+       * Insert a new row
+       * @access  public
+       * @param   test_id, question_id, weight, order, required
+       * @return  table rows
+       * @author  Cindy Qi Li
+       */
+       function Create($test_id, $question_id, $weight, $order, $required)
+       {
+               $sql = "INSERT INTO " . TABLE_PREFIX . "tests_questions_assoc" . 
+                               "(test_id, question_id, weight, ordering, required) " .
+                               "VALUES ($test_id, $question_id, $weight, $order, $required)";
+           return $this->execute($sql);
+       }
+       
+       /**
+       * Delete a row
+       * @access  public
+       * @param   name
+       * @return  true or false
+       * @author  Cindy Qi Li
+       function Delete($name)
+       {
+           $sql = "DELETE FROM ".TABLE_PREFIX."config 
+                    WHERE name = '".$name."'";
+           return $this->execute($sql);
+       }
+       */
+       
+       /**
+       * Return a config row by name
+       * @access  public
+       * @param   name
+       * @return  table rows
+       * @author  Cindy Qi Li
+       function get($name)
+       {
+           $sql = "SELECT * FROM ".TABLE_PREFIX."config WHERE name = '".$name."'";
+           $rows = $this->execute($sql);
+           return $rows[0];
+       }
+       */
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/DAO/UserCoursesDAO.class.php b/docs/include/classes/DAO/UserCoursesDAO.class.php
new file mode 100644 (file)
index 0000000..18fef9b
--- /dev/null
@@ -0,0 +1,150 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+ * DAO for "user_courses" table
+ * @access     public
+ * @author     Cindy Qi Li
+ * @package    DAO
+ */
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+require_once(TR_INCLUDE_PATH. 'classes/DAO/DAO.class.php');
+
+class UserCoursesDAO extends DAO {
+
+       /**
+        * Create a new row
+        * @access  public
+        * @param   user_id
+        *          course_id
+        *          last_cid
+        * @return  true if a new row is inserted successfully or the record with (user_id, course_id) already exists 
+        *          otherwise, false
+        * @author  Cindy Qi Li
+        */
+       public function Create($user_id, $course_id, $role, $last_cid)
+       {
+               // check whether the record already exists
+               if (!$this->isExist($user_id, $course_id))
+               {
+                       /* insert into the db */
+                       $sql = "INSERT INTO ".TABLE_PREFIX."user_courses
+                                     (user_id, course_id, role, last_cid)
+                              VALUES (".$user_id.",
+                                      ".$course_id.",
+                                      ".$role.",
+                                      ".$last_cid.")";
+
+                       return $this->execute($sql);
+               }
+               else
+               {
+                       return true;
+               }
+       }
+
+       /**
+        * Update last cid based on user id and course id
+        * @access  public
+        * @param   user_id
+        *          course_id
+        *          last_cid
+        * @return  true if successful 
+        *          otherwise, false
+        * @author  Cindy Qi Li
+        */
+       public function UpdateLastCid($user_id, $course_id, $last_cid)
+       {
+               // only save last cid for courses that are on the user's course list
+               if ($this->isExist($user_id, $course_id))
+               {
+                       $sql = "UPDATE ".TABLE_PREFIX."user_courses
+                                  SET last_cid = ".$last_cid."
+                                WHERE user_id = ".$user_id."
+                                  AND course_id = ".$course_id;
+       
+                       return $this->execute($sql);
+               }
+               else return true;
+       }
+
+       /**
+        * Delete a record
+        * @access  public
+        * @param   user id, course id
+        * @return  true, if successful, otherwise, return false
+        * @author  Cindy Qi Li
+        */
+       public function Delete($user_id, $course_id)
+       {
+               $sql = "DELETE FROM ".TABLE_PREFIX."user_courses 
+                        WHERE user_id = ".$user_id." AND course_id = ".$course_id;
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return course information by given user id & course_id
+        * @access  public
+        * @param   user id
+        *          course_id
+        * @return  one row from table "user_courses"
+        * @author  Cindy Qi Li
+        */
+       public function get($user_id, $course_id)
+       {
+               $sql = "SELECT * FROM ".TABLE_PREFIX."user_courses
+                        WHERE user_id=".$user_id."
+                          AND course_id = ".$course_id;
+               if ($rows = $this->execute($sql))
+               {
+                       return $rows[0];
+               }
+               else return false;
+       }
+
+       /**
+        * Return course information by given user id
+        * @access  public
+        * @param   user id
+        * @return  course row
+        * @author  Cindy Qi Li
+        */
+       public function getByUserID($user_id)
+       {
+               $sql = "SELECT * FROM ".TABLE_PREFIX."user_courses uc, ".TABLE_PREFIX."courses c
+                        WHERE uc.user_id=".$user_id."
+                          AND uc.course_id = c.course_id
+                        ORDER BY c.title";
+               return $this->execute($sql);
+       }
+
+       /**
+        * Return course information by given user id
+        * @access  public
+        * @param   user id
+        * @return  course row
+        * @author  Cindy Qi Li
+        */
+       public function isExist($user_id, $course_id)
+       {
+               $sql = "SELECT * FROM ".TABLE_PREFIX."user_courses
+                        WHERE user_id=".$user_id."
+                          AND course_id=".$course_id;
+               $rows = $this->execute($sql);
+               
+               return is_array($rows);
+       }
+
+}
+?>
\ No newline at end of file
index 7cb5cfb..931860b 100644 (file)
@@ -131,7 +131,7 @@ class UsersDAO extends DAO {
                                       '".$province."',
                                       '".$country."',
                                       '".$postal_code."',
-                                      '".Utility::getRandomStr()."',
+                                      '".Utility::getRandomStr(32)."',
                                       ".$status.", 
                                       now()
                                                                                )";
diff --git a/docs/include/classes/FileUtility.class.php b/docs/include/classes/FileUtility.class.php
new file mode 100644 (file)
index 0000000..c475831
--- /dev/null
@@ -0,0 +1,407 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* File utility functions 
+* @access      public
+* @author      Cindy Qi Li
+*/
+
+if (!defined('TR_INCLUDE_PATH')) exit;
+
+class FileUtility {
+
+       /**
+       * Allows the copying of entire directories.
+       * @access  public
+       * @param   string $source               the source directory
+       * @param   string $dest                 the destination directory
+       * @return  boolean                              whether the copy was successful or not
+       * @link    http://www.php.net/copy
+       * @author  www at w8c dot com
+       */
+       public static function copys($source,$dest)
+       {
+               if (!is_dir($source)) {
+                       return false;
+               }
+               if (!is_dir($dest))     {
+                       mkdir($dest);
+               }
+               
+               $h=@dir($source);
+               while (@($entry=$h->read()) !== false) {
+                       if (($entry == '.') || ($entry == '..')) {
+                               continue;
+                       }
+       
+                       if (is_dir("$source/$entry") && $dest!=="$source/$entry") {
+                               copys("$source/$entry", "$dest/$entry");
+                       } else {
+                               @copy("$source/$entry", "$dest/$entry");
+                       }
+               }
+               $h->close();
+               return true;
+       } 
+       
+       /**
+       * Enables deletion of directory if not empty
+       * @access  public
+       * @param   string $dir          the directory to delete
+       * @return  boolean                      whether the deletion was successful
+       * @author  Joel Kronenberg
+       */
+       public static function clr_dir($dir) {
+               if(!$opendir = @opendir($dir)) {
+                       return false;
+               }
+               
+               while(($readdir=readdir($opendir)) !== false) {
+                       if (($readdir !== '..') && ($readdir !== '.')) {
+                               $readdir = trim($readdir);
+       
+                               clearstatcache(); /* especially needed for Windows machines: */
+       
+                               if (is_file($dir.'/'.$readdir)) {
+                                       if(!@unlink($dir.'/'.$readdir)) {
+                                               return false;
+                                       }
+                               } else if (is_dir($dir.'/'.$readdir)) {
+                                       /* calls itself to clear subdirectories */
+                                       if(!FileUtility::clr_dir($dir.'/'.$readdir)) {
+                                               return false;
+                                       }
+                               }
+                       }
+               } /* end while */
+       
+               @closedir($opendir);
+               
+               if(!@rmdir($dir)) {
+                       return false;
+               }
+               return true;
+       }
+       
+       /**
+       * Calculate the size in Bytes of a directory recursively.
+       * @access  public
+       * @param   string $dir          the directory to traverse
+       * @return  int                          the total size in Bytes of the directory
+       * @author  Joel Kronenberg
+       */
+       public static function dirsize($dir) {
+               if (is_dir($dir)) {
+                       $dh = @opendir($dir);
+               }
+               if (!$dh) {
+                       return -1;
+               }
+               
+               $size = 0;
+               while (($file = readdir($dh)) !== false) {
+           
+                       if ($file != '.' && $file != '..') {
+                               $path = $dir.$file;
+                               if (is_dir($path)) {
+                                       $size += FileUtility::dirsize($path.'/');
+                               } elseif (is_file($path)) {
+                                       $size += filesize($path);
+                               }
+                       }
+                        
+               }
+               closedir($dh);
+               return $size;
+       }
+       
+       /**
+       * This function gets used by PclZip when extracting a zip archive.
+       * @access  private
+       * @return  int                          whether or not to include the file
+       * @author  Joel Kronenberg
+       */
+       public static function preExtractCallBack($p_event, &$p_header) {
+               global $translated_file_names;
+
+               if ($p_header['folder'] == 1) {
+                       return 1;
+               }
+
+               if ($translated_file_names[$p_header['index']] == '') {
+                       return 0;
+               }
+
+               if ($translated_file_names[$p_header['index']]) {
+                       $p_header['filename'] = substr($p_header['filename'], 0, -strlen($p_header['stored_filename']));
+                       $p_header['filename'] .= $translated_file_names[$p_header['index']];
+               }
+               return 1;
+       }
+
+       /* prints the <options> out of $cats which is an array of course categories where */
+       /* $cats[parent_cat_id][] = $row */
+       public static function print_course_cats($parent_cat_id, &$cats, $cat_row, $depth=0) {
+               $my_cats = $cats[$parent_cat_id];
+               if (!is_array($my_cats)) {
+                       return;
+               }
+               foreach ($my_cats as $cat) {
+       
+                       echo '<option value="'.$cat['cat_id'].'"';
+                       if($cat['cat_id'] == $cat_row){
+                               echo  ' selected="selected"';
+                       }
+                       echo '>';
+                       echo str_pad('', $depth, '-');
+                       echo $cat['cat_name'].'</option>'."\n";
+       
+                       print_course_cats($cat['cat_id'], $cats,  $cat_row, $depth+1);
+               }
+       }
+       
+       // returns the most appropriate representation of Bytes in MB, KB, or B
+       public static function get_human_size($num_bytes) {
+               $abs_num_bytes = abs($num_bytes);
+       
+               if ($abs_num_bytes >= TR_KBYTE_SIZE * TR_KBYTE_SIZE) {
+                       return round(bytes_to_megabytes($num_bytes), 2) .' '. _AT('mb');
+               } else if ($abs_num_bytes >= TR_KBYTE_SIZE) {
+                       return round(bytes_to_kilobytes($num_bytes), 2) .' '._AT('kb') ;
+               }
+               // else:
+       
+               return $num_bytes . ' '._AT('bt');
+       }
+       
+       /**
+       * Returns the MB representation of inputed bytes
+       * @access  public
+       * @param   int $num_bytes       the input bytes to convert
+       * @return  int                          MB representation of $num_bytes
+       * @author  Heidi Hazelton
+       */
+       public static function bytes_to_megabytes($num_bytes) {
+               return $num_bytes/TR_KBYTE_SIZE/TR_KBYTE_SIZE;
+       }
+       
+       /**
+       * Returns the Byte representation of inputed MB
+       * @access  public
+       * @param   int $num_bytes       the input MB to convert
+       * @return  int                          the Bytes representation of $num_bytes
+       * @author  Heidi Hazelton
+       */
+       public static function megabytes_to_bytes($num_bytes) {
+               return $num_bytes*TR_KBYTE_SIZE*TR_KBYTE_SIZE;
+       }
+       
+       /**
+       * Returns the KB representation of inputed Bytes
+       * @access  public
+       * @param   int $num_bytes       the input Bytes to convert
+       * @return  int                          the KB representation of $num_bytes
+       * @author  Heidi Hazelton
+       */
+       public static function bytes_to_kilobytes($num_bytes) {
+               return $num_bytes/TR_KBYTE_SIZE;
+       }
+       
+       /**
+       * Returns the Bytes representation of inputed KBytes
+       * @access  public
+       * @param   int $num_bytes       the input KBytes to convert
+       * @return  int                          the KBytes representation of $num_bytes
+       * @author  Heidi Hazelton
+       */
+       public static function kilobytes_to_bytes($num_bytes) {
+               return $num_bytes*TR_KBYTE_SIZE;
+       }
+       
+       /**
+       * Outputs the directories associated with a course in the form of <option> elements.
+       * @access public
+       * @param  string $cur_dir  the current directory to include in the options.
+       * @author Norma Thompson
+       */
+       public static function output_dirs($current_path,$cur_dir,$indent) {
+               // open the cur_dir
+               if ($dir = opendir($current_path.$cur_dir)) {
+       
+                       // recursively call output_dirs() for all directories in this directory
+                       while (false !== ($file = readdir($dir)) ) {
+       
+                               //if the name is not a directory 
+                               if( ($file == '.') || ($file == '..') ) {
+                                       continue;
+                               }
+       
+                               // if it is a directory call function
+                               if(is_dir($current_path.$cur_dir.$file)) {
+                                       $ldir = explode('/',$cur_dir.$file);
+                                       $count = count($ldir);
+                                       $label = $ldir[$count-1];
+                                       
+                                       $dir_option .= '<option value="'.$cur_dir.$file.'/" >'.$indent.$label.'</option>';
+       
+                                       $dir_option .= output_dirs($current_path,$cur_dir.$file.'/',$indent.'--');
+                               }
+                               
+                       } // end while  
+                       
+                       closedir($dir); 
+               }
+               return $dir_option;
+       }
+       
+       public static function display_tree($current_path, $cur_dir, $pathext, $ignore_children = false) {
+               // open the cur_dir
+               static $list_array;
+               if (!isset($list_array)) {
+                       $list_array = explode(',', $_GET['list']);
+               }
+               if ($dir = opendir($current_path . $cur_dir)) {
+       
+                       // recursively call output_dirs() for all directories in this directory
+                       while (false !== ($file = readdir($dir)) ) {
+       
+                               //if the name is not a directory 
+                               if( ($file == '.') || ($file == '..') ) {
+                                       continue;
+                               }
+       
+                               // if it is a directory call function
+                               if (is_dir($current_path . $cur_dir . $file)) {
+       
+                                       //$ldir = explode('/',$cur_dir.$file);
+                                       //$count = count($ldir);
+                                       //$label = $ldir[$count-1];
+       
+                                       $check = '';
+                                       $here  = '';
+                                       if ($cur_dir . $file == substr($pathext, 0, -1)) {
+                                               $check = 'checked="checked"';
+                                               $here = ' ' . _AT('current_location');
+                                       } else if (($cur_dir == $pathext) && in_array($file, $list_array)) {
+                                               $ignore_children = true;
+                                       }
+       
+                                       if ($ignore_children) {
+                                               $check = 'disabled="disabled"';
+                                               $class = ' disabled';
+                                       }
+       
+                                       $dir_option .= '<ul><li class="folders'.$class.'">';
+                                       $dir_option .= '<label><input type="radio" name="dir_name" value="'.$cur_dir.$file.'" '.$check. '/>'. $file . $here. '</label>';
+                                       $dir_option .= ''.display_tree($current_path,$cur_dir.$file.'/', $pathext, $ignore_children).'';
+                                       $dir_option .= '</li></ul>';
+       
+                                       if (($cur_dir == $pathext) && in_array($file, $list_array)) {
+                                               $ignore_children = false;
+                                               $class = '';
+                                       }
+                               }
+       
+                               
+                       } // end while  
+                       
+                       closedir($dir); 
+               }
+               return $dir_option;
+       }
+       
+       public static function course_realpath($file) {
+               if (!$_SESSION['course_id']) {
+                       return FALSE;
+               }
+               
+               $course_path = TR_CONTENT_DIR . $_SESSION['course_id'];
+               
+               $path_parts = pathinfo($file);
+               
+               $dir_name   = $path_parts['dirname'];
+               $file_name  = $path_parts['basename'];
+               $ext_name   = $path_parts['extension'];
+       
+               //1. determine the real path of the file/directory
+               if (is_dir($dir_name.DIRECTORY_SEPARATOR.$file_name) && $ext_name == '') {
+                       //if directory ws passed through (moving file to diff directory)
+                       $real = realpath($dir_name . DIRECTORY_SEPARATOR . $file_name);
+               } else {
+                       //if file was passed through or no existant direcotry was passed through (rename/creating dir)
+                       $real = realpath($dir_name);
+               }
+       
+               //2. and whether its in the course content directory
+               if (substr($real, 0, strlen($course_path)) != $course_path) {
+                       return FALSE;
+               }
+       
+               //3. check if extensions are legal
+       
+               //4. Otherwise return the real path of the file
+               return $real;
+       }
+       
+       /**
+       * Returns canonicalized absolute pathname to a file/directory in the content directory
+       * @access public
+       * @param  string $file the relative path to the file or directory
+       * @return  string       the full path to the file or directory, FALSE if it does not exist in our content directory.
+       */
+       public static function course_realpath_NEW_VERSION($file) {
+               if (!$_SESSION['course_id']) {
+                       return FALSE;
+               }
+               
+               $course_path = TR_CONTENT_DIR . $_SESSION['course_id'];
+       
+               // determine the real path of the file/directory
+               $real = realpath($course_path . DIRECTORY_SEPARATOR . $file);
+               
+               if (!file_exists($real)) {
+                       // the file or directory does not exist
+                       return FALSE;
+       
+               } else if (substr($real, 0, strlen($course_path)) != $course_path) {
+                       // the file or directory is not in the content path
+                       return FALSE;
+       
+               } else {
+                       // Otherwise return the real path of the file
+                       return $real;
+               }
+       }
+       
+       /**
+       * Returns the name of the readme file in the given directory
+       * @access public
+       * @param  string $dir_name the name of the directory
+       * @return  string       the name of the readme file
+       */
+       public static function get_readme($dir)
+       {
+               if (!is_dir($dir)) return '';
+               
+               $dh = opendir($dir);
+               
+               while (($file = readdir($dh)) !== false) {
+                       if (stristr($file, 'readme') && substr($file, -4) <> '.php')
+                               return $file;
+               }
+               
+               closedir($dh);
+               return '';
+       }
+}
+?>
\ No newline at end of file
index 357ca73..f5e0a3e 100644 (file)
@@ -96,7 +96,11 @@ class LanguageManager {
        function getLanguage($code, $charset = '') {
                if (!$charset) {
                        if (isset($this->allLanguages[$code])) {
-                               return current($this->allLanguages[$code]);
+                               // return the first language object
+                               if (is_array($this->allLanguages[$code]))
+                                       foreach ($this->allLanguages[$code] as $language)
+                                               return $language;
+//                             return current($this->allLanguages[$code]);
                        } else {
                                return FALSE;
                        }
@@ -263,7 +267,7 @@ class LanguageManager {
 
                global $languageManager, $msg;
 
-               $import_path = TR_TEMP_DIR . 'import/';
+               $import_path = TR_CONTENT_DIR . 'import/';
 
                $archive = new PclZip($filename);
                if ($archive->extract(PCLZIP_OPT_PATH,  $import_path) == 0) {
index 5ecc58e..94dd27d 100644 (file)
@@ -65,7 +65,7 @@ class RemoteLanguageManager extends LanguageManager {
        }
 
        function import($language_code) {
-               $filename = tempnam(TR_TEMP_DIR . 'import', $language_code);
+               $filename = tempnam(TR_CONTENT_DIR . 'import', $language_code);
                if ($this->fetchLanguage($language_code, $filename)) {
                        parent::import($filename);
                }
index 4e217b8..98d01fd 100644 (file)
@@ -59,7 +59,7 @@ class Menu {
                $this->sub_menus = $this->setSubMenus($this->current_page);   // loop recursively to set $this->submenus to the top parent of $this->current_page
                $this->root_page = $this->setRootPage($this->current_page);  
                $this->path = $this->setPath($this->current_page);
-               $this->back_to_page = $this->setBackToPage();  
+               $this->back_to_page = $this->setBackToPage();
        }
 
        /**
index 03a19bd..a3ec22d 100644 (file)
 /* as published by the Free Software Foundation.                        */
 /************************************************************************/
 
-define('AT_INCLUDE_PATH', '../../');
-require(AT_INCLUDE_PATH.'classes/testQuestions.class.php');
-require(AT_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');    
+define('TR_INCLUDE_PATH', '../../');
+require_once(TR_INCLUDE_PATH.'classes/testQuestions.class.php');
+require_once(TR_INCLUDE_PATH.'classes/QTI/QTIParser.class.php');       
+require_once(TR_INCLUDE_PATH.'classes/DAO/TestsDAO.class.php');
 
 /**
 * QTIImport
@@ -227,32 +228,11 @@ class QTIImport {
                        if ($this->title != '') {
                                $test_obj['title'] = $this->title;
                        } else {
-//                             $test_obj['title'] = 'random title';
-                               
                                //set marks to 0 if no title? 
                                $this->weights = array();
                        }
                }
 
-               /*
-               if ($test_obj['random'] && !$test_obj['num_questions']) {
-                       $missing_fields[] = _AT('num_questions_per_test');
-               }
-
-               if ($test_obj['pass_score']==1 && !$test_obj['passpercent']) {
-                       $missing_fields[] = _AT('percentage_score');
-               }
-
-               if ($test_obj['pass_score']==2 && !$test_obj['passscore']) {
-                       $missing_fields[] = _AT('points_score');
-               }
-
-               if ($missing_fields) {
-                       $missing_fields = implode(', ', $missing_fields);
-                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
-               }
-               */
-
                $day_start      = intval(date('j'));
                $month_start= intval(date('n'));
                $year_start     = intval(date('Y'));
@@ -310,8 +290,9 @@ class QTIImport {
 
                        //If title exceeded database defined length, truncate it.
                        $test_obj['title'] = validate_length($test_obj['title'], 100);
-
-                       $sql_params = array (   $_SESSION['course_id'], 
+                       
+                       $testsDAO = new TestsDAO();
+                       $tid = $testsDAO->Create(       $_SESSION['course_id'], 
                                                                        $test_obj['title'], 
                                                                        $test_obj['description'], 
                                                                        $test_obj['format'], 
@@ -334,9 +315,32 @@ class QTIImport {
                                                                        $test_obj['allow_guests'], 
                                                                        $test_obj['display']);
 
-                       $sql = vsprintf(AT_SQL_TEST, $sql_params);
-                       $result = mysql_query($sql, $db);
-                       $tid = mysql_insert_id($db);
+//                     $sql_params = array (   $_SESSION['course_id'], 
+//                                                                     $test_obj['title'], 
+//                                                                     $test_obj['description'], 
+//                                                                     $test_obj['format'], 
+//                                                                     $start_date, 
+//                                                                     $end_date, 
+//                                                                     $test_obj['order'], 
+//                                                                     $test_obj['num_questions'], 
+//                                                                     $test_obj['instructions'], 
+//                                                                     $test_obj['content_id'], 
+//                                                                     $test_obj['passscore'], 
+//                                                                     $test_obj['passpercent'], 
+//                                                                     $test_obj['passfeedback'], 
+//                                                                     $test_obj['failfeedback'], 
+//                                                                     $test_obj['result_release'], 
+//                                                                     $test_obj['random'], 
+//                                                                     $test_obj['difficulty'], 
+//                                                                     $test_obj['num_takes'], 
+//                                                                     $test_obj['anonymous'], 
+//                                                                     '', 
+//                                                                     $test_obj['allow_guests'], 
+//                                                                     $test_obj['display']);
+//
+//                     $sql = vsprintf(AT_SQL_TEST, $sql_params);
+//                     $result = mysql_query($sql, $db);
+//                     $tid = mysql_insert_id($db);
                //debug($qti_import->weights, 'weights');                       
                }
                return $tid;
@@ -388,18 +392,15 @@ class QTIImport {
                        //we only want to touch the files that the test/surveys use
                        if ($new_file_loc!=$file_loc){
                                //check if new folder is there, if not, create it.
-                               createDir(AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc );
+                               createDir(TR_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc );
                                
-                               //copy files over
-               //                      if (rename(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$file_loc, 
-               //                              AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$package_base_name.'/'.$new_file_loc) === false) {
                                //overwrite files
-                               if (file_exists(AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc)){
-                                       unlink(AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc);
+                               if (file_exists(TR_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc)){
+                                       unlink(TR_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc);
                                }
-                               if (file_exists(AT_CONTENT_DIR.'import/'.$_SESSION['course_id'].'/'.$file_loc)){
-                                       if (copy(AT_CONTENT_DIR . 'import/'.$_SESSION['course_id'].'/'.$file_loc, 
-                                               AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc) === false) {
+                               if (file_exists($this->import_path.$file_loc)){
+                                       if (copy($this->import_path.$file_loc, 
+                                               TR_CONTENT_DIR .$_SESSION['course_id'].'/'.$new_file_loc) === false) {
                                                //TODO: Print out file already exist error.
                                                if (!$msg->containsErrors()) {
                        //                              $msg->addError('FILE_EXISTED');
index 52b8acd..25a228b 100644 (file)
@@ -11,9 +11,9 @@
 /************************************************************************/
 
 //Constances
-define('AT_QTI_REPONSE_GRP',    1);
-define('AT_QTI_REPONSE_LID',    2);
-define('AT_QTI_REPONSE_STR',    3);
+define('TR_QTI_REPONSE_GRP',    1);
+define('TR_QTI_REPONSE_LID',    2);
+define('TR_QTI_REPONSE_STR',    3);
 
 /**
 * QTIParser
@@ -94,17 +94,17 @@ class QTIParser {
                                break;
                        case 'response_lid':
                                if ($this->response_type[$this->item_num] <= 0) {
-                                       $this->response_type[$this->item_num] = AT_QTI_REPONSE_LID;
+                                       $this->response_type[$this->item_num] = TR_QTI_REPONSE_LID;
                                }
                        case 'response_grp':
                                if ($this->response_type[$this->item_num] <= 0) {
-                                       $this->response_type[$this->item_num] = AT_QTI_REPONSE_GRP;
+                                       $this->response_type[$this->item_num] = TR_QTI_REPONSE_GRP;
                                }
                        case 'response_str':
                                $this->attributes[$this->item_num][$name]['ident'] = $attributes['ident'];
                                $this->attributes[$this->item_num][$name]['rcardinality'] = $attributes['rcardinality'];
                                if ($this->response_type[$this->item_num] <= 0) {
-                                       $this->response_type[$this->item_num] = AT_QTI_REPONSE_STR;
+                                       $this->response_type[$this->item_num] = TR_QTI_REPONSE_STR;
                                }
                                break;
                        case 'response_label':
@@ -377,13 +377,13 @@ class QTIParser {
                //Check if this is an ordering, or matching
                $response_obj;
                switch ($this->response_type[$item_num]){
-                       case AT_QTI_REPONSE_LID:
+                       case TR_QTI_REPONSE_LID:
                                $response_obj = $this->attributes[$item_num]['response_lid'];
                                break;
-                       case AT_QTI_REPONSE_GRP:
+                       case TR_QTI_REPONSE_GRP:
                                $response_obj = $this->attributes[$item_num]['response_grp'];
                                break;
-                       case AT_QTI_REPONSE_STR:
+                       case TR_QTI_REPONSE_STR:
                                $response_obj = $this->attributes[$item_num]['response_str'];
                                return 3;       //no need to parse the rcardinality?
                                break;
diff --git a/docs/include/classes/RESTWebServiceOutput.class.php b/docs/include/classes/RESTWebServiceOutput.class.php
new file mode 100644 (file)
index 0000000..7045a6c
--- /dev/null
@@ -0,0 +1,164 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+/**
+* RESTWebServiceOutput
+* Class to generate search or error report in REST format 
+* @access      public
+* @author      Cindy Qi Li
+*/
+if (!defined("TR_INCLUDE_PATH")) die("Error: TR_INCLUDE_PATH is not defined.");
+
+class RESTWebServiceOutput {
+
+       // all private
+       var $results;                    // constructor parameter. array of errors
+       var $totalCount;                 // constructor parameter. total number of search results regardless of the maxResults
+       var $lastRecNumber;              // constructor parameter. number of the last record in the <results> element
+       var $output;                     // final web service output
+       
+       // REST templates
+       var $rest_main =
+'<?xml version="1.0" encoding="ISO-8859-1"?>
+<resultset>
+  <summary>
+    <numOfTotalResults>{NUMOFTOTALRESULTS}</numOfTotalResults>
+    <numOfResults>{NUMOFRESULTS}</numOfResults>
+    <lastResultNumber>{LASTRESULTNUMBER}</lastResultNumber>
+  </summary>
+
+  <results>
+{RESULTS}
+  </results>
+</resultset>
+';
+       
+       var $rest_result = 
+'    <result>
+      <courseID>{COURSEID}</courseID>
+      <title>{TITLE}</title>
+      <description>{DESCRIPTION}</description>
+      <creationDate>{CREATIONDATE}</creationDate>
+    </result> 
+';
+       
+       /**
+       * class constructor
+       * @access public
+       * @param  $results: an array of search results
+       *         $totalCount: total number of all search results
+       *         $lastRecNumber: number of the last record in the <results> element
+       */
+       function RESTWebServiceOutput($results, $totalCount, $lastRecNumber)
+       {
+               $this->results = $results;
+               $this->totalCount = $totalCount;
+               $this->lastRecNumber = $lastRecNumber;
+               
+               $this->generateRESTRpt();
+       }
+       
+       /**
+       * private
+       * main process to generate report in html format
+       */
+       private function generateRESTRpt()
+       {
+               if (!is_array($this->results))
+               {
+                       $num_of_results = 0;
+                       $results_in_rest = '';
+               }
+               else
+               {
+                       $num_of_results = count($this->results);
+                       foreach ($this->results as $result)
+                       {
+                               $results_in_rest .= str_replace(array('{COURSEID}', 
+                                                            '{TITLE}',
+                                                            '{DESCRIPTION}', 
+                                                            '{CREATIONDATE}'),
+                                                     array($result['course_id'], 
+                                                           $result['title'], 
+                                                           $result['description'], 
+                                                           $result['created_date']),
+                                                     $this->rest_result);
+                       }
+               }
+               
+               // calculate the last record number
+               
+               // generate final output
+               $this->output = str_replace(array('{NUMOFTOTALRESULTS}', 
+                                                 '{NUMOFRESULTS}', 
+                                                         '{LASTRESULTNUMBER}', 
+                                                 '{RESULTS}'),
+                                           array($this->totalCount,
+                                                 $num_of_results,
+                                                 $this->lastRecNumber,
+                                                 $results_in_rest), 
+                                           $this->rest_main);
+       }
+       
+       /** 
+       * public
+       * return final web service output
+       * parameters: none
+       * author: Cindy Qi Li
+       */
+       public function getWebServiceOutput()
+       {
+               return $this->output;
+       }
+       
+       /** 
+       * public
+       * return error report in html
+       * parameters: $errors: errors array
+       * author: Cindy Qi Li
+       */
+       public static function generateErrorRpt($errors)
+       {
+               // initialize error codes. Note that all errors reported in REST need to be defined here.
+               $errorCodes['TR_ERROR_EMPTY_KEYWORDS'] = 401;
+               $errorCodes['TR_ERROR_EMPTY_WEB_SERVICE_ID'] = 402;
+               $errorCodes['TR_ERROR_INVALID_WEB_SERVICE_ID'] = 403;
+               
+               // error template in REST format
+               $rest_error = 
+'<?xml version="1.0" encoding="ISO-8859-1"?>
+<errors>
+  <totalCount>{TOTOAL_COUNT}</totalCount>
+{ERROR_DETAIL}
+</errors>
+';
+       
+               $rest_error_detail = 
+'  <error code="{ERROR_CODE}">
+    <message>{MESSAGE}</message>
+  </error>
+';
+               if (!is_array($errors)) return false;
+               
+               foreach ($errors as $err)
+               {
+                       $error_detail .= str_replace(array("{ERROR_CODE}", "{MESSAGE}"), 
+                                                    array($errorCodes[$err], htmlentities(_AT($err))), 
+                                                    $rest_error_detail); 
+               }
+                                                   
+               return str_replace(array('{TOTOAL_COUNT}', '{ERROR_DETAIL}'), 
+                                  array(count($errors), $error_detail),
+                                  $rest_error);
+       }
+}
+?>  
index d839582..f4ebaee 100644 (file)
@@ -68,15 +68,28 @@ class User {
        /**
         * Check if user is an author 
         * @access  public
-        * @param   none
+        * @param   $course_id: optional. 
+        *          if > 0, check whether the user is the author of the course with $course_id
+        *          else if = 0 or is not given, check whether the user has author privilege 
         * @return  true : if is an author
         *          false : if not an author
         * @author  Cindy Qi Li
         */
-       public function isAuthor()
+       public function isAuthor($course_id = 0)
        {
-               $row = $this->userDAO->getUserByID($this->userID);
-               return $row['is_author'];
+               if ($course_id == 0)
+               {
+                       $row = $this->userDAO->getUserByID($this->userID);
+                       return $row['is_author'];
+               }
+               else
+               {
+                       include_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+                       $coursesDAO = new CoursesDAO();
+                       $course_row = $coursesDAO->get($course_id);
+                       
+                       return ($course_row['user_id'] == $this->userID);
+               }
        }
 
        /**
index d13e0c0..7f271f6 100644 (file)
@@ -21,7 +21,8 @@ if (!defined('TR_INCLUDE_PATH')) exit;
 class Utility {\r
 \r
        /**\r
-       * return a unique random string based on the given length\r
+       * Return a unique random string based on the given length.\r
+       * The maxium length is 32 hexidecimal\r
        * @access  public\r
        * @param   none\r
        * @return  a random string\r
@@ -118,5 +119,171 @@ class Utility {
                        }\r
                }\r
        }\r
+\r
+       /**\r
+       * Checks if the data exceeded the database predefined length, if so,\r
+       * truncate it.\r
+       * This is used on data that are being inserted into the database.\r
+       * If this function is used for display purposes, you may want to add the '...' \r
+       *  at the end of the string by setting the $forDisplay=1\r
+       * @param        the mbstring that needed to be checked\r
+       * @param        the byte length of what the input should be in the database.\r
+       * @param        (OPTIONAL)\r
+       *                       append '...' at the end of the string.  Should not use this when \r
+       *                       dealing with database.  This should only be set for display purposes.\r
+       * @return       the mbstring safe sql entry\r
+       * @author       Harris Wong\r
+       */\r
+       public static function validateLength($input, $len, $forDisplay=0){\r
+               global $strlen, $substr;\r
+               $input_bytes_len = strlen($input);\r
+               $input_len = $strlen($input);\r
+       \r
+               //If the input has exceeded the db column limit\r
+               if ($input_bytes_len > $len){\r
+                       //calculate where to chop off the string\r
+                       $percentage = $input_bytes_len / $input_len;\r
+                       //Get the suitable length that should be stored in the db\r
+                       $suitable_len = floor($len / $percentage);\r
+       \r
+                       if ($forDisplay===1){\r
+                               return $substr($input, 0, $suitable_len).'...';\r
+                       }\r
+                       return $substr($input, 0, $suitable_len);\r
+               }\r
+               //if valid length\r
+               return $input;\r
+       }\r
+\r
+       /**\r
+       * check if value in the given attribute is a valid language code\r
+       * return true if valid, otherwise, return false\r
+       */\r
+       public static function isValidLangCode($code)\r
+       {\r
+               require_once(TR_INCLUDE_PATH.'classes/DAO/LangCodesDAO.class.php');\r
+               $langCodesDAO = new LangCodesDAO();\r
+\r
+               if (strlen($code) == 2) \r
+               {\r
+                       $rows = $langCodesDAO->GetLangCodeBy2LetterCode($code);\r
+               }\r
+               else if (strlen($code) == 3)\r
+               {\r
+                       $rows = $langCodesDAO->GetLangCodeBy3LetterCode($code);\r
+               }\r
+               else \r
+               {\r
+                       return false;\r
+               }\r
+\r
+               return (is_array($rows));\r
+       }\r
+\r
+       /**\r
+        * Return a valid 3-character language code\r
+        * 1. if input is a valid 3-character language code, return itself;\r
+        * 2. if input is a valid 2-character language code, return according 3-character language code\r
+        * 3. if input is an invalid language code, return default language code\r
+        */\r
+       public static function get3LetterLangCode($code)\r
+       {\r
+               require_once(TR_INCLUDE_PATH.'classes/DAO/LangCodesDAO.class.php');\r
+               $langCodesDAO = new LangCodesDAO();\r
+               \r
+               if (!Utility::isValidLangCode($code))\r
+                       return $_config['default_language'];\r
+               else\r
+               {\r
+                       if (strlen($code) == 3) return $code;\r
+                       \r
+                       if (strlen($code) == 2) \r
+                       {\r
+                               $rows = $langCodesDAO->GetLangCodeBy2LetterCode($code);\r
+                               return $rows[0]['code_3letters'];\r
+                       }\r
+                       \r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Find out whether the current theme is a mobile theme\r
+        * @access public\r
+        * @param  none\r
+        * @return true if the current theme is a mobile theme; otherwise, false.\r
+        */\r
+       public static function isMobileTheme() {\r
+               return ($_SESSION['prefs']['PREF_THEME'] == 'mobile');\r
+       }\r
+       \r
+       /**\r
+       * This function authenticate user privilege\r
+       * @access  public\r
+       * @param   privilege constants\r
+       * @author  Cindy Qi Li\r
+       */\r
+       public static function authenticate($privilegeToValidate) {\r
+               global $_current_user, $_course_id, $msg;\r
+               \r
+               $authenticated = true; // default\r
+               /* make sure the user is the author of the current course */\r
+               if ($privilegeToValidate == TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE && \r
+                   (!isset($_current_user) || !$_current_user->isAuthor($_course_id) || !isset($_course_id)))\r
+               {\r
+                       $authenticated = false;\r
+               }\r
+\r
+               if ($privilegeToValidate == TR_PRIV_ISAUTHOR &&\r
+                   (!isset($_current_user) || !$_current_user->isAuthor()))\r
+               {\r
+                       $authenticated = false;\r
+               }\r
+               \r
+               if (!$authenticated)\r
+               {\r
+                       $msg->addError('NO_PRIV');\r
+                       include(TR_INCLUDE_PATH.'header.inc.php');\r
+                       $msg->printAll(); \r
+                       include(TR_INCLUDE_PATH.'footer.inc.php');\r
+                       exit;\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * This function highlights the given keywords in the text\r
+        * and perserves the case of the keywords in the text\r
+        * @access public\r
+        * @param  $text string, \r
+        *         $keywords    an array of keywords\r
+        * @author Cindy Qi Li\r
+        */\r
+       public static function highlightKeywords($text, $keywords)\r
+       {\r
+               if (!is_array($keywords)) return $text;\r
+               \r
+               foreach($keywords as $keyword)\r
+               {        \r
+                       $textLen = strlen($keyword);\r
+       \r
+                       $textArray = array();\r
+                       $pos                                    = 0;\r
+                       $count                   = 0;\r
+       \r
+                       while($pos !== FALSE) {\r
+                                       $pos = stripos($text,$keyword,$pos);\r
+                                       if($pos !== FALSE) {\r
+                                                       $textArray[$count]['kwic'] = substr($text,$pos,$textLen);\r
+                                                       $textArray[$count++]['pos']     = $pos;\r
+                                                       $pos++;\r
+                                       }\r
+                       }\r
+       \r
+                       for($i=count($textArray)-1;$i>=0;$i--) {\r
+                                       $replace = '<strong class="highlight">'.$textArray[$i]['kwic'].'</strong>';\r
+                                       $text = substr_replace($text,$replace,$textArray[$i]['pos'],$textLen);\r
+                       }\r
+               }\r
+               return $text;\r
+       }\r
 }\r
 ?>
\ No newline at end of file
index bb6522b..05226b3 100644 (file)
@@ -48,7 +48,7 @@ class WeblinksExport {
                //$savant->assign('url_window_features', $url['window_features']);
 
                //generates xml
-               $xml = $savant->fetch(AT_INCLUDE_PATH.'classes/Weblinks/Weblinks.tmpl.php');
+               $xml = $savant->fetch(TR_INCLUDE_PATH.'classes/Weblinks/Weblinks.tmpl.php');
 
                return $xml;
        }
diff --git a/docs/include/classes/XML/XML_HTMLSax/HTMLSax/XML_HTMLSax_Decorators.php b/docs/include/classes/XML/XML_HTMLSax/HTMLSax/XML_HTMLSax_Decorators.php
new file mode 100644 (file)
index 0000000..415e5fc
--- /dev/null
@@ -0,0 +1,306 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
+// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: XML_HTMLSax_Decorators.php 2291 2004-11-16 19:35:41Z joel $
+//
+/**
+* Decorators for dealing with parser options
+* @package XML_HTMLSax
+* @version $Id: XML_HTMLSax_Decorators.php 2291 2004-11-16 19:35:41Z joel $
+* @see XML_HTMLSax::set_option
+*/
+/**
+* Trims the contents of element data from whitespace at start and end
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_Trim {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax_Trim
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax_Trim(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Trims the data
+    * @param XML_HTMLSax
+    * @param string element data
+    * @access protected
+    */
+    function trimData(&$parser, $data) {
+        $data = trim($data);
+        if ($data != '') {
+            $this->orig_obj->{$this->orig_method}($parser, $data);
+        }
+    }
+}
+/**
+* Coverts tag names to upper case
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_CaseFolding {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original open handler method
+    * @var string
+    * @access private
+    */
+    var $orig_open_method;
+    /**
+    * Original close handler method
+    * @var string
+    * @access private
+    */
+    var $orig_close_method;
+    /**
+    * Constructs XML_HTMLSax_CaseFolding
+    * @param object handler object being decorated
+    * @param string original open handler method
+    * @param string original close handler method
+    * @access protected
+    */
+    function XML_HTMLSax_CaseFolding(&$orig_obj, $orig_open_method, $orig_close_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_open_method = $orig_open_method;
+        $this->orig_close_method = $orig_close_method;
+    }
+    /**
+    * Folds up open tag callbacks
+    * @param XML_HTMLSax
+    * @param string tag name
+    * @param array tag attributes
+    * @access protected
+    */
+    function foldOpen(&$parser, $tag, $attrs=array(), $empty = FALSE) {
+        $this->orig_obj->{$this->orig_open_method}($parser, strtoupper($tag), $attrs, $empty);
+    }
+    /**
+    * Folds up close tag callbacks
+    * @param XML_HTMLSax
+    * @param string tag name
+    * @access protected
+    */
+    function foldClose(&$parser, $tag, $empty = FALSE) {
+        $this->orig_obj->{$this->orig_close_method}($parser, strtoupper($tag), $empty);
+    }
+}
+/**
+* Breaks up data by linefeed characters, resulting in additional
+* calls to the data handler
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_Linefeed {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax_LineFeed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax_LineFeed(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by linefeeds
+    * @param XML_HTMLSax
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = explode("\n",$data);
+        foreach ( $data as $chunk ) {
+            $this->orig_obj->{$this->orig_method}($parser, $chunk);
+        }
+    }
+}
+/**
+* Breaks up data by tab characters, resulting in additional
+* calls to the data handler
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_Tab {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax_Tab
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax_Tab(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by linefeeds
+    * @param XML_HTMLSax
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = explode("\t",$data);
+        foreach ( $data as $chunk ) {
+            $this->orig_obj->{$this->orig_method}($this, $chunk);
+        }
+    }
+}
+/**
+* Breaks up data by XML entities and parses them with html_entity_decode(),
+* resulting in additional calls to the data handler<br />
+* Requires PHP 4.3.0+
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_Entities_Parsed {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax_Entities_Parsed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax_Entities_Parsed(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by XML entities
+    * @param XML_HTMLSax
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = preg_split('/(&.+?;)/',$data,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
+        foreach ( $data as $chunk ) {
+            $chunk = html_entity_decode($chunk,ENT_NOQUOTES);
+            $this->orig_obj->{$this->orig_method}($this, $chunk);
+        }
+    }
+}
+/**
+* Compatibility with older PHP versions
+*/
+if (version_compare(phpversion(), '4.3', '<') && !function_exists('html_entity_decode') ) {
+    function html_entity_decode($str, $style=ENT_NOQUOTES) {
+        return strtr($str,
+            array_flip(get_html_translation_table(HTML_ENTITIES,$style)));
+    }
+}
+/**
+* Breaks up data by XML entities but leaves them unparsed,
+* resulting in additional calls to the data handler<br />
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_Entities_Unparsed {
+    /**
+    * Original handler object
+    * @var object
+    * @access private
+    */
+    var $orig_obj;
+    /**
+    * Original handler method
+    * @var string
+    * @access private
+    */
+    var $orig_method;
+    /**
+    * Constructs XML_HTMLSax_Entities_Unparsed
+    * @param object handler object being decorated
+    * @param string original handler method
+    * @access protected
+    */
+    function XML_HTMLSax_Entities_Unparsed(&$orig_obj, $orig_method) {
+        $this->orig_obj =& $orig_obj;
+        $this->orig_method = $orig_method;
+    }
+    /**
+    * Breaks the data up by XML entities
+    * @param XML_HTMLSax
+    * @param string element data
+    * @access protected
+    */
+    function breakData(&$parser, $data) {
+        $data = preg_split('/(&.+?;)/',$data,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
+        foreach ( $data as $chunk ) {
+            $this->orig_obj->{$this->orig_method}($this, $chunk);
+        }
+    }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/XML/XML_HTMLSax/HTMLSax/XML_HTMLSax_States.php b/docs/include/classes/XML/XML_HTMLSax/HTMLSax/XML_HTMLSax_States.php
new file mode 100644 (file)
index 0000000..b588af2
--- /dev/null
@@ -0,0 +1,292 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
+// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: XML_HTMLSax_States.php 2291 2004-11-16 19:35:41Z joel $
+//
+/**
+* Main parser components
+* @package XML_HTMLSax
+* @version $Id: XML_HTMLSax_States.php 2291 2004-11-16 19:35:41Z joel $
+*/
+/**
+* Define parser states
+*/
+define('XML_HTMLSAX_STATE_STOP', 0);
+define('XML_HTMLSAX_STATE_START', 1);
+define('XML_HTMLSAX_STATE_TAG', 2);
+define('XML_HTMLSAX_STATE_OPENING_TAG', 3);
+define('XML_HTMLSAX_STATE_CLOSING_TAG', 4);
+define('XML_HTMLSAX_STATE_ESCAPE', 6);
+define('XML_HTMLSAX_STATE_JASP', 7);
+define('XML_HTMLSAX_STATE_PI', 8);
+/**
+* StartingState searches for the start of any XML tag
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_StartingState  {
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant XML_HTMLSAX_STATE_TAG
+    * @access protected
+    */
+    function parse(&$context) {
+        $data = $context->scanUntilString('<');
+        if ($data != '') {
+            $context->handler_object_data->
+                {$context->handler_method_data}($context->htmlsax, $data);
+        }
+        $context->IgnoreCharacter();
+        return XML_HTMLSAX_STATE_TAG;
+    }
+}
+/**
+* Decides which state to move one from after StartingState
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_TagState {
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant the next state to move into
+    * @access protected
+    */
+    function parse(&$context) {
+        switch($context->ScanCharacter()) {
+        case '/':
+            return XML_HTMLSAX_STATE_CLOSING_TAG;
+            break;
+        case '?':
+            return XML_HTMLSAX_STATE_PI;
+            break;
+        case '%':
+            return XML_HTMLSAX_STATE_JASP;
+            break;
+        case '!':
+            return XML_HTMLSAX_STATE_ESCAPE;
+            break;
+        default:
+            $context->unscanCharacter();
+            return XML_HTMLSAX_STATE_OPENING_TAG;
+        }
+    }
+}
+/**
+* Dealing with closing XML tags
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_ClosingTagState {
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant XML_HTMLSAX_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $tag = $context->scanUntilCharacters('/>');
+        if ($tag != '') {
+            $char = $context->scanCharacter();
+            if ($char == '/') {
+                $char = $context->scanCharacter();
+                if ($char != '>') {
+                    $context->unscanCharacter();
+                }
+            }
+            $context->handler_object_element->
+                {$context->handler_method_closing}($context->htmlsax, $tag, FALSE);
+        }
+        return XML_HTMLSAX_STATE_START;
+    }
+}
+/**
+* Dealing with opening XML tags
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_OpeningTagState {
+    /**
+    * Handles attributes
+    * @param string attribute name
+    * @param string attribute value
+    * @return void
+    * @access protected
+    * @see XML_HTMLSax_AttributeStartState
+    */
+    function parseAttributes(&$context) {
+        $Attributes = array();
+    
+        $context->ignoreWhitespace();
+        $attributename = $context->scanUntilCharacters("=/> \n\r\t");
+        while ($attributename != '') {
+            $attributevalue = NULL;
+            $context->ignoreWhitespace();
+            $char = $context->scanCharacter();
+            if ($char == '=') {
+                $context->ignoreWhitespace();
+                $char = $context->ScanCharacter();
+                if ($char == '"') {
+                    $attributevalue= $context->scanUntilString('"');
+                    $context->IgnoreCharacter();
+                } else if ($char == "'") {
+                    $attributevalue = $context->scanUntilString("'");
+                    $context->IgnoreCharacter();
+                } else {
+                    $context->unscanCharacter();
+                    $attributevalue =
+                        $context->scanUntilCharacters("> \n\r\t");
+                }
+            } else if ($char !== NULL) {
+                $attributevalue = true;
+                $context->unscanCharacter();
+            }
+            $Attributes[$attributename] = $attributevalue;
+            
+            $context->ignoreWhitespace();
+            $attributename = $context->scanUntilCharacters("=/> \n\r\t");
+        }
+        return $Attributes;
+    }
+
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant XML_HTMLSAX_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $tag = $context->scanUntilCharacters("/> \n\r\t");
+        if ($tag != '') {
+            $this->attrs = array();
+            $Attributes = $this->parseAttributes($context);
+            $char = $context->scanCharacter();
+            if ($char == '/') {
+                $char = $context->scanCharacter();
+                if ($char != '>') {
+                    $context->unscanCharacter();
+                }
+                $context->handler_object_element->
+                    {$context->handler_method_opening}($context->htmlsax, $tag, 
+                    $Attributes, TRUE);
+                $context->handler_object_element->
+                    {$context->handler_method_closing}($context->htmlsax, $tag, 
+                    TRUE);
+            } else {
+                $context->handler_object_element->
+                    {$context->handler_method_opening}($context->htmlsax, $tag, 
+                    $Attributes, FALSE);
+            }
+        }
+        return XML_HTMLSAX_STATE_START;
+    }
+}
+
+/**
+* Deals with XML escapes handling comments and CDATA correctly
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_EscapeState {
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant XML_HTMLSAX_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        if ($context->parser_options['XML_OPTION_FULL_ESCAPES']==0) {
+            $char = $context->ScanCharacter();
+            if ($char == '-') {
+                $char = $context->ScanCharacter();
+                if ($char == '-') {
+                    $text = $context->scanUntilString('-->');
+                    $context->IgnoreCharacter();
+                    $context->IgnoreCharacter();
+                } else {
+                    $context->unscanCharacter();
+                    $text = $context->scanUntilString('>');
+                }
+            } else if ( $char == '[') {
+                $context->scanUntilString('CDATA[');
+                for ( $i=0;$i<6;$i++ ) {
+                    $context->IgnoreCharacter();
+                }
+                $text = $context->scanUntilString(']]>');
+                $context->IgnoreCharacter();
+                $context->IgnoreCharacter();
+            } else {
+                $context->unscanCharacter();
+                $text = $context->scanUntilString('>');
+            }
+        } else {
+            $text = $context->scanUntilString('>');
+        }
+        $context->IgnoreCharacter();
+        if ($text != '') {
+            $context->handler_object_escape->
+            {$context->handler_method_escape}($context->htmlsax, $text);
+        }
+        return XML_HTMLSAX_STATE_START;
+    }
+}
+/**
+* Deals with JASP/ASP markup
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_JaspState {
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant XML_HTMLSAX_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $text = $context->scanUntilString('%>');
+        if ($text != '') {
+            $context->handler_object_jasp->
+                {$context->handler_method_jasp}($context->htmlsax, $text);
+        }
+        $context->IgnoreCharacter();
+        $context->IgnoreCharacter();
+        return XML_HTMLSAX_STATE_START;
+    }
+}
+/**
+* Deals with XML processing instructions
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_PiState {
+    /**
+    * @param XML_HTMLSax_StateParser subclass
+    * @return constant XML_HTMLSAX_STATE_START
+    * @access protected
+    */
+    function parse(&$context) {
+        $target = $context->scanUntilCharacters(" \n\r\t");
+        $data = $context->scanUntilString('?>');
+        if ($data != '') {
+            $context->handler_object_pi->
+            {$context->handler_method_pi}($context->htmlsax, $target, $data);
+        }
+        $context->IgnoreCharacter();
+        $context->IgnoreCharacter();
+        return XML_HTMLSAX_STATE_START;
+    }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/XML/XML_HTMLSax/OS/Guess.php b/docs/include/classes/XML/XML_HTMLSax/OS/Guess.php
new file mode 100644 (file)
index 0000000..e620b26
--- /dev/null
@@ -0,0 +1,343 @@
+<?php\r
+/**\r
+ * The OS_Guess class\r
+ *\r
+ * PHP versions 4 and 5\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Gregory Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: Guess.php 8901 2009-11-11 19:10:19Z cindy $\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      File available since PEAR 0.1\r
+ */\r
+\r
+// {{{ uname examples\r
+\r
+// php_uname() without args returns the same as 'uname -a', or a PHP-custom\r
+// string for Windows.\r
+// PHP versions prior to 4.3 return the uname of the host where PHP was built,\r
+// as of 4.3 it returns the uname of the host running the PHP code.\r
+//\r
+// PC RedHat Linux 7.1:\r
+// Linux host.example.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown\r
+//\r
+// PC Debian Potato:\r
+// Linux host 2.4.17 #2 SMP Tue Feb 12 15:10:04 CET 2002 i686 unknown\r
+//\r
+// PC FreeBSD 3.3:\r
+// FreeBSD host.example.com 3.3-STABLE FreeBSD 3.3-STABLE #0: Mon Feb 21 00:42:31 CET 2000     root@example.com:/usr/src/sys/compile/CONFIG  i386\r
+//\r
+// PC FreeBSD 4.3:\r
+// FreeBSD host.example.com 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Mon Jun 25 11:19:43 EDT 2001     root@example.com:/usr/src/sys/compile/CONFIG  i386\r
+//\r
+// PC FreeBSD 4.5:\r
+// FreeBSD host.example.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb  6 23:59:23 CET 2002     root@example.com:/usr/src/sys/compile/CONFIG  i386\r
+//\r
+// PC FreeBSD 4.5 w/uname from GNU shellutils:\r
+// FreeBSD host.example.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb  i386 unknown\r
+//\r
+// HP 9000/712 HP-UX 10:\r
+// HP-UX iq B.10.10 A 9000/712 2008429113 two-user license\r
+//\r
+// HP 9000/712 HP-UX 10 w/uname from GNU shellutils:\r
+// HP-UX host B.10.10 A 9000/712 unknown\r
+//\r
+// IBM RS6000/550 AIX 4.3:\r
+// AIX host 3 4 000003531C00\r
+//\r
+// AIX 4.3 w/uname from GNU shellutils:\r
+// AIX host 3 4 000003531C00 unknown\r
+//\r
+// SGI Onyx IRIX 6.5 w/uname from GNU shellutils:\r
+// IRIX64 host 6.5 01091820 IP19 mips\r
+//\r
+// SGI Onyx IRIX 6.5:\r
+// IRIX64 host 6.5 01091820 IP19\r
+//\r
+// SparcStation 20 Solaris 8 w/uname from GNU shellutils:\r
+// SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc\r
+//\r
+// SparcStation 20 Solaris 8:\r
+// SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc SUNW,SPARCstation-20\r
+//\r
+// Mac OS X (Darwin)\r
+// Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug  5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC  Power Macintosh\r
+//\r
+// Mac OS X early versions\r
+// \r
+\r
+// }}}\r
+\r
+/* TODO:\r
+ * - define endianness, to allow matchSignature("bigend") etc.\r
+ */\r
+\r
+/**\r
+ * Retrieves information about the current operating system\r
+ *\r
+ * This class uses php_uname() to grok information about the current OS\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Gregory Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      Class available since Release 0.1\r
+ */\r
+class OS_Guess\r
+{\r
+    var $sysname;\r
+    var $nodename;\r
+    var $cpu;\r
+    var $release;\r
+    var $extra;\r
+\r
+    function OS_Guess($uname = null)\r
+    {\r
+        list($this->sysname,\r
+             $this->release,\r
+             $this->cpu,\r
+             $this->extra,\r
+             $this->nodename) = $this->parseSignature($uname);\r
+    }\r
+\r
+    function parseSignature($uname = null)\r
+    {\r
+        static $sysmap = array(\r
+            'HP-UX' => 'hpux',\r
+            'IRIX64' => 'irix',\r
+        );\r
+        static $cpumap = array(\r
+            'i586' => 'i386',\r
+            'i686' => 'i386',\r
+            'ppc' => 'powerpc',\r
+        );\r
+        if ($uname === null) {\r
+            $uname = php_uname();\r
+        }\r
+        $parts = split('[[:space:]]+', trim($uname));\r
+        $n = count($parts);\r
+\r
+        $release = $machine = $cpu = '';\r
+        $sysname = $parts[0];\r
+        $nodename = $parts[1];\r
+        $cpu = $parts[$n-1];\r
+        $extra = '';\r
+        if ($cpu == 'unknown') {\r
+            $cpu = $parts[$n-2];\r
+        }\r
+\r
+        switch ($sysname) {\r
+            case 'AIX' :\r
+                $release = "$parts[3].$parts[2]";\r
+                break;\r
+            case 'Windows' :\r
+                switch ($parts[1]) {\r
+                    case '95/98':\r
+                        $release = '9x';\r
+                        break;\r
+                    default:\r
+                        $release = $parts[1];\r
+                        break;\r
+                }\r
+                $cpu = 'i386';\r
+                break;\r
+            case 'Linux' :\r
+                $extra = $this->_detectGlibcVersion();\r
+                // use only the first two digits from the kernel version\r
+                $release = preg_replace('^([0-9]+\.[0-9]+).*', '\1', $parts[2]);\r
+                break;\r
+            case 'Mac' :\r
+                $sysname = 'darwin';\r
+                $nodename = $parts[2];\r
+                $release = $parts[3];\r
+                if ($cpu == 'Macintosh') {\r
+                    if ($parts[$n - 2] == 'Power') {\r
+                        $cpu = 'powerpc';\r
+                    }\r
+                }\r
+                break;\r
+            case 'Darwin' :\r
+                if ($cpu == 'Macintosh') {\r
+                    if ($parts[$n - 2] == 'Power') {\r
+                        $cpu = 'powerpc';\r
+                    }\r
+                }\r
+                $release = preg_replace('^([0-9]+\.[0-9]+).*', '\1', $parts[2]);\r
+                break;\r
+            default:\r
+                $release = preg_replace('/-.*/', '', $parts[2]);\r
+                break;\r
+        }\r
+\r
+\r
+        if (isset($sysmap[$sysname])) {\r
+            $sysname = $sysmap[$sysname];\r
+        } else {\r
+            $sysname = strtolower($sysname);\r
+        }\r
+        if (isset($cpumap[$cpu])) {\r
+            $cpu = $cpumap[$cpu];\r
+        }\r
+        return array($sysname, $release, $cpu, $extra, $nodename);\r
+    }\r
+\r
+    function _detectGlibcVersion()\r
+    {\r
+        static $glibc = false;\r
+        if ($glibc !== false) {\r
+            return $glibc; // no need to run this multiple times\r
+        }\r
+        include_once "System.php";\r
+        if (!file_exists('/usr/bin/cpp') || !is_executable('/usr/bin/cpp')) {\r
+            // Use glibc's <features.h> header file to\r
+            // get major and minor version number:\r
+            if ($features_file = @fopen('/usr/include/features.h', 'rb') ) {\r
+                while (!feof($features_file)) {\r
+                    $line = fgets($features_file, 8192);\r
+                    if (!$line || (strpos($line, '#define') === false)) {\r
+                        continue;\r
+                    }\r
+                    if (strpos($line, '__GLIBC__')) {\r
+                        // major version number #define __GLIBC__ version\r
+                        $line = preg_split('/\s+/', $line);\r
+                        $glibc_major = trim($line[2]);\r
+                        if (isset($glibc_minor)) {\r
+                            break;\r
+                        }\r
+                        continue;\r
+                    }\r
+                    if (strpos($line, '__GLIBC_MINOR__'))  {\r
+                        // got the minor version number\r
+                        // #define __GLIBC_MINOR__ version\r
+                        $line = preg_split('/\s+/', $line);\r
+                        $glibc_minor = trim($line[2]);\r
+                        if (isset($glibc_major)) {\r
+                            break;\r
+                        }\r
+                        continue;\r
+                    }\r
+                }\r
+                fclose($features_file);\r
+                if (!isset($glibc_major) || !isset($glibc_minor)) {\r
+                    return $glibc = '';\r
+                }\r
+                return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ;\r
+            }\r
+            return $glibc = '';\r
+        }\r
+        $tmpfile = System::mktemp("glibctest");\r
+        $fp = fopen($tmpfile, "w");\r
+        fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n");\r
+        fclose($fp);\r
+        $cpp = popen("/usr/bin/cpp $tmpfile", "r");\r
+        $major = $minor = 0;\r
+        while ($line = fgets($cpp, 1024)) {\r
+            if ($line{0} == '#' || trim($line) == '') {\r
+                continue;\r
+            }\r
+            if (list($major, $minor) = explode(' ', trim($line))) {\r
+                break;\r
+            }\r
+        }\r
+        pclose($cpp);\r
+        unlink($tmpfile);\r
+        if (!($major && $minor) && is_link('/lib/libc.so.6')) {\r
+            // Let's try reading the libc.so.6 symlink\r
+            if (preg_match('/^libc-([.*])\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) {\r
+                list($major, $minor) = explode('.', $matches);\r
+            }\r
+        }\r
+        if (!($major && $minor)) {\r
+            return $glibc = '';\r
+        }\r
+        return $glibc = "glibc{$major}.{$minor}";\r
+    }\r
+\r
+    function getSignature()\r
+    {\r
+        if (empty($this->extra)) {\r
+            return "{$this->sysname}-{$this->release}-{$this->cpu}";\r
+        }\r
+        return "{$this->sysname}-{$this->release}-{$this->cpu}-{$this->extra}";\r
+    }\r
+\r
+    function getSysname()\r
+    {\r
+        return $this->sysname;\r
+    }\r
+\r
+    function getNodename()\r
+    {\r
+        return $this->nodename;\r
+    }\r
+\r
+    function getCpu()\r
+    {\r
+        return $this->cpu;\r
+    }\r
+\r
+    function getRelease()\r
+    {\r
+        return $this->release;\r
+    }\r
+\r
+    function getExtra()\r
+    {\r
+        return $this->extra;\r
+    }\r
+\r
+    function matchSignature($match)\r
+    {\r
+        if (is_array($match)) {\r
+            $fragments = $match;\r
+        } else {\r
+            $fragments = explode('-', $match);\r
+        }\r
+        $n = count($fragments);\r
+        $matches = 0;\r
+        if ($n > 0) {\r
+            $matches += $this->_matchFragment($fragments[0], $this->sysname);\r
+        }\r
+        if ($n > 1) {\r
+            $matches += $this->_matchFragment($fragments[1], $this->release);\r
+        }\r
+        if ($n > 2) {\r
+            $matches += $this->_matchFragment($fragments[2], $this->cpu);\r
+        }\r
+        if ($n > 3) {\r
+            $matches += $this->_matchFragment($fragments[3], $this->extra);\r
+        }\r
+        return ($matches == $n);\r
+    }\r
+\r
+    function _matchFragment($fragment, $value)\r
+    {\r
+        if (strcspn($fragment, '*?') < strlen($fragment)) {\r
+            $reg = '/^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '$/i';\r
+            return preg_match($reg, $value);\r
+        }\r
+        return ($fragment == '*' || !strcasecmp($fragment, $value));\r
+    }\r
+\r
+}\r
+/*\r
+ * Local Variables:\r
+ * indent-tabs-mode: nil\r
+ * c-basic-offset: 4\r
+ * End:\r
+ */\r
+?>\r
diff --git a/docs/include/classes/XML/XML_HTMLSax/PEAR.php b/docs/include/classes/XML/XML_HTMLSax/PEAR.php
new file mode 100644 (file)
index 0000000..94a2149
--- /dev/null
@@ -0,0 +1,1095 @@
+<?php\r
+/**\r
+ * PEAR, the PHP Extension and Application Repository\r
+ *\r
+ * PEAR class and PEAR_Error class\r
+ *\r
+ * PHP versions 4 and 5\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Sterling Hughes <sterling@php.net>\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Tomas V.V.Cox <cox@idecnet.com>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: PEAR.php 8901 2009-11-11 19:10:19Z cindy $\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      File available since Release 0.1\r
+ */\r
+\r
+/**#@+\r
+ * ERROR constants\r
+ */\r
+define('PEAR_ERROR_RETURN',     1);\r
+define('PEAR_ERROR_PRINT',      2);\r
+define('PEAR_ERROR_TRIGGER',    4);\r
+define('PEAR_ERROR_DIE',        8);\r
+define('PEAR_ERROR_CALLBACK',  16);\r
+/**\r
+ * WARNING: obsolete\r
+ * @deprecated\r
+ */\r
+define('PEAR_ERROR_EXCEPTION', 32);\r
+/**#@-*/\r
+define('PEAR_ZE2', (function_exists('version_compare') &&\r
+                    version_compare(zend_version(), "2-dev", "ge")));\r
+\r
+if (substr(PHP_OS, 0, 3) == 'WIN') {\r
+    define('OS_WINDOWS', true);\r
+    define('OS_UNIX',    false);\r
+    define('PEAR_OS',    'Windows');\r
+} else {\r
+    define('OS_WINDOWS', false);\r
+    define('OS_UNIX',    true);\r
+    define('PEAR_OS',    'Unix'); // blatant assumption\r
+}\r
+\r
+// instant backwards compatibility\r
+if (!defined('PATH_SEPARATOR')) {\r
+    if (OS_WINDOWS) {\r
+        define('PATH_SEPARATOR', ';');\r
+    } else {\r
+        define('PATH_SEPARATOR', ':');\r
+    }\r
+}\r
+\r
+$GLOBALS['_PEAR_default_error_mode']     = PEAR_ERROR_RETURN;\r
+$GLOBALS['_PEAR_default_error_options']  = E_USER_NOTICE;\r
+$GLOBALS['_PEAR_destructor_object_list'] = array();\r
+$GLOBALS['_PEAR_shutdown_funcs']         = array();\r
+$GLOBALS['_PEAR_error_handler_stack']    = array();\r
+\r
+@ini_set('track_errors', true);\r
+\r
+/**\r
+ * Base class for other PEAR classes.  Provides rudimentary\r
+ * emulation of destructors.\r
+ *\r
+ * If you want a destructor in your class, inherit PEAR and make a\r
+ * destructor method called _yourclassname (same name as the\r
+ * constructor, but with a "_" prefix).  Also, in your constructor you\r
+ * have to call the PEAR constructor: $this->PEAR();.\r
+ * The destructor method will be called without parameters.  Note that\r
+ * at in some SAPI implementations (such as Apache), any output during\r
+ * the request shutdown (in which destructors are called) seems to be\r
+ * discarded.  If you need to get any debug information from your\r
+ * destructor, use error_log(), syslog() or something similar.\r
+ *\r
+ * IMPORTANT! To use the emulated destructors you need to create the\r
+ * objects by reference: $obj = new PEAR_child;\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Tomas V.V. Cox <cox@idecnet.com>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @see        PEAR_Error\r
+ * @since      Class available since PHP 4.0.2\r
+ * @link        http://pear.php.net/manual/en/core.pear.php#core.pear.pear\r
+ */\r
+class PEAR\r
+{\r
+    // {{{ properties\r
+\r
+    /**\r
+     * Whether to enable internal debug messages.\r
+     *\r
+     * @var     bool\r
+     * @access  private\r
+     */\r
+    var $_debug = false;\r
+\r
+    /**\r
+     * Default error mode for this object.\r
+     *\r
+     * @var     int\r
+     * @access  private\r
+     */\r
+    var $_default_error_mode = null;\r
+\r
+    /**\r
+     * Default error options used for this object when error mode\r
+     * is PEAR_ERROR_TRIGGER.\r
+     *\r
+     * @var     int\r
+     * @access  private\r
+     */\r
+    var $_default_error_options = null;\r
+\r
+    /**\r
+     * Default error handler (callback) for this object, if error mode is\r
+     * PEAR_ERROR_CALLBACK.\r
+     *\r
+     * @var     string\r
+     * @access  private\r
+     */\r
+    var $_default_error_handler = '';\r
+\r
+    /**\r
+     * Which class to use for error objects.\r
+     *\r
+     * @var     string\r
+     * @access  private\r
+     */\r
+    var $_error_class = 'PEAR_Error';\r
+\r
+    /**\r
+     * An array of expected errors.\r
+     *\r
+     * @var     array\r
+     * @access  private\r
+     */\r
+    var $_expected_errors = array();\r
+\r
+    // }}}\r
+\r
+    // {{{ constructor\r
+\r
+    /**\r
+     * Constructor.  Registers this object in\r
+     * $_PEAR_destructor_object_list for destructor emulation if a\r
+     * destructor object exists.\r
+     *\r
+     * @param string $error_class  (optional) which class to use for\r
+     *        error objects, defaults to PEAR_Error.\r
+     * @access public\r
+     * @return void\r
+     */\r
+    function PEAR($error_class = null)\r
+    {\r
+        $classname = strtolower(get_class($this));\r
+        if ($this->_debug) {\r
+            print "PEAR constructor called, class=$classname\n";\r
+        }\r
+        if ($error_class !== null) {\r
+            $this->_error_class = $error_class;\r
+        }\r
+        while ($classname && strcasecmp($classname, "pear")) {\r
+            $destructor = "_$classname";\r
+            if (method_exists($this, $destructor)) {\r
+                global $_PEAR_destructor_object_list;\r
+                $_PEAR_destructor_object_list[] = &$this;\r
+                if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {\r
+                    register_shutdown_function("_PEAR_call_destructors");\r
+                    $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;\r
+                }\r
+                break;\r
+            } else {\r
+                $classname = get_parent_class($classname);\r
+            }\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ destructor\r
+\r
+    /**\r
+     * Destructor (the emulated type of...).  Does nothing right now,\r
+     * but is included for forward compatibility, so subclass\r
+     * destructors should always call it.\r
+     *\r
+     * See the note in the class desciption about output from\r
+     * destructors.\r
+     *\r
+     * @access public\r
+     * @return void\r
+     */\r
+    function _PEAR() {\r
+        if ($this->_debug) {\r
+            printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getStaticProperty()\r
+\r
+    /**\r
+    * If you have a class that's mostly/entirely static, and you need static\r
+    * properties, you can use this method to simulate them. Eg. in your method(s)\r
+    * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');\r
+    * You MUST use a reference, or they will not persist!\r
+    *\r
+    * @access public\r
+    * @param  string $class  The calling classname, to prevent clashes\r
+    * @param  string $var    The variable to retrieve.\r
+    * @return mixed   A reference to the variable. If not set it will be\r
+    *                 auto initialised to NULL.\r
+    */\r
+    function &getStaticProperty($class, $var)\r
+    {\r
+        static $properties;\r
+        return $properties[$class][$var];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ registerShutdownFunc()\r
+\r
+    /**\r
+    * Use this function to register a shutdown method for static\r
+    * classes.\r
+    *\r
+    * @access public\r
+    * @param  mixed $func  The function name (or array of class/method) to call\r
+    * @param  mixed $args  The arguments to pass to the function\r
+    * @return void\r
+    */\r
+    function registerShutdownFunc($func, $args = array())\r
+    {\r
+        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ isError()\r
+\r
+    /**\r
+     * Tell whether a value is a PEAR error.\r
+     *\r
+     * @param   mixed $data   the value to test\r
+     * @param   int   $code   if $data is an error object, return true\r
+     *                        only if $code is a string and\r
+     *                        $obj->getMessage() == $code or\r
+     *                        $code is an integer and $obj->getCode() == $code\r
+     * @access  public\r
+     * @return  bool    true if parameter is an error\r
+     */\r
+    function isError($data, $code = null)\r
+    {\r
+        if (is_a($data, 'PEAR_Error')) {\r
+            if (is_null($code)) {\r
+                return true;\r
+            } elseif (is_string($code)) {\r
+                return $data->getMessage() == $code;\r
+            } else {\r
+                return $data->getCode() == $code;\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ setErrorHandling()\r
+\r
+    /**\r
+     * Sets how errors generated by this object should be handled.\r
+     * Can be invoked both in objects and statically.  If called\r
+     * statically, setErrorHandling sets the default behaviour for all\r
+     * PEAR objects.  If called in an object, setErrorHandling sets\r
+     * the default behaviour for that object.\r
+     *\r
+     * @param int $mode\r
+     *        One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,\r
+     *        PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,\r
+     *        PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.\r
+     *\r
+     * @param mixed $options\r
+     *        When $mode is PEAR_ERROR_TRIGGER, this is the error level (one\r
+     *        of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).\r
+     *\r
+     *        When $mode is PEAR_ERROR_CALLBACK, this parameter is expected\r
+     *        to be the callback function or method.  A callback\r
+     *        function is a string with the name of the function, a\r
+     *        callback method is an array of two elements: the element\r
+     *        at index 0 is the object, and the element at index 1 is\r
+     *        the name of the method to call in the object.\r
+     *\r
+     *        When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is\r
+     *        a printf format string used when printing the error\r
+     *        message.\r
+     *\r
+     * @access public\r
+     * @return void\r
+     * @see PEAR_ERROR_RETURN\r
+     * @see PEAR_ERROR_PRINT\r
+     * @see PEAR_ERROR_TRIGGER\r
+     * @see PEAR_ERROR_DIE\r
+     * @see PEAR_ERROR_CALLBACK\r
+     * @see PEAR_ERROR_EXCEPTION\r
+     *\r
+     * @since PHP 4.0.5\r
+     */\r
+\r
+    function setErrorHandling($mode = null, $options = null)\r
+    {\r
+        if (isset($this) && is_a($this, 'PEAR')) {\r
+            $setmode     = &$this->_default_error_mode;\r
+            $setoptions  = &$this->_default_error_options;\r
+        } else {\r
+            $setmode     = &$GLOBALS['_PEAR_default_error_mode'];\r
+            $setoptions  = &$GLOBALS['_PEAR_default_error_options'];\r
+        }\r
+\r
+        switch ($mode) {\r
+            case PEAR_ERROR_EXCEPTION:\r
+            case PEAR_ERROR_RETURN:\r
+            case PEAR_ERROR_PRINT:\r
+            case PEAR_ERROR_TRIGGER:\r
+            case PEAR_ERROR_DIE:\r
+            case null:\r
+                $setmode = $mode;\r
+                $setoptions = $options;\r
+                break;\r
+\r
+            case PEAR_ERROR_CALLBACK:\r
+                $setmode = $mode;\r
+                // class/object method callback\r
+                if (is_callable($options)) {\r
+                    $setoptions = $options;\r
+                } else {\r
+                    trigger_error("invalid error callback", E_USER_WARNING);\r
+                }\r
+                break;\r
+\r
+            default:\r
+                trigger_error("invalid error mode", E_USER_WARNING);\r
+                break;\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ expectError()\r
+\r
+    /**\r
+     * This method is used to tell which errors you expect to get.\r
+     * Expected errors are always returned with error mode\r
+     * PEAR_ERROR_RETURN.  Expected error codes are stored in a stack,\r
+     * and this method pushes a new element onto it.  The list of\r
+     * expected errors are in effect until they are popped off the\r
+     * stack with the popExpect() method.\r
+     *\r
+     * Note that this method can not be called statically\r
+     *\r
+     * @param mixed $code a single error code or an array of error codes to expect\r
+     *\r
+     * @return int     the new depth of the "expected errors" stack\r
+     * @access public\r
+     */\r
+    function expectError($code = '*')\r
+    {\r
+        if (is_array($code)) {\r
+            array_push($this->_expected_errors, $code);\r
+        } else {\r
+            array_push($this->_expected_errors, array($code));\r
+        }\r
+        return sizeof($this->_expected_errors);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ popExpect()\r
+\r
+    /**\r
+     * This method pops one element off the expected error codes\r
+     * stack.\r
+     *\r
+     * @return array   the list of error codes that were popped\r
+     */\r
+    function popExpect()\r
+    {\r
+        return array_pop($this->_expected_errors);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ _checkDelExpect()\r
+\r
+    /**\r
+     * This method checks unsets an error code if available\r
+     *\r
+     * @param mixed error code\r
+     * @return bool true if the error code was unset, false otherwise\r
+     * @access private\r
+     * @since PHP 4.3.0\r
+     */\r
+    function _checkDelExpect($error_code)\r
+    {\r
+        $deleted = false;\r
+\r
+        foreach ($this->_expected_errors AS $key => $error_array) {\r
+            if (in_array($error_code, $error_array)) {\r
+                unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);\r
+                $deleted = true;\r
+            }\r
+\r
+            // clean up empty arrays\r
+            if (0 == count($this->_expected_errors[$key])) {\r
+                unset($this->_expected_errors[$key]);\r
+            }\r
+        }\r
+        return $deleted;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ delExpect()\r
+\r
+    /**\r
+     * This method deletes all occurences of the specified element from\r
+     * the expected error codes stack.\r
+     *\r
+     * @param  mixed $error_code error code that should be deleted\r
+     * @return mixed list of error codes that were deleted or error\r
+     * @access public\r
+     * @since PHP 4.3.0\r
+     */\r
+    function delExpect($error_code)\r
+    {\r
+        $deleted = false;\r
+\r
+        if ((is_array($error_code) && (0 != count($error_code)))) {\r
+            // $error_code is a non-empty array here;\r
+            // we walk through it trying to unset all\r
+            // values\r
+            foreach($error_code as $key => $error) {\r
+                if ($this->_checkDelExpect($error)) {\r
+                    $deleted =  true;\r
+                } else {\r
+                    $deleted = false;\r
+                }\r
+            }\r
+            return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME\r
+        } elseif (!empty($error_code)) {\r
+            // $error_code comes alone, trying to unset it\r
+            if ($this->_checkDelExpect($error_code)) {\r
+                return true;\r
+            } else {\r
+                return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME\r
+            }\r
+        } else {\r
+            // $error_code is empty\r
+            return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ raiseError()\r
+\r
+    /**\r
+     * This method is a wrapper that returns an instance of the\r
+     * configured error class with this object's default error\r
+     * handling applied.  If the $mode and $options parameters are not\r
+     * specified, the object's defaults are used.\r
+     *\r
+     * @param mixed $message a text error message or a PEAR error object\r
+     *\r
+     * @param int $code      a numeric error code (it is up to your class\r
+     *                  to define these if you want to use codes)\r
+     *\r
+     * @param int $mode      One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,\r
+     *                  PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,\r
+     *                  PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.\r
+     *\r
+     * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter\r
+     *                  specifies the PHP-internal error level (one of\r
+     *                  E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).\r
+     *                  If $mode is PEAR_ERROR_CALLBACK, this\r
+     *                  parameter specifies the callback function or\r
+     *                  method.  In other error modes this parameter\r
+     *                  is ignored.\r
+     *\r
+     * @param string $userinfo If you need to pass along for example debug\r
+     *                  information, this parameter is meant for that.\r
+     *\r
+     * @param string $error_class The returned error object will be\r
+     *                  instantiated from this class, if specified.\r
+     *\r
+     * @param bool $skipmsg If true, raiseError will only pass error codes,\r
+     *                  the error message parameter will be dropped.\r
+     *\r
+     * @access public\r
+     * @return object   a PEAR error object\r
+     * @see PEAR::setErrorHandling\r
+     * @since PHP 4.0.5\r
+     */\r
+    function &raiseError($message = null,\r
+                         $code = null,\r
+                         $mode = null,\r
+                         $options = null,\r
+                         $userinfo = null,\r
+                         $error_class = null,\r
+                         $skipmsg = false)\r
+    {\r
+        // The error is yet a PEAR error object\r
+        if (is_object($message)) {\r
+            $code        = $message->getCode();\r
+            $userinfo    = $message->getUserInfo();\r
+            $error_class = $message->getType();\r
+            $message->error_message_prefix = '';\r
+            $message     = $message->getMessage();\r
+        }\r
+\r
+        if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {\r
+            if ($exp[0] == "*" ||\r
+                (is_int(reset($exp)) && in_array($code, $exp)) ||\r
+                (is_string(reset($exp)) && in_array($message, $exp))) {\r
+                $mode = PEAR_ERROR_RETURN;\r
+            }\r
+        }\r
+        // No mode given, try global ones\r
+        if ($mode === null) {\r
+            // Class error handler\r
+            if (isset($this) && isset($this->_default_error_mode)) {\r
+                $mode    = $this->_default_error_mode;\r
+                $options = $this->_default_error_options;\r
+            // Global error handler\r
+            } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {\r
+                $mode    = $GLOBALS['_PEAR_default_error_mode'];\r
+                $options = $GLOBALS['_PEAR_default_error_options'];\r
+            }\r
+        }\r
+\r
+        if ($error_class !== null) {\r
+            $ec = $error_class;\r
+        } elseif (isset($this) && isset($this->_error_class)) {\r
+            $ec = $this->_error_class;\r
+        } else {\r
+            $ec = 'PEAR_Error';\r
+        }\r
+        if ($skipmsg) {\r
+            $a = new $ec($code, $mode, $options, $userinfo);\r
+            return $a;\r
+        } else {\r
+            $a = new $ec($message, $code, $mode, $options, $userinfo);\r
+            return $a;\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ throwError()\r
+\r
+    /**\r
+     * Simpler form of raiseError with fewer options.  In most cases\r
+     * message, code and userinfo are enough.\r
+     *\r
+     * @param string $message\r
+     *\r
+     */\r
+    function &throwError($message = null,\r
+                         $code = null,\r
+                         $userinfo = null)\r
+    {\r
+        if (isset($this) && is_a($this, 'PEAR')) {\r
+            $a = &$this->raiseError($message, $code, null, null, $userinfo);\r
+            return $a;\r
+        } else {\r
+            $a = &PEAR::raiseError($message, $code, null, null, $userinfo);\r
+            return $a;\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    function staticPushErrorHandling($mode, $options = null)\r
+    {\r
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];\r
+        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];\r
+        $def_options = &$GLOBALS['_PEAR_default_error_options'];\r
+        $stack[] = array($def_mode, $def_options);\r
+        switch ($mode) {\r
+            case PEAR_ERROR_EXCEPTION:\r
+            case PEAR_ERROR_RETURN:\r
+            case PEAR_ERROR_PRINT:\r
+            case PEAR_ERROR_TRIGGER:\r
+            case PEAR_ERROR_DIE:\r
+            case null:\r
+                $def_mode = $mode;\r
+                $def_options = $options;\r
+                break;\r
+\r
+            case PEAR_ERROR_CALLBACK:\r
+                $def_mode = $mode;\r
+                // class/object method callback\r
+                if (is_callable($options)) {\r
+                    $def_options = $options;\r
+                } else {\r
+                    trigger_error("invalid error callback", E_USER_WARNING);\r
+                }\r
+                break;\r
+\r
+            default:\r
+                trigger_error("invalid error mode", E_USER_WARNING);\r
+                break;\r
+        }\r
+        $stack[] = array($mode, $options);\r
+        return true;\r
+    }\r
+\r
+    function staticPopErrorHandling()\r
+    {\r
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];\r
+        $setmode     = &$GLOBALS['_PEAR_default_error_mode'];\r
+        $setoptions  = &$GLOBALS['_PEAR_default_error_options'];\r
+        array_pop($stack);\r
+        list($mode, $options) = $stack[sizeof($stack) - 1];\r
+        array_pop($stack);\r
+        switch ($mode) {\r
+            case PEAR_ERROR_EXCEPTION:\r
+            case PEAR_ERROR_RETURN:\r
+            case PEAR_ERROR_PRINT:\r
+            case PEAR_ERROR_TRIGGER:\r
+            case PEAR_ERROR_DIE:\r
+            case null:\r
+                $setmode = $mode;\r
+                $setoptions = $options;\r
+                break;\r
+\r
+            case PEAR_ERROR_CALLBACK:\r
+                $setmode = $mode;\r
+                // class/object method callback\r
+                if (is_callable($options)) {\r
+                    $setoptions = $options;\r
+                } else {\r
+                    trigger_error("invalid error callback", E_USER_WARNING);\r
+                }\r
+                break;\r
+\r
+            default:\r
+                trigger_error("invalid error mode", E_USER_WARNING);\r
+                break;\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // {{{ pushErrorHandling()\r
+\r
+    /**\r
+     * Push a new error handler on top of the error handler options stack. With this\r
+     * you can easily override the actual error handler for some code and restore\r
+     * it later with popErrorHandling.\r
+     *\r
+     * @param mixed $mode (same as setErrorHandling)\r
+     * @param mixed $options (same as setErrorHandling)\r
+     *\r
+     * @return bool Always true\r
+     *\r
+     * @see PEAR::setErrorHandling\r
+     */\r
+    function pushErrorHandling($mode, $options = null)\r
+    {\r
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];\r
+        if (isset($this) && is_a($this, 'PEAR')) {\r
+            $def_mode    = &$this->_default_error_mode;\r
+            $def_options = &$this->_default_error_options;\r
+        } else {\r
+            $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];\r
+            $def_options = &$GLOBALS['_PEAR_default_error_options'];\r
+        }\r
+        $stack[] = array($def_mode, $def_options);\r
+\r
+        if (isset($this) && is_a($this, 'PEAR')) {\r
+            $this->setErrorHandling($mode, $options);\r
+        } else {\r
+            PEAR::setErrorHandling($mode, $options);\r
+        }\r
+        $stack[] = array($mode, $options);\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ popErrorHandling()\r
+\r
+    /**\r
+    * Pop the last error handler used\r
+    *\r
+    * @return bool Always true\r
+    *\r
+    * @see PEAR::pushErrorHandling\r
+    */\r
+    function popErrorHandling()\r
+    {\r
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];\r
+        array_pop($stack);\r
+        list($mode, $options) = $stack[sizeof($stack) - 1];\r
+        array_pop($stack);\r
+        if (isset($this) && is_a($this, 'PEAR')) {\r
+            $this->setErrorHandling($mode, $options);\r
+        } else {\r
+            PEAR::setErrorHandling($mode, $options);\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ loadExtension()\r
+\r
+    /**\r
+    * OS independant PHP extension load. Remember to take care\r
+    * on the correct extension name for case sensitive OSes.\r
+    *\r
+    * @param string $ext The extension name\r
+    * @return bool Success or not on the dl() call\r
+    */\r
+    function loadExtension($ext)\r
+    {\r
+        if (!extension_loaded($ext)) {\r
+            // if either returns true dl() will produce a FATAL error, stop that\r
+            if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {\r
+                return false;\r
+            }\r
+            if (OS_WINDOWS) {\r
+                $suffix = '.dll';\r
+            } elseif (PHP_OS == 'HP-UX') {\r
+                $suffix = '.sl';\r
+            } elseif (PHP_OS == 'AIX') {\r
+                $suffix = '.a';\r
+            } elseif (PHP_OS == 'OSX') {\r
+                $suffix = '.bundle';\r
+            } else {\r
+                $suffix = '.so';\r
+            }\r
+            return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+}\r
+\r
+// {{{ _PEAR_call_destructors()\r
+\r
+function _PEAR_call_destructors()\r
+{\r
+    global $_PEAR_destructor_object_list;\r
+    if (is_array($_PEAR_destructor_object_list) &&\r
+        sizeof($_PEAR_destructor_object_list))\r
+    {\r
+        reset($_PEAR_destructor_object_list);\r
+        if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) {\r
+            $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);\r
+        }\r
+        while (list($k, $objref) = each($_PEAR_destructor_object_list)) {\r
+            $classname = get_class($objref);\r
+            while ($classname) {\r
+                $destructor = "_$classname";\r
+                if (method_exists($objref, $destructor)) {\r
+                    $objref->$destructor();\r
+                    break;\r
+                } else {\r
+                    $classname = get_parent_class($classname);\r
+                }\r
+            }\r
+        }\r
+        // Empty the object list to ensure that destructors are\r
+        // not called more than once.\r
+        $_PEAR_destructor_object_list = array();\r
+    }\r
+\r
+    // Now call the shutdown functions\r
+    if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {\r
+        foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {\r
+            call_user_func_array($value[0], $value[1]);\r
+        }\r
+    }\r
+}\r
+\r
+// }}}\r
+/**\r
+ * Standard PEAR error class for PHP 4\r
+ *\r
+ * This class is supserseded by {@link PEAR_Exception} in PHP 5\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Tomas V.V. Cox <cox@idecnet.com>\r
+ * @author     Gregory Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/manual/en/core.pear.pear-error.php\r
+ * @see        PEAR::raiseError(), PEAR::throwError()\r
+ * @since      Class available since PHP 4.0.2\r
+ */\r
+class PEAR_Error\r
+{\r
+    // {{{ properties\r
+\r
+    var $error_message_prefix = '';\r
+    var $mode                 = PEAR_ERROR_RETURN;\r
+    var $level                = E_USER_NOTICE;\r
+    var $code                 = -1;\r
+    var $message              = '';\r
+    var $userinfo             = '';\r
+    var $backtrace            = null;\r
+\r
+    // }}}\r
+    // {{{ constructor\r
+\r
+    /**\r
+     * PEAR_Error constructor\r
+     *\r
+     * @param string $message  message\r
+     *\r
+     * @param int $code     (optional) error code\r
+     *\r
+     * @param int $mode     (optional) error mode, one of: PEAR_ERROR_RETURN,\r
+     * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,\r
+     * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION\r
+     *\r
+     * @param mixed $options   (optional) error level, _OR_ in the case of\r
+     * PEAR_ERROR_CALLBACK, the callback function or object/method\r
+     * tuple.\r
+     *\r
+     * @param string $userinfo (optional) additional user/debug info\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function PEAR_Error($message = 'unknown error', $code = null,\r
+                        $mode = null, $options = null, $userinfo = null)\r
+    {\r
+        if ($mode === null) {\r
+            $mode = PEAR_ERROR_RETURN;\r
+        }\r
+        $this->message   = $message;\r
+        $this->code      = $code;\r
+        $this->mode      = $mode;\r
+        $this->userinfo  = $userinfo;\r
+        if (function_exists("debug_backtrace")) {\r
+            if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {\r
+                $this->backtrace = debug_backtrace();\r
+            }\r
+        }\r
+        if ($mode & PEAR_ERROR_CALLBACK) {\r
+            $this->level = E_USER_NOTICE;\r
+            $this->callback = $options;\r
+        } else {\r
+            if ($options === null) {\r
+                $options = E_USER_NOTICE;\r
+            }\r
+            $this->level = $options;\r
+            $this->callback = null;\r
+        }\r
+        if ($this->mode & PEAR_ERROR_PRINT) {\r
+            if (is_null($options) || is_int($options)) {\r
+                $format = "%s";\r
+            } else {\r
+                $format = $options;\r
+            }\r
+            printf($format, $this->getMessage());\r
+        }\r
+        if ($this->mode & PEAR_ERROR_TRIGGER) {\r
+            trigger_error($this->getMessage(), $this->level);\r
+        }\r
+        if ($this->mode & PEAR_ERROR_DIE) {\r
+            $msg = $this->getMessage();\r
+            if (is_null($options) || is_int($options)) {\r
+                $format = "%s";\r
+                if (substr($msg, -1) != "\n") {\r
+                    $msg .= "\n";\r
+                }\r
+            } else {\r
+                $format = $options;\r
+            }\r
+            die(sprintf($format, $msg));\r
+        }\r
+        if ($this->mode & PEAR_ERROR_CALLBACK) {\r
+            if (is_callable($this->callback)) {\r
+                call_user_func($this->callback, $this);\r
+            }\r
+        }\r
+        if ($this->mode & PEAR_ERROR_EXCEPTION) {\r
+            trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);\r
+            eval('$e = new Exception($this->message, $this->code);throw($e);');\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getMode()\r
+\r
+    /**\r
+     * Get the error mode from an error object.\r
+     *\r
+     * @return int error mode\r
+     * @access public\r
+     */\r
+    function getMode() {\r
+        return $this->mode;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getCallback()\r
+\r
+    /**\r
+     * Get the callback function/method from an error object.\r
+     *\r
+     * @return mixed callback function or object/method array\r
+     * @access public\r
+     */\r
+    function getCallback() {\r
+        return $this->callback;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getMessage()\r
+\r
+\r
+    /**\r
+     * Get the error message from an error object.\r
+     *\r
+     * @return  string  full error message\r
+     * @access public\r
+     */\r
+    function getMessage()\r
+    {\r
+        return ($this->error_message_prefix . $this->message);\r
+    }\r
+\r
+\r
+    // }}}\r
+    // {{{ getCode()\r
+\r
+    /**\r
+     * Get error code from an error object\r
+     *\r
+     * @return int error code\r
+     * @access public\r
+     */\r
+     function getCode()\r
+     {\r
+        return $this->code;\r
+     }\r
+\r
+    // }}}\r
+    // {{{ getType()\r
+\r
+    /**\r
+     * Get the name of this error/exception.\r
+     *\r
+     * @return string error/exception name (type)\r
+     * @access public\r
+     */\r
+    function getType()\r
+    {\r
+        return get_class($this);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getUserInfo()\r
+\r
+    /**\r
+     * Get additional user-supplied information.\r
+     *\r
+     * @return string user-supplied information\r
+     * @access public\r
+     */\r
+    function getUserInfo()\r
+    {\r
+        return $this->userinfo;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getDebugInfo()\r
+\r
+    /**\r
+     * Get additional debug information supplied by the application.\r
+     *\r
+     * @return string debug information\r
+     * @access public\r
+     */\r
+    function getDebugInfo()\r
+    {\r
+        return $this->getUserInfo();\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getBacktrace()\r
+\r
+    /**\r
+     * Get the call backtrace from where the error was generated.\r
+     * Supported with PHP 4.3.0 or newer.\r
+     *\r
+     * @param int $frame (optional) what frame to fetch\r
+     * @return array Backtrace, or NULL if not available.\r
+     * @access public\r
+     */\r
+    function getBacktrace($frame = null)\r
+    {\r
+        if (defined('PEAR_IGNORE_BACKTRACE')) {\r
+            return null;\r
+        }\r
+        if ($frame === null) {\r
+            return $this->backtrace;\r
+        }\r
+        return $this->backtrace[$frame];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ addUserInfo()\r
+\r
+    function addUserInfo($info)\r
+    {\r
+        if (empty($this->userinfo)) {\r
+            $this->userinfo = $info;\r
+        } else {\r
+            $this->userinfo .= " ** $info";\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ toString()\r
+\r
+    /**\r
+     * Make a string representation of this object.\r
+     *\r
+     * @return string a string with an object summary\r
+     * @access public\r
+     */\r
+    function toString() {\r
+        $modes = array();\r
+        $levels = array(E_USER_NOTICE  => 'notice',\r
+                        E_USER_WARNING => 'warning',\r
+                        E_USER_ERROR   => 'error');\r
+        if ($this->mode & PEAR_ERROR_CALLBACK) {\r
+            if (is_array($this->callback)) {\r
+                $callback = (is_object($this->callback[0]) ?\r
+                    strtolower(get_class($this->callback[0])) :\r
+                    $this->callback[0]) . '::' .\r
+                    $this->callback[1];\r
+            } else {\r
+                $callback = $this->callback;\r
+            }\r
+            return sprintf('[%s: message="%s" code=%d mode=callback '.\r
+                           'callback=%s prefix="%s" info="%s"]',\r
+                           strtolower(get_class($this)), $this->message, $this->code,\r
+                           $callback, $this->error_message_prefix,\r
+                           $this->userinfo);\r
+        }\r
+        if ($this->mode & PEAR_ERROR_PRINT) {\r
+            $modes[] = 'print';\r
+        }\r
+        if ($this->mode & PEAR_ERROR_TRIGGER) {\r
+            $modes[] = 'trigger';\r
+        }\r
+        if ($this->mode & PEAR_ERROR_DIE) {\r
+            $modes[] = 'die';\r
+        }\r
+        if ($this->mode & PEAR_ERROR_RETURN) {\r
+            $modes[] = 'return';\r
+        }\r
+        return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.\r
+                       'prefix="%s" info="%s"]',\r
+                       strtolower(get_class($this)), $this->message, $this->code,\r
+                       implode("|", $modes), $levels[$this->level],\r
+                       $this->error_message_prefix,\r
+                       $this->userinfo);\r
+    }\r
+\r
+    // }}}\r
+}\r
+\r
+/*\r
+ * Local Variables:\r
+ * mode: php\r
+ * tab-width: 4\r
+ * c-basic-offset: 4\r
+ * End:\r
+ */\r
+?>\r
diff --git a/docs/include/classes/XML/XML_HTMLSax/PEAR/Autoloader.php b/docs/include/classes/XML/XML_HTMLSax/PEAR/Autoloader.php
new file mode 100644 (file)
index 0000000..e486615
--- /dev/null
@@ -0,0 +1,223 @@
+<?php\r
+/**\r
+ * Class auto-loader\r
+ *\r
+ * PHP versions 4\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: Autoloader.php 8901 2009-11-11 19:10:19Z cindy $\r
+ * @link       http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader\r
+ * @since      File available since Release 0.1\r
+ * @deprecated File deprecated in Release 1.4.0a1\r
+ */\r
+\r
+// /* vim: set expandtab tabstop=4 shiftwidth=4: */\r
+\r
+if (!extension_loaded("overload")) {\r
+    // die hard without ext/overload\r
+    die("Rebuild PHP with the `overload' extension to use PEAR_Autoloader");\r
+}\r
+\r
+/**\r
+ * Include for PEAR_Error and PEAR classes\r
+ */\r
+require_once "PEAR.php";\r
+\r
+/**\r
+ * This class is for objects where you want to separate the code for\r
+ * some methods into separate classes.  This is useful if you have a\r
+ * class with not-frequently-used methods that contain lots of code\r
+ * that you would like to avoid always parsing.\r
+ *\r
+ * The PEAR_Autoloader class provides autoloading and aggregation.\r
+ * The autoloading lets you set up in which classes the separated\r
+ * methods are found.  Aggregation is the technique used to import new\r
+ * methods, an instance of each class providing separated methods is\r
+ * stored and called every time the aggregated method is called.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author Stig Bakken <ssb@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader\r
+ * @since      File available since Release 0.1\r
+ * @deprecated File deprecated in Release 1.4.0a1\r
+ */\r
+class PEAR_Autoloader extends PEAR\r
+{\r
+    // {{{ properties\r
+\r
+    /**\r
+     * Map of methods and classes where they are defined\r
+     *\r
+     * @var array\r
+     *\r
+     * @access private\r
+     */\r
+    var $_autoload_map = array();\r
+\r
+    /**\r
+     * Map of methods and aggregate objects\r
+     *\r
+     * @var array\r
+     *\r
+     * @access private\r
+     */\r
+    var $_method_map = array();\r
+\r
+    // }}}\r
+    // {{{ addAutoload()\r
+\r
+    /**\r
+     * Add one or more autoload entries.\r
+     *\r
+     * @param string $method     which method to autoload\r
+     *\r
+     * @param string $classname  (optional) which class to find the method in.\r
+     *                           If the $method parameter is an array, this\r
+     *                           parameter may be omitted (and will be ignored\r
+     *                           if not), and the $method parameter will be\r
+     *                           treated as an associative array with method\r
+     *                           names as keys and class names as values.\r
+     *\r
+     * @return void\r
+     *\r
+     * @access public\r
+     */\r
+    function addAutoload($method, $classname = null)\r
+    {\r
+        if (is_array($method)) {\r
+            array_walk($method, create_function('$a,&$b', '$b = strtolower($b);'));\r
+            $this->_autoload_map = array_merge($this->_autoload_map, $method);\r
+        } else {\r
+            $this->_autoload_map[strtolower($method)] = $classname;\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ removeAutoload()\r
+\r
+    /**\r
+     * Remove an autoload entry.\r
+     *\r
+     * @param string $method  which method to remove the autoload entry for\r
+     *\r
+     * @return bool TRUE if an entry was removed, FALSE if not\r
+     *\r
+     * @access public\r
+     */\r
+    function removeAutoload($method)\r
+    {\r
+        $method = strtolower($method);\r
+        $ok = isset($this->_autoload_map[$method]);\r
+        unset($this->_autoload_map[$method]);\r
+        return $ok;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ addAggregateObject()\r
+\r
+    /**\r
+     * Add an aggregate object to this object.  If the specified class\r
+     * is not defined, loading it will be attempted following PEAR's\r
+     * file naming scheme.  All the methods in the class will be\r
+     * aggregated, except private ones (name starting with an\r
+     * underscore) and constructors.\r
+     *\r
+     * @param string $classname  what class to instantiate for the object.\r
+     *\r
+     * @return void\r
+     *\r
+     * @access public\r
+     */\r
+    function addAggregateObject($classname)\r
+    {\r
+        $classname = strtolower($classname);\r
+        if (!class_exists($classname)) {\r
+            $include_file = preg_replace('/[^a-z0-9]/i', '_', $classname);\r
+            include_once $include_file;\r
+        }\r
+        $obj = new $classname;\r
+        $methods = get_class_methods($classname);\r
+        foreach ($methods as $method) {\r
+            // don't import priviate methods and constructors\r
+            if ($method{0} != '_' && $method != $classname) {\r
+                $this->_method_map[$method] = $obj;\r
+            }\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ removeAggregateObject()\r
+\r
+    /**\r
+     * Remove an aggregate object.\r
+     *\r
+     * @param string $classname  the class of the object to remove\r
+     *\r
+     * @return bool  TRUE if an object was removed, FALSE if not\r
+     *\r
+     * @access public\r
+     */\r
+    function removeAggregateObject($classname)\r
+    {\r
+        $ok = false;\r
+        $classname = strtolower($classname);\r
+        reset($this->_method_map);\r
+        while (list($method, $obj) = each($this->_method_map)) {\r
+            if (is_a($obj, $classname)) {\r
+                unset($this->_method_map[$method]);\r
+                $ok = true;\r
+            }\r
+        }\r
+        return $ok;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ __call()\r
+\r
+    /**\r
+     * Overloaded object call handler, called each time an\r
+     * undefined/aggregated method is invoked.  This method repeats\r
+     * the call in the right aggregate object and passes on the return\r
+     * value.\r
+     *\r
+     * @param string $method  which method that was called\r
+     *\r
+     * @param string $args    An array of the parameters passed in the\r
+     *                        original call\r
+     *\r
+     * @return mixed  The return value from the aggregated method, or a PEAR\r
+     *                error if the called method was unknown.\r
+     */\r
+    function __call($method, $args, &$retval)\r
+    {\r
+        $method = strtolower($method);\r
+        if (empty($this->_method_map[$method]) && isset($this->_autoload_map[$method])) {\r
+            $this->addAggregateObject($this->_autoload_map[$method]);\r
+        }\r
+        if (isset($this->_method_map[$method])) {\r
+            $retval = call_user_func_array(array($this->_method_map[$method], $method), $args);\r
+            return true;\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+}\r
+\r
+overload("PEAR_Autoloader");\r
+\r
+?>\r
diff --git a/docs/include/classes/XML/XML_HTMLSax/PEAR/Common.php b/docs/include/classes/XML/XML_HTMLSax/PEAR/Common.php
new file mode 100644 (file)
index 0000000..f0f1fe4
--- /dev/null
@@ -0,0 +1,1140 @@
+<?php\r
+/**\r
+ * PEAR_Common, the base class for the PEAR Installer\r
+ *\r
+ * PHP versions 4 and 5\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Tomas V. V. Cox <cox@idecnet.com>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: Common.php 8901 2009-11-11 19:10:19Z cindy $\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      File available since Release 0.1.0\r
+ * @deprecated File deprecated since Release 1.4.0a1\r
+ */\r
+\r
+/**\r
+ * Include error handling\r
+ */\r
+require_once 'PEAR.php';\r
+\r
+// {{{ constants and globals\r
+\r
+/**\r
+ * PEAR_Common error when an invalid PHP file is passed to PEAR_Common::analyzeSourceCode()\r
+ */\r
+define('PEAR_COMMON_ERROR_INVALIDPHP', 1);\r
+define('_PEAR_COMMON_PACKAGE_NAME_PREG', '[A-Za-z][a-zA-Z0-9_]+');\r
+define('PEAR_COMMON_PACKAGE_NAME_PREG', '/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '$/');\r
+\r
+// this should allow: 1, 1.0, 1.0RC1, 1.0dev, 1.0dev123234234234, 1.0a1, 1.0b1, 1.0pl1\r
+define('_PEAR_COMMON_PACKAGE_VERSION_PREG', '\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?');\r
+define('PEAR_COMMON_PACKAGE_VERSION_PREG', '/^' . _PEAR_COMMON_PACKAGE_VERSION_PREG . '$/i');\r
+\r
+// XXX far from perfect :-)\r
+define('_PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '(' . _PEAR_COMMON_PACKAGE_NAME_PREG .\r
+    ')(-([.0-9a-zA-Z]+))?');\r
+define('PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '/^' . _PEAR_COMMON_PACKAGE_DOWNLOAD_PREG .\r
+    '$/');\r
+\r
+define('_PEAR_CHANNELS_NAME_PREG', '[A-Za-z][a-zA-Z0-9_\.]+');\r
+define('PEAR_CHANNELS_NAME_PREG', '/^' . _PEAR_CHANNELS_NAME_PREG . '$/');\r
+\r
+// this should allow any dns or IP address, plus a path - NO UNDERSCORES ALLOWED\r
+define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(\/[a-zA-Z0-9-]+)*');\r
+define('PEAR_CHANNELS_SERVER_PREG', '/^' . _PEAR_CHANNELS_SERVER_PREG . '$/i');\r
+\r
+define('_PEAR_CHANNELS_PACKAGE_PREG',  '(' ._PEAR_CHANNELS_SERVER_PREG . ')\/('\r
+         . _PEAR_COMMON_PACKAGE_NAME_PREG . ')');\r
+define('PEAR_CHANNELS_PACKAGE_PREG', '/^' . _PEAR_CHANNELS_PACKAGE_PREG . '$/i');\r
+\r
+define('_PEAR_COMMON_CHANNEL_DOWNLOAD_PREG', '(' . _PEAR_CHANNELS_NAME_PREG . ')::('\r
+    . _PEAR_COMMON_PACKAGE_NAME_PREG . ')(-([.0-9a-zA-Z]+))?');\r
+define('PEAR_COMMON_CHANNEL_DOWNLOAD_PREG', '/^' . _PEAR_COMMON_CHANNEL_DOWNLOAD_PREG . '$/');\r
+\r
+/**\r
+ * List of temporary files and directories registered by\r
+ * PEAR_Common::addTempFile().\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_tempfiles'] = array();\r
+\r
+/**\r
+ * Valid maintainer roles\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_maintainer_roles'] = array('lead','developer','contributor','helper');\r
+\r
+/**\r
+ * Valid release states\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_release_states'] = array('alpha','beta','stable','snapshot','devel');\r
+\r
+/**\r
+ * Valid dependency types\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_dependency_types'] = array('pkg','ext','php','prog','ldlib','rtlib','os','websrv','sapi');\r
+\r
+/**\r
+ * Valid dependency relations\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_dependency_relations'] = array('has','eq','lt','le','gt','ge','not', 'ne');\r
+\r
+/**\r
+ * Valid file roles\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_file_roles'] = array('php','ext','test','doc','data','src','script');\r
+\r
+/**\r
+ * Valid replacement types\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_replacement_types'] = array('php-const', 'pear-config', 'package-info');\r
+\r
+/**\r
+ * Valid "provide" types\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_provide_types'] = array('ext', 'prog', 'class', 'function', 'feature', 'api');\r
+\r
+/**\r
+ * Valid "provide" types\r
+ * @var array\r
+ */\r
+$GLOBALS['_PEAR_Common_script_phases'] = array('pre-install', 'post-install', 'pre-uninstall', 'post-uninstall', 'pre-build', 'post-build', 'pre-configure', 'post-configure', 'pre-setup', 'post-setup');\r
+\r
+// }}}\r
+\r
+/**\r
+ * Class providing common functionality for PEAR administration classes.\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Tomas V. V. Cox <cox@idecnet.com>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      Class available since Release 1.4.0a1\r
+ * @deprecated This class will disappear, and its components will be spread\r
+ *             into smaller classes, like the AT&T breakup, as of Release 1.4.0a1\r
+ */\r
+class PEAR_Common extends PEAR\r
+{\r
+    // {{{ properties\r
+\r
+    /** stack of elements, gives some sort of XML context */\r
+    var $element_stack = array();\r
+\r
+    /** name of currently parsed XML element */\r
+    var $current_element;\r
+\r
+    /** array of attributes of the currently parsed XML element */\r
+    var $current_attributes = array();\r
+\r
+    /** assoc with information about a package */\r
+    var $pkginfo = array();\r
+\r
+    /**\r
+     * User Interface object (PEAR_Frontend_* class).  If null,\r
+     * the log() method uses print.\r
+     * @var object\r
+     */\r
+    var $ui = null;\r
+\r
+    /**\r
+     * Configuration object (PEAR_Config).\r
+     * @var object\r
+     */\r
+    var $config = null;\r
+\r
+    var $current_path = null;\r
+\r
+    /**\r
+     * PEAR_SourceAnalyzer instance\r
+     * @var object\r
+     */\r
+    var $source_analyzer = null;\r
+    /**\r
+     * Flag variable used to mark a valid package file\r
+     * @var boolean\r
+     * @access private\r
+     */\r
+    var $_validPackageFile;\r
+\r
+    // }}}\r
+\r
+    // {{{ constructor\r
+\r
+    /**\r
+     * PEAR_Common constructor\r
+     *\r
+     * @access public\r
+     */\r
+    function PEAR_Common()\r
+    {\r
+        parent::PEAR();\r
+        $this->config = &PEAR_Config::singleton();\r
+        $this->debug = $this->config->get('verbose');\r
+    }\r
+\r
+    // }}}\r
+    // {{{ destructor\r
+\r
+    /**\r
+     * PEAR_Common destructor\r
+     *\r
+     * @access private\r
+     */\r
+    function _PEAR_Common()\r
+    {\r
+        // doesn't work due to bug #14744\r
+        //$tempfiles = $this->_tempfiles;\r
+        $tempfiles =& $GLOBALS['_PEAR_Common_tempfiles'];\r
+        while ($file = array_shift($tempfiles)) {\r
+            if (@is_dir($file)) {\r
+                if (!class_exists('System')) {\r
+                    require_once 'System.php';\r
+                }\r
+                System::rm(array('-rf', $file));\r
+            } elseif (file_exists($file)) {\r
+                unlink($file);\r
+            }\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ addTempFile()\r
+\r
+    /**\r
+     * Register a temporary file or directory.  When the destructor is\r
+     * executed, all registered temporary files and directories are\r
+     * removed.\r
+     *\r
+     * @param string  $file  name of file or directory\r
+     *\r
+     * @return void\r
+     *\r
+     * @access public\r
+     */\r
+    function addTempFile($file)\r
+    {\r
+        if (!class_exists('PEAR_Frontend')) {\r
+            require_once 'PEAR/Frontend.php';\r
+        }\r
+        PEAR_Frontend::addTempFile($file);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ mkDirHier()\r
+\r
+    /**\r
+     * Wrapper to System::mkDir(), creates a directory as well as\r
+     * any necessary parent directories.\r
+     *\r
+     * @param string  $dir  directory name\r
+     *\r
+     * @return bool TRUE on success, or a PEAR error\r
+     *\r
+     * @access public\r
+     */\r
+    function mkDirHier($dir)\r
+    {\r
+        $this->log(2, "+ create dir $dir");\r
+        if (!class_exists('System')) {\r
+            require_once 'System.php';\r
+        }\r
+        return System::mkDir(array('-p', $dir));\r
+    }\r
+\r
+    // }}}\r
+    // {{{ log()\r
+\r
+    /**\r
+     * Logging method.\r
+     *\r
+     * @param int    $level  log level (0 is quiet, higher is noisier)\r
+     * @param string $msg    message to write to the log\r
+     *\r
+     * @return void\r
+     *\r
+     * @access public\r
+     * @static\r
+     */\r
+    function log($level, $msg, $append_crlf = true)\r
+    {\r
+        if ($this->debug >= $level) {\r
+            if (!class_exists('PEAR_Frontend')) {\r
+                require_once 'PEAR/Frontend.php';\r
+            }\r
+            $ui = &PEAR_Frontend::singleton();\r
+            if (is_a($ui, 'PEAR_Frontend')) {\r
+                $ui->log($msg, $append_crlf);\r
+            } else {\r
+                print "$msg\n";\r
+            }\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ mkTempDir()\r
+\r
+    /**\r
+     * Create and register a temporary directory.\r
+     *\r
+     * @param string $tmpdir (optional) Directory to use as tmpdir.\r
+     *                       Will use system defaults (for example\r
+     *                       /tmp or c:\windows\temp) if not specified\r
+     *\r
+     * @return string name of created directory\r
+     *\r
+     * @access public\r
+     */\r
+    function mkTempDir($tmpdir = '')\r
+    {\r
+        if ($tmpdir) {\r
+            $topt = array('-t', $tmpdir);\r
+        } else {\r
+            $topt = array();\r
+        }\r
+        $topt = array_merge($topt, array('-d', 'pear'));\r
+        if (!class_exists('System')) {\r
+            require_once 'System.php';\r
+        }\r
+        if (!$tmpdir = System::mktemp($topt)) {\r
+            return false;\r
+        }\r
+        $this->addTempFile($tmpdir);\r
+        return $tmpdir;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ setFrontendObject()\r
+\r
+    /**\r
+     * Set object that represents the frontend to be used.\r
+     *\r
+     * @param  object Reference of the frontend object\r
+     * @return void\r
+     * @access public\r
+     */\r
+    function setFrontendObject(&$ui)\r
+    {\r
+        $this->ui = &$ui;\r
+    }\r
+\r
+    // }}}\r
+\r
+    // {{{ infoFromTgzFile()\r
+\r
+    /**\r
+     * Returns information about a package file.  Expects the name of\r
+     * a gzipped tar file as input.\r
+     *\r
+     * @param string  $file  name of .tgz file\r
+     *\r
+     * @return array  array with package information\r
+     *\r
+     * @access public\r
+     * @deprecated use PEAR_PackageFile->fromTgzFile() instead\r
+     *\r
+     */\r
+    function infoFromTgzFile($file)\r
+    {\r
+        $packagefile = new PEAR_PackageFile($this->config);\r
+        $pf = &$packagefile->fromTgzFile($file, PEAR_VALIDATE_NORMAL);\r
+        if (PEAR::isError($pf)) {\r
+            $errs = $pf->getUserinfo();\r
+            if (is_array($errs)) {\r
+                foreach ($errs as $error) {\r
+                    $e = $this->raiseError($error['message'], $error['code'], null, null, $error);\r
+                }\r
+            }\r
+            return $pf;\r
+        }\r
+        return $this->_postProcessValidPackagexml($pf);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ infoFromDescriptionFile()\r
+\r
+    /**\r
+     * Returns information about a package file.  Expects the name of\r
+     * a package xml file as input.\r
+     *\r
+     * @param string  $descfile  name of package xml file\r
+     *\r
+     * @return array  array with package information\r
+     *\r
+     * @access public\r
+     * @deprecated use PEAR_PackageFile->fromPackageFile() instead\r
+     *\r
+     */\r
+    function infoFromDescriptionFile($descfile)\r
+    {\r
+        $packagefile = new PEAR_PackageFile($this->config);\r
+        $pf = &$packagefile->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);\r
+        if (PEAR::isError($pf)) {\r
+            $errs = $pf->getUserinfo();\r
+            if (is_array($errs)) {\r
+                foreach ($errs as $error) {\r
+                    $e = $this->raiseError($error['message'], $error['code'], null, null, $error);\r
+                }\r
+            }\r
+            return $pf;\r
+        }\r
+        return $this->_postProcessValidPackagexml($pf);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ infoFromString()\r
+\r
+    /**\r
+     * Returns information about a package file.  Expects the contents\r
+     * of a package xml file as input.\r
+     *\r
+     * @param string  $data  contents of package.xml file\r
+     *\r
+     * @return array   array with package information\r
+     *\r
+     * @access public\r
+     * @deprecated use PEAR_PackageFile->fromXmlstring() instead\r
+     *\r
+     */\r
+    function infoFromString($data)\r
+    {\r
+        $packagefile = new PEAR_PackageFile($this->config);\r
+        $pf = &$packagefile->fromXmlString($data, PEAR_VALIDATE_NORMAL, false);\r
+        if (PEAR::isError($pf)) {\r
+            $errs = $pf->getUserinfo();\r
+            if (is_array($errs)) {\r
+                foreach ($errs as $error) {\r
+                    $e = $this->raiseError($error['message'], $error['code'], null, null, $error);\r
+                }\r
+            }\r
+            return $pf;\r
+        }\r
+        return $this->_postProcessValidPackagexml($pf);\r
+    }\r
+    // }}}\r
+\r
+    /**\r
+     * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2\r
+     * @return array\r
+     */\r
+    function _postProcessValidPackagexml(&$pf)\r
+    {\r
+        if (is_a($pf, 'PEAR_PackageFile_v2')) {\r
+            // sort of make this into a package.xml 1.0-style array\r
+            // changelog is not converted to old format.\r
+            $arr = $pf->toArray(true);\r
+            $arr = array_merge($arr, $arr['old']);\r
+            unset($arr['old']);\r
+            unset($arr['xsdversion']);\r
+            unset($arr['contents']);\r
+            unset($arr['compatible']);\r
+            unset($arr['channel']);\r
+            unset($arr['uri']);\r
+            unset($arr['dependencies']);\r
+            unset($arr['phprelease']);\r
+            unset($arr['extsrcrelease']);\r
+            unset($arr['extbinrelease']);\r
+            unset($arr['bundle']);\r
+            unset($arr['lead']);\r
+            unset($arr['developer']);\r
+            unset($arr['helper']);\r
+            unset($arr['contributor']);\r
+            $arr['filelist'] = $pf->getFilelist();\r
+            $this->pkginfo = $arr;\r
+            return $arr;\r
+        } else {\r
+            $this->pkginfo = $pf->toArray();\r
+            return $this->pkginfo;\r
+        }\r
+    }\r
+    // {{{ infoFromAny()\r
+\r
+    /**\r
+     * Returns package information from different sources\r
+     *\r
+     * This method is able to extract information about a package\r
+     * from a .tgz archive or from a XML package definition file.\r
+     *\r
+     * @access public\r
+     * @param  string Filename of the source ('package.xml', '<package>.tgz')\r
+     * @return string\r
+     * @deprecated use PEAR_PackageFile->fromAnyFile() instead\r
+     */\r
+    function infoFromAny($info)\r
+    {\r
+        if (is_string($info) && file_exists($info)) {\r
+            $packagefile = new PEAR_PackageFile($this->config);\r
+            $pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL);\r
+            if (PEAR::isError($pf)) {\r
+                $errs = $pf->getUserinfo();\r
+                if (is_array($errs)) {\r
+                    foreach ($errs as $error) {\r
+                        $e = $this->raiseError($error['message'], $error['code'], null, null, $error);\r
+                    }\r
+                }\r
+                return $pf;\r
+            }\r
+            return $this->_postProcessValidPackagexml($pf);\r
+        }\r
+        return $info;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ xmlFromInfo()\r
+\r
+    /**\r
+     * Return an XML document based on the package info (as returned\r
+     * by the PEAR_Common::infoFrom* methods).\r
+     *\r
+     * @param array  $pkginfo  package info\r
+     *\r
+     * @return string XML data\r
+     *\r
+     * @access public\r
+     * @deprecated use a PEAR_PackageFile_v* object's generator instead\r
+     */\r
+    function xmlFromInfo($pkginfo)\r
+    {\r
+        $config = &PEAR_Config::singleton();\r
+        $packagefile = new PEAR_PackageFile($config);\r
+        $pf = &$packagefile->fromArray($pkginfo);\r
+        $gen = &$pf->getDefaultGenerator();\r
+        return $gen->toXml(PEAR_VALIDATE_PACKAGING);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ validatePackageInfo()\r
+\r
+    /**\r
+     * Validate XML package definition file.\r
+     *\r
+     * @param  string $info Filename of the package archive or of the\r
+     *                package definition file\r
+     * @param  array $errors Array that will contain the errors\r
+     * @param  array $warnings Array that will contain the warnings\r
+     * @param  string $dir_prefix (optional) directory where source files\r
+     *                may be found, or empty if they are not available\r
+     * @access public\r
+     * @return boolean\r
+     * @deprecated use the validation of PEAR_PackageFile objects\r
+     */\r
+    function validatePackageInfo($info, &$errors, &$warnings, $dir_prefix = '')\r
+    {\r
+        $config = &PEAR_Config::singleton();\r
+        $packagefile = new PEAR_PackageFile($config);\r
+        PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);\r
+        if (strpos($info, '<?xml') !== false) {\r
+            $pf = &$packagefile->fromXmlString($info, PEAR_VALIDATE_NORMAL, '');\r
+        } else {\r
+            $pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL);\r
+        }\r
+        PEAR::staticPopErrorHandling();\r
+        if (PEAR::isError($pf)) {\r
+            $errs = $pf->getUserinfo();\r
+            if (is_array($errs)) {\r
+                foreach ($errs as $error) {\r
+                    if ($error['level'] == 'error') {\r
+                        $errors[] = $error['message'];\r
+                    } else {\r
+                        $warnings[] = $error['message'];\r
+                    }\r
+                }\r
+            }\r
+            return false;\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ buildProvidesArray()\r
+\r
+    /**\r
+     * Build a "provides" array from data returned by\r
+     * analyzeSourceCode().  The format of the built array is like\r
+     * this:\r
+     *\r
+     *  array(\r
+     *    'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'),\r
+     *    ...\r
+     *  )\r
+     *\r
+     *\r
+     * @param array $srcinfo array with information about a source file\r
+     * as returned by the analyzeSourceCode() method.\r
+     *\r
+     * @return void\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function buildProvidesArray($srcinfo)\r
+    {\r
+        $file = basename($srcinfo['source_file']);\r
+        $pn = '';\r
+        if (isset($this->_packageName)) {\r
+            $pn = $this->_packageName;\r
+        }\r
+        $pnl = strlen($pn);\r
+        foreach ($srcinfo['declared_classes'] as $class) {\r
+            $key = "class;$class";\r
+            if (isset($this->pkginfo['provides'][$key])) {\r
+                continue;\r
+            }\r
+            $this->pkginfo['provides'][$key] =\r
+                array('file'=> $file, 'type' => 'class', 'name' => $class);\r
+            if (isset($srcinfo['inheritance'][$class])) {\r
+                $this->pkginfo['provides'][$key]['extends'] =\r
+                    $srcinfo['inheritance'][$class];\r
+            }\r
+        }\r
+        foreach ($srcinfo['declared_methods'] as $class => $methods) {\r
+            foreach ($methods as $method) {\r
+                $function = "$class::$method";\r
+                $key = "function;$function";\r
+                if ($method{0} == '_' || !strcasecmp($method, $class) ||\r
+                    isset($this->pkginfo['provides'][$key])) {\r
+                    continue;\r
+                }\r
+                $this->pkginfo['provides'][$key] =\r
+                    array('file'=> $file, 'type' => 'function', 'name' => $function);\r
+            }\r
+        }\r
+\r
+        foreach ($srcinfo['declared_functions'] as $function) {\r
+            $key = "function;$function";\r
+            if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) {\r
+                continue;\r
+            }\r
+            if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) {\r
+                $warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\"";\r
+            }\r
+            $this->pkginfo['provides'][$key] =\r
+                array('file'=> $file, 'type' => 'function', 'name' => $function);\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ analyzeSourceCode()\r
+\r
+    /**\r
+     * Analyze the source code of the given PHP file\r
+     *\r
+     * @param  string Filename of the PHP file\r
+     * @return mixed\r
+     * @access public\r
+     */\r
+    function analyzeSourceCode($file)\r
+    {\r
+        if (!function_exists("token_get_all")) {\r
+            return false;\r
+        }\r
+        if (!defined('T_DOC_COMMENT')) {\r
+            define('T_DOC_COMMENT', T_COMMENT);\r
+        }\r
+        if (!defined('T_INTERFACE')) {\r
+            define('T_INTERFACE', -1);\r
+        }\r
+        if (!defined('T_IMPLEMENTS')) {\r
+            define('T_IMPLEMENTS', -1);\r
+        }\r
+        if (!$fp = @fopen($file, "r")) {\r
+            return false;\r
+        }\r
+        if (function_exists('file_get_contents')) {\r
+            fclose($fp);\r
+            $contents = file_get_contents($file);\r
+        } else {\r
+            $contents = fread($fp, filesize($file));\r
+            fclose($fp);\r
+        }\r
+        $tokens = token_get_all($contents);\r
+/*\r
+        for ($i = 0; $i < sizeof($tokens); $i++) {\r
+            @list($token, $data) = $tokens[$i];\r
+            if (is_string($token)) {\r
+                var_dump($token);\r
+            } else {\r
+                print token_name($token) . ' ';\r
+                var_dump(rtrim($data));\r
+            }\r
+        }\r
+*/\r
+        $look_for = 0;\r
+        $paren_level = 0;\r
+        $bracket_level = 0;\r
+        $brace_level = 0;\r
+        $lastphpdoc = '';\r
+        $current_class = '';\r
+        $current_interface = '';\r
+        $current_class_level = -1;\r
+        $current_function = '';\r
+        $current_function_level = -1;\r
+        $declared_classes = array();\r
+        $declared_interfaces = array();\r
+        $declared_functions = array();\r
+        $declared_methods = array();\r
+        $used_classes = array();\r
+        $used_functions = array();\r
+        $extends = array();\r
+        $implements = array();\r
+        $nodeps = array();\r
+        $inquote = false;\r
+        $interface = false;\r
+        for ($i = 0; $i < sizeof($tokens); $i++) {\r
+            if (is_array($tokens[$i])) {\r
+                list($token, $data) = $tokens[$i];\r
+            } else {\r
+                $token = $tokens[$i];\r
+                $data = '';\r
+            }\r
+            if ($inquote) {\r
+                if ($token != '"') {\r
+                    continue;\r
+                } else {\r
+                    $inquote = false;\r
+                    continue;\r
+                }\r
+            }\r
+            switch ($token) {\r
+                case T_WHITESPACE:\r
+                    continue;\r
+                case ';':\r
+                    if ($interface) {\r
+                        $current_function = '';\r
+                        $current_function_level = -1;\r
+                    }\r
+                    break;\r
+                case '"':\r
+                    $inquote = true;\r
+                    break;\r
+                case T_CURLY_OPEN:\r
+                case T_DOLLAR_OPEN_CURLY_BRACES:\r
+                case '{': $brace_level++; continue 2;\r
+                case '}':\r
+                    $brace_level--;\r
+                    if ($current_class_level == $brace_level) {\r
+                        $current_class = '';\r
+                        $current_class_level = -1;\r
+                    }\r
+                    if ($current_function_level == $brace_level) {\r
+                        $current_function = '';\r
+                        $current_function_level = -1;\r
+                    }\r
+                    continue 2;\r
+                case '[': $bracket_level++; continue 2;\r
+                case ']': $bracket_level--; continue 2;\r
+                case '(': $paren_level++;   continue 2;\r
+                case ')': $paren_level--;   continue 2;\r
+                case T_INTERFACE:\r
+                    $interface = true;\r
+                case T_CLASS:\r
+                    if (($current_class_level != -1) || ($current_function_level != -1)) {\r
+                        PEAR::raiseError("Parser error: invalid PHP found in file \"$file\"",\r
+                            PEAR_COMMON_ERROR_INVALIDPHP);\r
+                        return false;\r
+                    }\r
+                case T_FUNCTION:\r
+                case T_NEW:\r
+                case T_EXTENDS:\r
+                case T_IMPLEMENTS:\r
+                    $look_for = $token;\r
+                    continue 2;\r
+                case T_STRING:\r
+                    if (version_compare(zend_version(), '2.0', '<')) {\r
+                        if (in_array(strtolower($data),\r
+                            array('public', 'private', 'protected', 'abstract',\r
+                                  'interface', 'implements', 'throw') \r
+                                 )) {\r
+                            PEAR::raiseError('Error: PHP5 token encountered in ' . $file . \r
+                            'packaging should be done in PHP 5');\r
+                            return false;\r
+                        }\r
+                    }\r
+                    if ($look_for == T_CLASS) {\r
+                        $current_class = $data;\r
+                        $current_class_level = $brace_level;\r
+                        $declared_classes[] = $current_class;\r
+                    } elseif ($look_for == T_INTERFACE) {\r
+                        $current_interface = $data;\r
+                        $current_class_level = $brace_level;\r
+                        $declared_interfaces[] = $current_interface;\r
+                    } elseif ($look_for == T_IMPLEMENTS) {\r
+                        $implements[$current_class] = $data;\r
+                    } elseif ($look_for == T_EXTENDS) {\r
+                        $extends[$current_class] = $data;\r
+                    } elseif ($look_for == T_FUNCTION) {\r
+                        if ($current_class) {\r
+                            $current_function = "$current_class::$data";\r
+                            $declared_methods[$current_class][] = $data;\r
+                        } elseif ($current_interface) {\r
+                            $current_function = "$current_interface::$data";\r
+                            $declared_methods[$current_interface][] = $data;\r
+                        } else {\r
+                            $current_function = $data;\r
+                            $declared_functions[] = $current_function;\r
+                        }\r
+                        $current_function_level = $brace_level;\r
+                        $m = array();\r
+                    } elseif ($look_for == T_NEW) {\r
+                        $used_classes[$data] = true;\r
+                    }\r
+                    $look_for = 0;\r
+                    continue 2;\r
+                case T_VARIABLE:\r
+                    $look_for = 0;\r
+                    continue 2;\r
+                case T_DOC_COMMENT:\r
+                case T_COMMENT:\r
+                    if (preg_match('!^/\*\*\s!', $data)) {\r
+                        $lastphpdoc = $data;\r
+                        if (preg_match_all('/@nodep\s+(\S+)/', $lastphpdoc, $m)) {\r
+                            $nodeps = array_merge($nodeps, $m[1]);\r
+                        }\r
+                    }\r
+                    continue 2;\r
+                case T_DOUBLE_COLON:\r
+                    if (!($tokens[$i - 1][0] == T_WHITESPACE || $tokens[$i - 1][0] == T_STRING)) {\r
+                        PEAR::raiseError("Parser error: invalid PHP found in file \"$file\"",\r
+                            PEAR_COMMON_ERROR_INVALIDPHP);\r
+                        return false;\r
+                    }\r
+                    $class = $tokens[$i - 1][1];\r
+                    if (strtolower($class) != 'parent') {\r
+                        $used_classes[$class] = true;\r
+                    }\r
+                    continue 2;\r
+            }\r
+        }\r
+        return array(\r
+            "source_file" => $file,\r
+            "declared_classes" => $declared_classes,\r
+            "declared_interfaces" => $declared_interfaces,\r
+            "declared_methods" => $declared_methods,\r
+            "declared_functions" => $declared_functions,\r
+            "used_classes" => array_diff(array_keys($used_classes), $nodeps),\r
+            "inheritance" => $extends,\r
+            "implements" => $implements,\r
+            );\r
+    }\r
+\r
+    // }}}\r
+    // {{{  betterStates()\r
+\r
+    /**\r
+     * Return an array containing all of the states that are more stable than\r
+     * or equal to the passed in state\r
+     *\r
+     * @param string Release state\r
+     * @param boolean Determines whether to include $state in the list\r
+     * @return false|array False if $state is not a valid release state\r
+     */\r
+    function betterStates($state, $include = false)\r
+    {\r
+        static $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable');\r
+        $i = array_search($state, $states);\r
+        if ($i === false) {\r
+            return false;\r
+        }\r
+        if ($include) {\r
+            $i--;\r
+        }\r
+        return array_slice($states, $i + 1);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ detectDependencies()\r
+\r
+    function detectDependencies($any, $status_callback = null)\r
+    {\r
+        if (!function_exists("token_get_all")) {\r
+            return false;\r
+        }\r
+        if (PEAR::isError($info = $this->infoFromAny($any))) {\r
+            return $this->raiseError($info);\r
+        }\r
+        if (!is_array($info)) {\r
+            return false;\r
+        }\r
+        $deps = array();\r
+        $used_c = $decl_c = $decl_f = $decl_m = array();\r
+        foreach ($info['filelist'] as $file => $fa) {\r
+            $tmp = $this->analyzeSourceCode($file);\r
+            $used_c = @array_merge($used_c, $tmp['used_classes']);\r
+            $decl_c = @array_merge($decl_c, $tmp['declared_classes']);\r
+            $decl_f = @array_merge($decl_f, $tmp['declared_functions']);\r
+            $decl_m = @array_merge($decl_m, $tmp['declared_methods']);\r
+            $inheri = @array_merge($inheri, $tmp['inheritance']);\r
+        }\r
+        $used_c = array_unique($used_c);\r
+        $decl_c = array_unique($decl_c);\r
+        $undecl_c = array_diff($used_c, $decl_c);\r
+        return array('used_classes' => $used_c,\r
+                     'declared_classes' => $decl_c,\r
+                     'declared_methods' => $decl_m,\r
+                     'declared_functions' => $decl_f,\r
+                     'undeclared_classes' => $undecl_c,\r
+                     'inheritance' => $inheri,\r
+                     );\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getUserRoles()\r
+\r
+    /**\r
+     * Get the valid roles for a PEAR package maintainer\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getUserRoles()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_maintainer_roles'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getReleaseStates()\r
+\r
+    /**\r
+     * Get the valid package release states of packages\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getReleaseStates()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_release_states'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getDependencyTypes()\r
+\r
+    /**\r
+     * Get the implemented dependency types (php, ext, pkg etc.)\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getDependencyTypes()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_dependency_types'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getDependencyRelations()\r
+\r
+    /**\r
+     * Get the implemented dependency relations (has, lt, ge etc.)\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getDependencyRelations()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_dependency_relations'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getFileRoles()\r
+\r
+    /**\r
+     * Get the implemented file roles\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getFileRoles()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_file_roles'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getReplacementTypes()\r
+\r
+    /**\r
+     * Get the implemented file replacement types in\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getReplacementTypes()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_replacement_types'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getProvideTypes()\r
+\r
+    /**\r
+     * Get the implemented file replacement types in\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getProvideTypes()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_provide_types'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getScriptPhases()\r
+\r
+    /**\r
+     * Get the implemented file replacement types in\r
+     *\r
+     * @return array\r
+     * @static\r
+     */\r
+    function getScriptPhases()\r
+    {\r
+        return $GLOBALS['_PEAR_Common_script_phases'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ validPackageName()\r
+\r
+    /**\r
+     * Test whether a string contains a valid package name.\r
+     *\r
+     * @param string $name the package name to test\r
+     *\r
+     * @return bool\r
+     *\r
+     * @access public\r
+     */\r
+    function validPackageName($name)\r
+    {\r
+        return (bool)preg_match(PEAR_COMMON_PACKAGE_NAME_PREG, $name);\r
+    }\r
+\r
+\r
+    // }}}\r
+    // {{{ validPackageVersion()\r
+\r
+    /**\r
+     * Test whether a string contains a valid package version.\r
+     *\r
+     * @param string $ver the package version to test\r
+     *\r
+     * @return bool\r
+     *\r
+     * @access public\r
+     */\r
+    function validPackageVersion($ver)\r
+    {\r
+        return (bool)preg_match(PEAR_COMMON_PACKAGE_VERSION_PREG, $ver);\r
+    }\r
+\r
+\r
+    // }}}\r
+\r
+    // {{{ downloadHttp()\r
+\r
+    /**\r
+     * Download a file through HTTP.  Considers suggested file name in\r
+     * Content-disposition: header and can run a callback function for\r
+     * different events.  The callback will be called with two\r
+     * parameters: the callback type, and parameters.  The implemented\r
+     * callback types are:\r
+     *\r
+     *  'setup'       called at the very beginning, parameter is a UI object\r
+     *                that should be used for all output\r
+     *  'message'     the parameter is a string with an informational message\r
+     *  'saveas'      may be used to save with a different file name, the\r
+     *                parameter is the filename that is about to be used.\r
+     *                If a 'saveas' callback returns a non-empty string,\r
+     *                that file name will be used as the filename instead.\r
+     *                Note that $save_dir will not be affected by this, only\r
+     *                the basename of the file.\r
+     *  'start'       download is starting, parameter is number of bytes\r
+     *                that are expected, or -1 if unknown\r
+     *  'bytesread'   parameter is the number of bytes read so far\r
+     *  'done'        download is complete, parameter is the total number\r
+     *                of bytes read\r
+     *  'connfailed'  if the TCP connection fails, this callback is called\r
+     *                with array(host,port,errno,errmsg)\r
+     *  'writefailed' if writing to disk fails, this callback is called\r
+     *                with array(destfile,errmsg)\r
+     *\r
+     * If an HTTP proxy has been configured (http_proxy PEAR_Config\r
+     * setting), the proxy will be used.\r
+     *\r
+     * @param string  $url       the URL to download\r
+     * @param object  $ui        PEAR_Frontend_* instance\r
+     * @param object  $config    PEAR_Config instance\r
+     * @param string  $save_dir  (optional) directory to save file in\r
+     * @param mixed   $callback  (optional) function/method to call for status\r
+     *                           updates\r
+     *\r
+     * @return string  Returns the full path of the downloaded file or a PEAR\r
+     *                 error on failure.  If the error is caused by\r
+     *                 socket-related errors, the error object will\r
+     *                 have the fsockopen error code available through\r
+     *                 getCode().\r
+     *\r
+     * @access public\r
+     * @deprecated in favor of PEAR_Downloader::downloadHttp()\r
+     */\r
+    function downloadHttp($url, &$ui, $save_dir = '.', $callback = null)\r
+    {\r
+        if (!class_exists('PEAR_Downloader')) {\r
+            require_once 'PEAR/Downloader.php';\r
+        }\r
+        return PEAR_Downloader::downloadHttp($url, $ui, $save_dir, $callback);\r
+    }\r
+\r
+    // }}}\r
+\r
+    /**\r
+     * @param string $path relative or absolute include path\r
+     * @return boolean\r
+     * @static\r
+     */\r
+    function isIncludeable($path)\r
+    {\r
+        if (file_exists($path) && is_readable($path)) {\r
+            return true;\r
+        }\r
+        $ipath = explode(PATH_SEPARATOR, ini_get('include_path'));\r
+        foreach ($ipath as $include) {\r
+            $test = realpath($include . DIRECTORY_SEPARATOR . $path);\r
+            if (file_exists($test) && is_readable($test)) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+}\r
+require_once 'PEAR/Config.php';\r
+require_once 'PEAR/PackageFile.php';\r
+if (!function_exists('file_get_contents')) {\r
+    function file_get_contents($filename)\r
+    {\r
+        $fp = fopen($filename, 'rb');\r
+        $ret = '';\r
+        while (!feof($fp)) {\r
+            $ret .= fread($fp, 8092);;\r
+        }\r
+        return $ret;\r
+    }\r
+}\r
+?>
\ No newline at end of file
diff --git a/docs/include/classes/XML/XML_HTMLSax/PEAR/Config.php b/docs/include/classes/XML/XML_HTMLSax/PEAR/Config.php
new file mode 100644 (file)
index 0000000..26f26cd
--- /dev/null
@@ -0,0 +1,2054 @@
+<?php\r
+/**\r
+ * PEAR_Config, customized configuration handling for the PEAR Installer\r
+ *\r
+ * PHP versions 4 and 5\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: Config.php 8901 2009-11-11 19:10:19Z cindy $\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      File available since Release 0.1\r
+ */\r
+\r
+/**\r
+ * Required for error handling\r
+ */\r
+require_once 'PEAR.php';\r
+require_once 'PEAR/Registry.php';\r
+require_once 'PEAR/Installer/Role.php';\r
+require_once 'System.php';\r
+require_once 'PEAR/Remote.php';\r
+\r
+/**\r
+ * Last created PEAR_Config instance.\r
+ * @var object\r
+ */\r
+$GLOBALS['_PEAR_Config_instance'] = null;\r
+if (!defined('PEAR_INSTALL_DIR') || !PEAR_INSTALL_DIR) {\r
+    $PEAR_INSTALL_DIR = PHP_LIBDIR . DIRECTORY_SEPARATOR . 'pear';\r
+} else {\r
+    $PEAR_INSTALL_DIR = PEAR_INSTALL_DIR;\r
+}\r
+\r
+// Below we define constants with default values for all configuration\r
+// parameters except username/password.  All of them can have their\r
+// defaults set through environment variables.  The reason we use the\r
+// PHP_ prefix is for some security, PHP protects environment\r
+// variables starting with PHP_*.\r
+\r
+// default channel and preferred mirror is based on whether we are invoked through\r
+// the "pear" or the "pecl" command\r
+\r
+if (!defined('PEAR_RUNTYPE') || PEAR_RUNTYPE == 'pear') {\r
+    define('PEAR_CONFIG_DEFAULT_CHANNEL', 'pear.php.net');\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_CHANNEL', 'pecl.php.net');\r
+}\r
+\r
+if (getenv('PHP_PEAR_SYSCONF_DIR')) {\r
+    define('PEAR_CONFIG_SYSCONFDIR', getenv('PHP_PEAR_SYSCONF_DIR'));\r
+} elseif (getenv('SystemRoot')) {\r
+    define('PEAR_CONFIG_SYSCONFDIR', getenv('SystemRoot'));\r
+} else {\r
+    define('PEAR_CONFIG_SYSCONFDIR', PHP_SYSCONFDIR);\r
+}\r
+\r
+// Default for master_server\r
+if (getenv('PHP_PEAR_MASTER_SERVER')) {\r
+    define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', getenv('PHP_PEAR_MASTER_SERVER'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', 'pear.php.net');\r
+}\r
+\r
+// Default for http_proxy\r
+if (getenv('PHP_PEAR_HTTP_PROXY')) {\r
+    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', getenv('PHP_PEAR_HTTP_PROXY'));\r
+} elseif (getenv('http_proxy')) {\r
+    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', getenv('http_proxy'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', '');\r
+}\r
+\r
+// Default for php_dir\r
+if (getenv('PHP_PEAR_INSTALL_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_PHP_DIR', getenv('PHP_PEAR_INSTALL_DIR'));\r
+} else {\r
+    if (@is_dir($PEAR_INSTALL_DIR)) {\r
+        define('PEAR_CONFIG_DEFAULT_PHP_DIR',\r
+               $PEAR_INSTALL_DIR);\r
+    } else {\r
+        define('PEAR_CONFIG_DEFAULT_PHP_DIR', $PEAR_INSTALL_DIR);\r
+    }\r
+}\r
+\r
+// Default for ext_dir\r
+if (getenv('PHP_PEAR_EXTENSION_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR'));\r
+} else {\r
+    if (ini_get('extension_dir')) {\r
+        define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir'));\r
+    } elseif (defined('PEAR_EXTENSION_DIR') && @is_dir(PEAR_EXTENSION_DIR)) {\r
+        define('PEAR_CONFIG_DEFAULT_EXT_DIR', PEAR_EXTENSION_DIR);\r
+    } elseif (defined('PHP_EXTENSION_DIR')) {\r
+        define('PEAR_CONFIG_DEFAULT_EXT_DIR', PHP_EXTENSION_DIR);\r
+    } else {\r
+        define('PEAR_CONFIG_DEFAULT_EXT_DIR', '.');\r
+    }\r
+}\r
+\r
+// Default for doc_dir\r
+if (getenv('PHP_PEAR_DOC_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_DOC_DIR', getenv('PHP_PEAR_DOC_DIR'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_DOC_DIR',\r
+           $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'docs');\r
+}\r
+\r
+// Default for bin_dir\r
+if (getenv('PHP_PEAR_BIN_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_BIN_DIR', getenv('PHP_PEAR_BIN_DIR'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_BIN_DIR', PHP_BINDIR);\r
+}\r
+\r
+// Default for data_dir\r
+if (getenv('PHP_PEAR_DATA_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_DATA_DIR', getenv('PHP_PEAR_DATA_DIR'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_DATA_DIR',\r
+           $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'data');\r
+}\r
+\r
+// Default for test_dir\r
+if (getenv('PHP_PEAR_TEST_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_TEST_DIR', getenv('PHP_PEAR_TEST_DIR'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_TEST_DIR',\r
+           $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'tests');\r
+}\r
+\r
+// Default for cache_dir\r
+if (getenv('PHP_PEAR_CACHE_DIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_CACHE_DIR',\r
+           System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .\r
+           DIRECTORY_SEPARATOR . 'cache');\r
+}\r
+\r
+// Default for php_bin\r
+if (getenv('PHP_PEAR_PHP_BIN')) {\r
+    define('PEAR_CONFIG_DEFAULT_PHP_BIN', getenv('PHP_PEAR_PHP_BIN'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_PHP_BIN', PEAR_CONFIG_DEFAULT_BIN_DIR.\r
+           DIRECTORY_SEPARATOR.'php'.(OS_WINDOWS ? '.exe' : ''));\r
+}\r
+\r
+// Default for verbose\r
+if (getenv('PHP_PEAR_VERBOSE')) {\r
+    define('PEAR_CONFIG_DEFAULT_VERBOSE', getenv('PHP_PEAR_VERBOSE'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_VERBOSE', 1);\r
+}\r
+\r
+// Default for preferred_state\r
+if (getenv('PHP_PEAR_PREFERRED_STATE')) {\r
+    define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', getenv('PHP_PEAR_PREFERRED_STATE'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', 'stable');\r
+}\r
+\r
+// Default for umask\r
+if (getenv('PHP_PEAR_UMASK')) {\r
+    define('PEAR_CONFIG_DEFAULT_UMASK', getenv('PHP_PEAR_UMASK'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_UMASK', decoct(umask()));\r
+}\r
+\r
+// Default for cache_ttl\r
+if (getenv('PHP_PEAR_CACHE_TTL')) {\r
+    define('PEAR_CONFIG_DEFAULT_CACHE_TTL', getenv('PHP_PEAR_CACHE_TTL'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_CACHE_TTL', 3600);\r
+}\r
+\r
+// Default for sig_type\r
+if (getenv('PHP_PEAR_SIG_TYPE')) {\r
+    define('PEAR_CONFIG_DEFAULT_SIG_TYPE', getenv('PHP_PEAR_SIG_TYPE'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_SIG_TYPE', 'gpg');\r
+}\r
+\r
+// Default for sig_bin\r
+if (getenv('PHP_PEAR_SIG_BIN')) {\r
+    define('PEAR_CONFIG_DEFAULT_SIG_BIN', getenv('PHP_PEAR_SIG_BIN'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_SIG_BIN',\r
+           System::which(\r
+               'gpg', OS_WINDOWS ? 'c:\gnupg\gpg.exe' : '/usr/local/bin/gpg'));\r
+}\r
+\r
+// Default for sig_keydir\r
+if (getenv('PHP_PEAR_SIG_KEYDIR')) {\r
+    define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR', getenv('PHP_PEAR_SIG_KEYDIR'));\r
+} else {\r
+    define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR',\r
+           PEAR_CONFIG_SYSCONFDIR . DIRECTORY_SEPARATOR . 'pearkeys');\r
+}\r
+\r
+/**\r
+ * This is a class for storing configuration data, keeping track of\r
+ * which are system-defined, user-defined or defaulted.\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      Class available since Release 0.1\r
+ */\r
+class PEAR_Config extends PEAR\r
+{\r
+    // {{{ properties\r
+\r
+    /**\r
+     * Array of config files used.\r
+     *\r
+     * @var array layer => config file\r
+     */\r
+    var $files = array(\r
+        'system' => '',\r
+        'user' => '',\r
+        );\r
+\r
+    var $layers = array();\r
+    \r
+    /**\r
+     * Configuration data, two-dimensional array where the first\r
+     * dimension is the config layer ('user', 'system' and 'default'),\r
+     * and the second dimension is keyname => value.\r
+     *\r
+     * The order in the first dimension is important!  Earlier\r
+     * layers will shadow later ones when a config value is\r
+     * requested (if a 'user' value exists, it will be returned first,\r
+     * then 'system' and finally 'default').\r
+     *\r
+     * @var array layer => array(keyname => value, ...)\r
+     */\r
+    var $configuration = array(\r
+        'user' => array(),\r
+        'system' => array(),\r
+        'default' => array(),\r
+        );\r
+    \r
+    /**\r
+     * Configuration values that can be set for a channel\r
+     *\r
+     * All other configuration values can only have a global value\r
+     * @var array\r
+     * @access private\r
+     */\r
+    var $_channelConfigInfo = array(\r
+        'php_dir', 'ext_dir', 'doc_dir', 'bin_dir', 'data_dir',\r
+        'test_dir', 'php_bin', 'username', 'password', 'verbose',\r
+        'preferred_state', 'umask', 'preferred_mirror',\r
+        );\r
+\r
+    /**\r
+     * Channels that can be accessed\r
+     * @see setChannels()\r
+     * @var array\r
+     * @access private\r
+     */\r
+    var $_channels = array('pear.php.net', 'pecl.php.net', '__uri');\r
+\r
+    /**\r
+     * This variable is used to control the directory values returned\r
+     * @see setInstallRoot();\r
+     * @var string|false\r
+     * @access private\r
+     */\r
+    var $_installRoot = false;\r
+\r
+    /**\r
+     * If requested, this will always refer to the registry\r
+     * contained in php_dir\r
+     * @var PEAR_Registry\r
+     */\r
+    var $_registry = array();\r
+\r
+    /**\r
+     * @var array\r
+     * @access private\r
+     */\r
+    var $_regInitialized = array();\r
+\r
+    /**\r
+     * @var bool\r
+     * @access private\r
+     */\r
+    var $_noRegistry = false;\r
+\r
+    /**\r
+     * amount of errors found while parsing config\r
+     * @var integer\r
+     * @access private\r
+     */\r
+    var $_errorsFound = 0;\r
+    var $_lastError = null;\r
+\r
+    /**\r
+     * Information about the configuration data.  Stores the type,\r
+     * default value and a documentation string for each configuration\r
+     * value.\r
+     *\r
+     * @var array layer => array(infotype => value, ...)\r
+     */\r
+    var $configuration_info = array(\r
+        // Channels/Internet Access\r
+        'default_channel' => array(\r
+            'type' => 'string',\r
+            'default' => PEAR_CONFIG_DEFAULT_CHANNEL,\r
+            'doc' => 'the default channel to use for all non explicit commands',\r
+            'prompt' => 'Default Channel',\r
+            'group' => 'Internet Access',\r
+            ),\r
+        'preferred_mirror' => array(\r
+            'type' => 'string',\r
+            'default' => PEAR_CONFIG_DEFAULT_CHANNEL,\r
+            'doc' => 'the default server or mirror to use for channel actions',\r
+            'prompt' => 'Default Channel Mirror',\r
+            'group' => 'Internet Access',\r
+            ),\r
+        'remote_config' => array(\r
+            'type' => 'password',\r
+            'default' => '',\r
+            'doc' => 'ftp url of remote configuration file to use for synchronized install',\r
+            'prompt' => 'Remote Configuration File',\r
+            'group' => 'Internet Access',\r
+            ),\r
+        'auto_discover' => array(\r
+            'type' => 'integer',\r
+            'default' => 0,\r
+            'doc' => 'whether to automatically discover new channels',\r
+            'prompt' => 'Auto-discover new Channels',\r
+            'group' => 'Internet Access',\r
+            ),\r
+        // Internet Access\r
+        'master_server' => array(\r
+            'type' => 'string',\r
+            'default' => 'pear.php.net',\r
+            'doc' => 'name of the main PEAR server [NOT USED IN THIS VERSION]',\r
+            'prompt' => 'PEAR server [DEPRECATED]',\r
+            'group' => 'Internet Access',\r
+            ),\r
+        'http_proxy' => array(\r
+            'type' => 'string',\r
+            'default' => PEAR_CONFIG_DEFAULT_HTTP_PROXY,\r
+            'doc' => 'HTTP proxy (host:port) to use when downloading packages',\r
+            'prompt' => 'HTTP Proxy Server Address',\r
+            'group' => 'Internet Access',\r
+            ),\r
+        // File Locations\r
+        'php_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_PHP_DIR,\r
+            'doc' => 'directory where .php files are installed',\r
+            'prompt' => 'PEAR directory',\r
+            'group' => 'File Locations',\r
+            ),\r
+        'ext_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_EXT_DIR,\r
+            'doc' => 'directory where loadable extensions are installed',\r
+            'prompt' => 'PHP extension directory',\r
+            'group' => 'File Locations',\r
+            ),\r
+        'doc_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_DOC_DIR,\r
+            'doc' => 'directory where documentation is installed',\r
+            'prompt' => 'PEAR documentation directory',\r
+            'group' => 'File Locations',\r
+            ),\r
+        'bin_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_BIN_DIR,\r
+            'doc' => 'directory where executables are installed',\r
+            'prompt' => 'PEAR executables directory',\r
+            'group' => 'File Locations',\r
+            ),\r
+        'data_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_DATA_DIR,\r
+            'doc' => 'directory where data files are installed',\r
+            'prompt' => 'PEAR data directory',\r
+            'group' => 'File Locations (Advanced)',\r
+            ),\r
+        'test_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_TEST_DIR,\r
+            'doc' => 'directory where regression tests are installed',\r
+            'prompt' => 'PEAR test directory',\r
+            'group' => 'File Locations (Advanced)',\r
+            ),\r
+        'cache_dir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_CACHE_DIR,\r
+            'doc' => 'directory which is used for XMLRPC cache',\r
+            'prompt' => 'PEAR Installer cache directory',\r
+            'group' => 'File Locations (Advanced)',\r
+            ),\r
+        'php_bin' => array(\r
+            'type' => 'file',\r
+            'default' => PEAR_CONFIG_DEFAULT_PHP_BIN,\r
+            'doc' => 'PHP CLI/CGI binary for executing scripts',\r
+            'prompt' => 'PHP CLI/CGI binary',\r
+            'group' => 'File Locations (Advanced)',\r
+            ),\r
+        // Maintainers\r
+        'username' => array(\r
+            'type' => 'string',\r
+            'default' => '',\r
+            'doc' => '(maintainers) your PEAR account name',\r
+            'prompt' => 'PEAR username (for maintainers)',\r
+            'group' => 'Maintainers',\r
+            ),\r
+        'password' => array(\r
+            'type' => 'password',\r
+            'default' => '',\r
+            'doc' => '(maintainers) your PEAR account password',\r
+            'prompt' => 'PEAR password (for maintainers)',\r
+            'group' => 'Maintainers',\r
+            ),\r
+        // Advanced\r
+        'verbose' => array(\r
+            'type' => 'integer',\r
+            'default' => PEAR_CONFIG_DEFAULT_VERBOSE,\r
+            'doc' => 'verbosity level\r
+0: really quiet\r
+1: somewhat quiet\r
+2: verbose\r
+3: debug',\r
+            'prompt' => 'Debug Log Level',\r
+            'group' => 'Advanced',\r
+            ),\r
+        'preferred_state' => array(\r
+            'type' => 'set',\r
+            'default' => PEAR_CONFIG_DEFAULT_PREFERRED_STATE,\r
+            'doc' => 'the installer will prefer releases with this state when installing packages without a version or state specified',\r
+            'valid_set' => array(\r
+                'stable', 'beta', 'alpha', 'devel', 'snapshot'),\r
+            'prompt' => 'Preferred Package State',\r
+            'group' => 'Advanced',\r
+            ),\r
+        'umask' => array(\r
+            'type' => 'mask',\r
+            'default' => PEAR_CONFIG_DEFAULT_UMASK,\r
+            'doc' => 'umask used when creating files (Unix-like systems only)',\r
+            'prompt' => 'Unix file mask',\r
+            'group' => 'Advanced',\r
+            ),\r
+        'cache_ttl' => array(\r
+            'type' => 'integer',\r
+            'default' => PEAR_CONFIG_DEFAULT_CACHE_TTL,\r
+            'doc' => 'amount of secs where the local cache is used and not updated',\r
+            'prompt' => 'Cache TimeToLive',\r
+            'group' => 'Advanced',\r
+            ),\r
+        'sig_type' => array(\r
+            'type' => 'set',\r
+            'default' => PEAR_CONFIG_DEFAULT_SIG_TYPE,\r
+            'doc' => 'which package signature mechanism to use',\r
+            'valid_set' => array('gpg'),\r
+            'prompt' => 'Package Signature Type',\r
+            'group' => 'Maintainers',\r
+            ),\r
+        'sig_bin' => array(\r
+            'type' => 'string',\r
+            'default' => PEAR_CONFIG_DEFAULT_SIG_BIN,\r
+            'doc' => 'which package signature mechanism to use',\r
+            'prompt' => 'Signature Handling Program',\r
+            'group' => 'Maintainers',\r
+            ),\r
+        'sig_keyid' => array(\r
+            'type' => 'string',\r
+            'default' => '',\r
+            'doc' => 'which key to use for signing with',\r
+            'prompt' => 'Signature Key Id',\r
+            'group' => 'Maintainers',\r
+            ),\r
+        'sig_keydir' => array(\r
+            'type' => 'directory',\r
+            'default' => PEAR_CONFIG_DEFAULT_SIG_KEYDIR,\r
+            'doc' => 'directory where signature keys are located',\r
+            'prompt' => 'Signature Key Directory',\r
+            'group' => 'Maintainers',\r
+            ),\r
+        // __channels is reserved - used for channel-specific configuration\r
+        );\r
+\r
+    // }}}\r
+\r
+    // {{{ PEAR_Config([file], [defaults_file])\r
+\r
+    /**\r
+     * Constructor.\r
+     *\r
+     * @param string file to read user-defined options from\r
+     * @param string file to read system-wide defaults from\r
+     * @param bool   determines whether a registry object "follows"\r
+     *               the value of php_dir (is automatically created\r
+     *               and moved when php_dir is changed)\r
+     * @param bool   if true, fails if configuration files cannot be loaded\r
+     *\r
+     * @access public\r
+     *\r
+     * @see PEAR_Config::singleton\r
+     */\r
+    function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false,\r
+                         $strict = true)\r
+    {\r
+        $this->PEAR();\r
+        PEAR_Installer_Role::initializeConfig($this);\r
+        $sl = DIRECTORY_SEPARATOR;\r
+        if (empty($user_file)) {\r
+            if (OS_WINDOWS) {\r
+                $user_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.ini';\r
+            } else {\r
+                $user_file = getenv('HOME') . $sl . '.pearrc';\r
+            }\r
+        }\r
+        if (empty($system_file)) {\r
+            if (OS_WINDOWS) {\r
+                $system_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pearsys.ini';\r
+            } else {\r
+                $system_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.conf';\r
+            }\r
+        }\r
+\r
+        $this->layers = array_keys($this->configuration);\r
+        $this->files['user'] = $user_file;\r
+        $this->files['system'] = $system_file;\r
+        if ($user_file && @file_exists($user_file)) {\r
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);\r
+            $this->readConfigFile($user_file, 'user', $strict);\r
+            $this->popErrorHandling();\r
+            if ($this->_errorsFound > 0) {\r
+                return;\r
+            }\r
+        }\r
+\r
+        if ($system_file && @file_exists($system_file)) {\r
+            $this->mergeConfigFile($system_file, false, 'system', $strict);\r
+            if ($this->_errorsFound > 0) {\r
+                return;\r
+            }\r
+\r
+        }\r
+\r
+        if (!$ftp_file) {\r
+            $ftp_file = $this->get('remote_config');\r
+        }\r
+\r
+        if ($ftp_file && defined('PEAR_REMOTEINSTALL_OK')) {\r
+            $this->readFTPConfigFile($ftp_file);\r
+        }\r
+\r
+        foreach ($this->configuration_info as $key => $info) {\r
+            $this->configuration['default'][$key] = $info['default'];\r
+        }\r
+\r
+        $this->_registry['default'] = new PEAR_Registry($this->configuration['default']['php_dir']);\r
+        $this->_registry['default']->setConfig($this);\r
+        $this->_regInitialized['default'] = false;\r
+        //$GLOBALS['_PEAR_Config_instance'] = &$this;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ singleton([file], [defaults_file])\r
+\r
+    /**\r
+     * Static singleton method.  If you want to keep only one instance\r
+     * of this class in use, this method will give you a reference to\r
+     * the last created PEAR_Config object if one exists, or create a\r
+     * new object.\r
+     *\r
+     * @param string (optional) file to read user-defined options from\r
+     * @param string (optional) file to read system-wide defaults from\r
+     *\r
+     * @return object an existing or new PEAR_Config instance\r
+     *\r
+     * @access public\r
+     *\r
+     * @see PEAR_Config::PEAR_Config\r
+     */\r
+    function &singleton($user_file = '', $system_file = '', $strict = true)\r
+    {\r
+        if (is_object($GLOBALS['_PEAR_Config_instance'])) {\r
+            return $GLOBALS['_PEAR_Config_instance'];\r
+        }\r
+\r
+        $t_conf = new PEAR_Config($user_file, $system_file, false, $strict);\r
+        if ($t_conf->_errorsFound > 0) {\r
+             return $t_conf->lastError;\r
+        }\r
+\r
+        $GLOBALS['_PEAR_Config_instance'] = &$t_conf;\r
+        return $GLOBALS['_PEAR_Config_instance'];\r
+    }\r
+\r
+    // }}}\r
+    // {{{ validConfiguration()\r
+\r
+    /**\r
+     * Determine whether any configuration files have been detected, and whether a\r
+     * registry object can be retrieved from this configuration.\r
+     * @return bool\r
+     * @since PEAR 1.4.0a1\r
+     */\r
+    function validConfiguration()\r
+    {\r
+        if ($this->isDefinedLayer('user') || $this->isDefinedLayer('system')) {\r
+            return true;\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ readConfigFile([file], [layer])\r
+\r
+    /**\r
+     * Reads configuration data from a file.  All existing values in\r
+     * the config layer are discarded and replaced with data from the\r
+     * file.\r
+     * @param string file to read from, if NULL or not specified, the\r
+     *               last-used file for the same layer (second param) is used\r
+     * @param string config layer to insert data into ('user' or 'system')\r
+     * @return bool TRUE on success or a PEAR error on failure\r
+     */\r
+    function readConfigFile($file = null, $layer = 'user', $strict = true)\r
+    {\r
+        if (empty($this->files[$layer])) {\r
+            return $this->raiseError("unknown config layer `$layer'");\r
+        }\r
+\r
+        if ($file === null) {\r
+            $file = $this->files[$layer];\r
+        }\r
+\r
+        $data = $this->_readConfigDataFrom($file);\r
+\r
+        if (PEAR::isError($data)) {\r
+            if ($strict) {\r
+                $this->_errorsFound++;\r
+                $this->lastError = $data;\r
+\r
+                return $data;\r
+            } else {\r
+                return true;\r
+            }\r
+        } else {\r
+            $this->files[$layer] = $file;\r
+        }\r
+\r
+        $this->_decodeInput($data);\r
+        $this->configuration[$layer] = $data;\r
+        $this->_setupChannels();\r
+        if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) {\r
+            $this->_registry[$layer] = new PEAR_Registry($phpdir);\r
+            $this->_registry[$layer]->setConfig($this);\r
+            $this->_regInitialized[$layer] = false;\r
+        } else {\r
+            unset($this->_registry[$layer]);\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+\r
+    /**\r
+     * @param string url to the remote config file, like ftp://www.example.com/pear/config.ini\r
+     * @return true|PEAR_Error\r
+     */\r
+    function readFTPConfigFile($path)\r
+    {\r
+        do { // poor man's try\r
+            if (!class_exists('Net_FTP')) {\r
+                if (!class_exists('PEAR_Common')) {\r
+                    require_once 'PEAR/Common.php';\r
+                }\r
+                if (PEAR_Common::isIncludeable('Net/FTP.php')) {\r
+                    include_once 'Net/FTP.php';\r
+                }\r
+            }\r
+            if (class_exists('Net_FTP') &&\r
+                  (class_exists('PEAR_FTP') || PEAR_Common::isIncludeable('PEAR/FTP.php'))) {\r
+                require_once 'PEAR/FTP.php';\r
+                $this->_ftp = new PEAR_FTP;\r
+                $this->_ftp->pushErrorHandling(PEAR_ERROR_RETURN);\r
+                $e = $this->_ftp->init($path);\r
+                if (PEAR::isError($e)) {\r
+                    $this->_ftp->popErrorHandling();\r
+                    return $e;\r
+                }\r
+                $tmp = System::mktemp('-d');\r
+                PEAR_Common::addTempFile($tmp);\r
+                $e = $this->_ftp->get(basename($path), $tmp . DIRECTORY_SEPARATOR .\r
+                    'pear.ini', false, FTP_BINARY);\r
+                if (PEAR::isError($e)) {\r
+                    $this->_ftp->popErrorHandling();\r
+                    return $e;\r
+                }\r
+                PEAR_Common::addTempFile($tmp . DIRECTORY_SEPARATOR . 'pear.ini');\r
+                $this->_ftp->disconnect();\r
+                $this->_ftp->popErrorHandling();\r
+                $this->files['ftp'] = $tmp . DIRECTORY_SEPARATOR . 'pear.ini';\r
+                $e = $this->readConfigFile(null, 'ftp');\r
+                if (PEAR::isError($e)) {\r
+                    return $e;\r
+                }\r
+                $fail = array();\r
+                foreach ($this->configuration_info as $key => $val) {\r
+                    if (in_array($this->getGroup($key),\r
+                          array('File Locations', 'File Locations (Advanced)')) &&\r
+                          $this->getType($key) == 'directory') {\r
+                        // any directory configs must be set for this to work\r
+                        if (!isset($this->configuration['ftp'][$key])) {\r
+                            $fail[] = $key;\r
+                        }\r
+                    }\r
+                }\r
+                if (count($fail)) {\r
+                    $fail = '"' . implode('", "', $fail) . '"';\r
+                    unset($this->files['ftp']);\r
+                    unset($this->configuration['ftp']);\r
+                    return PEAR::raiseError('ERROR: Ftp configuration file must set all ' .\r
+                        'directory configuration variables.  These variables were not set: ' .\r
+                        $fail);\r
+                } else {\r
+                    return true;\r
+                }\r
+            } else {\r
+                return PEAR::raiseError('Net_FTP must be installed to use remote config');\r
+            }\r
+        } while (false); // poor man's catch\r
+        unset($this->files['ftp']);\r
+        return PEAR::raiseError('no remote host specified');\r
+    }\r
+\r
+    // {{{ _setupChannels()\r
+    \r
+    /**\r
+     * Reads the existing configurations and creates the _channels array from it\r
+     */\r
+    function _setupChannels()\r
+    {\r
+        $set = array_flip(array_values($this->_channels));\r
+        foreach ($this->configuration as $layer => $data) {\r
+            $i = 1000;\r
+            if (isset($data['__channels'])) {\r
+                foreach ($data['__channels'] as $channel => $info) {\r
+                    $set[$channel] = $i++;\r
+                }\r
+            }\r
+        }\r
+        $this->_channels = array_values(array_flip($set));\r
+        $this->setChannels($this->_channels);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ deleteChannel(channel)\r
+\r
+    function deleteChannel($channel)\r
+    {\r
+        foreach ($this->configuration as $layer => $data) {\r
+            if (isset($data['__channels'])) {\r
+                if (isset($data['__channels'][strtolower($channel)])) {\r
+                    unset($this->configuration[$layer]['__channels'][strtolower($channel)]);\r
+                }\r
+            }\r
+        }\r
+        $this->_channels = array_flip($this->_channels);\r
+        unset($this->_channels[strtolower($channel)]);\r
+        $this->_channels = array_flip($this->_channels);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ mergeConfigFile(file, [override], [layer])\r
+\r
+    /**\r
+     * Merges data into a config layer from a file.  Does the same\r
+     * thing as readConfigFile, except it does not replace all\r
+     * existing values in the config layer.\r
+     * @param string file to read from\r
+     * @param bool whether to overwrite existing data (default TRUE)\r
+     * @param string config layer to insert data into ('user' or 'system')\r
+     * @param string if true, errors are returned if file opening fails\r
+     * @return bool TRUE on success or a PEAR error on failure\r
+     */\r
+    function mergeConfigFile($file, $override = true, $layer = 'user', $strict = true)\r
+    {\r
+        if (empty($this->files[$layer])) {\r
+            return $this->raiseError("unknown config layer `$layer'");\r
+        }\r
+        if ($file === null) {\r
+            $file = $this->files[$layer];\r
+        }\r
+        $data = $this->_readConfigDataFrom($file);\r
+        if (PEAR::isError($data)) {\r
+            if ($strict) {\r
+                $this->_errorsFound++;\r
+                $this->lastError = $data;\r
+\r
+                return $data;\r
+            } else {\r
+                return true;\r
+            }\r
+        }\r
+        $this->_decodeInput($data);\r
+        if ($override) {\r
+            $this->configuration[$layer] =\r
+                PEAR_Config::arrayMergeRecursive($this->configuration[$layer], $data);\r
+        } else {\r
+            $this->configuration[$layer] =\r
+                PEAR_Config::arrayMergeRecursive($data, $this->configuration[$layer]);\r
+        }\r
+        $this->_setupChannels();\r
+        if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) {\r
+            $this->_registry[$layer] = new PEAR_Registry($phpdir);\r
+            $this->_registry[$layer]->setConfig($this);\r
+            $this->_regInitialized[$layer] = false;\r
+        } else {\r
+            unset($this->_registry[$layer]);\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ arrayMergeRecursive($arr2, $arr1)\r
+    /**\r
+     * @param array\r
+     * @param array\r
+     * @return array\r
+     * @static\r
+     */\r
+    function arrayMergeRecursive($arr2, $arr1)\r
+    {\r
+        $ret = array();\r
+        foreach ($arr2 as $key => $data) {\r
+            if (!isset($arr1[$key])) {\r
+                $ret[$key] = $data;\r
+                unset($arr1[$key]);\r
+                continue;\r
+            }\r
+            if (is_array($data)) {\r
+                if (!is_array($arr1[$key])) {\r
+                    $ret[$key] = $arr1[$key];\r
+                    unset($arr1[$key]);\r
+                    continue;\r
+                }\r
+                $ret[$key] = PEAR_Config::arrayMergeRecursive($arr1[$key], $arr2[$key]);\r
+                unset($arr1[$key]);\r
+            }\r
+        }\r
+        return array_merge($ret, $arr1);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ writeConfigFile([file], [layer])\r
+\r
+    /**\r
+     * Writes data into a config layer from a file.\r
+     *\r
+     * @param string|null file to read from, or null for default\r
+     * @param string config layer to insert data into ('user' or\r
+     *               'system')\r
+     * @param string|null data to write to config file or null for internal data [DEPRECATED]\r
+     * @return bool TRUE on success or a PEAR error on failure\r
+     */\r
+    function writeConfigFile($file = null, $layer = 'user', $data = null)\r
+    {\r
+        $this->_lazyChannelSetup($layer);\r
+        if ($layer == 'both' || $layer == 'all') {\r
+            foreach ($this->files as $type => $file) {\r
+                $err = $this->writeConfigFile($file, $type, $data);\r
+                if (PEAR::isError($err)) {\r
+                    return $err;\r
+                }\r
+            }\r
+            return true;\r
+        }\r
+        if (empty($this->files[$layer])) {\r
+            return $this->raiseError("unknown config file type `$layer'");\r
+        }\r
+        if ($file === null) {\r
+            $file = $this->files[$layer];\r
+        }\r
+        $data = ($data === null) ? $this->configuration[$layer] : $data;\r
+        $this->_encodeOutput($data);\r
+        $opt = array('-p', dirname($file));\r
+        if (!@System::mkDir($opt)) {\r
+            return $this->raiseError("could not create directory: " . dirname($file));\r
+        }\r
+        if (@is_file($file) && !@is_writeable($file)) {\r
+            return $this->raiseError("no write access to $file!");\r
+        }\r
+        $fp = @fopen($file, "w");\r
+        if (!$fp) {\r
+            return $this->raiseError("PEAR_Config::writeConfigFile fopen('$file','w') failed");\r
+        }\r
+        $contents = "#PEAR_Config 0.9\n" . serialize($data);\r
+        if (!@fwrite($fp, $contents)) {\r
+            return $this->raiseError("PEAR_Config::writeConfigFile: fwrite failed");\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ _readConfigDataFrom(file)\r
+\r
+    /**\r
+     * Reads configuration data from a file and returns the parsed data\r
+     * in an array.\r
+     *\r
+     * @param string file to read from\r
+     *\r
+     * @return array configuration data or a PEAR error on failure\r
+     *\r
+     * @access private\r
+     */\r
+    function _readConfigDataFrom($file)\r
+    {\r
+        $fp = @fopen($file, "r");\r
+        if (!$fp) {\r
+            return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed");\r
+        }\r
+        $size = filesize($file);\r
+        $rt = get_magic_quotes_runtime();\r
+        set_magic_quotes_runtime(0);\r
+        if (function_exists('file_get_contents')) {\r
+            fclose($fp);\r
+            $contents = file_get_contents($file);\r
+        } else {\r
+            $contents = @fread($fp, $size);\r
+            fclose($fp);\r
+        }\r
+        if (empty($contents)) {\r
+            return $this->raiseError('Configuration file "' . $file . '" is empty');\r
+        }\r
+        \r
+        set_magic_quotes_runtime($rt);\r
+\r
+        $version = false;\r
+        if (preg_match('/^#PEAR_Config\s+(\S+)\s+/si', $contents, $matches)) {\r
+            $version = $matches[1];\r
+            $contents = substr($contents, strlen($matches[0]));\r
+        } else {\r
+            // Museum config file\r
+            if (substr($contents,0,2) == 'a:') {\r
+                $version = '0.1';\r
+            }\r
+        }\r
+        if ($version && version_compare("$version", '1', '<')) {\r
+\r
+            // no '@', it is possible that unserialize\r
+            // raises a notice but it seems to block IO to\r
+            // STDOUT if a '@' is used and a notice is raise\r
+            $data = unserialize($contents);\r
+\r
+            if (!is_array($data) && !$data) {\r
+                if ($contents == serialize(false)) {\r
+                    $data = array();\r
+                } else {\r
+                    $err = $this->raiseError("PEAR_Config: bad data in $file");\r
+                    return $err;\r
+                }\r
+            }\r
+            if (!is_array($data)) {\r
+                if (strlen(trim($contents)) > 0) {\r
+                    $error = "PEAR_Config: bad data in $file";\r
+                    $err = $this->raiseError($error);\r
+                    return $err;\r
+                } else {\r
+                    $data = array();\r
+                }\r
+            }\r
+        // add parsing of newer formats here...\r
+        } else {\r
+            $err = $this->raiseError("$file: unknown version `$version'");\r
+            return $err; \r
+        }\r
+        return $data;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getConfFile(layer)\r
+    /**\r
+    * Gets the file used for storing the config for a layer\r
+    *\r
+    * @param string $layer 'user' or 'system'\r
+    */\r
+\r
+    function getConfFile($layer)\r
+    {\r
+        return $this->files[$layer];\r
+    }\r
+\r
+    // }}}\r
+\r
+    /**\r
+     * @param array information on a role as parsed from its xml file\r
+     * @return true|PEAR_Error\r
+     * @access private\r
+     */\r
+    function _addConfigVars($vars)\r
+    {\r
+        if (count($vars) > 3) {\r
+            return $this->raiseError('Roles can only define 3 new config variables or less');\r
+        }\r
+        foreach ($vars as $name => $var) {\r
+            if (!is_array($var)) {\r
+                return $this->raiseError('Configuration information must be an array');\r
+            }\r
+            if (!isset($var['type'])) {\r
+                return $this->raiseError('Configuration information must contain a type');\r
+            } else {\r
+                if (!in_array($var['type'],\r
+                      array('string', 'mask', 'password', 'directory', 'file', 'set'))) {\r
+                    return $this->raiseError(\r
+                        'Configuration type must be one of directory, file, string, ' .\r
+                        'mask, set, or password');\r
+                }\r
+            }\r
+            if (!isset($var['default'])) {\r
+                return $this->raiseError(\r
+                    'Configuration information must contain a default value ("default" index)');\r
+            } else {\r
+                if (is_array($var['default'])) {\r
+                    $real_default = '';\r
+                    foreach ($var['default'] as $config_var => $val) {\r
+                        if (strpos($config_var, 'text') === 0) {\r
+                            $real_default .= $val;\r
+                        } elseif (strpos($config_var, 'constant') === 0) {\r
+                            if (defined($val)) {\r
+                                $real_default .= constant($val);\r
+                            } else {\r
+                                return $this->raiseError(\r
+                                    'Unknown constant "' . $val . '" requested in ' .\r
+                                    'default value for configuration variable "' .\r
+                                    $name . '"');\r
+                            }\r
+                        } elseif (isset($this->configuration_info[$config_var])) {\r
+                            $real_default .=\r
+                                $this->configuration_info[$config_var]['default'];\r
+                        } else {\r
+                            return $this->raiseError(\r
+                                'Unknown request for "' . $config_var . '" value in ' .\r
+                                'default value for configuration variable "' .\r
+                                $name . '"');\r
+                        }\r
+                    }\r
+                    $var['default'] = $real_default;\r
+                }\r
+                if ($var['type'] == 'integer') {\r
+                    $var['default'] = (integer) $var['default'];\r
+                }\r
+            }\r
+            if (!isset($var['doc'])) {\r
+                return $this->raiseError(\r
+                    'Configuration information must contain a summary ("doc" index)');\r
+            }\r
+            if (!isset($var['prompt'])) {\r
+                return $this->raiseError(\r
+                    'Configuration information must contain a simple prompt ("prompt" index)');\r
+            }\r
+            if (!isset($var['group'])) {\r
+                return $this->raiseError(\r
+                    'Configuration information must contain a simple group ("group" index)');\r
+            }\r
+            if (isset($this->configuration_info[$name])) {\r
+                return $this->raiseError('Configuration variable "' . $name .\r
+                    '" already exists');\r
+            }\r
+            $this->configuration_info[$name] = $var;\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // {{{ _encodeOutput(&data)\r
+\r
+    /**\r
+     * Encodes/scrambles configuration data before writing to files.\r
+     * Currently, 'password' values will be base64-encoded as to avoid\r
+     * that people spot cleartext passwords by accident.\r
+     *\r
+     * @param array (reference) array to encode values in\r
+     *\r
+     * @return bool TRUE on success\r
+     *\r
+     * @access private\r
+     */\r
+    function _encodeOutput(&$data)\r
+    {\r
+        foreach ($data as $key => $value) {\r
+            if ($key == '__channels') {\r
+                foreach ($data['__channels'] as $channel => $blah) {\r
+                    $this->_encodeOutput($data['__channels'][$channel]);\r
+                }\r
+            }\r
+            if (!isset($this->configuration_info[$key])) {\r
+                continue;\r
+            }\r
+            $type = $this->configuration_info[$key]['type'];\r
+            switch ($type) {\r
+                // we base64-encode passwords so they are at least\r
+                // not shown in plain by accident\r
+                case 'password': {\r
+                    $data[$key] = base64_encode($data[$key]);\r
+                    break;\r
+                }\r
+                case 'mask': {\r
+                    $data[$key] = octdec($data[$key]);\r
+                    break;\r
+                }\r
+            }\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ _decodeInput(&data)\r
+\r
+    /**\r
+     * Decodes/unscrambles configuration data after reading from files.\r
+     *\r
+     * @param array (reference) array to encode values in\r
+     *\r
+     * @return bool TRUE on success\r
+     *\r
+     * @access private\r
+     *\r
+     * @see PEAR_Config::_encodeOutput\r
+     */\r
+    function _decodeInput(&$data)\r
+    {\r
+        if (!is_array($data)) {\r
+            return true;\r
+        }\r
+        foreach ($data as $key => $value) {\r
+            if ($key == '__channels') {\r
+                foreach ($data['__channels'] as $channel => $blah) {\r
+                    $this->_decodeInput($data['__channels'][$channel]);\r
+                }\r
+            }\r
+            if (!isset($this->configuration_info[$key])) {\r
+                continue;\r
+            }\r
+            $type = $this->configuration_info[$key]['type'];\r
+            switch ($type) {\r
+                case 'password': {\r
+                    $data[$key] = base64_decode($data[$key]);\r
+                    break;\r
+                }\r
+                case 'mask': {\r
+                    $data[$key] = decoct($data[$key]);\r
+                    break;\r
+                }\r
+            }\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getDefaultChannel([layer])\r
+    /**\r
+     * Retrieve the default channel.\r
+     *\r
+     * On startup, channels are not initialized, so if the default channel is not\r
+     * pear.php.net, then initialize the config.\r
+     * @param string registry layer\r
+     * @return string|false\r
+     */\r
+    function getDefaultChannel($layer = null)\r
+    {\r
+        $ret = false;\r
+        if ($layer === null) {\r
+            foreach ($this->layers as $layer) {\r
+                if (isset($this->configuration[$layer]['default_channel'])) {\r
+                    $ret = $this->configuration[$layer]['default_channel'];\r
+                    break;\r
+                }\r
+            }\r
+        } elseif (isset($this->configuration[$layer]['default_channel'])) {\r
+            $ret = $this->configuration[$layer]['default_channel'];\r
+        }\r
+        if ($ret == 'pear.php.net' && defined('PEAR_RUNTYPE') && PEAR_RUNTYPE == 'pecl') {\r
+            $ret = 'pecl.php.net';\r
+        }\r
+        if ($ret) {\r
+            if ($ret != 'pear.php.net') {\r
+                $this->_lazyChannelSetup();\r
+            }\r
+            return $ret;\r
+        }\r
+        return PEAR_CONFIG_DEFAULT_CHANNEL;\r
+    }\r
+\r
+    // {{{ get(key, [layer])\r
+    /**\r
+     * Returns a configuration value, prioritizing layers as per the\r
+     * layers property.\r
+     *\r
+     * @param string config key\r
+     *\r
+     * @return mixed the config value, or NULL if not found\r
+     *\r
+     * @access public\r
+     */\r
+    function get($key, $layer = null, $channel = false)\r
+    {\r
+        if (!isset($this->configuration_info[$key])) {\r
+            return null;\r
+        }\r
+        if ($key == '__channels') {\r
+            return null;\r
+        }\r
+        if ($key == 'default_channel') {\r
+            return $this->getDefaultChannel($layer);\r
+        }\r
+        if (!$channel) {\r
+            $channel = $this->getDefaultChannel();\r
+        } elseif ($channel != 'pear.php.net') {\r
+            $this->_lazyChannelSetup();\r
+        }\r
+        $channel = strtolower($channel);\r
+        \r
+        $test = (in_array($key, $this->_channelConfigInfo)) ?\r
+            $this->_getChannelValue($key, $layer, $channel) :\r
+            null;\r
+        if ($test !== null) {\r
+            if ($this->_installRoot) {\r
+                if (in_array($this->getGroup($key),\r
+                      array('File Locations', 'File Locations (Advanced)')) &&\r
+                      $this->getType($key) == 'directory') {\r
+                    return $this->_prependPath($test, $this->_installRoot);\r
+                }\r
+            }\r
+            return $test;\r
+        }\r
+        if ($layer === null) {\r
+            foreach ($this->layers as $layer) {\r
+                if (isset($this->configuration[$layer][$key])) {\r
+                    $test = $this->configuration[$layer][$key];\r
+                    if ($this->_installRoot) {\r
+                        if (in_array($this->getGroup($key),\r
+                              array('File Locations', 'File Locations (Advanced)')) &&\r
+                              $this->getType($key) == 'directory') {\r
+                            return $this->_prependPath($test, $this->_installRoot);\r
+                        }\r
+                    }\r
+                    if ($key == 'preferred_mirror') {\r
+                        $reg = &$this->getRegistry();\r
+                        if (is_object($reg)) {\r
+                            $chan = &$reg->getChannel($channel);\r
+                            if (!$chan->getMirror($test) && $chan->getName() != $test) {\r
+                                return $channel; // mirror does not exist\r
+                            }\r
+                        }\r
+                    }\r
+                    return $test;\r
+                }\r
+            }\r
+        } elseif (isset($this->configuration[$layer][$key])) {\r
+            $test = $this->configuration[$layer][$key];\r
+            if ($this->_installRoot) {\r
+                if (in_array($this->getGroup($key),\r
+                      array('File Locations', 'File Locations (Advanced)')) &&\r
+                      $this->getType($key) == 'directory') {\r
+                    return $this->_prependPath($test, $this->_installRoot);\r
+                }\r
+            }\r
+            if ($key == 'preferred_mirror') {\r
+                $reg = &$this->getRegistry();\r
+                if (is_object($reg)) {\r
+                    $chan = &$reg->getChannel($channel);\r
+                    if (!$chan->getMirror($test) && $chan->getName() != $test) {\r
+                        return $channel; // mirror does not exist\r
+                    }\r
+                }\r
+            }\r
+            return $test;\r
+        }\r
+        return null;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ _getChannelValue(key, value, [layer])\r
+    /**\r
+     * Returns a channel-specific configuration value, prioritizing layers as per the\r
+     * layers property.\r
+     *\r
+     * @param string config key\r
+     *\r
+     * @return mixed the config value, or NULL if not found\r
+     *\r
+     * @access private\r
+     */\r
+    function _getChannelValue($key, $layer, $channel)\r
+    {\r
+        if ($key == '__channels' || $channel == 'pear.php.net') {\r
+            return null;\r
+        }\r
+        $ret = null;\r
+        if ($layer === null) {\r
+            foreach ($this->layers as $ilayer) {\r
+                if (isset($this->configuration[$ilayer]['__channels'][$channel][$key])) {\r
+                    $ret = $this->configuration[$ilayer]['__channels'][$channel][$key];\r
+                    break;\r
+                }\r
+            }\r
+        } elseif (isset($this->configuration[$layer]['__channels'][$channel][$key])) {\r
+            $ret = $this->configuration[$layer]['__channels'][$channel][$key];\r
+        }\r
+        if ($key == 'preferred_mirror') {\r
+            if ($ret !== null) {\r
+                $reg = &$this->getRegistry($layer);\r
+                if (is_object($reg)) {\r
+                    $chan = &$reg->getChannel($channel);\r
+                    if (!$chan->getMirror($ret) && $chan->getName() != $ret) {\r
+                        return $channel; // mirror does not exist\r
+                    }\r
+                }\r
+                return $ret;\r
+            }\r
+            if ($channel == $this->getDefaultChannel($layer)) {\r
+                return $channel; // we must use the channel name as the preferred mirror\r
+                                 // if the user has not chosen an alternate\r
+            } else {\r
+                return $this->getDefaultChannel($layer);\r
+            }\r
+        }\r
+        return $ret;\r
+    }\r
+\r
+\r
+    // }}}\r
+    // {{{ set(key, value, [layer])\r
+\r
+    /**\r
+     * Set a config value in a specific layer (defaults to 'user').\r
+     * Enforces the types defined in the configuration_info array.  An\r
+     * integer config variable will be cast to int, and a set config\r
+     * variable will be validated against its legal values.\r
+     *\r
+     * @param string config key\r
+     * @param string config value\r
+     * @param string (optional) config layer\r
+     * @param string channel to set this value for, or null for global value\r
+     * @return bool TRUE on success, FALSE on failure\r
+     */\r
+    function set($key, $value, $layer = 'user', $channel = false)\r
+    {\r
+        if ($key == '__channels') {\r
+            return false;\r
+        }\r
+        if (!isset($this->configuration[$layer])) {\r
+            return false;\r
+        }\r
+        if ($key == 'default_channel') {\r
+            // can only set this value globally\r
+            $channel = 'pear.php.net';\r
+            if ($value != 'pear.php.net') {\r
+                $this->_lazyChannelSetup($layer);\r
+            }\r
+        }\r
+        if ($key == 'preferred_mirror') {\r
+            if ($channel == '__uri') {\r
+                return false; // can't set the __uri pseudo-channel's mirror\r
+            }\r
+            $reg = &$this->getRegistry($layer);\r
+            if (is_object($reg)) {\r
+                $chan = &$reg->getChannel($channel ? $channel : 'pear.php.net');\r
+                if (!$chan->getMirror($value) && $chan->getName() != $value) {\r
+                    return false; // mirror does not exist\r
+                }\r
+            }\r
+        }\r
+        if (empty($this->configuration_info[$key])) {\r
+            return false;\r
+        }\r
+        extract($this->configuration_info[$key]);\r
+        switch ($type) {\r
+            case 'integer':\r
+                $value = (int)$value;\r
+                break;\r
+            case 'set': {\r
+                // If a valid_set is specified, require the value to\r
+                // be in the set.  If there is no valid_set, accept\r
+                // any value.\r
+                if ($valid_set) {\r
+                    reset($valid_set);\r
+                    if ((key($valid_set) === 0 && !in_array($value, $valid_set)) ||\r
+                        (key($valid_set) !== 0 && empty($valid_set[$value])))\r
+                    {\r
+                        return false;\r
+                    }\r
+                }\r
+                break;\r
+            }\r
+        }\r
+        if (!$channel) {\r
+            $channel = $this->get('default_channel', null, 'pear.php.net');\r
+        }\r
+        if (!in_array($channel, $this->_channels)) {\r
+            $this->_lazyChannelSetup($layer);\r
+            $reg = &$this->getRegistry($layer);\r
+            if ($reg) {\r
+                $channel = $reg->channelName($channel);\r
+            }\r
+            if (!in_array($channel, $this->_channels)) {\r
+                return false;\r
+            }\r
+        }\r
+        if ($channel != 'pear.php.net') {\r
+            if (in_array($key, $this->_channelConfigInfo)) {\r
+                $this->configuration[$layer]['__channels'][$channel][$key] = $value;\r
+                return true;\r
+            } else {\r
+                return false;\r
+            }\r
+        } else {\r
+            if ($key == 'default_channel') {\r
+                if (!isset($reg)) {\r
+                    $reg = &$this->getRegistry($layer);\r
+                    if (!$reg) {\r
+                        $reg = &$this->getRegistry();\r
+                    }\r
+                }\r
+                if ($reg) {\r
+                    $value = $reg->channelName($value);\r
+                }\r
+                if (!$value) {\r
+                    return false;\r
+                }\r
+            }\r
+        }\r
+        $this->configuration[$layer][$key] = $value;\r
+        if ($key == 'php_dir' && !$this->_noRegistry) {\r
+            if (!isset($this->_registry[$layer]) ||\r
+                  $value != $this->_registry[$layer]->install_dir) {\r
+                $this->_registry[$layer] = new PEAR_Registry($value);\r
+                $this->_regInitialized[$layer] = false;\r
+                $this->_registry[$layer]->setConfig($this);\r
+            }\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    function _lazyChannelSetup($uselayer = false)\r
+    {\r
+        if ($this->_noRegistry) {\r
+            return;\r
+        }\r
+        $merge = false;\r
+        foreach ($this->_registry as $layer => $p) {\r
+            if ($uselayer && $uselayer != $layer) {\r
+                continue;\r
+            }\r
+            if (!$this->_regInitialized[$layer]) {\r
+                if ($layer == 'default' && isset($this->_registry['user']) ||\r
+                      isset($this->_registry['system'])) {\r
+                    // only use the default registry if there are no alternatives\r
+                    continue;\r
+                }\r
+                if (!is_object($this->_registry[$layer])) {\r
+                    if ($phpdir = $this->get('php_dir', $layer, 'pear.php.net')) {\r
+                        $this->_registry[$layer] = new PEAR_Registry($phpdir);\r
+                        $this->_registry[$layer]->setConfig($this);\r
+                        $this->_regInitialized[$layer] = false;\r
+                    } else {\r
+                        unset($this->_registry[$layer]);\r
+                        return;\r
+                    }\r
+                }\r
+                $this->setChannels($this->_registry[$layer]->listChannels(), $merge);\r
+                $this->_regInitialized[$layer] = true;\r
+                $merge = true;\r
+            }\r
+        }\r
+    }\r
+    // {{{ setChannels()\r
+    \r
+    /**\r
+     * Set the list of channels.\r
+     *\r
+     * This should be set via a call to {@link PEAR_Registry::listChannels()}\r
+     * @param array\r
+     * @param bool\r
+     * @return bool success of operation\r
+     */\r
+    function setChannels($channels, $merge = false)\r
+    {\r
+        if (!is_array($channels)) {\r
+            return false;\r
+        }\r
+        if ($merge) {\r
+            $this->_channels = array_merge($this->_channels, $channels);\r
+        } else {\r
+            $this->_channels = $channels;\r
+        }\r
+        foreach ($channels as $channel) {\r
+            $channel = strtolower($channel);\r
+            if ($channel == 'pear.php.net') {\r
+                continue;\r
+            }\r
+            foreach ($this->layers as $layer) {\r
+                if (!isset($this->configuration[$layer]['__channels'][$channel])\r
+                      || !is_array($this->configuration[$layer]['__channels'][$channel])) {\r
+                    $this->configuration[$layer]['__channels'][$channel] = array();\r
+                }\r
+            }\r
+        }\r
+        return true;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getType(key)\r
+\r
+    /**\r
+     * Get the type of a config value.\r
+     *\r
+     * @param string  config key\r
+     *\r
+     * @return string type, one of "string", "integer", "file",\r
+     * "directory", "set" or "password".\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getType($key)\r
+    {\r
+        if (isset($this->configuration_info[$key])) {\r
+            return $this->configuration_info[$key]['type'];\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getDocs(key)\r
+\r
+    /**\r
+     * Get the documentation for a config value.\r
+     *\r
+     * @param string  config key\r
+     *\r
+     * @return string documentation string\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getDocs($key)\r
+    {\r
+        if (isset($this->configuration_info[$key])) {\r
+            return $this->configuration_info[$key]['doc'];\r
+        }\r
+        return false;\r
+    }\r
+       // }}}\r
+    // {{{ getPrompt(key)\r
+\r
+    /**\r
+     * Get the short documentation for a config value.\r
+     *\r
+     * @param string  config key\r
+     *\r
+     * @return string short documentation string\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getPrompt($key)\r
+    {\r
+        if (isset($this->configuration_info[$key])) {\r
+            return $this->configuration_info[$key]['prompt'];\r
+        }\r
+        return false;\r
+    }\r
+    // }}}\r
+    // {{{ getGroup(key)\r
+\r
+    /**\r
+     * Get the parameter group for a config key.\r
+     *\r
+     * @param string  config key\r
+     *\r
+     * @return string parameter group\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getGroup($key)\r
+    {\r
+        if (isset($this->configuration_info[$key])) {\r
+            return $this->configuration_info[$key]['group'];\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getGroups()\r
+\r
+    /**\r
+     * Get the list of parameter groups.\r
+     *\r
+     * @return array list of parameter groups\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getGroups()\r
+    {\r
+        $tmp = array();\r
+        foreach ($this->configuration_info as $key => $info) {\r
+            $tmp[$info['group']] = 1;\r
+        }\r
+        return array_keys($tmp);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getGroupKeys()\r
+\r
+    /**\r
+     * Get the list of the parameters in a group.\r
+     *\r
+     * @param string $group parameter group\r
+     *\r
+     * @return array list of parameters in $group\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getGroupKeys($group)\r
+    {\r
+        $keys = array();\r
+        foreach ($this->configuration_info as $key => $info) {\r
+            if ($info['group'] == $group) {\r
+                $keys[] = $key;\r
+            }\r
+        }\r
+        return $keys;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getSetValues(key)\r
+\r
+    /**\r
+     * Get the list of allowed set values for a config value.  Returns\r
+     * NULL for config values that are not sets.\r
+     *\r
+     * @param string  config key\r
+     *\r
+     * @return array enumerated array of set values, or NULL if the\r
+     *               config key is unknown or not a set\r
+     *\r
+     * @access public\r
+     *\r
+     */\r
+    function getSetValues($key)\r
+    {\r
+        if (isset($this->configuration_info[$key]) &&\r
+            isset($this->configuration_info[$key]['type']) &&\r
+            $this->configuration_info[$key]['type'] == 'set')\r
+        {\r
+            $valid_set = $this->configuration_info[$key]['valid_set'];\r
+            reset($valid_set);\r
+            if (key($valid_set) === 0) {\r
+                return $valid_set;\r
+            }\r
+            return array_keys($valid_set);\r
+        }\r
+        return null;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getKeys()\r
+\r
+    /**\r
+     * Get all the current config keys.\r
+     *\r
+     * @return array simple array of config keys\r
+     *\r
+     * @access public\r
+     */\r
+    function getKeys()\r
+    {\r
+        $keys = array();\r
+        foreach ($this->layers as $layer) {\r
+            $test = $this->configuration[$layer];\r
+            if (isset($test['__channels'])) {\r
+                foreach ($test['__channels'] as $channel => $configs) {\r
+                    $keys = array_merge($keys, $configs);\r
+                }\r
+            }\r
+            unset($test['__channels']);\r
+            $keys = array_merge($keys, $test);\r
+        }\r
+        return array_keys($keys);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ remove(key, [layer])\r
+\r
+    /**\r
+     * Remove the a config key from a specific config layer.\r
+     *\r
+     * @param string config key\r
+     *\r
+     * @param string (optional) config layer\r
+     *\r
+     * @return bool TRUE on success, FALSE on failure\r
+     *\r
+     * @access public\r
+     */\r
+    function remove($key, $layer = 'user')\r
+    {\r
+        $channel = $this->getDefaultChannel();\r
+        if ($channel !== 'pear.php.net') {\r
+            if (isset($this->configuration[$layer]['__channels'][$channel][$key])) {\r
+                unset($this->configuration[$layer]['__channels'][$channel][$key]);\r
+                return true;\r
+            }\r
+        }\r
+        if (isset($this->configuration[$layer][$key])) {\r
+            unset($this->configuration[$layer][$key]);\r
+            return true;\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ removeLayer(layer)\r
+\r
+    /**\r
+     * Temporarily remove an entire config layer.  USE WITH CARE!\r
+     *\r
+     * @param string config key\r
+     *\r
+     * @param string (optional) config layer\r
+     *\r
+     * @return bool TRUE on success, FALSE on failure\r
+     *\r
+     * @access public\r
+     */\r
+    function removeLayer($layer)\r
+    {\r
+        if (isset($this->configuration[$layer])) {\r
+            $this->configuration[$layer] = array();\r
+            return true;\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ store([layer])\r
+\r
+    /**\r
+     * Stores configuration data in a layer.\r
+     *\r
+     * @param string config layer to store\r
+     *\r
+     * @return bool TRUE on success, or PEAR error on failure\r
+     *\r
+     * @access public\r
+     */\r
+    function store($layer = 'user', $data = null)\r
+    {\r
+        return $this->writeConfigFile(null, $layer, $data);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ toDefault(key)\r
+\r
+    /**\r
+     * Unset the user-defined value of a config key, reverting the\r
+     * value to the system-defined one.\r
+     *\r
+     * @param string config key\r
+     *\r
+     * @return bool TRUE on success, FALSE on failure\r
+     *\r
+     * @access public\r
+     */\r
+    function toDefault($key)\r
+    {\r
+        trigger_error("PEAR_Config::toDefault() deprecated, use PEAR_Config::remove() instead", E_USER_NOTICE);\r
+        return $this->remove($key, 'user');\r
+    }\r
+\r
+    // }}}\r
+    // {{{ definedBy(key)\r
+\r
+    /**\r
+     * Tells what config layer that gets to define a key.\r
+     *\r
+     * @param string config key\r
+     * @param boolean return the defining channel\r
+     *\r
+     * @return string|array the config layer, or an empty string if not found.\r
+     *\r
+     *         if $returnchannel, the return is an array array('layer' => layername,\r
+     *         'channel' => channelname), or an empty string if not found\r
+     *\r
+     * @access public\r
+     */\r
+    function definedBy($key, $returnchannel = false)\r
+    {\r
+        foreach ($this->layers as $layer) {\r
+            $channel = $this->getDefaultChannel();\r
+            if ($channel !== 'pear.php.net') {\r
+                if (isset($this->configuration[$layer]['__channels'][$channel][$key])) {\r
+                    if ($returnchannel) {\r
+                        return array('layer' => $layer, 'channel' => $channel);\r
+                    }\r
+                    return $layer;\r
+                }\r
+            }\r
+            if (isset($this->configuration[$layer][$key])) {\r
+                if ($returnchannel) {\r
+                    return array('layer' => $layer, 'channel' => 'pear.php.net');\r
+                }\r
+                return $layer;\r
+            }\r
+        }\r
+        return '';\r
+    }\r
+\r
+    // }}}\r
+    // {{{ isDefaulted(key)\r
+\r
+    /**\r
+     * Tells whether a config value has a system-defined value.\r
+     *\r
+     * @param string   config key\r
+     *\r
+     * @return bool\r
+     *\r
+     * @access public\r
+     *\r
+     * @deprecated\r
+     */\r
+    function isDefaulted($key)\r
+    {\r
+        trigger_error("PEAR_Config::isDefaulted() deprecated, use PEAR_Config::definedBy() instead", E_USER_NOTICE);\r
+        return $this->definedBy($key) == 'system';\r
+    }\r
+\r
+    // }}}\r
+    // {{{ isDefined(key)\r
+\r
+    /**\r
+     * Tells whether a given key exists as a config value.\r
+     *\r
+     * @param string config key\r
+     *\r
+     * @return bool whether <config key> exists in this object\r
+     *\r
+     * @access public\r
+     */\r
+    function isDefined($key)\r
+    {\r
+        foreach ($this->layers as $layer) {\r
+            if (isset($this->configuration[$layer][$key])) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    }\r
+\r
+    // }}}\r
+    // {{{ isDefinedLayer(key)\r
+\r
+    /**\r
+     * Tells whether a given config layer exists.\r
+     *\r
+     * @param string config layer\r
+     *\r
+     * @return bool whether <config layer> exists in this object\r
+     *\r
+     * @access public\r
+     */\r
+    function isDefinedLayer($layer)\r
+    {\r
+        return isset($this->configuration[$layer]);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ getLayers()\r
+\r
+    /**\r
+     * Returns the layers defined (except the 'default' one)\r
+     *\r
+     * @return array of the defined layers\r
+     */\r
+    function getLayers()\r
+    {\r
+        $cf = $this->configuration;\r
+        unset($cf['default']);\r
+        return array_keys($cf);\r
+    }\r
+\r
+    // }}}\r
+    // {{{ apiVersion()\r
+    function apiVersion()\r
+    {\r
+        return '1.1';\r
+    }\r
+    // }}}\r
+\r
+    /**\r
+     * @return PEAR_Registry\r
+     */\r
+    function &getRegistry($use = null)\r
+    {\r
+        if ($use === null) {\r
+            $layer = 'user';\r
+        } else {\r
+            $layer = $use;\r
+        }\r
+        if (isset($this->_registry[$layer])) {\r
+            return $this->_registry[$layer];\r
+        } elseif ($use === null && isset($this->_registry['system'])) {\r
+            return $this->_registry['system'];\r
+        } elseif ($use === null && isset($this->_registry['default'])) {\r
+            return $this->_registry['default'];\r
+        } elseif ($use) {\r
+            $a = false;\r
+            return $a;\r
+        } else {\r
+            // only go here if null was passed in\r
+            die("CRITICAL ERROR: Registry could not be initialized from any value");\r
+        }\r
+    }\r
+    /**\r
+     * This is to allow customization like the use of installroot\r
+     * @param PEAR_Registry\r
+     * @return bool\r
+     */\r
+    function setRegistry(&$reg, $layer = 'user')\r
+    {\r
+        if ($this->_noRegistry) {\r
+            return false;\r
+        }\r
+        if (!in_array($layer, array('user', 'system'))) {\r
+            return false;\r
+        }\r
+        $this->_registry[$layer] = &$reg;\r
+        if (is_object($reg)) {\r
+            $this->_registry[$layer]->setConfig($this);\r
+        }\r
+        return true;\r
+    }\r
+\r
+    function noRegistry()\r
+    {\r
+        $this->_noRegistry = true;\r
+    }\r
+\r
+    /**\r
+     * @return PEAR_Remote\r
+     */\r
+    function &getRemote()\r
+    {\r
+        $remote = new PEAR_Remote($this);\r
+        return $remote;\r
+    }\r
+\r
+    /**\r
+     * @return PEAR_REST\r
+     */\r
+    function &getREST($version, $options = array())\r
+    {\r
+        $version = str_replace('.', '', $version);\r
+        if (!class_exists($class = 'PEAR_REST_' . $version)) {\r
+            require_once 'PEAR/REST/' . $version . '.php';\r
+        }\r
+        $remote = new $class($this, $options);\r
+        return $remote;\r
+    }\r
+\r
+    /**\r
+     * The ftp server is set in {@link readFTPConfigFile()}.  It exists only if a\r
+     * remote configuration file has been specified\r
+     * @return PEAR_FTP|false\r
+     */\r
+    function &getFTP()\r
+    {\r
+        if (isset($this->_ftp)) {\r
+            return $this->_ftp;\r
+        } else {\r
+            $a = false;\r
+            return $a;\r
+        }\r
+    }\r
+\r
+    // {{{ _prependPath($path, $prepend)\r
+\r
+    function _prependPath($path, $prepend)\r
+    {\r
+        if (strlen($prepend) > 0) {\r
+            if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) {\r
+                if (preg_match('/^[a-z]:/i', $prepend)) {\r
+                    $prepend = substr($prepend, 2);\r
+                } elseif ($prepend{0} != '\\') {\r
+                    $prepend = "\\$prepend";\r
+                }\r
+                $path = substr($path, 0, 2) . $prepend . substr($path, 2);\r
+            } else {\r
+                $path = $prepend . $path;\r
+            }\r
+        }\r
+        return $path;\r
+    }\r
+    // }}}\r
+\r
+    /**\r
+     * @param string|false installation directory to prepend to all _dir variables, or false to\r
+     *                     disable\r
+     */\r
+    function setInstallRoot($root)\r
+    {\r
+        if (substr($root, -1) == DIRECTORY_SEPARATOR) {\r
+            $root = substr($root, 0, -1);\r
+        }\r
+        $old = $this->_installRoot;\r
+        $this->_installRoot = $root;\r
+        if (($old != $root) && !$this->_noRegistry) {\r
+            foreach (array_keys($this->_registry) as $layer) {\r
+                if ($layer == 'ftp' || !isset($this->_registry[$layer])) {\r
+                    continue;\r
+                }\r
+                $this->_registry[$layer] =\r
+                    new PEAR_Registry($this->get('php_dir', $layer, 'pear.php.net'));\r
+                $this->_registry[$layer]->setConfig($this);\r
+                $this->_regInitialized[$layer] = false;\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+?>\r
diff --git a/docs/include/classes/XML/XML_HTMLSax/PEAR/Remote.php b/docs/include/classes/XML/XML_HTMLSax/PEAR/Remote.php
new file mode 100644 (file)
index 0000000..ffc8b6d
--- /dev/null
@@ -0,0 +1,519 @@
+<?php\r
+/**\r
+ * PEAR_Remote\r
+ *\r
+ * PHP versions 4 and 5\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: Remote.php 7208 2008-01-09 16:07:24Z greg $\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      File available since Release 0.1\r
+ */\r
+\r
+/**\r
+ * needed for PEAR_Error\r
+ */\r
+require_once 'PEAR.php';\r
+require_once 'PEAR/Config.php';\r
+\r
+/**\r
+ * This is a class for doing remote operations against the central\r
+ * PEAR database.\r
+ *\r
+ * @nodep XML_RPC_Value\r
+ * @nodep XML_RPC_Message\r
+ * @nodep XML_RPC_Client\r
+ * @category   pear\r
+ * @package    PEAR\r
+ * @author     Stig Bakken <ssb@php.net>\r
+ * @author     Greg Beaver <cellog@php.net>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    Release: 1.4.4\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      Class available since Release 0.1\r
+ */\r
+class PEAR_Remote extends PEAR\r
+{\r
+    // {{{ properties\r
+\r
+    var $config = null;\r
+    var $cache  = null;\r
+    /**\r
+     * @var PEAR_Registry\r
+     * @access private\r
+     */\r
+    var $_registry;\r
+\r
+    // }}}\r
+\r
+    // {{{ PEAR_Remote(config_object)\r
+\r
+    function PEAR_Remote(&$config)\r
+    {\r
+        $this->PEAR();\r
+        $this->config = &$config;\r
+        $this->_registry = &$this->config->getRegistry();\r
+    }\r
+\r
+    // }}}\r
+    // {{{ setRegistry()\r
+    \r
+    function setRegistry(&$reg)\r
+    {\r
+        $this->_registry = &$reg;\r
+    }\r
+    // }}}\r
+    // {{{ getCache()\r
+\r
+\r
+    function getCache($args)\r
+    {\r
+        $id       = md5(serialize($args));\r
+        $cachedir = $this->config->get('cache_dir');\r
+        $filename = $cachedir . DIRECTORY_SEPARATOR . 'xmlrpc_cache_' . $id;\r
+        if (!file_exists($filename)) {\r
+            return null;\r
+        }\r
+\r
+        $fp = fopen($filename, 'rb');\r
+        if (!$fp) {\r
+            return null;\r
+        }\r
+        if (function_exists('file_get_contents')) {\r
+            fclose($fp);\r
+            $content = file_get_contents($filename);\r
+        } else {\r
+            $content  = fread($fp, filesize($filename));\r
+            fclose($fp);\r
+        }\r
+        $result   = array(\r
+            'age'        => time() - filemtime($filename),\r
+            'lastChange' => filemtime($filename),\r
+            'content'    => unserialize($content),\r
+            );\r
+        return $result;\r
+    }\r
+\r
+    // }}}\r
+\r
+    // {{{ saveCache()\r
+\r
+    function saveCache($args, $data)\r
+    {\r
+        $id       = md5(serialize($args));\r
+        $cachedir = $this->config->get('cache_dir');\r
+        if (!file_exists($cachedir)) {\r
+            System::mkdir(array('-p', $cachedir));\r
+        }\r
+        $filename = $cachedir.'/xmlrpc_cache_'.$id;\r
+\r
+        $fp = @fopen($filename, "wb");\r
+        if ($fp) {\r
+            fwrite($fp, serialize($data));\r
+            fclose($fp);\r
+        }\r
+    }\r
+\r
+    // }}}\r
+\r
+    // {{{ clearCache()\r
+\r
+    function clearCache($method, $args)\r
+    {\r
+        array_unshift($args, $method);\r
+        array_unshift($args, $this->config->get('default_channel')); // cache by channel\r
+        $id       = md5(serialize($args));\r
+        $cachedir = $this->config->get('cache_dir');\r
+        $filename = $cachedir.'/xmlrpc_cache_'.$id;\r
+        if (file_exists($filename)) {\r
+            @unlink($filename);\r
+        }\r
+    }\r
+\r
+    // }}}\r
+    // {{{ call(method, [args...])\r
+\r
+    function call($method)\r
+    {\r
+        $_args = $args = func_get_args();\r
+\r
+        $server_channel = $this->config->get('default_channel');\r
+        $channel = $this->_registry->getChannel($server_channel);\r
+        if ($channel) {\r
+            $mirror = $this->config->get('preferred_mirror');\r
+            if ($channel->getMirror($mirror)) {\r
+                if ($channel->supports('xmlrpc', $method, $mirror)) {\r
+                    $server_channel = $server_host = $mirror; // use the preferred mirror\r
+                    $server_port = $channel->getPort($mirror);\r
+                } elseif (!$channel->supports('xmlrpc', $method)) {\r
+                    return $this->raiseError("Channel $server_channel does not " .\r
+                        "support xml-rpc method $method");\r
+                }\r
+            }\r
+            if (!isset($server_host)) {\r
+                if (!$channel->supports('xmlrpc', $method)) {\r
+                    return $this->raiseError("Channel $server_channel does not support " .\r
+                        "xml-rpc method $method");\r
+                } else {\r
+                    $server_host = $server_channel;\r
+                    $server_port = $channel->getPort();\r
+                }\r
+            }\r
+        } else {\r
+            return $this->raiseError("Unknown channel '$server_channel'");\r
+        }\r
+\r
+        array_unshift($_args, $server_channel); // cache by channel\r
+        $this->cache = $this->getCache($_args);\r
+        $cachettl = $this->config->get('cache_ttl');\r
+        // If cache is newer than $cachettl seconds, we use the cache!\r
+        if ($this->cache !== null && $this->cache['age'] < $cachettl) {\r
+            return $this->cache['content'];\r
+        }\r
+        if (extension_loaded("xmlrpc")) {\r
+            $result = call_user_func_array(array(&$this, 'call_epi'), $args);\r
+            if (!PEAR::isError($result)) {\r
+                $this->saveCache($_args, $result);\r
+            }\r
+            return $result;\r
+        } elseif (!@include_once 'XML/RPC.php') {\r
+            return $this->raiseError("For this remote PEAR operation you need to load the xmlrpc extension or install XML_RPC");\r
+        }\r
+\r
+        array_shift($args);\r
+        $username = $this->config->get('username');\r
+        $password = $this->config->get('password');\r
+        $eargs = array();\r
+        foreach($args as $arg) {\r
+            $eargs[] = $this->_encode($arg);\r
+        }\r
+        $f = new XML_RPC_Message($method, $eargs);\r
+        if ($this->cache !== null) {\r
+            $maxAge = '?maxAge='.$this->cache['lastChange'];\r
+        } else {\r
+            $maxAge = '';\r
+        }\r
+        $proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';\r
+        if ($proxy = parse_url($this->config->get('http_proxy'))) {\r
+            $proxy_host = @$proxy['host'];\r
+            if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') {\r
+                $proxy_host = 'https://' . $proxy_host;\r
+            }\r
+            $proxy_port = @$proxy['port'];\r
+            $proxy_user = @urldecode(@$proxy['user']);\r
+            $proxy_pass = @urldecode(@$proxy['pass']);\r
+        }\r
+        $shost = $server_host;\r
+        if ($channel->getSSL()) {\r
+            $shost = "https://$shost";\r
+        }\r
+        $c = new XML_RPC_Client('/' . $channel->getPath('xmlrpc')\r
+            . $maxAge, $shost, $server_port, $proxy_host, $proxy_port,\r
+            $proxy_user, $proxy_pass);\r
+        if ($username && $password) {\r
+            $c->setCredentials($username, $password);\r
+        }\r
+        if ($this->config->get('verbose') >= 3) {\r
+            $c->setDebug(1);\r
+        }\r
+        $r = $c->send($f);\r
+        if (!$r) {\r
+            return $this->raiseError("XML_RPC send failed");\r
+        }\r
+        $v = $r->value();\r
+        if ($e = $r->faultCode()) {\r
+            if ($e == $GLOBALS['XML_RPC_err']['http_error'] && strstr($r->faultString(), '304 Not Modified') !== false) {\r
+                return $this->cache['content'];\r
+            }\r
+            return $this->raiseError($r->faultString(), $e);\r
+        }\r
+\r
+        $result = XML_RPC_decode($v);\r
+        $this->saveCache($_args, $result);\r
+        return $result;\r
+    }\r
+\r
+    // }}}\r
+\r
+    // {{{ call_epi(method, [args...])\r
+\r
+    function call_epi($method)\r
+    {\r
+        do {\r
+            if (extension_loaded("xmlrpc")) {\r
+                break;\r
+            }\r
+            if (OS_WINDOWS) {\r
+                $ext = 'dll';\r
+            } elseif (PHP_OS == 'HP-UX') {\r
+                $ext = 'sl';\r
+            } elseif (PHP_OS == 'AIX') {\r
+                $ext = 'a';\r
+            } else {\r
+                $ext = 'so';\r
+            }\r
+            $ext = OS_WINDOWS ? 'dll' : 'so';\r
+            @dl("xmlrpc-epi.$ext");\r
+            if (extension_loaded("xmlrpc")) {\r
+                break;\r
+            }\r
+            @dl("xmlrpc.$ext");\r
+            if (extension_loaded("xmlrpc")) {\r
+                break;\r
+            }\r
+            return $this->raiseError("unable to load xmlrpc extension");\r
+        } while (false);\r
+        $server_channel = $this->config->get('default_channel');\r
+        $channel = $this->_registry->getChannel($server_channel);\r
+        if ($channel) {\r
+            $mirror = $this->config->get('preferred_mirror');\r
+            if ($channel->getMirror($mirror)) {\r
+                if ($channel->supports('xmlrpc', $method, $mirror)) {\r
+                    $server_channel = $server_host = $mirror; // use the preferred mirror\r
+                    $server_port = $channel->getPort($mirror);\r
+                } elseif (!$channel->supports('xmlrpc', $method)) {\r
+                    return $this->raiseError("Channel $server_channel does not " .\r
+                        "support xml-rpc method $method");\r
+                }\r
+            }\r
+            if (!isset($server_host)) {\r
+                if (!$channel->supports('xmlrpc', $method)) {\r
+                    return $this->raiseError("Channel $server_channel does not support " .\r
+                        "xml-rpc method $method");\r
+                } else {\r
+                    $server_host = $server_channel;\r
+                    $server_port = $channel->getPort();\r
+                }\r
+            }\r
+        } else {\r
+            return $this->raiseError("Unknown channel '$server_channel'");\r
+        }\r
+        $params = func_get_args();\r
+        array_shift($params);\r
+        $method = str_replace("_", ".", $method);\r
+        $request = xmlrpc_encode_request($method, $params);\r
+        if ($http_proxy = $this->config->get('http_proxy')) {\r
+            $proxy = parse_url($http_proxy);\r
+            $proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';\r
+            $proxy_host = @$proxy['host'];\r
+            if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') {\r
+                $proxy_host = 'ssl://' . $proxy_host;\r
+            }\r
+            $proxy_port = @$proxy['port'];\r
+            $proxy_user = @urldecode(@$proxy['user']);\r
+            $proxy_pass = @urldecode(@$proxy['pass']);\r
+            $fp = @fsockopen($proxy_host, $proxy_port);\r
+            $use_proxy = true;\r
+            if ($channel->getSSL()) {\r
+                $server_host = "https://$server_host";\r
+            }\r
+        } else {\r
+            $use_proxy = false;\r
+            $ssl = $channel->getSSL();\r
+            $fp = @fsockopen(($ssl ? 'ssl://' : '') . $server_host, $server_port);\r
+            if (!$fp) {\r
+                $server_host = "$ssl$server_host"; // for error-reporting\r
+            }\r
+        }\r
+        if (!$fp && $http_proxy) {\r
+            return $this->raiseError("PEAR_Remote::call: fsockopen(`$proxy_host', $proxy_port) failed");\r
+        } elseif (!$fp) {\r
+            return $this->raiseError("PEAR_Remote::call: fsockopen(`$server_host', $server_port) failed");\r
+        }\r
+        $len = strlen($request);\r
+        $req_headers = "Host: $server_host:$server_port\r\n" .\r
+             "Content-type: text/xml\r\n" .\r
+             "Content-length: $len\r\n";\r
+        $username = $this->config->get('username');\r
+        $password = $this->config->get('password');\r
+        if ($username && $password) {\r
+            $req_headers .= "Cookie: PEAR_USER=$username; PEAR_PW=$password\r\n";\r
+            $tmp = base64_encode("$username:$password");\r
+            $req_headers .= "Authorization: Basic $tmp\r\n";\r
+        }\r
+        if ($this->cache !== null) {\r
+            $maxAge = '?maxAge='.$this->cache['lastChange'];\r
+        } else {\r
+            $maxAge = '';\r
+        }\r
+\r
+        if ($use_proxy && $proxy_host != '' && $proxy_user != '') {\r
+            $req_headers .= 'Proxy-Authorization: Basic '\r
+                .base64_encode($proxy_user.':'.$proxy_pass)\r
+                ."\r\n";\r
+        }\r
+\r
+        if ($this->config->get('verbose') > 3) {\r
+            print "XMLRPC REQUEST HEADERS:\n";\r
+            var_dump($req_headers);\r
+            print "XMLRPC REQUEST BODY:\n";\r
+            var_dump($request);\r
+        }\r
+\r
+        if ($use_proxy && $proxy_host != '') {\r
+            $post_string = "POST http://".$server_host;\r
+            if ($proxy_port > '') {\r
+                $post_string .= ':'.$server_port;\r
+            }\r
+        } else {\r
+            $post_string = "POST ";\r
+        }\r
+\r
+        $path = '/' . $channel->getPath('xmlrpc');\r
+        fwrite($fp, ($post_string . $path . "$maxAge HTTP/1.0\r\n$req_headers\r\n$request"));\r
+        $response = '';\r
+        $line1 = fgets($fp, 2048);\r
+        if (!preg_match('!^HTTP/[0-9\.]+ (\d+) (.*)!', $line1, $matches)) {\r
+            return $this->raiseError("PEAR_Remote: invalid HTTP response from XML-RPC server");\r
+        }\r
+        switch ($matches[1]) {\r
+            case "200": // OK\r
+                break;\r
+            case "304": // Not Modified\r
+                return $this->cache['content'];\r
+            case "401": // Unauthorized\r
+                if ($username && $password) {\r
+                    return $this->raiseError("PEAR_Remote ($server_host:$server_port) " .\r
+                        ": authorization failed", 401);\r
+                } else {\r
+                    return $this->raiseError("PEAR_Remote ($server_host:$server_port) " .\r
+                        ": authorization required, please log in first", 401);\r
+                }\r
+            default:\r
+                return $this->raiseError("PEAR_Remote ($server_host:$server_port) : " .\r
+                    "unexpected HTTP response", (int)$matches[1], null, null,\r
+                    "$matches[1] $matches[2]");\r
+        }\r
+        while (trim(fgets($fp, 2048)) != ''); // skip rest of headers\r
+        while ($chunk = fread($fp, 10240)) {\r
+            $response .= $chunk;\r
+        }\r
+        fclose($fp);\r
+        if ($this->config->get('verbose') > 3) {\r
+            print "XMLRPC RESPONSE:\n";\r
+            var_dump($response);\r
+        }\r
+        $ret = xmlrpc_decode($response);\r
+        if (is_array($ret) && isset($ret['__PEAR_TYPE__'])) {\r
+            if ($ret['__PEAR_TYPE__'] == 'error') {\r
+                if (isset($ret['__PEAR_CLASS__'])) {\r
+                    $class = $ret['__PEAR_CLASS__'];\r
+                } else {\r
+                    $class = "PEAR_Error";\r
+                }\r
+                if ($ret['code']     === '') $ret['code']     = null;\r
+                if ($ret['message']  === '') $ret['message']  = null;\r
+                if ($ret['userinfo'] === '') $ret['userinfo'] = null;\r
+                if (strtolower($class) == 'db_error') {\r
+                    $ret = $this->raiseError(PEAR::errorMessage($ret['code']),\r
+                                             $ret['code'], null, null,\r
+                                             $ret['userinfo']);\r
+                } else {\r
+                    $ret = $this->raiseError($ret['message'], $ret['code'],\r
+                                             null, null, $ret['userinfo']);\r
+                }\r
+            }\r
+        } elseif (is_array($ret) && sizeof($ret) == 1 && isset($ret[0])\r
+                  && is_array($ret[0]) &&\r
+                  !empty($ret[0]['faultString']) &&\r
+                  !empty($ret[0]['faultCode'])) {\r
+            extract($ret[0]);\r
+            $faultString = "XML-RPC Server Fault: " .\r
+                 str_replace("\n", " ", $faultString);\r
+            return $this->raiseError($faultString, $faultCode);\r
+        } elseif (is_array($ret) && sizeof($ret) == 2 && !empty($ret['faultString']) &&\r
+              !empty($ret['faultCode'])) {\r
+            extract($ret);\r
+            $faultString = "XML-RPC Server Fault: " .\r
+                 str_replace("\n", " ", $faultString);\r
+            return $this->raiseError($faultString, $faultCode);\r
+        }\r
+        return $ret;\r
+    }\r
+\r
+    // }}}\r
+\r
+    // {{{ _encode\r
+\r
+    // a slightly extended version of XML_RPC_encode\r
+    function _encode($php_val)\r
+    {\r
+        global $XML_RPC_Boolean, $XML_RPC_Int, $XML_RPC_Double;\r
+        global $XML_RPC_String, $XML_RPC_Array, $XML_RPC_Struct;\r
+\r
+        $type = gettype($php_val);\r
+        $xmlrpcval = new XML_RPC_Value;\r
+\r
+        switch($type) {\r
+            case "array":\r
+                reset($php_val);\r
+                $firstkey = key($php_val);\r
+                end($php_val);\r
+                $lastkey = key($php_val);\r
+                reset($php_val);\r
+                if ($firstkey === 0 && is_int($lastkey) &&\r
+                    ($lastkey + 1) == count($php_val)) {\r
+                    $is_continuous = true;\r
+                    reset($php_val);\r
+                    $size = count($php_val);\r
+                    for ($expect = 0; $expect < $size; $expect++, next($php_val)) {\r
+                        if (key($php_val) !== $expect) {\r
+                            $is_continuous = false;\r
+                            break;\r
+                        }\r
+                    }\r
+                    if ($is_continuous) {\r
+                        reset($php_val);\r
+                        $arr = array();\r
+                        while (list($k, $v) = each($php_val)) {\r
+                            $arr[$k] = $this->_encode($v);\r
+                        }\r
+                        $xmlrpcval->addArray($arr);\r
+                        break;\r
+                    }\r
+                }\r
+                // fall though if not numerical and continuous\r
+            case "object":\r
+                $arr = array();\r
+                while (list($k, $v) = each($php_val)) {\r
+                    $arr[$k] = $this->_encode($v);\r
+                }\r
+                $xmlrpcval->addStruct($arr);\r
+                break;\r
+            case "integer":\r
+                $xmlrpcval->addScalar($php_val, $XML_RPC_Int);\r
+                break;\r
+            case "double":\r
+                $xmlrpcval->addScalar($php_val, $XML_RPC_Double);\r
+                break;\r
+            case "string":\r
+            case "NULL":\r
+                $xmlrpcval->addScalar($php_val, $XML_RPC_String);\r
+                break;\r
+            case "boolean":\r
+                $xmlrpcval->addScalar($php_val, $XML_RPC_Boolean);\r
+                break;\r
+            case "unknown type":\r
+            default:\r
+                return null;\r
+        }\r
+        return $xmlrpcval;\r
+    }\r
+\r
+    // }}}\r
+\r
+}\r
+\r
+?>\r
diff --git a/docs/include/classes/XML/XML_HTMLSax/System.php b/docs/include/classes/XML/XML_HTMLSax/System.php
new file mode 100644 (file)
index 0000000..c9b51fc
--- /dev/null
@@ -0,0 +1,580 @@
+<?php\r
+/**\r
+ * File/Directory manipulation\r
+ *\r
+ * PHP versions 4 and 5\r
+ *\r
+ * LICENSE: This source file is subject to version 3.0 of the PHP license\r
+ * that is available through the world-wide-web at the following URI:\r
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of\r
+ * the PHP License and are unable to obtain it through the web, please\r
+ * send a note to license@php.net so we can mail you a copy immediately.\r
+ *\r
+ * @category   pear\r
+ * @package    System\r
+ * @author     Tomas V.V.Cox <cox@idecnet.com>\r
+ * @copyright  1997-2008 The PHP Group\r
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+ * @version    CVS: $Id: System.php 7208 2008-01-09 16:07:24Z greg $\r
+ * @link       http://pear.php.net/package/PEAR\r
+ * @since      File available since Release 0.1\r
+ */\r
+\r
+/**\r
+ * base class\r
+ */\r
+require_once 'PEAR.php';\r
+require_once 'Console/Getopt.php';\r
+\r
+$GLOBALS['_System_temp_files'] = array();\r
+\r
+/**\r
+* System offers cross plattform compatible system functions\r
+*\r
+* Static functions for different operations. Should work under\r
+* Unix and Windows. The names and usage has been taken from its respectively\r
+* GNU commands. The functions will return (bool) false on error and will\r
+* trigger the error with the PHP trigger_error() function (you can silence\r
+* the error by prefixing a '@' sign after the function call).\r
+*\r
+* Documentation on this class you can find in:\r
+* http://pear.php.net/manual/\r
+*\r
+* Example usage:\r
+* if (!@System::rm('-r file1 dir1')) {\r
+*    print "could not delete file1 or dir1";\r
+* }\r
+*\r
+* In case you need to to pass file names with spaces,\r
+* pass the params as an array:\r
+*\r
+* System::rm(array('-r', $file1, $dir1));\r
+*\r
+* @category   pear\r
+* @package    System\r
+* @author     Tomas V.V. Cox <cox@idecnet.com>\r
+* @copyright  1997-2008 The PHP Group\r
+* @license    http://www.php.net/license/3_0.txt  PHP License 3.0\r
+* @version    Release: 1.4.4\r
+* @link       http://pear.php.net/package/PEAR\r
+* @since      Class available since Release 0.1\r
+*/\r
+class System\r
+{\r
+    /**\r
+    * returns the commandline arguments of a function\r
+    *\r
+    * @param    string  $argv           the commandline\r
+    * @param    string  $short_options  the allowed option short-tags\r
+    * @param    string  $long_options   the allowed option long-tags\r
+    * @return   array   the given options and there values\r
+    * @access private\r
+    */\r
+    function _parseArgs($argv, $short_options, $long_options = null)\r
+    {\r
+        if (!is_array($argv) && $argv !== null) {\r
+            $argv = preg_split('/\s+/', $argv, -1, PREG_SPLIT_NO_EMPTY);\r
+        }\r
+        return Console_Getopt::getopt2($argv, $short_options);\r
+    }\r
+\r
+    /**\r
+    * Output errors with PHP trigger_error(). You can silence the errors\r
+    * with prefixing a "@" sign to the function call: @System::mkdir(..);\r
+    *\r
+    * @param mixed $error a PEAR error or a string with the error message\r
+    * @return bool false\r
+    * @access private\r
+    */\r
+    function raiseError($error)\r
+    {\r
+        if (PEAR::isError($error)) {\r
+            $error = $error->getMessage();\r
+        }\r
+        trigger_error($error, E_USER_WARNING);\r
+        return false;\r
+    }\r
+\r
+    /**\r
+    * Creates a nested array representing the structure of a directory\r
+    *\r
+    * System::_dirToStruct('dir1', 0) =>\r
+    *   Array\r
+    *    (\r
+    *    [dirs] => Array\r
+    *        (\r
+    *            [0] => dir1\r
+    *        )\r
+    *\r
+    *    [files] => Array\r
+    *        (\r
+    *            [0] => dir1/file2\r
+    *            [1] => dir1/file3\r
+    *        )\r
+    *    )\r
+    * @param    string  $sPath      Name of the directory\r
+    * @param    integer $maxinst    max. deep of the lookup\r
+    * @param    integer $aktinst    starting deep of the lookup\r
+    * @return   array   the structure of the dir\r
+    * @access   private\r
+    */\r
+\r
+    function _dirToStruct($sPath, $maxinst, $aktinst = 0)\r
+    {\r
+        $struct = array('dirs' => array(), 'files' => array());\r
+        if (($dir = @opendir($sPath)) === false) {\r
+            System::raiseError("Could not open dir $sPath");\r
+            return $struct; // XXX could not open error\r
+        }\r
+        $struct['dirs'][] = $sPath = realpath($sPath); // XXX don't add if '.' or '..' ?\r
+        $list = array();\r
+        while (false !== ($file = readdir($dir))) {\r
+            if ($file != '.' && $file != '..') {\r
+                $list[] = $file;\r
+            }\r
+        }\r
+        closedir($dir);\r
+        sort($list);\r
+        if ($aktinst < $maxinst || $maxinst == 0) {\r
+            foreach($list as $val) {\r
+                $path = $sPath . DIRECTORY_SEPARATOR . $val;\r
+                if (is_dir($path) && !is_link($path)) {\r
+                    $tmp = System::_dirToStruct($path, $maxinst, $aktinst+1);\r
+                    $struct = array_merge_recursive($tmp, $struct);\r
+                } else {\r
+                    $struct['files'][] = $path;\r
+                }\r
+            }\r
+        }\r
+        return $struct;\r
+    }\r
+\r
+    /**\r
+    * Creates a nested array representing the structure of a directory and files\r
+    *\r
+    * @param    array $files Array listing files and dirs\r
+    * @return   array\r
+    * @see System::_dirToStruct()\r
+    */\r
+    function _multipleToStruct($files)\r
+    {\r
+        $struct = array('dirs' => array(), 'files' => array());\r
+        settype($files, 'array');\r
+        foreach ($files as $file) {\r
+            if (is_dir($file) && !is_link($file)) {\r
+                $tmp = System::_dirToStruct($file, 0);\r
+                $struct = array_merge_recursive($tmp, $struct);\r
+            } else {\r
+                $struct['files'][] = $file;\r
+            }\r
+        }\r
+        return $struct;\r
+    }\r
+\r
+    /**\r
+    * The rm command for removing files.\r
+    * Supports multiple files and dirs and also recursive deletes\r
+    *\r
+    * @param    string  $args   the arguments for rm\r
+    * @return   mixed   PEAR_Error or true for success\r
+    * @access   public\r
+    */\r
+    function rm($args)\r
+    {\r
+        $opts = System::_parseArgs($args, 'rf'); // "f" do nothing but like it :-)\r
+        if (PEAR::isError($opts)) {\r
+            return System::raiseError($opts);\r
+        }\r
+        foreach($opts[0] as $opt) {\r
+            if ($opt[0] == 'r') {\r
+                $do_recursive = true;\r
+            }\r
+        }\r
+        $ret = true;\r
+        if (isset($do_recursive)) {\r
+            $struct = System::_multipleToStruct($opts[1]);\r
+            foreach($struct['files'] as $file) {\r
+                if (!@unlink($file)) {\r
+                    $ret = false;\r
+                }\r
+            }\r
+            foreach($struct['dirs'] as $dir) {\r
+                if (!@rmdir($dir)) {\r
+                    $ret = false;\r
+                }\r
+            }\r
+        } else {\r
+            foreach ($opts[1] as $file) {\r
+                $delete = (is_dir($file)) ? 'rmdir' : 'unlink';\r
+                if (!@$delete($file)) {\r
+                    $ret = false;\r
+                }\r
+            }\r
+        }\r
+        return $ret;\r
+    }\r
+\r
+    /**\r
+    * Make directories.\r
+    *\r
+    * The -p option will create parent directories\r
+    * @param    string  $args    the name of the director(y|ies) to create\r
+    * @return   bool    True for success\r
+    * @access   public\r
+    */\r
+    function mkDir($args)\r
+    {\r
+        $opts = System::_parseArgs($args, 'pm:');\r
+        if (PEAR::isError($opts)) {\r
+            return System::raiseError($opts);\r
+        }\r
+        $mode = 0777; // default mode\r
+        foreach($opts[0] as $opt) {\r
+            if ($opt[0] == 'p') {\r
+                $create_parents = true;\r
+            } elseif($opt[0] == 'm') {\r
+                // if the mode is clearly an octal number (starts with 0)\r
+                // convert it to decimal\r
+                if (strlen($opt[1]) && $opt[1]{0} == '0') {\r
+                    $opt[1] = octdec($opt[1]);\r
+                } else {\r
+                    // convert to int\r
+                    $opt[1] += 0;\r
+                }\r
+                $mode = $opt[1];\r
+            }\r
+        }\r
+        $ret = true;\r
+        if (isset($create_parents)) {\r
+            foreach($opts[1] as $dir) {\r
+                $dirstack = array();\r
+                while (!@is_dir($dir) && $dir != DIRECTORY_SEPARATOR) {\r
+                    array_unshift($dirstack, $dir);\r
+                    $dir = dirname($dir);\r
+                }\r
+                while ($newdir = array_shift($dirstack)) {\r
+                    if (!is_writeable(dirname($newdir))) {\r
+                        $ret = false;\r
+                        break;\r
+                    }\r
+                    if (!mkdir($newdir, $mode)) {\r
+                        $ret = false;\r
+                    }\r
+                }\r
+            }\r
+        } else {\r
+            foreach($opts[1] as $dir) {\r
+                if (!@is_dir($dir) && !mkdir($dir, $mode)) {\r
+                    $ret = false;\r
+                }\r
+            }\r
+        }\r
+        return $ret;\r
+    }\r
+\r
+    /**\r
+    * Concatenate files\r
+    *\r
+    * Usage:\r
+    * 1) $var = System::cat('sample.txt test.txt');\r
+    * 2) System::cat('sample.txt test.txt > final.txt');\r
+    * 3) System::cat('sample.txt test.txt >> final.txt');\r
+    *\r
+    * Note: as the class use fopen, urls should work also (test that)\r
+    *\r
+    * @param    string  $args   the arguments\r
+    * @return   boolean true on success\r
+    * @access   public\r
+    */\r
+    function &cat($args)\r
+    {\r
+        $ret = null;\r
+        $files = array();\r
+        if (!is_array($args)) {\r
+            $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY);\r
+        }\r
+        for($i=0; $i < count($args); $i++) {\r
+            if ($args[$i] == '>') {\r
+                $mode = 'wb';\r
+                $outputfile = $args[$i+1];\r
+                break;\r
+            } elseif ($args[$i] == '>>') {\r
+                $mode = 'ab+';\r
+                $outputfile = $args[$i+1];\r
+                break;\r
+            } else {\r
+                $files[] = $args[$i];\r
+            }\r
+        }\r
+        if (isset($mode)) {\r
+            if (!$outputfd = fopen($outputfile, $mode)) {\r
+                $err = System::raiseError("Could not open $outputfile");\r
+                return $err;\r
+            }\r
+            $ret = true;\r
+        }\r
+        foreach ($files as $file) {\r
+            if (!$fd = fopen($file, 'r')) {\r
+                System::raiseError("Could not open $file");\r
+                continue;\r
+            }\r
+            while ($cont = fread($fd, 2048)) {\r
+                if (isset($outputfd)) {\r
+                    fwrite($outputfd, $cont);\r
+                } else {\r
+                    $ret .= $cont;\r
+                }\r
+            }\r
+            fclose($fd);\r
+        }\r
+        if (@is_resource($outputfd)) {\r
+            fclose($outputfd);\r
+        }\r
+        return $ret;\r
+    }\r
+\r
+    /**\r
+    * Creates temporary files or directories. This function will remove\r
+    * the created files when the scripts finish its execution.\r
+    *\r
+    * Usage:\r
+    *   1) $tempfile = System::mktemp("prefix");\r
+    *   2) $tempdir  = System::mktemp("-d prefix");\r
+    *   3) $tempfile = System::mktemp();\r
+    *   4) $tempfile = System::mktemp("-t /var/tmp prefix");\r
+    *\r
+    * prefix -> The string that will be prepended to the temp name\r
+    *           (defaults to "tmp").\r
+    * -d     -> A temporary dir will be created instead of a file.\r
+    * -t     -> The target dir where the temporary (file|dir) will be created. If\r
+    *           this param is missing by default the env vars TMP on Windows or\r
+    *           TMPDIR in Unix will be used. If these vars are also missing\r
+    *           c:\windows\temp or /tmp will be used.\r
+    *\r
+    * @param   string  $args  The arguments\r
+    * @return  mixed   the full path of the created (file|dir) or false\r
+    * @see System::tmpdir()\r
+    * @access  public\r
+    */\r
+    function mktemp($args = null)\r
+    {\r
+        static $first_time = true;\r
+        $opts = System::_parseArgs($args, 't:d');\r
+        if (PEAR::isError($opts)) {\r
+            return System::raiseError($opts);\r
+        }\r
+        foreach($opts[0] as $opt) {\r
+            if($opt[0] == 'd') {\r
+                $tmp_is_dir = true;\r
+            } elseif($opt[0] == 't') {\r
+                $tmpdir = $opt[1];\r
+            }\r
+        }\r
+        $prefix = (isset($opts[1][0])) ? $opts[1][0] : 'tmp';\r
+        if (!isset($tmpdir)) {\r
+            $tmpdir = System::tmpdir();\r
+        }\r
+        if (!System::mkDir(array('-p', $tmpdir))) {\r
+            return false;\r
+        }\r
+        $tmp = tempnam($tmpdir, $prefix);\r
+        if (isset($tmp_is_dir)) {\r
+            unlink($tmp); // be careful possible race condition here\r
+            if (!mkdir($tmp, 0700)) {\r
+                return System::raiseError("Unable to create temporary directory $tmpdir");\r
+            }\r
+        }\r
+        $GLOBALS['_System_temp_files'][] = $tmp;\r
+        if ($first_time) {\r
+            PEAR::registerShutdownFunc(array('System', '_removeTmpFiles'));\r
+            $first_time = false;\r
+        }\r
+        return $tmp;\r
+    }\r
+\r
+    /**\r
+    * Remove temporary files created my mkTemp. This function is executed\r
+    * at script shutdown time\r
+    *\r
+    * @access private\r
+    */\r
+    function _removeTmpFiles()\r
+    {\r
+        if (count($GLOBALS['_System_temp_files'])) {\r
+            $delete = $GLOBALS['_System_temp_files'];\r
+            array_unshift($delete, '-r');\r
+            System::rm($delete);\r
+            $GLOBALS['_System_temp_files'] = array();\r
+        }\r
+    }\r
+\r
+    /**\r
+    * Get the path of the temporal directory set in the system\r
+    * by looking in its environments variables.\r
+    * Note: php.ini-recommended removes the "E" from the variables_order setting,\r
+    * making unavaible the $_ENV array, that s why we do tests with _ENV\r
+    *\r
+    * @return string The temporal directory on the system\r
+    */\r
+    function tmpdir()\r
+    {\r
+        if (OS_WINDOWS) {\r
+            if ($var = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : getenv('TEMP')) {\r
+                return $var;\r
+            }\r
+            if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) {\r
+                return $var;\r
+            }\r
+            if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) {\r
+                return $var;\r
+            }\r
+            return getenv('SystemRoot') . '\temp';\r
+        }\r
+        if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) {\r
+            return $var;\r
+        }\r
+        return '/tmp';\r
+    }\r
+\r
+    /**\r
+    * The "which" command (show the full path of a command)\r
+    *\r
+    * @param string $program The command to search for\r
+    * @param mixed  $fallback Value to return if $program is not found\r
+    *\r
+    * @return mixed A string with the full path or false if not found\r
+    * @author Stig Bakken <ssb@php.net>\r
+    */\r
+    function which($program, $fallback = false)\r
+    {\r
+        // avaible since 4.3.0RC2\r
+        if (defined('PATH_SEPARATOR')) {\r
+            $path_delim = PATH_SEPARATOR;\r
+        } else {\r
+            $path_delim = OS_WINDOWS ? ';' : ':';\r
+        }\r
+        // full path given\r
+        if (basename($program) != $program) {\r
+            $path_elements[] = dirname($program);\r
+            $program = basename($program);\r
+        } else {\r
+            // Honor safe mode\r
+            if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) {\r
+                $path = getenv('PATH');\r
+                if (!$path) {\r
+                    $path = getenv('Path'); // some OSes are just stupid enough to do this\r
+                }\r
+            }\r
+            $path_elements = explode($path_delim, $path);\r
+        }\r
+\r
+        if (OS_WINDOWS) {\r
+            $exe_suffixes = getenv('PATHEXT')\r
+                                ? explode($path_delim, getenv('PATHEXT'))\r
+                                : array('.exe','.bat','.cmd','.com');\r
+            // allow passing a command.exe param\r
+            if (strpos($program, '.') !== false) {\r
+                array_unshift($exe_suffixes, '');\r
+            }\r
+            // is_executable() is not available on windows for PHP4\r
+            $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file';\r
+        } else {\r
+            $exe_suffixes = array('');\r
+            $pear_is_executable = 'is_executable';\r
+        }\r
+\r
+        foreach ($exe_suffixes as $suff) {\r
+            foreach ($path_elements as $dir) {\r
+                $file = $dir . DIRECTORY_SEPARATOR . $program . $suff;\r
+                if ($pear_is_executable($file)) {\r
+                    return $file;\r
+                }\r
+            }\r
+        }\r
+        return $fallback;\r
+    }\r
+\r
+    /**\r
+    * The "find" command\r
+    *\r
+    * Usage:\r
+    *\r
+    * System::find($dir);\r
+    * System::find("$dir -type d");\r
+    * System::find("$dir -type f");\r
+    * System::find("$dir -name *.php");\r
+    * System::find("$dir -name *.php -name *.htm*");\r
+    * System::find("$dir -maxdepth 1");\r
+    *\r
+    * Params implmented:\r
+    * $dir            -> Start the search at this directory\r
+    * -type d         -> return only directories\r
+    * -type f         -> return only files\r
+    * -maxdepth <n>   -> max depth of recursion\r
+    * -name <pattern> -> search pattern (bash style). Multiple -name param allowed\r
+    *\r
+    * @param  mixed Either array or string with the command line\r
+    * @return array Array of found files\r
+    *\r
+    */\r
+    function find($args)\r
+    {\r
+        if (!is_array($args)) {\r
+            $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY);\r
+        }\r
+        $dir = array_shift($args);\r
+        $patterns = array();\r
+        $depth = 0;\r
+        $do_files = $do_dirs = true;\r
+        for ($i = 0; $i < count($args); $i++) {\r
+            switch ($args[$i]) {\r
+                case '-type':\r
+                    if (in_array($args[$i+1], array('d', 'f'))) {\r
+                        if ($args[$i+1] == 'd') {\r
+                            $do_files = false;\r
+                        } else {\r
+                            $do_dirs = false;\r
+                        }\r
+                    }\r
+                    $i++;\r
+                    break;\r
+                case '-name':\r
+                    if (OS_WINDOWS) {\r
+                        if ($args[$i+1]{0} == '\\') {\r
+                            // prepend drive\r
+                            $args[$i+1] = addslashes(substr(getcwd(), 0, 2) . $args[$i + 1]);\r
+                        }\r
+                    }\r
+                    $patterns[] = "(" . preg_replace(array('/\./', '/\*/'),\r
+                                                     array('\.', '.*', ),\r
+                                                     $args[$i+1])\r
+                                      . ")";\r
+                    $i++;\r
+                    break;\r
+                case '-maxdepth':\r
+                    $depth = $args[$i+1];\r
+                    break;\r
+            }\r
+        }\r
+        $path = System::_dirToStruct($dir, $depth);\r
+        if ($do_files && $do_dirs) {\r
+            $files = array_merge($path['files'], $path['dirs']);\r
+        } elseif ($do_dirs) {\r
+            $files = $path['dirs'];\r
+        } else {\r
+            $files = $path['files'];\r
+        }\r
+        if (count($patterns)) {\r
+            $patterns = implode('|', $patterns);\r
+            $ret = array();\r
+            for ($i = 0; $i < count($files); $i++) {\r
+                if (preg_match("#^$patterns\$#", $files[$i])) {\r
+                    $ret[] = $files[$i];\r
+                }\r
+            }\r
+            return $ret;\r
+        }\r
+        return $files;\r
+    }\r
+}\r
+?>\r
diff --git a/docs/include/classes/XML/XML_HTMLSax/XML_HTMLSax.php b/docs/include/classes/XML/XML_HTMLSax/XML_HTMLSax.php
new file mode 100644 (file)
index 0000000..2974a11
--- /dev/null
@@ -0,0 +1,671 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/3_0.txt.                                  |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
+// | Authors: Harry Fuecks <hfuecks@phppatterns.com> Port to PEAR + more  |
+// | Authors: Many @ Sitepointforums Advanced PHP Forums                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: XML_HTMLSax.php 8901 2009-11-11 19:10:19Z cindy $
+//
+/**
+* Main parser components
+* @package XML_HTMLSax
+* @version $Id: XML_HTMLSax.php 8901 2009-11-11 19:10:19Z cindy $
+*/
+/**
+* Required classes
+*/
+require_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/PEAR.php');
+if (!defined('XML_HTMLSAX')) {
+    define('XML_HTMLSAX', TR_INCLUDE_PATH . 'classes/XML/XML_HTMLSax/'); /*  'XML/' had to be removed to work. joel/ATRC */
+}
+require_once(XML_HTMLSAX . 'HTMLSax/XML_HTMLSax_States.php');
+require_once(XML_HTMLSAX . 'HTMLSax/XML_HTMLSax_Decorators.php');
+/**
+* Base State Parser
+* @package XML_HTMLSax
+* @access protected
+* @abstract
+*/
+class XML_HTMLSax_StateParser {
+    /**
+    * Instance of user front end class to be passed to callbacks
+    * @var XML_HTMLSax
+    * @access private
+    */
+    var $htmlsax;
+    /**
+    * User defined object for handling elements
+    * @var object
+    * @access private
+    */
+    var $handler_object_element;
+    /**
+    * User defined open tag handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_opening;
+    /**
+    * User defined close tag handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_closing;
+    /**
+    * User defined object for handling data in elements
+    * @var object
+    * @access private
+    */
+    var $handler_object_data;
+    /**
+    * User defined data handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_data;
+    /**
+    * User defined object for handling processing instructions
+    * @var object
+    * @access private
+    */
+    var $handler_object_pi;
+    /**
+    * User defined processing instruction handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_pi;
+    /**
+    * User defined object for handling JSP/ASP tags
+    * @var object
+    * @access private
+    */
+    var $handler_object_jasp;
+    /**
+    * User defined JSP/ASP handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_jasp;
+    /**
+    * User defined object for handling XML escapes
+    * @var object
+    * @access private
+    */
+    var $handler_object_escape;
+    /**
+    * User defined XML escape handler method
+    * @var string
+    * @access private
+    */
+    var $handler_method_escape;
+    /**
+    * User defined handler object or NullHandler
+    * @var object
+    * @access private
+    */
+    var $handler_default;
+    /**
+    * Parser options determining parsing behavior
+    * @var array
+    * @access private
+    */
+    var $parser_options = array();
+    /**
+    * XML document being parsed
+    * @var string
+    * @access private
+    */
+    var $rawtext;
+    /**
+    * Position in XML document relative to start (0)
+    * @var int
+    * @access private
+    */
+    var $position;
+    /**
+    * Length of the XML document in characters
+    * @var int
+    * @access private
+    */
+    var $length;
+    /**
+    * Array of state objects
+    * @var array
+    * @access private
+    */
+    var $State = array();
+
+    /**
+    * Constructs XML_HTMLSax_StateParser setting up states
+    * @var XML_HTMLSax instance of user front end class
+    * @access protected
+    */
+    function XML_HTMLSax_StateParser (& $htmlsax) {
+        $this->htmlsax = & $htmlsax;
+        $this->State[XML_HTMLSAX_STATE_START] = new XML_HTMLSax_StartingState();
+
+        $this->State[XML_HTMLSAX_STATE_CLOSING_TAG] = new XML_HTMLSax_ClosingTagState();
+        $this->State[XML_HTMLSAX_STATE_TAG] = new XML_HTMLSax_TagState();
+        $this->State[XML_HTMLSAX_STATE_OPENING_TAG] = new XML_HTMLSax_OpeningTagState();
+
+        $this->State[XML_HTMLSAX_STATE_PI] = new XML_HTMLSax_PiState();
+        $this->State[XML_HTMLSAX_STATE_JASP] = new XML_HTMLSax_JaspState();
+        $this->State[XML_HTMLSAX_STATE_ESCAPE] = new XML_HTMLSax_EscapeState();
+    }
+
+    /**
+    * Moves the position back one character
+    * @access protected
+    * @return void
+    */
+    function unscanCharacter() {
+        $this->position -= 1;
+    }
+
+    /**
+    * Moves the position forward one character
+    * @access protected
+    * @return void
+    */
+    function ignoreCharacter() {
+        $this->position += 1;
+    }
+
+    /**
+    * Returns the next character from the XML document or void if at end
+    * @access protected
+    * @return mixed
+    */
+    function scanCharacter() {
+        if ($this->position < $this->length) {
+            return $this->rawtext{$this->position++};
+        }
+    }
+
+    /**
+    * Returns a string from the current position to the next occurance
+    * of the supplied string
+    * @param string string to search until
+    * @access protected
+    * @return string
+    */
+    function scanUntilString($string) {
+        $start = $this->position;
+        $this->position = @strpos($this->rawtext, $string, $start);
+        if ($this->position === FALSE) {
+            $this->position = $this->length;
+        }
+        return substr($this->rawtext, $start, $this->position - $start);
+    }
+
+    /**
+    * Returns a string from the current position until the first instance of
+    * one of the characters in the supplied string argument
+    * @param string string to search until
+    * @access protected
+    * @return string
+    * @abstract
+    */
+    function scanUntilCharacters($string) {}
+
+    /**
+    * Moves the position forward past any whitespace characters
+    * @access protected
+    * @return void
+    * @abstract
+    */
+    function ignoreWhitespace() {}
+
+    /**
+    * Begins the parsing operation, setting up any decorators, depending on
+    * parse options invoking _parse() to execute parsing
+    * @param string XML document to parse
+    * @access protected
+    * @return void
+    */
+    function parse($data) {
+        if ($this->parser_options['XML_OPTION_TRIM_DATA_NODES']==1) {
+            $decorator = new XML_HTMLSax_Trim(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'trimData';
+        }
+        if ($this->parser_options['XML_OPTION_CASE_FOLDING']==1) {
+            $open_decor = new XML_HTMLSax_CaseFolding(
+                $this->handler_object_element,
+                $this->handler_method_opening,
+                $this->handler_method_closing);
+            $this->handler_object_element =& $open_decor;
+            $this->handler_method_opening ='foldOpen';
+            $this->handler_method_closing ='foldClose';
+        }
+        if ($this->parser_options['XML_OPTION_LINEFEED_BREAK']==1) {
+            $decorator = new XML_HTMLSax_Linefeed(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        if ($this->parser_options['XML_OPTION_TAB_BREAK']==1) {
+            $decorator = new XML_HTMLSax_Tab(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        if ($this->parser_options['XML_OPTION_ENTITIES_UNPARSED']==1) {
+            $decorator = new XML_HTMLSax_Entities_Unparsed(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        if ($this->parser_options['XML_OPTION_ENTITIES_PARSED']==1) {
+            $decorator = new XML_HTMLSax_Entities_Parsed(
+                $this->handler_object_data,
+                $this->handler_method_data);
+            $this->handler_object_data =& $decorator;
+            $this->handler_method_data = 'breakData';
+        }
+        $this->rawtext = $data;
+        $this->length = strlen($data);
+        $this->position = 0;
+        $this->_parse();
+    }
+
+    /**
+    * Performs the parsing itself, delegating calls to a specific parser
+    * state
+    * @param constant state object to parse with
+    * @access protected
+    * @return void
+    */
+    function _parse($state = XML_HTMLSAX_STATE_START) {
+        do {
+            $state = $this->State[$state]->parse($this);
+        } while ($state != XML_HTMLSAX_STATE_STOP &&
+                    $this->position < $this->length);
+    }
+}
+
+/**
+* Parser for PHP Versions below 4.3.0. Uses a slower parsing mechanism than
+* the equivalent PHP 4.3.0+  subclass of StateParser
+* @package XML_HTMLSax
+* @access protected
+* @see XML_HTMLSax_StateParser_Gtet430
+*/
+class XML_HTMLSax_StateParser_Lt430 extends XML_HTMLSax_StateParser {
+    /**
+    * Constructs XML_HTMLSax_StateParser_Lt430 defining available
+    * parser options
+    * @var XML_HTMLSax instance of user front end class
+    * @access protected
+    */
+    function XML_HTMLSax_StateParser_Lt430(& $htmlsax) {
+        parent::XML_HTMLSax_StateParser($htmlsax);
+        $this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0;
+        $this->parser_options['XML_OPTION_CASE_FOLDING'] = 0;
+        $this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_TAB_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0;
+        $this->parser_options['XML_OPTION_FULL_ESCAPES'] = 0;
+    }
+
+    /**
+    * Returns a string from the current position until the first instance of
+    * one of the characters in the supplied string argument
+    * @param string string to search until
+    * @access protected
+    * @return string
+    */
+    function scanUntilCharacters($string) {
+        $startpos = $this->position;
+        while ($this->position < $this->length && strpos($string, $this->rawtext{$this->position}) === FALSE) {
+            $this->position++;
+        }
+        return substr($this->rawtext, $startpos, $this->position - $startpos);
+    }
+
+    /**
+    * Moves the position forward past any whitespace characters
+    * @access protected
+    * @return void
+    */
+    function ignoreWhitespace() {
+        while ($this->position < $this->length && 
+            strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) {
+            $this->position++;
+        }
+    }
+
+    /**
+    * Begins the parsing operation, setting up the unparsed XML entities
+    * decorator if necessary then delegating further work to parent
+    * @param string XML document to parse
+    * @access protected
+    * @return void
+    */
+    function parse($data) {
+        parent::parse($data);
+    }
+}
+
+/**
+* Parser for PHP Versions equal to or greater than 4.3.0. Uses a faster
+* parsing mechanism than the equivalent PHP < 4.3.0 subclass of StateParser
+* @package XML_HTMLSax
+* @access protected
+* @see XML_HTMLSax_StateParser_Lt430
+*/
+class XML_HTMLSax_StateParser_Gtet430 extends XML_HTMLSax_StateParser {
+    /**
+    * Constructs XML_HTMLSax_StateParser_Gtet430 defining available
+    * parser options
+    * @var XML_HTMLSax instance of user front end class
+    * @access protected
+    */
+    function XML_HTMLSax_StateParser_Gtet430(& $htmlsax) {
+        parent::XML_HTMLSax_StateParser($htmlsax);
+        $this->parser_options['XML_OPTION_TRIM_DATA_NODES'] = 0;
+        $this->parser_options['XML_OPTION_CASE_FOLDING'] = 0;
+        $this->parser_options['XML_OPTION_LINEFEED_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_TAB_BREAK'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_PARSED'] = 0;
+        $this->parser_options['XML_OPTION_ENTITIES_UNPARSED'] = 0;
+        $this->parser_options['XML_OPTION_FULL_ESCAPES'] = 0;
+    }
+    /**
+    * Returns a string from the current position until the first instance of
+    * one of the characters in the supplied string argument.
+    * @param string string to search until
+    * @access protected
+    * @return string
+    */
+    function scanUntilCharacters($string) {
+        $startpos = $this->position;
+        $length = strcspn($this->rawtext, $string, $startpos);
+        $this->position += $length;
+        return substr($this->rawtext, $startpos, $length);
+    }
+
+    /**
+    * Moves the position forward past any whitespace characters
+    * @access protected
+    * @return void
+    */
+    function ignoreWhitespace() {
+        $this->position += strspn($this->rawtext, " \n\r\t", $this->position);
+    }
+
+    /**
+    * Begins the parsing operation, setting up the parsed and unparsed
+    * XML entity decorators if necessary then delegating further work
+    * to parent
+    * @param string XML document to parse
+    * @access protected
+    * @return void
+    */
+    function parse($data) {
+        parent::parse($data);
+    }
+}
+
+/**
+* Default NullHandler for methods which were not set by user
+* @package XML_HTMLSax
+* @access protected
+*/
+class XML_HTMLSax_NullHandler {
+    /**
+    * Generic handler method which does nothing
+    * @access protected
+    * @return void
+    */
+    function DoNothing() {
+    }
+}
+
+/**
+* User interface class. All user calls should only be made to this class
+* @package XML_HTMLSax
+* @access public
+*/
+class XML_HTMLSax extends Pear {
+    /**
+    * Instance of concrete subclass of XML_HTMLSax_StateParser
+    * @var XML_HTMLSax_StateParser
+    * @access private
+    */
+    var $state_parser;
+
+    /**
+    * Constructs XML_HTMLSax selecting concrete StateParser subclass
+    * depending on PHP version being used as well as setting the default
+    * NullHandler for all callbacks<br />
+    * <b>Example:</b>
+    * <pre>
+    * $myHandler = new MyHandler();
+    * $parser = new XML_HTMLSax();
+    * $parser->set_object($myHandler);
+    * $parser->set_option('XML_OPTION_CASE_FOLDING');
+    * $parser->set_element_handler('myOpenHandler','myCloseHandler');
+    * $parser->set_data_handler('myDataHandler');
+    * $parser->parser($xml);
+    * </pre>
+    * @access public
+    */
+    function XML_HTMLSax() {
+        if (version_compare(phpversion(), '4.3', 'ge')) {
+            $this->state_parser = new XML_HTMLSax_StateParser_Gtet430($this);
+        } else {
+            $this->state_parser = new XML_HTMLSax_StateParser_Lt430($this);
+        }
+        $nullhandler = new XML_HTMLSax_NullHandler();
+        $this->set_object($nullhandler);
+        $this->set_element_handler('DoNothing', 'DoNothing');
+        $this->set_data_handler('DoNothing');
+        $this->set_pi_handler('DoNothing');
+        $this->set_jasp_handler('DoNothing');
+        $this->set_escape_handler('DoNothing');
+    }
+
+    /**
+    * Sets the user defined handler object. Returns a PEAR Error
+    * if supplied argument is not an object.
+    * @param object handler object containing SAX callback methods
+    * @access public
+    * @return mixed
+    */
+    function set_object(&$object) {
+        if ( is_object($object) ) {
+            $this->state_parser->handler_default =& $object;
+            return true;
+        } else {
+            return $this->raiseError('XML_HTMLSax::set_object requires '.
+                'an object instance');
+        }
+    }
+
+    /**
+    * Sets a parser option. Returns a PEAR Error if option is invalid<br />
+    * <b>Available options:</b>
+    * <ul>
+    * <li>XML_OPTION_TRIM_DATA_NODES: trim whitespace off the beginning
+    * and end of data passed to the data handler</li>
+    * <li>XML_OPTION_LINEFEED_BREAK: linefeeds result in additional data
+    * handler calls</li>
+    * <li>XML_OPTION_TAB_BREAK: tabs result in additional data handler
+    * calls</li>
+    * <li>XML_OPTION_ENTIES_UNPARSED: XML entities are returned as
+    * seperate data handler calls in unparsed form</li>
+    * <li>XML_OPTION_ENTIES_PARSED: (PHP 4.3.0+ only) XML entities are
+    * returned as seperate data handler calls and are parsed with 
+    * PHP's html_entity_decode() function</li>
+    * </ul>
+    * @param string name of parser option
+    * @param int (optional) 1 to switch on, 0 for off
+    * @access public
+    * @return boolean
+    */
+    function set_option($name, $value=1) {
+        if ( array_key_exists($name,$this->state_parser->parser_options) ) {
+            $this->state_parser->parser_options[$name] = $value;
+            return true;
+        } else {
+            return $this->raiseError('XML_HTMLSax::set_option('.$name.') illegal');
+        }
+    }
+
+    /**
+    * Sets the data handler method which deals with the contents of XML
+    * elements.<br />
+    * The handler method must accept two arguments, the first being an
+    * instance of XML_HTMLSax and the second being the contents of an
+    * XML element e.g.
+    * <pre>
+    * function myDataHander(& $parser,$data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_data_handler($data_method) {
+        $this->state_parser->handler_object_data =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_data = $data_method;
+    }
+
+    /**
+    * Sets the open and close tag handlers
+    * <br />The open handler method must accept three arguments; the parser,
+    * the tag name and an array of attributes e.g.
+    * <pre>
+    * function myOpenHander(& $parser,$tagname,$attrs=array()){}
+    * </pre>
+    * The close handler method must accept two arguments; the parser and
+    * the tag name e.g.
+    * <pre>
+    * function myCloseHander(& $parser,$tagname){}
+    * </pre>
+    * @param string name of open method
+    * @param string name of close method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_element_handler($opening_method, $closing_method) {
+        $this->state_parser->handler_object_element =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_opening = $opening_method;
+        $this->state_parser->handler_method_closing = $closing_method;
+    }
+
+    /**
+    * Sets the processing instruction handler method e.g. for PHP open
+    * and close tags<br />
+    * The handler method must accept three arguments; the parser, the
+    * PI target and data inside the PI
+    * <pre>
+    * function myPIHander(& $parser,$target, $data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_pi_handler($pi_method) {
+        $this->state_parser->handler_object_pi =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_pi = $pi_method;
+    }
+
+    /**
+    * Sets the XML escape handler method e.g. for comments and doctype
+    * declarations<br />
+    * The handler method must accept two arguments; the parser and the
+    * contents of the escaped section
+    * <pre>
+    * function myEscapeHander(& $parser, $data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_escape_handler($escape_method) {
+        $this->state_parser->handler_object_escape =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_escape = $escape_method;
+    }
+
+    /**
+    * Sets the JSP/ASP markup handler<br />
+    * The handler method must accept two arguments; the parser and
+    * body of the JASP tag
+    * <pre>
+    * function myJaspHander(& $parser, $data){}
+    * </pre>
+    * @param string name of method
+    * @access public
+    * @return void
+    * @see set_object
+    */
+    function set_jasp_handler ($jasp_method) {
+        $this->state_parser->handler_object_jasp =& $this->state_parser->handler_default;
+        $this->state_parser->handler_method_jasp = $jasp_method;
+    }
+
+    /**
+    * Returns the current string position of the "cursor" inside the XML
+    * document
+    * <br />Intended for use from within a user defined handler called
+    * via the $parser reference e.g.
+    * <pre>
+    * function myDataHandler(& $parser,$data) {
+    *     echo( 'Current position: '.$parser->get_current_position() );
+    * }
+    * </pre>
+    * @access public
+    * @return int
+    * @see get_length
+    */
+    function get_current_position() {
+        return $this->state_parser->position;
+    }
+
+    /**
+    * Returns the string length of the XML document being parsed
+    * @access public
+    * @return int
+    */
+    function get_length() {
+        return $this->state_parser->length;
+    }
+
+    /**
+    * Start parsing some XML
+    * @param string XML document
+    * @access public
+    * @return void
+    */
+    function parse($data) {
+        $this->state_parser->parse($data);
+    }
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/testQuestions.class.php b/docs/include/classes/testQuestions.class.php
new file mode 100644 (file)
index 0000000..acddc15
--- /dev/null
@@ -0,0 +1,1555 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+require_once(TR_INCLUDE_PATH.'lib/test_question_queries.inc.php');
+
+/*
+ * Steps to follow when adding a new question type:
+ *
+ * 1 - Create a class extending AbstractQuestion or extend an 
+ *     existing question class.
+ *     Define $sPrefix and $sNameVar appropriately.
+ *     Implement the following methods, which set template variables:
+ *
+ *        assignQTIVariables()
+ *        assignDisplayResultVariables()
+ *        assignDisplayVariables()
+ *        assignDisplayStatisticsVariables()
+ *               importQti()
+ *     
+ *     And implement mark() which is used for marking the result.
+ *
+ * 2 - Add the new class name to $question_classes in test_question_factory()
+ *
+ * 3 - Add $sNameVar to the language database.
+ *
+ * 4 - Create the following files for creating and editing the question,
+ *     where "{PREFIX}" is the value defined by $sPrefix:
+ *
+ *     /tools/tests/create_question_{PREFIX}.php
+ *     /tools/tests/edit_question_{PREFIX}.php
+ *
+ * 5 - Add those two newly created pages to 
+ *     /mods/_standard/tests/module.php
+ *
+ * 6 - Create the following template files:
+ *
+ *     /themes/default/test_questions/{PREFIX}.tmpl.php
+ *     /themes/default/test_questions/{PREFIX}_qti_2p1.tmpl.php
+ *     /themes/default/test_questions/{PREFIX}_result.tmpl.php
+ *     /themes/default/test_questions/{PREFIX}_stats.tmpl.php
+ *
+ * 7 - Add the new question type to qti import/export tools,
+ *     Implement the following methods, which set template variables:
+ *
+ *     include/classes/QTI/QTIParser.class.php
+ *        getQuestionType()
+ *
+ * 8 - Done!
+ **/
+class TestQuestions {
+       // returns array of prefix => name, sorted!
+       /*static */function getQuestionPrefixNames() {
+               $question_prefix_names = array(); // prefix => name
+               $questions = TestQuestions::getQuestionClasses();
+               foreach ($questions as $type => $question) {
+                       $o = TestQuestions::getQuestion($type);
+                       $question_prefix_names[$o->getPrefix()] = $o->getName();
+               }
+               asort($question_prefix_names);
+               return $question_prefix_names;
+       }
+
+       /*static */function getQuestionClasses() {
+               /** NOTE: The indices are CONSTANTS. Do NOT change!! **/
+               $question_classes = array(); // type ID => class name
+               $question_classes[1] = 'MultichoiceQuestion';
+               $question_classes[2] = 'TruefalseQuestion';
+               $question_classes[3] = 'LongQuestion';
+               $question_classes[4] = 'LikertQuestion';
+               $question_classes[5] = 'MatchingQuestion';
+               $question_classes[6] = 'OrderingQuestion';
+               $question_classes[7] = 'MultianswerQuestion';
+               $question_classes[8] = 'MatchingddQuestion';
+
+               return $question_classes;
+       }
+
+       /**
+        * Used to create question objects based on $question_type.
+        * A singleton that creates one obj per question since
+        * questions are all stateless.
+        * Returns a reference to the question object.
+        */
+       /*static */function & getQuestion($question_type) {
+               static $objs, $question_classes;
+
+               if (isset($objs[$question_type])) {
+                       return $objs[$question_type];
+               }
+
+               $question_classes = TestQuestions::getQuestionClasses();
+
+               if (isset($question_classes[$question_type])) {
+                       global $savant;
+                       $objs[$question_type] = new $question_classes[$question_type]($savant);
+               } else {
+                       return FALSE;
+               }
+
+               return $objs[$question_type];
+       }
+}
+
+/** 
+ * Export test questions
+ * @param      array   an array consist of all the ids of the questions in which we desired to export.
+ */
+function test_question_qti_export_v2p1($question_ids) {
+       require(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
+       require(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
+       require(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');     // for XML_HTMLSax
+
+       global $savant, $db, $system_courses, $languageManager;
+
+       $course_language = $system_courses[$_SESSION['course_id']]['primary_language'];
+       $courseLanguage =& $languageManager->getLanguage($course_language);
+       $course_language_charset = $courseLanguage->getCharacterSet();
+
+       $zipfile = new zipfile();
+       $zipfile->create_dir('resources/'); // for all the dependency files
+       $resources    = array();
+       $dependencies = array();
+
+       asort($question_ids);
+
+       $question_ids_delim = implode(',',$question_ids);
+
+       $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
+       $result = mysql_query($sql, $db);
+       while ($row = mysql_fetch_assoc($result)) {
+               $obj = TestQuestions::getQuestion($row['type']);
+               $xml = $obj->exportQTI($row, $course_language_charset, '2.1');
+               $local_dependencies = array();
+
+               $text_blob = implode(' ', $row);
+               $local_dependencies = get_html_resources($text_blob);
+               $dependencies = array_merge($dependencies, $local_dependencies);
+
+               $resources[] = array('href'         => 'question_'.$row['question_id'].'.xml',
+                                                        'dependencies' => array_keys($local_dependencies));
+
+               //TODO
+               $savant->assign('xml_content', $xml);
+               $savant->assign('title', $row['question']);
+               $xml = $savant->fetch('test_questions/wrapper.tmpl.php');
+
+               $zipfile->add_file($xml, 'question_'.$row['question_id'].'.xml');
+       }
+
+       // add any dependency files:
+       foreach ($dependencies as $resource => $resource_server_path) {
+               $zipfile->add_file(@file_get_contents($resource_server_path), 'resources/' . $resource, filemtime($resource_server_path));
+       }
+
+       // construct the manifest xml
+       $savant->assign('resources', $resources);
+       $savant->assign('dependencies', array_keys($dependencies));
+       $savant->assign('encoding', $course_language_charset);
+       $manifest_xml = $savant->fetch('test_questions/manifest_qti_2p1.tmpl.php');
+
+       $zipfile->add_file($manifest_xml, 'imsmanifest.xml');
+
+       $zipfile->close();
+
+       $filename = str_replace(array(' ', ':'), '_', $_SESSION['course_title'].'-'._AT('question_database').'-'.date('Ymd'));
+       $zipfile->send_file($filename);
+       exit;
+}
+
+
+/** 
+ * Export test questions
+ * @param      array   an array consist of all the ids of the questions in which we desired to export.
+ */
+function test_question_qti_export($question_ids) {
+       require(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
+       require(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
+       require(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');     // for XML_HTMLSax
+
+       global $savant, $db, $system_courses, $languageManager;
+
+       $course_language = $system_courses[$_SESSION['course_id']]['primary_language'];
+       $courseLanguage =& $languageManager->getLanguage($course_language);
+       $course_language_charset = $courseLanguage->getCharacterSet();
+
+       $zipfile = new zipfile();
+       $zipfile->create_dir('resources/'); // for all the dependency files
+       $resources    = array();
+       $dependencies = array();
+
+       asort($question_ids);
+
+       $question_ids_delim = implode(',',$question_ids);
+
+       $sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
+       $result = mysql_query($sql, $db);
+       while ($row = mysql_fetch_assoc($result)) {
+               $obj = TestQuestions::getQuestion($row['type']);
+               $local_xml = '';
+               $local_xml = $obj->exportQTI($row, $course_language_charset, '1.2.1');
+               $local_dependencies = array();
+
+               $text_blob = implode(' ', $row);
+               $local_dependencies = get_html_resources($text_blob);
+               $dependencies = array_merge($dependencies, $local_dependencies);
+
+//             $resources[] = array('href'         => 'question_'.$row['question_id'].'.xml',
+//                                                      'dependencies' => array_keys($local_dependencies));
+
+               $xml = $xml . "\n\n" . $local_xml;              
+       }
+       $xml = trim($xml);
+
+       //TODO
+       $savant->assign('xml_content', $xml);
+       $savant->assign('title', $row['question']);
+       $xml = $savant->fetch('test_questions/wrapper.tmpl.php');
+
+       $xml_filename = 'atutor_questions.xml';
+       $zipfile->add_file($xml, $xml_filename);
+
+       // add any dependency files:
+       foreach ($dependencies as $resource => $resource_server_path) {
+               $zipfile->add_file(@file_get_contents($resource_server_path), 'resources/' . $resource, filemtime($resource_server_path));
+       }
+
+       // construct the manifest xml
+//     $savant->assign('resources', $resources);
+       $savant->assign('dependencies', array_keys($dependencies));
+       $savant->assign('encoding', $course_language_charset);
+       $savant->assign('xml_filename', $xml_filename);
+//     $manifest_xml = $savant->fetch('test_questions/manifest_qti_2p1.tmpl.php');
+       $manifest_xml = $savant->fetch('test_questions/manifest_qti_1p2.tmpl.php');
+
+       $zipfile->add_file($manifest_xml, 'imsmanifest.xml');
+
+       $zipfile->close();
+
+       $filename = str_replace(array(' ', ':'), '_', $_SESSION['course_title'].'-'._AT('question_database').'-'.date('Ymd'));
+       $zipfile->send_file($filename);
+       exit;
+}
+
+
+/** 
+ * Export test 
+ * @param      int             test id
+ * @param      string  the test title
+ * @param      ref             [OPTIONAL] zip object reference
+ * @param      array   [OPTIONAL] list of already added files.
+ */
+function test_qti_export($tid, $test_title='', $zipfile = null){
+       require_once(TR_INCLUDE_PATH.'classes/zipfile.class.php'); // for zipfile
+       require_once(TR_INCLUDE_PATH.'classes/XML/XML_HTMLSax/XML_HTMLSax.php');        // for XML_HTMLSax
+       require_once(TR_INCLUDE_PATH.'lib/html_resource_parser.inc.php'); // for get_html_resources()
+       global $savant, $db, $system_courses, $languageManager, $test_zipped_files, $test_files, $use_cc;
+       global $course_id;
+
+       $course_language = $system_courses[$_SESSION['course_id']]['primary_language'];
+       $courseLanguage =& $languageManager->getLanguage($course_language);
+       $course_language_charset = $courseLanguage->getCharacterSet();
+       $imported_files;
+       $zipflag = false;
+
+       if ($zipfile==null){
+               $zipflag = true;
+       }
+
+       if ($test_zipped_files == null){
+               $test_zipped_files = array();
+       }
+
+       if ($zipflag){
+               $zipfile = new zipfile();
+               $zipfile->create_dir('resources/'); // for all the dependency files
+       }
+       $resources    = array();
+       $dependencies = array();
+
+//     don't want to sort it, i want the same order out.
+//     asort($question_ids);
+
+       //TODO: Merge the following 2 sqls together.
+       //Randomized or not, export all the questions that are associated with it.
+       $sql    = "SELECT TQ.question_id, TQA.weight FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQ.course_id=$_SESSION[course_id] AND TQA.test_id=$tid ORDER BY TQA.ordering, TQA.question_id";
+       $result = mysql_query($sql, $db);
+       $question_ids = array();
+
+       while (($question_row = mysql_fetch_assoc($result)) != false){
+               $question_ids[] = $question_row['question_id'];
+       }
+       $question_ids_delim = implode(',',$question_ids);
+       
+       //No questions in the test
+       if (sizeof($question_ids_delim)==0){
+               return;
+       }
+
+       //$sql = "SELECT * FROM ".TABLE_PREFIX."tests_questions WHERE course_id=$_SESSION[course_id] AND question_id IN($question_ids_delim)";
+       $sql = "SELECT TQ.*, TQA.weight, TQA.test_id FROM ".TABLE_PREFIX."tests_questions TQ INNER JOIN ".TABLE_PREFIX."tests_questions_assoc TQA USING (question_id) WHERE TQA.test_id=$tid AND TQ.question_id IN($question_ids_delim) ORDER BY TQA.ordering, TQA.question_id";
+
+       $result = mysql_query($sql, $db);
+       while ($row = mysql_fetch_assoc($result)) {
+               $obj = TestQuestions::getQuestion($row['type']);
+               $local_xml = '';
+               $local_xml = $obj->exportQTI($row, $course_language_charset, '1.2.1');
+               $local_dependencies = array();
+
+               $text_blob = implode(' ', $row);
+               $local_dependencies = get_html_resources($text_blob);
+               $dependencies = array_merge($dependencies, $local_dependencies);
+
+               $xml = $xml . "\n\n" . $local_xml;
+       }
+
+       //files that are found inside the test; used by print_organization(), to add all test files into QTI/ folder.
+       $test_files = $dependencies;
+
+       $resources[] = array('href'         => 'tests_'.$tid.'.xml',
+                                                'dependencies' => array_keys($dependencies));
+
+       $xml = trim($xml);
+
+       //get test title
+       $sql = "SELECT title FROM ".TABLE_PREFIX."tests WHERE test_id = $tid";
+       $result = mysql_query($sql, $db);
+       $row = mysql_fetch_array($result);
+
+       //TODO: wrap around xml now
+       $savant->assign('xml_content', $xml);
+       $savant->assign('title', htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8'));
+       $xml = $savant->fetch('test_questions/wrapper.tmpl.php');
+
+       $xml_filename = 'tests_'.$tid.'.xml';
+       if (!$use_cc){          
+               $zipfile->add_file($xml, $xml_filename);
+       } else {
+               $zipfile->add_file($xml, 'QTI/'.$xml_filename);
+       }
+
+       // add any dependency files:
+       if (!$use_cc){
+               foreach ($dependencies as $resource => $resource_server_path) {
+                       //add this file in if it's not already in the zip package
+                       if (!in_array($resource_server_path, $test_zipped_files)){
+                               $zipfile->add_file(@file_get_contents($resource_server_path), 'resources/'.$resource, filemtime($resource_server_path));
+                               $test_zipped_files[] = $resource_server_path;
+                       }
+               }
+       }
+
+       if ($zipflag){
+               // construct the manifest xml
+               $savant->assign('resources', $resources);
+               $savant->assign('dependencies', array_keys($dependencies));
+               $savant->assign('encoding', $course_language_charset);
+               $savant->assign('title', $test_title);
+               $savant->assign('xml_filename', $xml_filename);
+               
+               $manifest_xml = $savant->fetch('test_questions/manifest_qti_1p2.tmpl.php');
+               $zipfile->add_file($manifest_xml, 'imsmanifest.xml');
+
+               $zipfile->close();
+
+               $filename = str_replace(array(' ', ':'), '_', $_SESSION['course_title'].'-'.$test_title.'-'.date('Ymd'));
+               $zipfile->send_file($filename);
+               exit;
+       }
+       
+       $return_array[$xml_filename] = array_keys($dependencies);
+       return $return_array;
+       //done
+}
+
+
+/* 
+ * Recursively create folders
+ * For the purpose of this webapp only.  All the paths are seperated by a /
+ * And thus this function will loop through each directory and create them on the way
+ * if it doesn't exist.
+ * @author harris
+ */
+function recursive_mkdir($path, $mode = 0700) {
+    $dirs = explode(DIRECTORY_SEPARATOR , $path);
+    $count = count($dirs);
+    $path = '';
+    for ($i = 0; $i < $count; ++$i) {
+        $path .= $dirs[$i].DIRECTORY_SEPARATOR;
+               //If the directory has not been created, create it and return error on failure
+        if (!is_dir($path) && !mkdir($path, $mode)) {
+            return false;
+        }
+    }
+    return true;
+}
+
+
+/**
+* keeps count of the question number (when displaying the question)
+* need this function because PHP 4 doesn't support static members
+*/
+function TestQuestionCounter($increment = FALSE) {
+       static $count;
+
+       if (!isset($count)) { 
+               $count = 0;
+       }
+       if ($increment) {
+               $count++;
+       }
+
+       return $count;
+}
+
+
+/**
+ * testQuestion
+ *
+ * Note that all PHP 5 OO declarations and signatures are commented out to be
+ * backwards compatible with PHP 4.
+ *
+ */
+/*abstract */ class AbstractTestQuestion  {
+       /**
+       * Savant2 $savant - refrence to the savant obj
+       */
+       /*protected */ var $savant;
+
+       /**
+       * Constructor method.  Initialises variables.
+       */
+       function AbstractTestQuestion(&$savant) { $this->savant =& $savant; }
+
+       /**
+       * Public
+       */
+       /*final public */function seed($salt) {
+               /**
+               * by controlling the seed before calling array_rand() we insure that
+               * we can un-randomize the order for marking.
+               * used with ordering type questions only.
+               */
+               srand($salt + $_SESSION['user_id']);
+       }
+
+       /**
+       * Public
+       */
+       /*final public */function unseed() {
+               // To fix http://www.atutor.ca/atutor/mantis/view.php?id=3167
+               // Disturb the seed for ordering questions after mark to avoid the deterioration  
+               // of the random distribution due to a repeated initialization of the same random seed
+               list($usec, $sec) = explode(" ", microtime());
+               srand((int)($usec*10));
+       }
+
+       /**
+       * Public
+       * Prints the name of this question
+       */
+       /*final public */function printName() { echo $this->getName(); }
+
+       /**
+       * Public
+       * Prints the name of this question
+       */
+       /*final public */function getName() { return _AT($this->sNameVar); }
+
+       /**
+       * Public
+       * Returns the prefix string (used for file names)
+       */
+       /*final public */function getPrefix() { return $this->sPrefix; }
+
+       /**
+       * Display the current question (for taking or previewing a test/question)
+       */
+       /*final public */function display($row, $response = '') {
+               // print the generic question header
+               $this->displayHeader($row['weight']);
+
+               // print the question specific template
+               $row['question'] = format_content($row['question'], 1, '');
+               $this->assignDisplayVariables($row, $response);
+               $this->savant->display('test_questions/' . $this->sPrefix . '.tmpl.php');
+               
+               // print the generic question footer
+               $this->displayFooter();
+       }
+
+       /**
+       * Display the result for the current question
+       */
+       /*final public */function displayResult($row, $answer_row, $editable = FALSE) {
+               // print the generic question header
+               $this->displayHeader($row['weight'], $answer_row['score'], $editable ? $row['question_id'] : FALSE);
+
+               // print the question specific template
+               $this->assignDisplayResultVariables($row, $answer_row);
+               $this->savant->display('test_questions/' . $this->sPrefix . '_result.tmpl.php');
+               
+               // print the generic question footer
+               $this->displayFooter();
+       }
+
+
+       /**
+       * print the question template header
+       */
+       /*final public */function displayResultStatistics($row, $answers) {
+               TestQuestionCounter(TRUE);
+               $this->assignDisplayStatisticsVariables($row, $answers);
+               $this->savant->display('test_questions/' . $this->sPrefix . '_stats.tmpl.php');
+       }
+
+       /*final public */function exportQTI($row, $encoding, $version) {
+               $this->savant->assign('encoding', $encoding);
+               //Convert all row values to html entities
+               foreach ($row as $k=>$v){
+                       $row[$k] = htmlspecialchars($v, ENT_QUOTES, 'UTF-8');   //not using htmlentities cause it changes some languages falsely.
+               }
+               $this->assignQTIVariables($row);
+               if ($version=='2.1') {
+                       $xml = $this->savant->fetch('test_questions/'. $this->sPrefix . '_qti_2p1.tmpl.php');
+               } else {        
+                       $xml = $this->savant->fetch('test_questions/'. $this->sPrefix . '_qti_1p2.tmpl.php');
+               }
+               return $xml;
+       }
+
+       /**
+       * print the question template header
+       */
+       /*final private */function displayHeader($weight, $score = FALSE, $question_id = FALSE) {
+               TestQuestionCounter(TRUE);
+               
+               if ($score) $score = intval($score);
+               $this->savant->assign('question_id', $question_id);
+               $this->savant->assign('score', $score);
+               $this->savant->assign('weight', $weight);
+               $this->savant->assign('type',   _AT($this->sNameVar));
+               $this->savant->assign('number', TestQuestionCounter());
+               $this->savant->display('test_questions/header.tmpl.php');
+       }
+
+       /**
+       * print the question template footer
+       */
+       /*final private */function displayFooter() {
+               $this->savant->display('test_questions/footer.tmpl.php');
+       }
+
+       /**
+       * return only the non-empty choices from $row.
+       * assumes choices are sequential.
+       */
+       /*protected */function getChoices($row) {
+               $choices = array();
+               for ($i=0; $i < 10; $i++) {
+                       if ($row['choice_'.$i] != '') {
+                               $num_choices++;
+                               $choices[] = $row['choice_'.$i];
+                       } else {
+                               break;
+                       }
+               }
+               return $choices;
+       }
+}
+
+/**
+* orderingQuestion
+*
+*/
+class OrderingQuestion extends AbstractTestQuestion {
+       /*protected */ var $sNameVar = 'test_ordering';
+       /*protected */ var $sPrefix = 'ordering';
+       
+       /*protected */function assignDisplayResultVariables($row, $answer_row) {
+               $answers = explode('|', $answer_row['answer']);
+
+               $num_choices = count($this->getChoices($row));
+
+               $this->savant->assign('base_href', TR_BASE_HREF);
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('answers', $answers);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignQTIVariables($row) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayVariables($row, $response) {
+               // determine the number of choices this question has
+               // and save those choices to be re-assigned back to $row
+               // in the randomized order.
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               // response from the test_answers table is in the correct order
+               // so, they have to be re-randomized in the same order as the
+               // choices are. this is only possible because of the seed() method.
+               $response = explode('|', $response);
+               $new_response = array();
+
+               // randomize the order of choices and re-assign to $row
+               $this->seed($row['question_id']);
+               $rand = array_rand($choices, $num_choices);
+               for ($i=0; $i < 10; $i++) {
+                       $row['choice_'.$i] = $choices[$rand[$i]];
+                       $new_response[$i]  = $response[$rand[$i]];
+               }
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('row', $row);
+
+               $this->savant->assign('response', $new_response);
+       }
+
+       /*protected */function assignDisplayStatisticsVariables($row, $answers) {
+               $num_results = 0;               
+               foreach ($answers as $answer) {
+                       $num_results += $answer['count'];
+               }
+
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $final_answers = array(); // assoc array of # of times that key was used correctly 0, 1, ...  $num -1
+               foreach ($answers as $key => $value) {
+                       $values = explode('|', $key);
+                       // we assume $values is never empty and contains $num number of answers
+                       for ($i=0; $i<=$num_choices; $i++) {
+                               if ($values[$i] == $i) {
+                                       $final_answers[$i] += $answers[$key]['count'];
+                               }
+                       }
+               }
+
+               $this->savant->assign('num_results', $num_results);
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('answers', $final_answers);
+               $this->savant->assign('row', $row);
+       }
+
+       /*public */function mark($row) { 
+               $this->seed($row['question_id']);
+               $num_choices = count($_POST['answers'][$row['question_id']]);
+               $answers = range(0, $num_choices-1);
+               $answers = array_rand($answers, $num_choices);
+               
+               // Disturb the seed for ordering questions after mark to avoid the deterioration  
+               // of the random distribution due to a repeated initialization of the same random seed
+               $this->unseed();
+
+               $num_answer_correct = 0;
+
+               $ordered_answers = array();
+
+               for ($i = 0; $i < $num_choices ; $i++) {
+                       $_POST['answers'][$row['question_id']][$i] = intval($_POST['answers'][$row['question_id']][$i]);
+
+                       if ($_POST['answers'][$row['question_id']][$i] == -1) {
+                               // nothing to do. it was left blank
+                       } else if ($_POST['answers'][$row['question_id']][$i] == $answers[$i]) {
+                               $num_answer_correct++;
+                       }
+                       $ordered_answers[$answers[$i]] = $_POST['answers'][$row['question_id']][$i];
+               }
+               ksort($ordered_answers);
+
+               $score = 0;
+
+               // to avoid roundoff errors:
+               if ($num_answer_correct == $num_choices) {
+                       $score = $row['weight'];
+               } else if ($num_answer_correct > 0) {
+                       $score = number_format($row['weight'] / $num_choices * $num_answer_correct, 2);
+                       if ( (float) (int) $score == $score) {
+                               $score = (int) $score; // a whole number with decimals, eg. "2.00"
+                       } else {
+                               $score = trim($score, '0'); // remove trailing zeros, if any, eg. "2.50"
+                       }
+               }
+
+               $_POST['answers'][$row['question_id']] = implode('|', $ordered_answers);
+
+               return $score;
+       }
+
+       //QTI Import Ordering Question
+       function importQTI($_POST){
+               global $msg, $db;
+
+               if ($_POST['question'] == ''){
+                       $missing_fields[] = _AT('question');
+               }
+
+               if (trim($_POST['choice'][0]) == '') {
+                       $missing_fields[] = _AT('item').' 1';
+               }
+               if (trim($_POST['choice'][1]) == '') {
+                       $missing_fields[] = _AT('item').' 2';
+               }
+
+               if ($missing_fields) {
+                       $missing_fields = implode(', ', $missing_fields);
+                       $msg->addError(array('EMPTY_FIELDS', $missing_fields));
+               }
+
+               if (!$msg->containsErrors()) {
+                       $choice_new = array(); // stores the non-blank choices
+                       $answer_new = array(); // stores the non-blank answers
+                       $order = 0; // order count
+                       for ($i=0; $i<10; $i++) {
+                               /**
+                                * Db defined it to be 255 length, chop strings off it it's less than that
+                                * @harris
+                                */
+                               $_POST['choice'][$i] = validate_length($_POST['choice'][$i], 255);
+                               $_POST['choice'][$i] = trim($_POST['choice'][$i]);
+
+                               if ($_POST['choice'][$i] != '') {
+                                       /* filter out empty choices/ remove gaps */
+                                       $choice_new[] = $_POST['choice'][$i];
+                                       $answer_new[] = $order++;
+                               }
+                       }
+
+                       $_POST['choice']   = array_pad($choice_new, 10, '');
+                       $answer_new        = array_pad($answer_new, 10, 0);
+//                     $_POST['feedback'] = $addslashes($_POST['feedback']);
+//                     $_POST['question'] = $addslashes($_POST['question']);
+               
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_SESSION['course_id'],
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['choice'][0], 
+                                                                       $_POST['choice'][1], 
+                                                                       $_POST['choice'][2], 
+                                                                       $_POST['choice'][3], 
+                                                                       $_POST['choice'][4], 
+                                                                       $_POST['choice'][5], 
+                                                                       $_POST['choice'][6], 
+                                                                       $_POST['choice'][7], 
+                                                                       $_POST['choice'][8], 
+                                                                       $_POST['choice'][9], 
+                                                                       $answer_new[0], 
+                                                                       $answer_new[1], 
+                                                                       $answer_new[2], 
+                                                                       $answer_new[3], 
+                                                                       $answer_new[4], 
+                                                                       $answer_new[5], 
+                                                                       $answer_new[6], 
+                                                                       $answer_new[7], 
+                                                                       $answer_new[8], 
+                                                                       $answer_new[9]);
+
+                       $sql = vsprintf(TR_SQL_QUESTION_ORDERING, $sql_params);
+
+                       $result = mysql_query($sql, $db);
+                       if ($result==true){
+                               return mysql_insert_id();
+                       }                       
+               }
+       }
+}
+
+/**
+* truefalseQuestion
+*
+*/
+class TruefalseQuestion extends AbstracttestQuestion {
+       /*protected */ var $sPrefix = 'truefalse';
+       /*protected */ var $sNameVar   = 'test_tf';
+
+       /*protected */function assignQTIVariables($row) {
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayResultVariables($row, $answer_row) {
+
+               $this->savant->assign('base_href', TR_BASE_HREF);
+               $this->savant->assign('answers', $answer_row['answer']);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayVariables($row, $response) {
+               $this->savant->assign('row', $row);
+               $this->savant->assign('response', $response);
+       }
+
+       /*protected */function assignDisplayStatisticsVariables($row, $answers) {
+               $num_results = 0;               
+               foreach ($answers as $answer) {
+                       $num_results += $answer['count'];
+               }
+
+               $this->savant->assign('num_results', $num_results);
+               $this->savant->assign('num_blanks', (int) $answers['-1']['count']);
+               $this->savant->assign('num_true', (int) $answers['1']['count']);
+               $this->savant->assign('num_false', (int) $answers['2']['count']);
+               $this->savant->assign('row', $row);
+       }
+
+       /*public */function mark($row) { 
+               $_POST['answers'][$row['question_id']] = intval($_POST['answers'][$row['question_id']]);
+
+               if ($row['answer_0'] == $_POST['answers'][$row['question_id']]) {
+                       return (int) $row['weight'];
+               } // else:
+               return 0;
+       }
+
+       //QTI Import True/False Question
+       function importQTI($_POST){
+               global $msg, $db;
+
+               if ($_POST['question'] == ''){
+                       $msg->addError(array('EMPTY_FIELDS', _AT('statement')));
+               }
+
+               //assign true answer to 1, false answer to 2, idk to 3, for ATutor
+               if  ($_POST['answer'] == 'ChoiceT'){
+                       $_POST['answer'] = 1;
+               } else {
+                       $_POST['answer'] = 2;   
+               }
+
+               if (!$msg->containsErrors()) {
+//                     $_POST['feedback'] = $addslashes($_POST['feedback']);
+//                     $_POST['question'] = $addslashes($_POST['question']);
+
+
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_SESSION['course_id'],
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['answer']);
+
+                       $sql = vsprintf(TR_SQL_QUESTION_TRUEFALSE, $sql_params);
+                       $result = mysql_query($sql, $db);
+                       if ($result==true){
+                               return mysql_insert_id();
+                       }                       
+               }
+       }
+}
+
+/**
+* likertQuestion
+*
+*/
+class LikertQuestion extends AbstracttestQuestion {
+       /*protected */ var $sPrefix = 'likert';
+       /*protected */ var $sNameVar   = 'test_lk';
+
+       /*protected */function assignQTIVariables($row) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayResultVariables($row, $answer_row) {
+               $this->savant->assign('answer', $answer_row['answer']);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayVariables($row, $response) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('row', $row);
+
+               if (empty($response)) {
+                       $response = -1;
+               }
+               $this->savant->assign('response', $response);
+       }
+
+       /*protected */function assignDisplayStatisticsVariables($row, $answers) {
+               $num_results = 0;               
+               foreach ($answers as $answer) {
+                       $num_results += $answer['count'];
+               }
+               
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $sum = 0;
+               for ($i=0; $i<$num_choices; $i++) {
+                       $sum += ($i+1) * $answers[$i]['count'];
+               }
+               $average = round($sum/$num_results, 1);
+
+               $this->savant->assign('num_results', $num_results);
+               $this->savant->assign('average', $average);
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('num_blanks', (int) $answers['-1']['count']);
+               $this->savant->assign('answers', $answers);
+               $this->savant->assign('row', $row);
+       }
+
+       /*public */function mark($row) { 
+               $_POST['answers'][$row['question_id']] = intval($_POST['answers'][$row['question_id']]);
+               return 0;
+       }
+
+       //QTI Import Likert Question
+       function importQTI($_POST){
+               global $msg, $db;
+//             $_POST = $this->_POST; 
+
+               $empty_fields = array();
+               if ($_POST['question'] == ''){
+                       $empty_fields[] = _AT('question');
+               }
+               if ($_POST['choice'][0] == '') {
+                       $empty_fields[] = _AT('choice').' 1';
+               }
+
+               if ($_POST['choice'][1] == '') {
+                       $empty_fields[] = _AT('choice').' 2';
+               }
+
+               if (!empty($empty_fields)) {
+//                     $msg->addError(array('EMPTY_FIELDS', implode(', ', $empty_fields)));
+               }
+
+               if (!$msg->containsErrors()) {
+                       $_POST['feedback']   = '';
+//                     $_POST['question']   = $addslashes($_POST['question']);
+
+                       for ($i=0; $i<10; $i++) {
+                               $_POST['choice'][$i] = trim($_POST['choice'][$i]);
+                               $_POST['answer'][$i] = intval($_POST['answer'][$i]);
+
+                               if ($_POST['choice'][$i] == '') {
+                                       /* an empty option can't be correct */
+                                       $_POST['answer'][$i] = 0;
+                               }
+                       }
+
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_SESSION['course_id'],
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['choice'][0], 
+                                                                       $_POST['choice'][1], 
+                                                                       $_POST['choice'][2], 
+                                                                       $_POST['choice'][3], 
+                                                                       $_POST['choice'][4], 
+                                                                       $_POST['choice'][5], 
+                                                                       $_POST['choice'][6], 
+                                                                       $_POST['choice'][7], 
+                                                                       $_POST['choice'][8], 
+                                                                       $_POST['choice'][9], 
+                                                                       $_POST['answer'][0], 
+                                                                       $_POST['answer'][1], 
+                                                                       $_POST['answer'][2], 
+                                                                       $_POST['answer'][3], 
+                                                                       $_POST['answer'][4], 
+                                                                       $_POST['answer'][5], 
+                                                                       $_POST['answer'][6], 
+                                                                       $_POST['answer'][7], 
+                                                                       $_POST['answer'][8], 
+                                                                       $_POST['answer'][9]);
+
+                       $sql = vsprintf(TR_SQL_QUESTION_LIKERT, $sql_params);
+                       $result = mysql_query($sql, $db);
+                       if ($result==true){
+                               return mysql_insert_id();
+                       }
+               }
+       }
+}
+
+/**
+* longQuestion
+*
+*/
+class LongQuestion extends AbstracttestQuestion {
+       /*protected */ var $sPrefix = 'long';
+       /*protected */ var $sNameVar = 'test_open';
+
+       /*protected */function assignQTIVariables($row) {
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayResultVariables($row, $answer_row) {
+               $this->savant->assign('answer', $answer_row['answer']);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayVariables($row, $response) {
+               $this->savant->assign('row', $row);
+               $this->savant->assign('response', $response);
+       }
+
+       /*protected */function assignDisplayStatisticsVariables($row, $answers) {
+               $num_results = 0;               
+               foreach ($answers as $answer) {
+                       $num_results += $answer['count'];
+               }
+               
+               $this->savant->assign('num_results', $num_results);
+               $this->savant->assign('num_blanks', (int) $answers['']['count']);
+               $this->savant->assign('answers', $answers);
+               $this->savant->assign('row', $row);
+       }
+
+       /*public */function mark($row) { 
+               global $addslashes;
+               $_POST['answers'][$row['question_id']] = $addslashes($_POST['answers'][$row['question_id']]);
+               return NULL;
+       }
+
+       //QTI Import Open end/long Question
+       function importQTI($_POST){
+               global $msg, $db;
+//             $_POST = $this->_POST; 
+
+               if ($_POST['question'] == ''){
+//                     $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+               }
+
+               if (!$msg->containsErrors()) {
+//                     $_POST['feedback'] = $addslashes($_POST['feedback']);
+//                     $_POST['question'] = $addslashes($_POST['question']);
+
+                       if ($_POST['property']==''){
+                               $_POST['property'] = 4; //essay
+                       }
+
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_SESSION['course_id'],
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['property']);
+
+                       $sql = vsprintf(TR_SQL_QUESTION_LONG, $sql_params);
+
+                       $result = mysql_query($sql, $db);
+                       if ($result==true){
+                               return mysql_insert_id();
+                       }
+               }
+       }
+}
+
+/**
+* matchingQuestion
+*
+*/
+class MatchingQuestion extends AbstracttestQuestion {
+       /*protected */ var $sPrefix = 'matching';
+       /*protected */ var $sNameVar   = 'test_matching';
+
+       /*protected */function assignQTIVariables($row) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $num_options = 0;
+               for ($i=0; $i < 10; $i++) {
+                       if ($row['option_'. $i] != '') {
+                               $num_options++;
+                       }
+               }
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('num_options', $num_options);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayResultVariables($row, $answer_row) {
+               $num_options = 0;
+               for ($i=0; $i < 10; $i++) {
+                       if ($row['option_'. $i] != '') {
+                               $num_options++;
+                       }
+               }
+
+               $answer_row['answer'] = explode('|', $answer_row['answer']);
+
+               global $_letters;
+
+               $this->savant->assign('base_href', TR_BASE_HREF);
+               $this->savant->assign('answers', $answer_row['answer']);
+               $this->savant->assign('letters', $_letters);
+               $this->savant->assign('num_options', $num_options);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayVariables($row, $response) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               if (empty($response)) {
+                       $response = array_fill(0, $num_choices, -1);
+               } else {
+                       $response = explode('|', $response);
+               }
+
+               $num_options = 0;
+               for ($i=0; $i < 10; $i++) {
+                       if ($row['option_'. $i] != '') {
+                               $num_options++;
+                       }
+               }
+
+               global $_letters;
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('base_href', TR_BASE_HREF);
+               $this->savant->assign('letters', $_letters);
+               $this->savant->assign('num_options', $num_options);
+               $this->savant->assign('row', $row);
+
+               $this->savant->assign('response', $response);
+       }
+
+       /*protected */function assignDisplayStatisticsVariables($row, $answers) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $num_results = 0;
+               foreach ($answers as $answer) {
+                       $num_results += $answer['count'];
+               }
+                                       
+               foreach ($answers as $key => $value) {
+                       $values = explode('|', $key);
+                       if (count($values) > 1) {
+                               for ($i=0; $i<count($values); $i++) {
+                                       $answers[$values[$i]]['count']++;
+                               }
+                       }
+               }
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('num_results', $num_results);
+               $this->savant->assign('answers', $answers);
+               $this->savant->assign('row', $row);
+       }
+
+       /*public */function mark($row) { 
+               $num_choices = count($_POST['answers'][$row['question_id']]);
+               $num_answer_correct = 0;
+               foreach ($_POST['answers'][$row['question_id']] as $item_id => $response) {
+                       if ($row['answer_' . $item_id] == $response) {
+                               $num_answer_correct++;
+                       }
+                       $_POST['answers'][$row['question_id']][$item_id] = intval($_POST['answers'][$row['question_id']][$item_id]);
+               }
+
+               $score = 0;
+               // to avoid roundoff errors:
+               if ($num_answer_correct == $num_choices) {
+                       $score = $row['weight'];
+               } else if ($num_answer_correct > 0) {
+                       $score = number_format($row['weight'] / $num_choices * $num_answer_correct, 2);
+                       if ( (float) (int) $score == $score) {
+                               $score = (int) $score; // a whole number with decimals, eg. "2.00"
+                       } else {
+                               $score = trim($score, '0'); // remove trailing zeros, if any
+                       }
+               }
+
+               $_POST['answers'][$row['question_id']] = implode('|', $_POST['answers'][$row['question_id']]);
+
+               return $score;
+       }
+
+       //QTI Import Matching Question
+       function importQTI($_POST){
+               global $msg, $db;
+//             $_POST = $this->_POST; 
+
+               if (!is_array($_POST['answer'])){
+                       $temp = $_POST['answer'];
+                       $_POST['answer'] = array();
+                       $_POST['answer'][0] = $temp;
+               }
+               ksort($_POST['answer']);        //array_pad returns an array disregard of the array keys
+               //default for matching is '-'
+               $_POST['answer']= array_pad($_POST['answer'], 10, -1);
+
+               for ($i = 0 ; $i < 10; $i++) {
+                       $_POST['groups'][$i]        = trim($_POST['groups'][$i]);
+                       $_POST['answer'][$i] = (int) $_POST['answer'][$i];
+                       $_POST['choice'][$i]          = trim($_POST['choice'][$i]);
+               }
+
+               if (!$_POST['groups'][0] 
+                       || !$_POST['groups'][1] 
+                       || !$_POST['choice'][0] 
+                       || !$_POST['choice'][1]) {
+//                     $msg->addError('QUESTION_EMPTY');
+               }
+
+               if (!$msg->containsErrors()) {
+//                     $_POST['feedback']     = $addslashes($_POST['feedback']);
+//                     $_POST['instructions'] = $addslashes($_POST['instructions']);
+               
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_SESSION['course_id'],
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['groups'][0], 
+                                                                       $_POST['groups'][1], 
+                                                                       $_POST['groups'][2], 
+                                                                       $_POST['groups'][3], 
+                                                                       $_POST['groups'][4], 
+                                                                       $_POST['groups'][5], 
+                                                                       $_POST['groups'][6], 
+                                                                       $_POST['groups'][7], 
+                                                                       $_POST['groups'][8], 
+                                                                       $_POST['groups'][9], 
+                                                                       $_POST['answer'][0], 
+                                                                       $_POST['answer'][1], 
+                                                                       $_POST['answer'][2], 
+                                                                       $_POST['answer'][3], 
+                                                                       $_POST['answer'][4], 
+                                                                       $_POST['answer'][5], 
+                                                                       $_POST['answer'][6], 
+                                                                       $_POST['answer'][7], 
+                                                                       $_POST['answer'][8], 
+                                                                       $_POST['answer'][9],
+                                                                       $_POST['choice'][0], 
+                                                                       $_POST['choice'][1], 
+                                                                       $_POST['choice'][2], 
+                                                                       $_POST['choice'][3], 
+                                                                       $_POST['choice'][4], 
+                                                                       $_POST['choice'][5], 
+                                                                       $_POST['choice'][6], 
+                                                                       $_POST['choice'][7], 
+                                                                       $_POST['choice'][8], 
+                                                                       $_POST['choice'][9]);
+
+                       $sql = vsprintf(TR_SQL_QUESTION_MATCHINGDD, $sql_params);
+
+                       $result = mysql_query($sql, $db);
+                       if ($result==true){
+                               return mysql_insert_id();
+                       }
+               }
+       }
+}
+
+/**
+* matchingddQuestion
+*
+*/
+class MatchingddQuestion extends MatchingQuestion {
+       /*protected */ var $sPrefix = 'matchingdd';
+       /*protected */ var $sNameVar   = 'test_matchingdd';
+}
+
+/**
+* multichoiceQuestion
+*
+*/
+class MultichoiceQuestion extends AbstracttestQuestion {
+       /*protected */ var $sPrefix = 'multichoice';
+       /*protected */var $sNameVar = 'test_mc';
+
+       /*protected */function assignQTIVariables($row) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayResultVariables($row, $answer_row) {
+               if (strpos($answer_row['answer'], '|') !== false) {
+                       $answer_row['answer'] = explode('|', $answer_row['answer']);
+               } else {
+                       $answer_row['answer'] = array($answer_row['answer']);
+               }
+
+               $this->savant->assign('base_href', TR_BASE_HREF);
+               $this->savant->assign('answers', $answer_row['answer']);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayVariables($row, $response) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               if ($response == '') {
+                       $response = -1;
+               }
+               $response = explode('|', $response);
+               $this->savant->assign('response', $response);
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('row', $row);
+       }
+
+       /*protected */function assignDisplayStatisticsVariables($row, $answers) {
+               $choices = $this->getChoices($row);
+               $num_choices = count($choices);
+
+               $num_results = 0;
+               foreach ($answers as $answer) {
+                       $num_results += $answer['count'];
+               }
+                                       
+               foreach ($answers as $key => $value) {
+                       $values = explode('|', $key);
+                       if (count($values) > 1) {
+                               for ($i=0; $i<count($values); $i++) {
+                                       $answers[$values[$i]]['count']++;
+                               }
+                       }
+               }
+
+               $this->savant->assign('num_choices', $num_choices);
+               $this->savant->assign('num_results', $num_results);
+               $this->savant->assign('num_blanks', (int) $answers['-1']['count']);
+               $this->savant->assign('answers', $answers);
+               $this->savant->assign('row', $row);
+       }
+
+       /*public */function mark($row) { 
+               $score = 0;
+               $_POST['answers'][$row['question_id']] = intval($_POST['answers'][$row['question_id']]);
+               if ($row['answer_' . $_POST['answers'][$row['question_id']]]) {
+                       $score = $row['weight'];
+               } else if ($_POST['answers'][$row['question_id']] == -1) {
+                       $has_answer = 0;
+                       for($i=0; $i<10; $i++) {
+                               $has_answer += $row['answer_'.$i];
+                       }
+                       if (!$has_answer && $row['weight']) {
+                               // If MC has no answer and user answered "leave blank"
+                               $score = $row['weight'];
+                       }
+               }
+               return $score;
+       }
+
+       //QTI Import Multiple Choice Question
+       function importQTI($_POST){
+               global $msg, $db;
+//             $_POST = $this->_POST; 
+               if ($_POST['question'] == ''){
+                       $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+               }
+               
+               if (!$msg->containsErrors()) {
+//                     $_POST['question']   = $addslashes($_POST['question']);
+
+                       for ($i=0; $i<10; $i++) {
+                               $_POST['choice'][$i] = trim($_POST['choice'][$i]);
+                       }
+
+                       $answers = array_fill(0, 10, 0);
+                       if (is_array($_POST['answer'])){
+                               $answers[0] = 1;        //default the first to be the right answer. TODO, use summation of points.
+                       } else {
+                               $answers[$_POST['answer']] = 1;
+                       }
+               
+                       $sql_params = array(    $_POST['category_id'], 
+                                                                       $_SESSION['course_id'],
+                                                                       $_POST['feedback'], 
+                                                                       $_POST['question'], 
+                                                                       $_POST['choice'][0], 
+                                                                       $_POST['choice'][1], 
+                                                                       $_POST['choice'][2], 
+                                                                       $_POST['choice'][3], 
+                                                                       $_POST['choice'][4], 
+                                                                       $_POST['choice'][5], 
+                                                                       $_POST['choice'][6], 
+                                                                       $_POST['choice'][7], 
+                                                                       $_POST['choice'][8], 
+                                                                       $_POST['choice'][9], 
+                                                                       $answers[0], 
+                                                                       $answers[1], 
+                                                                       $answers[2], 
+                                                                       $answers[3], 
+                                                                       $answers[4], 
+                                                                       $answers[5], 
+                                                                       $answers[6], 
+                                                                       $answers[7], 
+                                                                       $answers[8], 
+                                                                       $answers[9]);
+
+                       $sql = vsprintf(TR_SQL_QUESTION_MULTI, $sql_params);
+                       $result = mysql_query($sql, $db);
+                       if ($result==true){
+                               return mysql_insert_id();
+                       }
+               }
+       }
+}
+
+/**
+* multianswerQuestion
+*
+*/
+class MultianswerQuestion extends MultichoiceQuestion {
+       /*protected */ var $sPrefix  = 'multianswer';
+       /*protected */ var $sNameVar = 'test_ma';
+
+       /*public */function mark($row) { 
+               $num_correct = array_sum(array_slice($row, 3));
+
+               if (is_array($_POST['answers'][$row['question_id']]) && count($_POST['answers'][$row['question_id']]) > 1) {
+                       if (($i = array_search('-1', $_POST['answers'][$row['question_id']])) !== FALSE) {
+                               unset($_POST['answers'][$row['question_id']][$i]);
+                       }
+                       $num_answer_correct = 0;
+                       foreach ($_POST['answers'][$row['question_id']] as $item_id => $answer) {
+                               if ($row['answer_' . $answer]) {
+                                       // correct answer
+                                       $num_answer_correct++;
+                               } else {
+                                       // wrong answer
+                                       $num_answer_correct--;
+                               }
+                               $_POST['answers'][$row['question_id']][$item_id] = intval($_POST['answers'][$row['question_id']][$item_id]);
+                       }
+                       if ($num_answer_correct == $num_correct) {
+                               $score = $row['weight'];
+                       } else {
+                               $score = 0;
+                       }
+                       $_POST['answers'][$row['question_id']] = implode('|', $_POST['answers'][$row['question_id']]);
+               } else {
+                       // no answer given
+                       $_POST['answers'][$row['question_id']] = '-1'; // left blank
+                       $score = 0;
+               }
+               return $score;
+       }
+
+       //QTI Import multianswer Question
+       function importQTI($_POST){
+               global $msg, $db;
+//             $_POST = $this->_POST; 
+
+               if ($_POST['question'] == ''){
+                       $msg->addError(array('EMPTY_FIELDS', _AT('question')));
+               }
+
+               //Multiple answer can have 0+ answers, in the QTIImport.class, if size(answer) < 2, answer will be came a scalar.
+               //The following code will change $_POST[answer] back to a vector.
+               $_POST['answer'] = $_POST['answers'];
+
+               if (!$msg->containsErrors()) {
+                       $choice_new = array(); // stores the non-blank choices
+                       $answer_new = array(); // stores the associated "answer" for the choices
+
+                       foreach ($_POST['choice'] as $choiceNum=>$choiceOpt) {
+                               $choiceOpt = validate_length($choiceOpt, 255);
+                               $choiceOpt = trim($choiceOpt);
+                               $_POST['answer'][$choiceNum] = intval($_POST['answer'][$choiceNum]);
+                               if ($choiceOpt == '') {
+                                       /* an empty option can't be correct */
+                                       $_POST['answer'][$choiceNum] = 0;
+                               } else {
+                                       /* filter out empty choices/ remove gaps */
+                                       $choice_new[] = $choiceOpt;
+                                       if (in_array($choiceNum, $_POST['answer'])){
+                                               $answer_new[] = 1;
+                                       } else {
+                                               $answer_new[] = 0;
+                                       }
+
+                                       if ($_POST['answer'][$choiceNum] != 0)
+                                               $has_answer = TRUE;
+                               }
+                       }
+
+                       if ($has_answer != TRUE) {
+               
+                               $hidden_vars['required']    = htmlspecialchars($_POST['required']);
+                               $hidden_vars['feedback']    = htmlspecialchars($_POST['feedback']);
+                               $hidden_vars['question']    = htmlspecialchars($_POST['question']);
+                               $hidden_vars['category_id'] = htmlspecialchars($_POST['category_id']);
+
+                               for ($i = 0; $i < count($choice_new); $i++) {
+                                       $hidden_vars['answer['.$i.']'] = htmlspecialchars($answer_new[$i]);
+                                       $hidden_vars['choice['.$i.']'] = htmlspecialchars($choice_new[$i]);
+                               }
+
+                               $msg->addConfirm('NO_ANSWER', $hidden_vars);
+                       } else {                        
+                               //add slahes throughout - does that fix it?
+                               $_POST['answer'] = $answer_new;
+                               $_POST['choice'] = $choice_new;
+                               $_POST['answer'] = array_pad($_POST['answer'], 10, 0);
+                               $_POST['choice'] = array_pad($_POST['choice'], 10, '');
+                       
+//                             $_POST['feedback'] = $addslashes($_POST['feedback']);
+//                             $_POST['question'] = $addslashes($_POST['question']);
+
+                               $sql_params = array(    $_POST['category_id'], 
+                                                                               $_SESSION['course_id'],
+                                                                               $_POST['feedback'], 
+                                                                               $_POST['question'], 
+                                                                               $_POST['choice'][0], 
+                                                                               $_POST['choice'][1], 
+                                                                               $_POST['choice'][2], 
+                                                                               $_POST['choice'][3], 
+                                                                               $_POST['choice'][4], 
+                                                                               $_POST['choice'][5], 
+                                                                               $_POST['choice'][6], 
+                                                                               $_POST['choice'][7], 
+                                                                               $_POST['choice'][8], 
+                                                                               $_POST['choice'][9], 
+                                                                               $_POST['answer'][0], 
+                                                                               $_POST['answer'][1], 
+                                                                               $_POST['answer'][2], 
+                                                                               $_POST['answer'][3], 
+                                                                               $_POST['answer'][4], 
+                                                                               $_POST['answer'][5], 
+                                                                               $_POST['answer'][6], 
+                                                                               $_POST['answer'][7], 
+                                                                               $_POST['answer'][8], 
+                                                                               $_POST['answer'][9]);
+
+                               $sql = vsprintf(TR_SQL_QUESTION_MULTIANSWER, $sql_params);
+
+                               $result = mysql_query($sql, $db);
+                               if ($result==true){
+                                       return mysql_insert_id();
+                               }
+                       }
+               }
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/docs/include/classes/vcard.php b/docs/include/classes/vcard.php
new file mode 100644 (file)
index 0000000..052740d
--- /dev/null
@@ -0,0 +1,160 @@
+<?php
+/***************************************************************************
+
+PHP vCard class v2.0
+(c) Kai Blankenhorn
+www.bitfolge.de/en
+kaib@bitfolge.de
+
+
+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.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+***************************************************************************/
+
+
+function encode($string) {
+       return escape(quoted_printable_encode($string));
+}
+
+function escape($string) {
+       return str_replace(";","\;",$string);
+}
+
+if (!function_exists("quoted_printable_encode")) {
+       // taken from PHP documentation comments
+       function quoted_printable_encode($input, $line_max = 76) {
+               $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
+               $lines = preg_split("/(?:\r\n|\r|\n)/", $input);
+               $eol = "\r\n";
+               $linebreak = "=0D=0A";
+               $escape = "=";
+               $output = "";
+
+               for ($j=0;$j<count($lines);$j++) {
+                       $line = $lines[$j];
+                       $linlen = strlen($line);
+                       $newline = "";
+                       for($i = 0; $i < $linlen; $i++) {
+                               $c = substr($line, $i, 1);
+                               $dec = ord($c);
+                               if ( ($dec == 32) && ($i == ($linlen - 1)) ) { // convert space at eol only
+                                       $c = "=20"; 
+                               } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
+                                       $h2 = floor($dec/16); $h1 = floor($dec%16); 
+                                       $c = $escape.$hex["$h2"].$hex["$h1"]; 
+                               }
+                               if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
+                                       $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
+                                       $newline = "    ";
+                               }
+                               $newline .= $c;
+                       } // end of for
+                       $output .= $newline;
+                       if ($j<count($lines)-1) $output .= $linebreak;
+               }
+               return trim($output);
+       }
+}
+
+class vCard {
+       var $properties;
+       var $filename;
+       
+       function setPhoneNumber($number, $type="") {
+       // type may be PREF | WORK | HOME | VOICE | FAX | MSG | CELL | PAGER | BBS | CAR | MODEM | ISDN | VIDEO or any senseful combination, e.g. "PREF;WORK;VOICE"
+               $key = "TEL";
+               if ($type!="") $key .= ";".$type;
+               $key.= ";ENCODING=QUOTED-PRINTABLE";
+               $this->properties[$key] = quoted_printable_encode($number);
+       }
+       
+       // UNTESTED !!!
+       function setPhoto($type, $photo) { // $type = "GIF" | "JPEG"
+               $this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
+       }
+       
+       function setFormattedName($name) {
+               $this->properties["FN"] = quoted_printable_encode($name);
+       }
+       
+       function setName($family="", $first="", $additional="", $prefix="", $suffix="") {
+               $this->properties["N"] = "$family;$first;$additional;$prefix;$suffix";
+               $this->filename = "$first%20$family.vcf";
+               if ($this->properties["FN"]=="") $this->setFormattedName(trim("$prefix $first $additional $family $suffix"));
+       }
+       
+       function setBirthday($date) { // $date format is YYYY-MM-DD
+               $this->properties["BDAY"] = $date;
+       }
+       
+       function setAddress($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") {
+       // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
+               $key = "ADR";
+               if ($type!="") $key.= ";$type";
+               $key.= ";ENCODING=QUOTED-PRINTABLE";
+               $this->properties[$key] = encode($name).";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country);
+               
+               if ($this->properties["LABEL;$type;ENCODING=QUOTED-PRINTABLE"] == "") {
+                       //$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type);
+               }
+       }
+       
+       function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") {
+               $label = "";
+               if ($postoffice!="") $label.= "$postoffice\r\n";
+               if ($extended!="") $label.= "$extended\r\n";
+               if ($street!="") $label.= "$street\r\n";
+               if ($zip!="") $label.= "$zip ";
+               if ($city!="") $label.= "$city\r\n";
+               if ($region!="") $label.= "$region\r\n";
+               if ($country!="") $country.= "$country\r\n";
+               
+               $this->properties["LABEL;$type;ENCODING=QUOTED-PRINTABLE"] = quoted_printable_encode($label);
+       }
+       
+       function setEmail($address) {
+               $this->properties["EMAIL;INTERNET"] = $address;
+       }
+       
+       function setNote($note) {
+               $this->properties["NOTE;ENCODING=QUOTED-PRINTABLE"] = quoted_printable_encode($note);
+       }
+       
+       function setURL($url, $type="") {
+       // $type may be WORK | HOME
+               $key = "URL";
+               if ($type!="") $key.= ";$type";
+               $this->properties[$key] = $url;
+       }
+       
+       function getVCard() {
+               $text = "BEGIN:VCARD\r\n";
+               $text.= "VERSION:2.1\r\n";
+               foreach($this->properties as $key => $value) {
+                       $text.= "$key:$value\r\n";
+               }
+               $text.= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n";
+               //$text.= "MAILER:PHP vCard class by Kai Blankenhorn\r\n";
+               $text.= "END:VCARD\r\n";
+               return $text;
+       }
+       
+       function getFileName() {
+               return $this->filename;
+       }
+}
+
+
+?>
\ No newline at end of file
index 02924a0..45ebc1b 100644 (file)
@@ -21,8 +21,10 @@ $_config_defaults = array();
 $_config_defaults['site_name']          = '';
 $_config_defaults['contact_email']      = '';
 $_config_defaults['max_file_size']      = 1048576;  // 1MB
+$_config_defaults['max_course_size']    = 10485760; // 10 MB
+$_config_defaults['max_file_size']      = 1048576;  // 1MB
 $_config_defaults['illegal_extentions'] = 'exe|asp|php|php3|bat|cgi|pl|com|vbs|reg|pcd|pif|scr|bas|inf|vb|vbe|wsc|wsf|wsh';
-$_config_defaults['default_language']   = 'eng';
+$_config_defaults['default_language']   = 'en';
 $_config_defaults['use_captcha']               = 0;    //use captcha?
 $_config_defaults['latex_server']       = 'http://www.atutor.ca/cgi/mimetex.cgi?'; // the full URL to an external LaTeX parse
 $_config_defaults['pref_defaults']      = 'a:1:{s:10:"PREF_THEME";s:7:"default";}';
@@ -35,7 +37,7 @@ define('SVN_TAG_FOLDER', 'http://atutorsvn.atrc.utoronto.ca/repos/atutor/tags/')
 define('RESULTS_PER_PAGE', 10);
 
 // language constants
-define('DEFAULT_LANGUAGE_CODE', 'eng');
+define('DEFAULT_LANGUAGE_CODE', 'en');
 define('DEFAULT_CHARSET', 'utf-8');
 define('TR_LANGUAGE_LOCALE_SEP', '-');
 //$_config['default_language'] = DEFAULT_LANGUAGE_CODE;
@@ -50,6 +52,18 @@ define('TR_STATUS_ENABLED', 1);
 define('TR_STATUS_DEFAULT', 2);
 define('TR_STATUS_UNCONFIRMED', 3);
 
+// User role
+define('TR_USERROLE_AUTHOR', 1);
+define('TR_USERROLE_VIEWER', 2);
+
+// User privilege
+define('TR_PRIV_ISAUTHOR', 1);
+define('TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE', 2);
+
+// course size
+define('TR_COURSESIZE_UNLIMITED',         -1); 
+define('TR_COURSESIZE_DEFAULT',                   -2);  /* can be changed in config.inc.php */
+
 // content type
 define('CONTENT_TYPE_CONTENT',  0);
 define('CONTENT_TYPE_FOLDER', 1);
@@ -57,6 +71,13 @@ define('CONTENT_TYPE_WEBLINK', 2);
 
 define('TR_KBYTE_SIZE', 1024);
 
+/* valid date format_types:                                            */
+/* @see ./include/lib/output.inc.php   */
+define('TR_DATE_MYSQL_DATETIME',               1); /* YYYY-MM-DD HH:MM:SS      */
+define('TR_DATE_MYSQL_TIMESTAMP_14',   2); /* YYYYMMDDHHMMSS           */
+define('TR_DATE_UNIX_TIMESTAMP',               3); /* seconds since epoch      */
+define('TR_DATE_INDEX_VALUE',                  4); /* index to the date arrays */
+
 function get_status_by_code($status_code)
 {
        if ($status_code == TR_STATUS_DISABLED)
index 3ec25df..be970a4 100644 (file)
 /************************************************************************/
 
 global $savant;
+global $_base_path, $_course_id;
 
 if (!defined('TR_INCLUDE_PATH')) { exit; }
 
+// get course copyright
+if ($_course_id > 0)
+{
+       require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+       $coursesDAO = new CoursesDAO();
+       $course_row = $coursesDAO->get($_course_id);
+       if ($course_row['copyright'] <> '') $savant->assign('course_copyright', $course_row['copyright']);
+}
+
+$savant->assign('course_id', $_course_id);
+$savant->assign('base_path', $_base_path);
+$savant->assign('theme', $_SESSION['prefs']['PREF_THEME']);
+
 $savant->display('include/footer.tmpl.php');
 ?>
index 1cded42..ecaf243 100644 (file)
@@ -26,8 +26,10 @@ global $_custom_css;
 global $_custom_head;
 global $_base_path;
 global $_pages;
-global $_current_user;
+global $_current_user, $_course_id, $_sequence_links;
 global $validate_content;
+global $contentManager;
+global $course_base_href, $content_base_href;
 
 include_once(TR_INCLUDE_PATH.'classes/Menu.class.php');
 
@@ -38,7 +40,7 @@ $_all_pages =  $menu->getAllPages();
 
 $_current_root_page = $menu->getRootPage();
 
-//$_breadcrumb_path = $menu->getPath();
+$_breadcrumb_path = $menu->getPath();
 
 $current_page = $menu->getCurrentPage();
 
@@ -55,18 +57,29 @@ $back_to_page = $menu->getBackToPage();
 //debug($_current_root_page);
 //debug($_current_page);
 
-//$savant->assign('path', $_breadcrumb_path);
+$savant->assign('path', $_breadcrumb_path);
 $savant->assign('top_level_pages', $_top_level_pages);
 $savant->assign('current_top_level_page', $_current_root_page);
 $savant->assign('sub_menus', $_sub_menus);
 if ($back_to_page <> '') $savant->assign('back_to_page', $back_to_page);
 $savant->assign('current_page', $_base_path.$current_page);
 
-$savant->assign('page_title', _AT($_all_pages[$current_page]['title_var']));
+if (isset($_pages[$current_page]['title'])) {
+       $_page_title = $_all_pages[$current_page]['title'];
+} else {
+       $_page_title = _AT($_all_pages[$current_page]['title_var']);
+}
+$savant->assign('page_title', htmlspecialchars($_page_title, ENT_COMPAT, "UTF-8"));
+
+if ($_course_id > 0) {
+       $sequence_links = $contentManager->generateSequenceCrumbs($cid);
+       $savant->assign('sequence_links', $sequence_links);
+}
 
 if (isset($_current_user))
 {
   $savant->assign('user_name', $_current_user->getUserName());
+  if ($_course_id > 0) $savant->assign('isAuthor', $_current_user->isAuthor($_course_id));
 }
 
 if ($myLang->isRTL()) {
@@ -75,6 +88,15 @@ if ($myLang->isRTL()) {
        $savant->assign('rtl_css', '');
 }
 
+$_tmp_base_href = TR_BASE_HREF;
+if (isset($course_base_href) || isset($content_base_href)) {
+       $_tmp_base_href .= $course_base_href;
+       if ($content_base_href) {
+               $_tmp_base_href .= $content_base_href;
+       }
+}
+
+$savant->assign('content_base_href', $_tmp_base_href);
 $savant->assign('lang_code', $_SESSION['lang']);
 $savant->assign('lang_charset', $myLang->getCharacterSet());
 $savant->assign('base_path', TR_BASE_HREF);
@@ -83,19 +105,14 @@ $savant->assign('theme', $_SESSION['prefs']['PREF_THEME']);
 $theme_img  = $_base_path . 'themes/'. $_SESSION['prefs']['PREF_THEME'] . '/images/';
 $savant->assign('img', $theme_img);
 
-if (isset($validate_content))
-{
-       $savant->assign('show_jump_to_report', 1);
-}
-
-// get custom head
-$custom_head = '';
+// get custom css
+$custom_css = '';
 if (isset($_custom_css)) {
-       $custom_head = '<link rel="stylesheet" href="'.$_custom_css.'" type="text/css" />';
+       $custom_css = '<link rel="stylesheet" href="'.$_custom_css.'" type="text/css" />';
 }
 
 if (isset($_custom_head)) {
-       $custom_head .= '
+       $custom_css .= '
 ' . $_custom_head;
 }
 
@@ -105,9 +122,10 @@ if (isset($_pages[$current_page]['guide']))
        $savant->assign('guide', TR_GUIDES_PATH .'index.php?p='. htmlentities($script_name));
 }
 
-$savant->assign('custom_head', $custom_head);
+$savant->assign('custom_css', $custom_css);
 
-if ($onload)   $savant->assign('onload', $onload);
+if ($onload) $savant->assign('onload', $onload);
+$savant->assign('course_id', $_course_id);
 
 $savant->display('include/header.tmpl.php');
 
diff --git a/docs/include/imscc/ims_template.inc.php b/docs/include/imscc/ims_template.inc.php
new file mode 100644 (file)
index 0000000..890a69a
--- /dev/null
@@ -0,0 +1,687 @@
+<?php
+/************************************************************************/
+/* ATutor                                                               */
+/************************************************************************/
+/* Copyright (c) 2002 - 2009                                            */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+// $Id: ims_template.inc.php 8180 2008-11-07 17:17:25Z hwong $
+
+if (!defined('TR_INCLUDE_PATH')) { exit; }
+
+// This function gets files from html tag @import
+function get_import_files($text)
+{
+       $text = strtolower($text);
+       $tag = '@import';
+       $files = array();
+       
+       while (strpos(strtolower($text), strtolower($tag)) > 0)
+       {
+               $start_pos      = strpos($text, $tag);
+               if ($start_pos !== false) 
+               {
+                       $text = substr($text, $start_pos);
+                       $start_pos = strlen($tag);
+                       $len = strpos($text, ';') - strlen($tag);
+                       
+                       $file = substr(trim($text), $start_pos, $len);
+                       
+                       // remove these characters from file name: url, (, ), ", '
+                       $file = trim(preg_replace('/(\'|\"|url|\(|\))/', '', $file));
+                       
+                       // strip processed tag
+                       $text = substr($text, $start_pos);
+                       array_push($files, $file);
+               }
+       
+       }
+       
+       return $files;
+}
+       
+function print_organizations($parent_id,
+                                                        &$_menu, 
+                                                        $depth, 
+                                                        $path='',
+                                                        $children,
+                                                        &$string) {
+       
+       global $html_content_template, $default_html_style, $zipfile, $resources, $ims_template_xml, $parser, $my_files;
+       global $used_glossary_terms, $course_id, $course_language_charset, $course_language_code;
+       static $paths, $zipped_files;
+//     global $glossary;
+       global $test_list, $test_zipped_files, $test_files, $test_xml_items, $use_a4a;
+       global $contentManager;
+        /* added by bologna*///TODO***********BOLOGNA**************REMOVE ME*****************/
+        global $db,$forum_list;//forum_list contiene tutti i forum distinti associati ai contenuti. poich� la funzione in questione ï¿½ ricorsiva deve essere globale in modo che in fase di creazione dell'archivio zip i file descrittori dei forum non vengano ripetuti
+
+       require_once(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
+       
+       $space  = '    ';
+       $prefix = '                    ';
+
+       if ($depth == 0) {
+               $string .= '<ul>';
+       }
+       $top_level = $_menu[$parent_id];
+       if (!is_array($paths)) {
+               $paths = array();
+       }
+       if (!is_array($zipped_files)) {
+               $zipped_files = array();
+       }
+       if ( is_array($top_level) ) {
+               
+               $counter = 1;
+               $num_items = count($top_level);
+                
+               foreach ($top_level as $garbage => $content) {
+                       $link = '';
+                       //XSL characters handling
+                       $content['title'] = str_replace('&', '&amp;', $content['title']);
+                               
+                       if ($content['content_path'] && (substr($content['content_path'],-1)!='/')) {
+                               $content['content_path'] .= '/';
+                       }
+
+                       /* 
+                        * generate weblinks 
+                        * Reason to put it here is cause we don't want the content to be overwrittened.
+                        */
+                       if ($content['content_type']==CONTENT_TYPE_WEBLINK){
+                               $wl = new Weblinks($content['title'], $content['text']);
+                               $wlexport = new WeblinksExport($wl);
+                               $wl_xml = $wlexport->export();
+                               $wl_filename = 'weblinks_'.$content['content_id'].'.xml';
+                               $zipfile->add_file($wl_xml , 'Weblinks/'.$wl_filename, $content['u_ts']);
+                               $resources .= str_replace(      array('{PATH}', '{CONTENT_ID}'), 
+                                                                                       array($wl_filename, $content['content_id']), 
+                                                                                       $ims_template_xml['resource_weblink']);
+                               //Done.
+//                             continue;
+                       }
+
+                       if ($content['content_type']==CONTENT_TYPE_FOLDER){
+                               $link .= $prefix.'<item identifier="MANIFEST01_FOLDER'.$content['content_id'].'">'."\n";
+                               $link .= $prefix.$space.'<title>'.$content['title'].'</title>'."\n";
+                       } else {
+                               $link .= '<item identifier="MANIFEST01_ITEM'.$content['content_id'].'" identifierref="MANIFEST01_RESOURCE'.$content['content_id'].'">'."\n";
+                               $link .= $prefix.$space.'<title>'.$content['title'].'</title>'."\n$prefix$space";
+                       }
+                       $html_link = '<a href="resources/'.$content['content_path'].$content['content_id'].'.html" target="body">'.$content['title'].'</a>';
+                       
+                       /* save the content as HTML files */
+                       /* @See: include/lib/format_content.inc.php */
+                       $content['text'] = str_replace('CONTENT_DIR/', '', $content['text']);
+                       /* Commented by Cindy Qi Li on Jan 12, 2010
+                        * Transformable does not support glossary and forum (discussion tools)
+                       // get all the glossary terms used
+                       $terms = find_terms($content['text']);
+                       if (is_array($terms)) {
+                               foreach ($terms[2] as $term) {
+                                       $used_glossary_terms[] = $term;
+                               }
+                       }
+
+
+                    // TODO-----------BOLOGNA------------REMOVE ME-------------/
+                    $f_count = count($forum_list); //count all distinct forum_id associated to a content page
+                                                //la funzione Ã¨ ricorsiva quindi lo devo ricavare attraverso la variabile globale forum_list
+
+                    // TODO-----------BOLOGNA------------REMOVE ME-------------/
+                    //recupero i forum associati al contenuto corrente
+                    $sql = "SELECT cf.forum_id, f.title, f.description FROM (SELECT * FROM ".TABLE_PREFIX."content_forums_assoc WHERE content_id=$content[content_id]) AS cf LEFT JOIN ".TABLE_PREFIX."forums f ON cf.forum_id=f.forum_id";
+                    $result_cf = mysql_query($sql,$db);
+                    $cf_count = mysql_num_rows($result_cf);
+   
+                    //per ogni forum ottenuto controllo se Ã¨ già stato caricato nell'array
+                    //necessario mantenerlo distinto poichè NON si prevedono funzioni sul
+                    //controllo dei nomi nell'inserimento di file nell'archivio.
+                    $find=false;
+                    $forums_dependency='';  //template for associate Discussion Topic to the current content into the manifest
+                    while($current_forum = mysql_fetch_assoc($result_cf)) {
+                        for($j=0;$j<$f_count;$j++) {
+                            if($forum_list[$j]['id'] == $current_forum['forum_id'])
+                                $find= true;
+                        }
+                        if(!$find) {
+
+                            $forum_list[$f_count]['id']=$current_forum['forum_id'];
+                            $forum_list[$f_count]['title']=$current_forum['title'];
+                            $forum_list[$f_count]['description']=$current_forum['description'];
+                            $find=false;
+                            $f_count++;
+                        }
+                       $forums_dependency .= $prefix.$space.'<dependency identifierref="Forum'.$current_forum['forum_id'].'_R" />';
+                    }
+*/
+                        /** Test dependency **/
+                       require_once(TR_INCLUDE_PATH.'classes/DAO/ContentTestsAssocDAO.class.php');
+                       $contentTestsAssocDAO = new ContentTestsAssocDAO();
+                       
+//                     $sql = 'SELECT * FROM '.TABLE_PREFIX.'content_tests_assoc WHERE content_id='.$content['content_id'];
+//                     $result = mysql_query($sql, $db);
+//                     while ($row = mysql_fetch_assoc($result)){
+                       $rows = $contentTestsAssocDAO->getByContent($content['content_id']);
+                       if (is_array($rows)) {
+                               //add test dependency on top of forum dependency
+                               foreach ($rows as $row)
+                                       $forums_dependency .= $prefix.$space.'<dependency identifierref="MANIFEST01_RESOURCE_QTI'.$row['test_id'].'" />';
+                       }
+
+
+                       /* calculate how deep this page is: */
+                       $path = '../';
+                       if ($content['content_path']) {
+                               $depth = substr_count($content['content_path'], '/');
+
+                               $path .= str_repeat('../', $depth);
+                       }
+
+                       $content['text'] = ContentUtility::formatContent($content['text'], $content['formatting']);
+                       // add HTML header and footers to the files
+                       // use default style if <style> is not in imported html head
+                       $head = '';
+                       if ($content['use_customized_head'])
+                       {
+                               if (strpos(strtolower($content['head']), '<style') > 0)
+                               {
+                                       $head = $content['head'];
+                               }
+                               else
+                               {
+                                       if (strlen($content['head']) > 0)  
+                                               $head = $content['head'] . $default_html_style;
+                                       else 
+                                               $head = $default_html_style;
+                               }
+                       }
+
+                       $content['text'] = str_replace( array('{TITLE}',        '{CONTENT}', '{KEYWORDS}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}', '{HEAD}'),
+                                                                       array($content['title'],        $content['text'], $content['keywords'], $course_language_charset, $course_language_code, $head),
+                                                                       $html_content_template);
+                                                               
+                       /* duplicate the paths in the content_path field in the zip file */
+                       if ($content['content_path']) {
+                               if (!in_array($content['content_path'], $paths)) {
+                                       $zipfile->create_dir('resources/'.$content['content_path'], time());
+                                       $paths[] = $content['content_path'];
+                               }
+                       }
+                       //add the file iff it's a content file
+                       if($content['content_type']==CONTENT_TYPE_CONTENT){
+                               $zipfile->add_file($content['text'], 'resources/'.$content['content_path'].$content['content_id'].'.html', $content['u_ts']);
+                       }
+                       $content['title'] = htmlspecialchars($content['title']);
+
+                       /* add the resource dependancies */                     
+                       if ($my_files == null) $my_files = array();
+                       $content_files = "\n";
+                       $parser->parse($content['text']);
+
+                       /* generate the IMS QTI resource and files */
+                       //check if test export is allowed.
+                       if ($contentManager->allowTestExport($content['content_id'])){
+                               $content_test_rs = $contentManager->getContentTestsAssoc($content['content_id']);       
+                               $test_ids = array();            //reset test ids
+                               //$my_files = array();          //reset myfiles.
+                               while ($content_test_row = mysql_fetch_assoc($content_test_rs)){
+                                       //export
+                                       $test_ids[] = $content_test_row['test_id'];
+                                       //the 'added_files' is for adding into the manifest file in this zip
+                                       $added_files = test_qti_export($content_test_row['test_id'], '', $zipfile);
+                                       foreach($added_files as $xml_file=>$chunk){
+                                               foreach ($chunk as $xml_filename){
+                                                       $added_files_xml .= str_replace('{FILE}', 'QTI/'.$xml_filename, $ims_template_xml['xml']);
+                                               }
+                                       }
+                                       //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
+                                       $resources .= str_replace(      array('{TEST_ID}', '{PATH}', '{FILES}'),
+                                                                                               array($content_test_row['test_id'], 'tests_'.$content_test_row['test_id'].'.xml', $added_files_xml),
+                                                                                               $ims_template_xml['resource_test']); 
+/*     Taken out since we are gonna use dependency instead
+                                       $test_xml_items .= str_replace( array('{TEST_ID}'),
+                                                                                               array($content_test_row['test_id']),
+                                                                                               $ims_template_xml['test']); 
+*/
+                                       foreach($test_files as $filename=>$realfilepath){
+                                               $zipfile->add_file(@file_get_contents($realfilepath), 'QTI/'.$filename, filemtime($realfilepath));
+                                       }
+                               }
+                       }
+
+                       /* generate the a4a files */
+                       $a4a_xml_array = array();
+                       if ($use_a4a == true){
+                               $a4aExport = new A4aExport($content['content_id']);
+//                             $a4aExport->setRelativePath('resources/'.$content['content_path']);
+                               $secondary_files = $a4aExport->getAllSecondaryFiles();
+                               $a4a_xml_array = $a4aExport->exportA4a();
+                               $my_files = array_merge($my_files, $a4aExport->getAllSecondaryFiles());
+                       }
+
+                       /* handle @import */
+                       $import_files = get_import_files($content['text']);
+
+                       if (count($import_files) > 0) $my_files = array_merge($my_files, $import_files);
+
+                       foreach ($my_files as $file) {
+                               /* filter out full urls */
+                               $url_parts = @parse_url($file);
+                               if (isset($url_parts['scheme'])) {
+                                       continue;
+                               }
+
+                               /* file should be relative to content. let's double check */
+                               if ((substr($file, 0, 1) == '/')) {
+                                       continue;
+                               }
+
+
+                               $file_path = realpath(TR_CONTENT_DIR . $course_id . '/' . $content['content_path'] . $file);
+
+                               /* check if this file exists in the content dir, if not don't include it */
+                               if (file_exists($file_path) &&  is_file($file_path) && !in_array($file_path, $zipped_files)) {
+                                       $zipped_files[] = $file_path;
+                                       $dir = substr(dirname($file_path), strlen(TR_CONTENT_DIR . $course_id));
+
+                                       if (!in_array($dir, $paths) && $dir) {
+                                               $dir = str_replace('\\', '/', substr($dir, 1));
+                                               $zipfile->create_dir('resources/' . $dir, time());
+                                               
+                                               $paths[] = $dir;
+                                       }
+
+                                       $file_info = stat( $file_path );
+
+                                       //remove relative path in the content_path.     
+                                       $filepath_array = explode('/', 'resources/' . $content['content_path'] . $file);
+                                       $new_filepath_array = array();
+                                       if (in_array('..', $filepath_array)){
+                                               while (!empty($filepath_array)){
+                                                       $temp = array_shift($filepath_array);
+                                                       if ($temp == '..'){
+                                                               array_pop($new_filepath_array);
+                                                       } else {
+                                                               array_push($new_filepath_array, $temp);
+                                                       }
+                                               }
+                                               $zip_path = implode('/', $new_filepath_array);
+                                       } else {
+                                               $zip_path = 'resources/' . $content['content_path'] . $file;
+                                       }
+
+                                       $zipfile->add_file(@file_get_contents($file_path), $zip_path, $file_info['mtime']);
+
+                                       //a4a secondary files have mapping, save the ones that we want in order to add the tag in
+                                       $a4a_secondary_files = array();
+                                       foreach ($a4a_xml_array as $a4a_filename=>$a4a_filearray){
+                                               if (preg_match('/(.*)\sto\s(.*)/', $a4a_filename, $matches)){
+                                                       //save the actual file name
+                                                       $a4a_secondary_files[$matches[1]][] = $a4a_filename;    //values are holders
+                                               }
+                                       }
+
+                                       // If this file has a4a alternatives, link it.
+                                       if (isset($a4a_xml_array[$file]) || isset($a4a_secondary_files[$file])){
+                                               //if this is an array, meaning that it has more than 1 alternatives, print all
+                                               if (is_array($a4a_secondary_files[$file])){
+                                                       $all_secondary_files_md = '';   //reinitialize string to null
+                                                       foreach ($a4a_secondary_files[$file] as $v){
+                                                               $all_secondary_files_md .= $a4a_xml_array[$v];  //all the meta data                                                             
+                                                       }
+                                                       $content_files .= str_replace(  array('{FILE}', '{FILE_META_DATA}'), 
+                                                                                                                       array('resources/'.$content['content_path'] . $file, $all_secondary_files_md), 
+                                                                                                                       $ims_template_xml['file_meta']);
+                                               } else {        
+                                                       $content_files .= str_replace(  array('{FILE}', '{FILE_META_DATA}'), 
+                                                                                                                       array('resources/'.$content['content_path'] . $file, $a4a_xml_array[$file]), 
+                                                                                                                       $ims_template_xml['file_meta']);
+                                               }
+                                       } else {
+                                               //if this file is in the test array, add an extra link to the direct file, 
+                                               if (!empty($test_zipped_files) && in_array($file_path, $test_zipped_files)){
+                                                       $content_files .= str_replace('{FILE}', $file, $ims_template_xml['file']);
+                                               } else {
+                                                       $content_files .= str_replace('{FILE}', $content['content_path'] . $file, $ims_template_xml['file']);
+                                               }
+                                       }
+                               }
+
+                               /* check if this file is one of the test xml file, if so, we need to add the dependency
+                                * Note:  The file has already been added to the archieve before this is called.
+                                */
+                               if (preg_match('/tests\_[0-9]+\.xml$/', $file) && !in_array($file, $test_zipped_files)){
+                                       $content_files .= str_replace('{FILE}', 'QTI/'.$file, $ims_template_xml['xml']);
+                                       $test_zipped_files[] = $file;
+                               }
+                       }
+
+                       /******************************/
+                       //add it to the resources section if it hasn't been added.  
+                       //Weblinks have been added.
+                       //Folders aren't resourecs, they shouldn't be added
+                       if($content['content_type']==CONTENT_TYPE_CONTENT){
+                               $resources .= str_replace(      array('{CONTENT_ID}', '{PATH}', '{FILES}','{DEPENDENCY}'),
+                                                                                       array($content['content_id'], $content['content_path'], $content_files, $forums_dependency),
+                                                                                       $ims_template_xml['resource']); 
+                       }
+                       
+
+                       for ($i=0; $i<$depth; $i++) {
+                               $link .= $space;
+                       }
+
+                       if ( is_array($_menu[$content['content_id']]) ) {
+                               /* has children */
+
+                               $html_link = '<li>'.$html_link.'<ul>';
+                               for ($i=0; $i<$depth; $i++) {
+                                       if ($children[$i] == 1) {
+                                               echo $space;
+                                               //$html_link = $space.$html_link;
+                                       } else {
+                                               echo $space;
+                                               //$html_link = $space.$html_link;
+                                       }
+                               }
+
+                       } else {
+                               /* doesn't have children */
+
+                               $html_link = '<li>'.$html_link.'</li>';
+                               if ($counter == $num_items) {
+                                       for ($i=0; $i<$depth; $i++) {
+                                               if ($children[$i] == 1) {
+                                                       echo $space;
+                                                       //$html_link = $space.$html_link;
+                                               } else {
+                                                       echo $space;
+                                                       //$html_link = $space.$html_link;
+                                               }
+                                       }
+                               } else {
+                                       for ($i=0; $i<$depth; $i++) {
+                                               echo $space;
+                                               //$html_link = $space.$html_link;
+                                       }
+                               }
+                               $title = $space.$title;
+                       }
+
+                       echo $prefix.$link;
+//                     echo $title;
+                       echo "\n";
+
+                       $string .= $html_link."\n";
+
+                       $depth ++;
+                       print_organizations($content['content_id'],
+                                                               $_menu, 
+                                                               $depth, 
+                                                               $path.$counter.'.', 
+                                                               $children,
+                                                               $string);
+                       $depth--;
+
+                       $counter++;
+                       for ($i=0; $i<$depth; $i++) {
+                               echo $space;
+                       }
+
+//                     if (!empty($_menu[$content['content_id']])){
+                       echo $prefix.'</item>';
+//                     }
+                       echo "\n";
+               }  
+
+               $string .= '</ul>';
+               if ($depth > 0) {
+                       $string .= '</li>';
+               }
+
+       }
+}
+
+
+//TODO***************BOLOGNA******************REMOVE ME***************/
+/* Export Forum */
+function print_resources_forum() {
+
+    global $forum_list, $zipfile, $resources;           //$forum_list contiene tutti i forum DISTINTI associati ai contenuti. caricato in print_organizations()
+
+    $ims_template_xml['resource_forum'] =
+
+        '<resource identifier="Forum{FORUMID}_R" type="imsdt_xmlv1p0">
+            <metadata/>
+            <file href="Forum{FORUMID}/FileDescriptorForum{FORUMID}.xml"/>
+        </resource>
+       '."\n";
+
+    foreach ($forum_list as $f){
+    // per ogni forum associato ad uno o pi� contenuti del corso viene aggiunto un elemento resource in imsmanifest.xml
+        $resources .= str_replace("{FORUMID}", $f['id'], $ims_template_xml['resource_forum']);
+
+        //viene generato il file descrittore
+        //file Descrittore con la descrzione del forum
+        $fileDesDT_D = '<?xml version="1.0" encoding="UTF-8"?>
+
+                    <dt:topic
+
+                        xmlns:dt="http://www.imsglobal.org/xsd/imsdt_v1p0"
+
+                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+                        <title>{TitleDiscussionTopic}</title>
+
+                        <text texttype="text/plain">{DescriptionDiscussionTopic}</text>
+
+                    </dt:topic>';
+
+        //file Descrittore senza la descrizione del forum
+        $fileDesDT = '<?xml version="1.0" encoding="UTF-8"?>
+
+                    <dt:topic
+
+                        xmlns:dt="http://www.imsglobal.org/xsd/imsdt_v1p0"
+
+                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+                        <title>{TitleDiscussionTopic}</title>
+
+                        <text/>
+
+                    </dt:topic>';
+
+               $f['title'] = htmlspecialchars($f['title']);
+               $f['description'] = htmlspecialchars($f['description']);
+        if (empty($f['description']))
+            $text_file_des_xml = str_replace (array('{TitleDiscussionTopic}', '{DescriptionDiscussionTopic}'), array($f['title'], $f['description']), $fileDesDT);
+        else
+            $text_file_des_xml = str_replace (array('{TitleDiscussionTopic}', '{DescriptionDiscussionTopic}'), array($f['title'], $f['description']), $fileDesDT_D);
+
+        $zipfile->add_file($text_file_des_xml,  'Forum'.$f['id'].'/'.'FileDescriptorForum'.$f['id'].'.xml');
+    }
+    //$zipfile->add_file(file_get_contents('../../images/home-forums_sm.png'),  'resources/home-forums_sm.png');
+}
+
+
+$ims_template_xml['header'] = '<?xml version="1.0" encoding="{COURSE_PRIMARY_LANGUAGE_CHARSET}"?>
+<!--This is an ATutor 1.0 Common Cartridge document-->
+<!--Created from the ATutor Content Package Generator - http://www.atutor.ca-->
+<manifest identifier="MANIFEST-2415ad93fc44817acbe40edfd1ffb1ee" xmlns="http://www.imsglobal.org/xsd/imscc/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1" xmlns:lomimscc="http://ltsc.ieee.org/xsd/imscc/LOM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscc/imscp_v1p1 imscp_v1p2_localised.xsd http://ltsc.ieee.org/xsd/imscc/LOM domainProfile_1/lomLoose_localised.xsd">
+       <metadata>
+               <schema>IMS Common Cartridge</schema>
+           <schemaversion>1.0.0</schemaversion>
+               <lomimscc:lom>
+      <lomimscc:general>
+        <lomimscc:identifier>          
+                       <lomimscc:catalog>ATutor</lomimscc:catalog>
+                       <lomimscc:entry></lomimscc:entry>
+        </lomimscc:identifier>
+        <lomimscc:title>
+                       <lomimscc:string language="{COURSE_PRIMARY_LANGUAGE_CODE}">{COURSE_TITLE}</lomimscc:string>
+        </lomimscc:title>
+        <lomimscc:language>en</lomimscc:language>
+        <lomimscc:description> 
+                       <lomimscc:string language="{COURSE_PRIMARY_LANGUAGE_CODE}">{COURSE_DESCRIPTION}</lomimscc:string>
+        </lomimscc:description>
+        <lomimscc:keyword>
+                       <lomimscc:string language="{COURSE_PRIMARY_LANGUAGE_CODE}">{KEYWORDS}</lomimscc:string>
+        </lomimscc:keyword>
+      </lomimscc:general>
+    </lomimscc:lom>
+       </metadata>'
+;
+
+$ims_template_xml['resource'] = '              <resource identifier="MANIFEST01_RESOURCE{CONTENT_ID}" type="webcontent" href="resources/{PATH}{CONTENT_ID}.html">
+                       <metadata/>
+                       <file href="resources/{PATH}{CONTENT_ID}.html"/>{FILES}
+                        {DEPENDENCY}
+               </resource>
+'."\n";
+$ims_template_xml['resource_glossary'] = '             <resource identifier="MANIFEST01_RESOURCE_GLOSSARY" type="associatedcontent/imscc_xmlv1p0/learning-application-resource" href="resources/GlossaryItem/glossary.xml">
+                       <metadata/>
+                       <file href="resources/GlossaryItem/glossary.xml"/>
+               </resource>
+'."\n";
+$ims_template_xml['resource_test'] = '         <resource identifier="MANIFEST01_RESOURCE_QTI{TEST_ID}" type="imsqti_xmlv1p2/imscc_xmlv1p0/assessment">
+                       <metadata/>
+                       <file href="QTI/{PATH}"/>{FILES}
+               </resource>
+'."\n";
+$ims_template_xml['resource_weblink'] = '              <resource identifier="MANIFEST01_RESOURCE{CONTENT_ID}" type="imswl_xmlv1p0">
+                       <metadata/>
+                       <file href="Weblinks/{PATH}"/>
+               </resource>
+'."\n";
+$ims_template_xml['file'] = '                  <file href="resources/{FILE}"/>'."\n";
+$ims_template_xml['xml'] = '                   <file href="{FILE}"/>'."\n";
+$ims_template_xml['glossary'] = '                      <item identifier="GlossaryItem" identifierref="MANIFEST01_RESOURCE_GLOSSARY">
+                               <title>Glossary</title>
+                       </item>';
+$ims_template_xml['test'] = '                  <item identifier="QTI{TEST_ID}" identifierref="MANIFEST01_RESOURCE_QTI{TEST_ID}">
+                               <title>Test {TEST_ID}</title>
+                       </item>';
+$ims_template_xml['file_meta'] = '                     <file href="{FILE}">
+                               <metadata>
+                               {FILE_META_DATA}
+                               </metadata>
+                       </file>'."\n";
+
+$ims_template_xml['final'] = '
+       <organizations>
+               <organization identifier="MANIFEST01_ORG1" structure="rooted-hierarchy">
+                       <item identifier="resources">           
+               {ORGANIZATIONS}
+                   </item>
+               </organization>
+       </organizations>
+       <resources>
+{RESOURCES}
+       </resources>
+</manifest>';
+
+$html_template = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
+       <title>{TITLE}</title>
+       <meta name="Generator" content="ATutor">
+       <meta name="Keywords" content="{KEYWORDS}">
+</head>
+<body>{CONTENT}</body>
+</html>';
+
+$html_content_template = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
+       {HEAD}
+       <title>{TITLE}</title>
+       <meta name="Generator" content="ATutor">
+       <meta name="Keywords" content="{KEYWORDS}">
+</head>
+<body>{CONTENT}</body>
+</html>';
+
+$default_html_style = '        <style type="text/css">
+       body { font-family: Verdana, Arial, Helvetica, sans-serif;}
+       a.at-term {     font-style: italic; }
+       </style>';
+       
+//output this as header.html
+$html_mainheader = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
+       <link rel="stylesheet" type="text/css" href="ims.css"/>
+       <title>{COURSE_TITLE}</title>
+</head>
+<body class="headerbody"><h3>{COURSE_TITLE}</h3></body></html>';
+
+
+$html_toc = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
+       <link rel="stylesheet" type="text/css" href="ims.css" />
+       <title></title>
+</head>
+<body>{TOC}</body></html>';
+
+// index.html
+$html_frame = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+   "http://www.w3.org/TR/html4/frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
+       <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
+       <title>{COURSE_TITLE}</title>
+</head>
+<frameset rows="50,*,50">
+<frame src="header.html" name="header" title="header" scrolling="no">
+       <frameset cols="25%, *" frameborder="1" framespacing="3">
+               <frame frameborder="2" marginwidth="0" marginheight="0" src="toc.html" name="frame" title="TOC">
+               <frame frameborder="2" src="resources/{PATH}{FIRST_ID}.html" name="body" title="{COURSE_TITLE}">
+       </frameset>
+<frame src="footer.html" name="footer" title="footer" scrolling="no">
+       <noframes>
+               <h1>{COURSE_TITLE}</h1>
+      <p><a href="toc.html">Table of Contents</a> | <a href="footer.html">About</a><br />
+         </p>
+  </noframes>
+</frameset>
+</html>';
+
+
+
+$glossary_xml = '<?xml version="1.0" encoding="{COURSE_PRIMARY_LANGUAGE_CHARSET}"?>
+<!--This is an ATutor Glossary terms document-->
+<!--Created from the ATutor Content Package Generator - http://www.atutor.ca-->
+<glossary:glossary xmlns:glossary="http://www.atutor.ca/xsd/glossary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+      {GLOSSARY_TERMS}
+</glossary:glossary>
+';
+
+$glossary_term_xml = ' <item>
+               <term>{TERM}</term>
+               <definition>{DEFINITION}</definition>
+       </item>';
+
+$glossary_body_html = '<h2>Glossary</h2>
+       <ul>
+{BODY}
+</ul>';
+
+$glossary_term_html = '        <li><a name="{ENCODED_TERM}"></a><strong>{TERM}</strong><br />
+               {DEFINITION}<br /><br /></li>';
+
+?>
similarity index 72%
rename from docs/include/jscripts/handleResponse.js
rename to docs/include/jscripts/handleAjaxResponse.js
index 5bf36ce..780fad7 100644 (file)
@@ -9,14 +9,16 @@
 //* as published by the Free Software Foundation.                        */\r
 //************************************************************************/\r
 \r
-// Parse returned data from ajax php script and display messages in div\r
-// with id "rtn-msg".\r
+// Parse the returned data array from php script and display messages in div #rtn-msg\r
 // @parameter: data   - array\r
-//  data array structure\r
-//  data['status'] = 'fail';  // fail or success\r
-//  data['num_of_errors'] = 3;\r
-//  data['num_of_feedbacks'] = 2;\r
-//  data['num_of_warnings'] = 1;\r
+//  success data array structure\r
+//  data['status'] = 'success';\r
+//  data['success'][] = 'success 1';\r
+//  data['success'][] = 'success 2';\r
+//  data['success'][] = 'success 3';\r
+\r
+//  fail data array structure\r
+//  data['status'] = 'fail';\r
 //  data['error'][] = 'error 1';\r
 //  data['error'][] = 'error 2';\r
 //  data['error'][] = 'error 3';\r
 //  data['feedback'][] = 'feedback 2';\r
 //\r
 //  data['warning'][] = 'warning 1';\r
-function handleResponse(data)\r
+function handleAjaxResponse(data)\r
 {\r
        var msg='';\r
        \r
        if (data == null) return;\r
        \r
-       if (typeof(data.status) == "undefined" || data.status == "success"\r
+       if (typeof(data.status) == "undefined") \r
        {\r
                jQuery('#rtn-msg').empty();\r
                return;\r
        }\r
        \r
-       // data.status == "fail", handle messages\r
+       // handle success message\r
+       if (typeof(data.status) == "undefined" || data.status == "success") \r
+       {\r
+               msg += template_feedback_prefix;\r
+               \r
+//             if (typeof(data.success) == "undefined") {\r
+//                     msg += "<li>Action completed successfully.</li>";\r
+//             }\r
+//             else {\r
+                       for(i=0; i<data.success.length; i++)\r
+                       {\r
+                               if (data.success[i] != "") msg += "<li>"+data.success[i]+"</li>";\r
+                       }\r
+//             }\r
+               msg += template_suffix;\r
+       }\r
+       \r
+       // handle fail messages\r
        if (typeof(data.error) != "undefined")\r
        {\r
                msg += template_error_prefix;\r
diff --git a/docs/include/jscripts/transformable.js b/docs/include/jscripts/transformable.js
new file mode 100644 (file)
index 0000000..099b70f
--- /dev/null
@@ -0,0 +1,211 @@
+// ************************************************************************\r
+// * Transformable                                                        *\r
+// ************************************************************************\r
+// * Copyright (c) 2009                                                   *\r
+// * Adaptive Technology Resource Centre / University of Toronto          *\r
+// *                                                                      *\r
+// * This program is free software. You can redistribute it and/or        *\r
+// * modify it under the terms of the GNU General Public License          *\r
+// * as published by the Free Software Foundation.                        *\r
+// ************************************************************************\r
+\r
+var newwindow;\r
+\r
+function poptastic(url) {\r
+       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');\r
+       if (window.focus) {newwindow.focus()}\r
+}\r
+\r
+function getexpirydate(nodays){\r
+       var UTCstring;\r
+       Today = new Date();\r
+       nomilli=Date.parse(Today);\r
+       Today.setTime(nomilli+nodays*24*60*60*1000);\r
+       UTCstring = Today.toUTCString();\r
+       return UTCstring;\r
+}\r
+\r
+function setcookie(name,value,duration){\r
+       cookiestring=name+"="+escape(value)+";path=/;expires="+getexpirydate(duration);\r
+       document.cookie=cookiestring;\r
+       if(!getcookie(name)){\r
+               return false;\r
+       } else {\r
+               return true;\r
+       }\r
+}\r
+\r
+function getcookie(cookiename) {\r
+       var cookiestring=""+document.cookie;\r
+       var index1=cookiestring.indexOf(cookiename);\r
+       if (index1==-1 || cookiename=="") return ""; \r
+       var index2=cookiestring.indexOf(';',index1);\r
+       if (index2==-1) index2=cookiestring.length; \r
+       return unescape(cookiestring.substring(index1+cookiename.length+1,index2));\r
+}\r
+\r
+function setDisplay(objId) {\r
+       var toc = document.getElementById(objId);\r
+\r
+       var state = getcookie(objId);\r
+       if (document.getElementById(objId) && state && (state == 'none')) {\r
+               toggleToc(objId);\r
+       }\r
+}\r
+\r
+\r
+function setstates() {\r
+       return;\r
+       var objId = "side-menu";\r
+       var state = getcookie(objId);\r
+       if (document.getElementById(objId) && state && (state == 'none')) {\r
+               toggleToc(objId);\r
+       }\r
+\r
+       var objId = "toccontent";\r
+       var state = getcookie(objId);\r
+       if (document.getElementById(objId) && state && (state == 'none')) {\r
+               toggleToc(objId);\r
+       }\r
+\r
+}\r
+\r
+function showTocToggle(objId, show, hide, key, selected) {\r
+       if(document.getElementById) {\r
+               if (key) {\r
+                       var accesskey = " accesskey='" + key + "' title='"+ show + "/" + hide + " Alt - "+ key +"'";\r
+               } else {\r
+                       var accesskey = "";\r
+               }\r
+\r
+               if (selected == 'hide') {\r
+                       document.writeln('<a href="javascript:toggleToc(\'' + objId + '\')" ' + accesskey + '>' +\r
+                       '<span id="' + objId + 'showlink" style="display:none;">' + show + '</span>' +\r
+                       '<span id="' + objId + 'hidelink">' + hide + '</span>'  + '</a>');\r
+               } else {\r
+                       document.writeln('<a href="javascript:toggleToc(\'' + objId + '\')" ' + accesskey + '>' +\r
+                       '<span id="' + objId + 'showlink">' + show + '</span>' +\r
+                       '<span id="' + objId + 'hidelink" style="display:none;">' + hide + '</span>'    + '</a>');\r
+               }\r
+       }\r
+}\r
+\r
+function toggleToc(objId) {\r
+       var toc = document.getElementById(objId);\r
+       if (toc == null) {\r
+               return;\r
+       }\r
+       var showlink=document.getElementById(objId + 'showlink');\r
+       var hidelink=document.getElementById(objId + 'hidelink');\r
+\r
+       if (hidelink.style.display == 'none') {\r
+               document.getElementById('contentcolumn').id="contentcolumn_shiftright";\r
+               jQuery("[id="+objId+"]").slideDown("slow");\r
+               hidelink.style.display='';\r
+               showlink.style.display='none';\r
+       } else {\r
+               document.getElementById('contentcolumn_shiftright').id="contentcolumn";\r
+               jQuery("[id="+objId+"]").slideUp("slow");\r
+               hidelink.style.display='none';\r
+               showlink.style.display='';\r
+       }\r
+       setcookie(objId, hidelink.style.display, 1);\r
+}\r
+\r
+// toggle content folder in side menu "content navigation"\r
+function toggleFolder(cid, expand_text, collapse_text)\r
+{\r
+       if (jQuery("#tree_icon"+cid).attr("src") == tree_collapse_icon) {\r
+               jQuery("#tree_icon"+cid).attr("src", tree_expand_icon);\r
+               jQuery("#tree_icon"+cid).attr("alt", expand_text);\r
+               jQuery("#tree_icon"+cid).attr("title", expand_text);\r
+               setcookie("c<?php echo $this->course_id;?>_"+cid, null, 1);\r
+       }\r
+       else {\r
+               jQuery("#tree_icon"+cid).attr("src", tree_collapse_icon);\r
+               jQuery("#tree_icon"+cid).attr("alt", collapse_text);\r
+               jQuery("#tree_icon"+cid).attr("title", collapse_text);\r
+               setcookie("c<?php echo $this->course_id;?>_"+cid, "1", 1);\r
+       }\r
+       \r
+       jQuery("#folder"+cid).slideToggle();\r
+}\r
+\r
+// toggle elements in side menu\r
+function elementToggle(elem, title, base_path, show_text, hide_text)\r
+{\r
+       element_collapse_icon = base_path+"images/mswitch_minus.gif";\r
+       element_expand_icon = base_path+"images/mswitch_plus.gif";\r
+       \r
+       if (jQuery(elem).attr("src") == element_collapse_icon) {\r
+               jQuery(elem).attr("src", element_expand_icon);\r
+               jQuery(elem).attr("alt", show_text + " "+ title);\r
+               jQuery(elem).attr("title", show_text + " "+ title);\r
+               setcookie("m_"+title, 0, 1);\r
+       }\r
+       else {\r
+               jQuery(elem).attr("src", element_collapse_icon);\r
+               jQuery(elem).attr("alt", hide_text + " "+ title);\r
+               jQuery(elem).attr("title", hide_text + " "+ title);\r
+               setcookie("m_"+title, null, 1);;\r
+       }\r
+       \r
+       jQuery(elem).parent().next().slideToggle();\r
+}\r
+\r
+function printSubmenuHeader(title, base_path, show_text, hide_text)\r
+{\r
+       if (getcookie("m_"+title) == "0")\r
+       {\r
+               image = base_path + "images/mswitch_plus.gif";\r
+               alt_text = show_text + title;\r
+       }\r
+       else\r
+       {\r
+               image = base_path+"images/mswitch_minus.gif";\r
+               alt_text = hide_text + title;\r
+       }\r
+       \r
+       document.writeln('<h4 class="box">'+\r
+       '       <input src="'+image+'"' + \r
+       '              onclick="elementToggle(this, \''+title+'\', \''+base_path+'\', \''+show_text+'\', \''+hide_text+'\'); return false;"' +\r
+       '              alt="'+ alt_text + '" ' +\r
+       '              title="'+ alt_text + '"' +\r
+       '              style="float:right" type="image" /> '+ title +\r
+       '</h4>');\r
+}\r
+\r
+var selected;\r
+\r
+function rowselect(obj) {\r
+       obj.className = 'selected';\r
+       if (selected && selected != obj.id)\r
+               document.getElementById(selected).className = '';\r
+       selected = obj.id;\r
+}\r
+function rowselectbox(obj, checked, handler) {\r
+       var functionDemo = new Function(handler + ";");\r
+       functionDemo();\r
+\r
+       if (checked)\r
+               obj.className = 'selected';\r
+       else\r
+               obj.className = '';\r
+}\r
+\r
+/**\r
+ * Easy to define namespace.\r
+ * Usage: namespace('Trans', 'Trans.course')\r
+ */\r
+namespace = function() { \r
+    var a=arguments, o=null, i, j, d; \r
+    for (i=0; i<a.length; i=i+1) { \r
+        d=a[i].split("."); \r
+        o=window; \r
+        for (j=0; j<d.length; j=j+1) { \r
+            o[d[j]]=o[d[j]] || {}; \r
+            o=o[d[j]]; \r
+        } \r
+    } \r
+    return o; \r
+}; \r
diff --git a/docs/include/lib/filemanager.inc.php b/docs/include/lib/filemanager.inc.php
deleted file mode 100644 (file)
index 02f3fb4..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-<?php
-/************************************************************************/
-/* Transformable                                                        */
-/************************************************************************/
-/* Copyright (c) 2009                                                   */
-/* Adaptive Technology Resource Centre / University of Toronto          */
-/*                                                                      */
-/* 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.                        */
-/************************************************************************/
-
-if (!defined('TR_INCLUDE_PATH')) { exit; }
-
-/**
-* Allows the copying of entire directories.
-* @access  public
-* @param   string $source              the source directory
-* @param   string $dest                        the destination directory
-* @return  boolean                             whether the copy was successful or not
-* @link           http://www.php.net/copy
-* @author  www at w8c dot com
-*/
-function copys($source,$dest)
-{
-       if (!is_dir($source)) {
-               return false;
-       }
-       if (!is_dir($dest))     {
-               mkdir($dest);
-       }
-       
-       $h=@dir($source);
-       while (@($entry=$h->read()) !== false) {
-               if (($entry == '.') || ($entry == '..')) {
-                       continue;
-               }
-
-               if (is_dir("$source/$entry") && $dest!=="$source/$entry") {
-                       copys("$source/$entry", "$dest/$entry");
-               } else {
-                       @copy("$source/$entry", "$dest/$entry");
-               }
-       }
-       $h->close();
-       return true;
-} 
-
-/**
-* Enables deletion of directory if not empty
-* @access  public
-* @param   string $dir         the directory to delete
-* @return  boolean                     whether the deletion was successful
-* @author  Joel Kronenberg
-*/
-function clr_dir($dir) {
-       if(!$opendir = @opendir($dir)) {
-               return false;
-       }
-       
-       while(($readdir=readdir($opendir)) !== false) {
-               if (($readdir !== '..') && ($readdir !== '.')) {
-                       $readdir = trim($readdir);
-
-                       clearstatcache(); /* especially needed for Windows machines: */
-
-                       if (is_file($dir.'/'.$readdir)) {
-                               if(!@unlink($dir.'/'.$readdir)) {
-                                       return false;
-                               }
-                       } else if (is_dir($dir.'/'.$readdir)) {
-                               /* calls itself to clear subdirectories */
-                               if(!clr_dir($dir.'/'.$readdir)) {
-                                       return false;
-                               }
-                       }
-               }
-       } /* end while */
-
-       @closedir($opendir);
-       
-       if(!@rmdir($dir)) {
-               return false;
-       }
-       return true;
-}
-
-/**
-* Calculate the size in Bytes of a directory recursively.
-* @access  public
-* @param   string $dir         the directory to traverse
-* @return  int                         the total size in Bytes of the directory
-* @author  Joel Kronenberg
-*/
-function dirsize($dir) {
-       if (is_dir($dir)) {
-               $dh = @opendir($dir);
-       }
-       if (!$dh) {
-               return -1;
-       }
-       $size = 0;
-       while (($file = readdir($dh)) !== false) {
-    
-               if ($file != '.' && $file != '..') {
-                       $path = $dir.$file;
-                       if (is_dir($path)) {
-                               $size += dirsize($path.'/');
-                       } elseif (is_file($path)) {
-                               $size += filesize($path);
-                       }
-               }
-                
-       }
-       closedir($dh);
-       //       echo 'something';
-    //  exit;
-       return $size;
- // exit;
-}
-
-/**
-* This function gets used by PclZip when extracting a zip archive.
-* @access  private
-* @return  int                         whether or not to include the file
-* @author  Joel Kronenberg
-*/
-       function preExtractCallBack($p_event, &$p_header) {
-               global $translated_file_names;
-
-               if ($p_header['folder'] == 1) {
-                       return 1;
-               }
-
-               if ($translated_file_names[$p_header['index']] == '') {
-                       return 0;
-               }
-
-               if ($translated_file_names[$p_header['index']]) {
-                       $p_header['filename'] = substr($p_header['filename'], 0, -strlen($p_header['stored_filename']));
-                       $p_header['filename'] .= $translated_file_names[$p_header['index']];
-               }
-               return 1;
-       }
-
-/**
-* This function gets used by PclZip when creating a zip archive.
-* @access  private
-* @return  int                         whether or not to include the file
-* @author  Joel Kronenberg
-*/
-       function preImportCallBack($p_event, &$p_header) {
-               global $IllegalExtentions;
-
-               if ($p_header['folder'] == 1) {
-                       return 1;
-               }
-
-               $path_parts = pathinfo($p_header['filename']);
-               $ext = $path_parts['extension'];
-
-               if (in_array($ext, $IllegalExtentions)) {
-                       return 0;
-               }
-
-               return 1;
-       }
-
-
-/* prints the <options> out of $cats which is an array of course categories where */
-/* $cats[parent_cat_id][] = $row */
-function print_course_cats($parent_cat_id, &$cats, $cat_row, $depth=0) {
-       $my_cats = $cats[$parent_cat_id];
-       if (!is_array($my_cats)) {
-               return;
-       }
-       foreach ($my_cats as $cat) {
-
-               echo '<option value="'.$cat['cat_id'].'"';
-               if($cat['cat_id'] == $cat_row){
-                       echo  ' selected="selected"';
-               }
-               echo '>';
-               echo str_pad('', $depth, '-');
-               echo $cat['cat_name'].'</option>'."\n";
-
-               print_course_cats($cat['cat_id'], $cats,  $cat_row, $depth+1);
-       }
-}
-
-// returns the most appropriate representation of Bytes in MB, KB, or B
-function get_human_size($num_bytes) {
-       $abs_num_bytes = abs($num_bytes);
-
-       if ($abs_num_bytes >= TR_KBYTE_SIZE * TR_KBYTE_SIZE) {
-               return round(bytes_to_megabytes($num_bytes), 2) .' '. _AT('mb');
-       } else if ($abs_num_bytes >= TR_KBYTE_SIZE) {
-               return round(bytes_to_kilobytes($num_bytes), 2) .' '._AT('kb') ;
-       }
-       // else:
-
-       return $num_bytes . ' '._AT('bt');
-}
-
-/**
-* Returns the MB representation of inputed bytes
-* @access  public
-* @param   int $num_bytes      the input bytes to convert
-* @return  int                         MB representation of $num_bytes
-* @author  Heidi Hazelton
-*/
-function bytes_to_megabytes($num_bytes) {
-       return $num_bytes/TR_KBYTE_SIZE/TR_KBYTE_SIZE;
-}
-
-/**
-* Returns the Byte representation of inputed MB
-* @access  public
-* @param   int $num_bytes      the input MB to convert
-* @return  int                         the Bytes representation of $num_bytes
-* @author  Heidi Hazelton
-*/
-function megabytes_to_bytes($num_bytes) {
-       return $num_bytes*TR_KBYTE_SIZE*TR_KBYTE_SIZE;
-}
-
-/**
-* Returns the KB representation of inputed Bytes
-* @access  public
-* @param   int $num_bytes      the input Bytes to convert
-* @return  int                         the KB representation of $num_bytes
-* @author  Heidi Hazelton
-*/
-function bytes_to_kilobytes($num_bytes) {
-       return $num_bytes/TR_KBYTE_SIZE;
-}
-
-/**
-* Returns the Bytes representation of inputed KBytes
-* @access  public
-* @param   int $num_bytes      the input KBytes to convert
-* @return  int                         the KBytes representation of $num_bytes
-* @author  Heidi Hazelton
-*/
-function kilobytes_to_bytes($num_bytes) {
-       return $num_bytes*TR_KBYTE_SIZE;
-}
-
-/**
-* Outputs the directories associated with a course in the form of <option> elements.
-* @access public
-* @param  string $cur_dir  the current directory to include in the options.
-* @author Norma Thompson
-*/
-function output_dirs($current_path,$cur_dir,$indent) {
-       // open the cur_dir
-       if ($dir = opendir($current_path.$cur_dir)) {
-
-               // recursively call output_dirs() for all directories in this directory
-               while (false !== ($file = readdir($dir)) ) {
-
-                       //if the name is not a directory 
-                       if( ($file == '.') || ($file == '..') ) {
-                               continue;
-                       }
-
-                       // if it is a directory call function
-                       if(is_dir($current_path.$cur_dir.$file)) {
-                               $ldir = explode('/',$cur_dir.$file);
-                               $count = count($ldir);
-                               $label = $ldir[$count-1];
-                               
-                               $dir_option .= '<option value="'.$cur_dir.$file.'/" >'.$indent.$label.'</option>';
-
-                               $dir_option .= output_dirs($current_path,$cur_dir.$file.'/',$indent.'--');
-                       }
-                       
-               } // end while  
-               
-               closedir($dir); 
-       }
-       return $dir_option;
-}
-
-function display_tree($current_path, $cur_dir, $pathext, $ignore_children = false) {
-       // open the cur_dir
-       static $list_array;
-       if (!isset($list_array)) {
-               $list_array = explode(',', $_GET['list']);
-       }
-       if ($dir = opendir($current_path . $cur_dir)) {
-
-               // recursively call output_dirs() for all directories in this directory
-               while (false !== ($file = readdir($dir)) ) {
-
-                       //if the name is not a directory 
-                       if( ($file == '.') || ($file == '..') ) {
-                               continue;
-                       }
-
-                       // if it is a directory call function
-                       if (is_dir($current_path . $cur_dir . $file)) {
-
-                               //$ldir = explode('/',$cur_dir.$file);
-                               //$count = count($ldir);
-                               //$label = $ldir[$count-1];
-
-                               $check = '';
-                               $here  = '';
-                               if ($cur_dir . $file == substr($pathext, 0, -1)) {
-                                       $check = 'checked="checked"';
-                                       $here = ' ' . _AT('current_location');
-                               } else if (($cur_dir == $pathext) && in_array($file, $list_array)) {
-                                       $ignore_children = true;
-                               }
-
-                               if ($ignore_children) {
-                                       $check = 'disabled="disabled"';
-                                       $class = ' disabled';
-                               }
-
-                               $dir_option .= '<ul><li class="folders'.$class.'">';
-                               $dir_option .= '<label><input type="radio" name="dir_name" value="'.$cur_dir.$file.'" '.$check. '/>'. $file . $here. '</label>';
-                               $dir_option .= ''.display_tree($current_path,$cur_dir.$file.'/', $pathext, $ignore_children).'';
-                               $dir_option .= '</li></ul>';
-
-                               if (($cur_dir == $pathext) && in_array($file, $list_array)) {
-                                       $ignore_children = false;
-                                       $class = '';
-                               }
-                       }
-
-                       
-               } // end while  
-               
-               closedir($dir); 
-       }
-       return $dir_option;
-}
-
-function course_realpath($file) {
-       if (!$_SESSION['course_id']) {
-               return FALSE;
-       }
-       
-       $course_path = TR_CONTENT_DIR . $_SESSION['course_id'];
-       
-       $path_parts = pathinfo($file);
-       
-       $dir_name   = $path_parts['dirname'];
-       $file_name  = $path_parts['basename'];
-       $ext_name   = $path_parts['extension'];
-
-       //1. determine the real path of the file/directory
-       if (is_dir($dir_name.DIRECTORY_SEPARATOR.$file_name) && $ext_name == '') {
-               //if directory ws passed through (moving file to diff directory)
-               $real = realpath($dir_name . DIRECTORY_SEPARATOR . $file_name);
-       } else {
-               //if file was passed through or no existant direcotry was passed through (rename/creating dir)
-               $real = realpath($dir_name);
-       }
-
-       //2. and whether its in the course content directory
-       if (substr($real, 0, strlen($course_path)) != $course_path) {
-               return FALSE;
-       }
-
-       //3. check if extensions are legal
-
-       //4. Otherwise return the real path of the file
-       return $real;
-}
-
-/**
-* Returns canonicalized absolute pathname to a file/directory in the content directory
-* @access public
-* @param  string $file the relative path to the file or directory
-* @return  string      the full path to the file or directory, FALSE if it does not exist in our content directory.
-*/
-function course_realpath_NEW_VERSION($file) {
-       if (!$_SESSION['course_id']) {
-               return FALSE;
-       }
-       
-       $course_path = TR_CONTENT_DIR . $_SESSION['course_id'];
-
-       // determine the real path of the file/directory
-       $real = realpath($course_path . DIRECTORY_SEPARATOR . $file);
-       
-       if (!file_exists($real)) {
-               // the file or directory does not exist
-               return FALSE;
-
-       } else if (substr($real, 0, strlen($course_path)) != $course_path) {
-               // the file or directory is not in the content path
-               return FALSE;
-
-       } else {
-               // Otherwise return the real path of the file
-               return $real;
-       }
-}
-
-/**
-* Returns the name of the readme file in the given directory
-* @access public
-* @param  string $dir_name the name of the directory
-* @return  string      the name of the readme file
-*/
-function get_readme($dir)
-{
-       if (!is_dir($dir)) return '';
-       
-       $dh = opendir($dir);
-       
-       while (($file = readdir($dh)) !== false) {
-               if (stristr($file, 'readme') && substr($file, -4) <> '.php')
-                       return $file;
-       }
-       
-       closedir($dh);
-       return '';
-}
-?>
\ No newline at end of file
index 354ab90..e4760d4 100644 (file)
@@ -166,7 +166,7 @@ function _AT() {
        TR_DATE_UNIX_TIMESTAMP:         seconds since epoch
        TR_DATE_INDEX_VALUE:            0-x, index into a date array
 */
-function TR_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL_DATETIME) {   
+function AT_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL_DATETIME) {   
        static $day_name_ext, $day_name_con, $month_name_ext, $month_name_con;
        global $_config;
 
@@ -242,7 +242,7 @@ function TR_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL
                $hour   = substr($timestamp,11,2);
                $min    = substr($timestamp,14,2);
                $sec    = substr($timestamp,17,2);
-           $timestamp  = mktime($hour, $min, $sec, $month, $day, $year);
+               $timestamp      = mktime($hour, $min, $sec, $month, $day, $year);
 
        } else if ($formTR_type == TR_DATE_MYSQL_TIMESTAMP_14) {
            $year               = substr($timestamp,0,4);
@@ -270,6 +270,7 @@ function TR_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL
        $num_tokens = count($tokens);
 
        $output = $format;
+       
        for ($i=0; $i<$num_tokens; $i++) {
                $tokens[$i] = substr($tokens[$i],0,1);
 
@@ -286,7 +287,6 @@ function TR_date($format='%Y-%M-%d', $timestamp = '', $formTR_type=TR_DATE_MYSQL
                        $output = str_replace('%M', _AT($month_name_con[date('n', $timestamp)-1]),$output);
 
                } else {
-
                        /* this token doesn't need translating */
                        $value = date($tokens[$i], $timestamp);
                        if ($value != $tokens[$i]) {
diff --git a/docs/include/lib/pclzip_callback.lib.php b/docs/include/lib/pclzip_callback.lib.php
new file mode 100644 (file)
index 0000000..17e29d3
--- /dev/null
@@ -0,0 +1,44 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+/**\r
+* File utility functions \r
+* @access      public\r
+* @author      Cindy Qi Li\r
+*/\r
+\r
+if (!defined('TR_INCLUDE_PATH')) exit;\r
+\r
+/**\r
+* This function gets used by PclZip when creating a zip archive.\r
+* @access  public\r
+* @return  int                         whether or not to include the file\r
+* @author  Joel Kronenberg\r
+*/\r
+function preImportCallBack($p_event, &$p_header) {\r
+       global $IllegalExtentions;\r
+\r
+       if ($p_header['folder'] == 1) {\r
+               return 1;\r
+       }\r
+\r
+       $path_parts = pathinfo($p_header['filename']);\r
+       $ext = $path_parts['extension'];\r
+\r
+       if (in_array($ext, $IllegalExtentions)) {\r
+               return 0;\r
+       }\r
+\r
+       return 1;\r
+}\r
+\r
+?>
\ No newline at end of file
index 6f069d9..791ec99 100644 (file)
@@ -85,6 +85,10 @@ if (in_array(TR_PRIV_HOME, $privs))
        $_pages['home/search.php']['title_var'] = 'search_results';\r
        $_pages['home/search.php']['parent']    = TR_NAV_PUBLIC;\r
        \r
+       // $_pages['home/course/search.php']['title_var'] is defined in home/course/outline.php with current course title\r
+       $_pages['home/course/outline.php']['parent']    = 'home/index.php';\r
+       $_pages['home/course/outline.php']['title_var'] = 'outline';\r
+       \r
        if (isset($_current_user) && $_current_user->isAuthor())\r
        {\r
                $_pages['home/index.php']['children']  = array_merge(array('home/create_course.php'), isset($_pages['home/index.php']['children']) ? $_pages['home/index.php']['children'] : array());\r
@@ -92,6 +96,13 @@ if (in_array(TR_PRIV_HOME, $privs))
                $_pages['home/create_course.php']['title_var'] = 'create_course';\r
                $_pages['home/create_course.php']['parent']    = 'home/index.php';\r
                $_pages['home/create_course.php']['guide']    = 'TR_HELP_CREATE_COURSE';\r
+\r
+               $_pages['home/course/del_course.php']['title_var'] = 'del_course';\r
+               $_pages['home/course/del_course.php']['parent']    = 'home/index.php';\r
+               \r
+               $_pages['home/course/course_property.php']['title_var'] = 'course_property';\r
+               $_pages['home/course/course_property.php']['parent']    = 'home/index.php';\r
+               $_pages['home/course/course_property.php']['guide']    = 'TR_HELP_COURSE_PROPERTY';\r
        }\r
 }\r
 \r
diff --git a/docs/include/side_menu.inc.php b/docs/include/side_menu.inc.php
new file mode 100644 (file)
index 0000000..7660427
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+if (!defined('TR_INCLUDE_PATH')) { exit; }
+require_once(TR_INCLUDE_PATH.'vitals.inc.php');
+require_once(TR_INCLUDE_PATH.'classes/DAO/CoursesDAO.class.php');
+
+global $_base_path;
+global $savant;
+global $contentManager, $_course_id;
+
+ob_start();
+
+echo '<div style="white-space:nowrap;">';
+
+echo '<a href="'.$_base_path.'home/course/outline.php?_course_id='.$_course_id.'">'._AT('outline').'</a><br />';
+
+/* @See classes/ContentManager.class.php       */
+$contentManager->printMainMenu();
+
+echo '</div>';
+
+$savant->assign('dropdown_contents', ob_get_contents());
+ob_end_clean();
+
+$coursesDAO = new CoursesDAO();
+$course_row = $coursesDAO->get($_course_id);
+
+$savant->assign('title', $course_row['title']);
+//$savant->assign('title', _AT('content_navigation'));
+$savant->display('include/box.tmpl.php');
+?>
\ No newline at end of file
index 37e4f41..7ac42b2 100644 (file)
@@ -44,7 +44,8 @@ function unregister_GLOBALS() {
  * 7. initialize theme and template management
  * 8. initialize a user instance without user id. 
  *    if $_SESSION['user_id'] is set, it's assigned to instance in include/header.inc.php
- * 9. register pages based on current user's priviledge 
+ * 9. register pages based on current user's priviledge
+ * 10. initialize course information if $_SESSION['course_id'] is set 
  ***/
 
 /**** 0. start system configuration options block ****/
@@ -107,6 +108,8 @@ if (is_array($rows))
 define('EMAIL',                     $_config['contact_email']);
 define('SITE_NAME',                 $_config['site_name']);
 $MaxFileSize       = $_config['max_file_size']; 
+$MaxCourseSize     = $_config['max_course_size'];
+$MaxFileSize       = $_config['max_file_size']; 
 $IllegalExtentions = explode('|',$_config['illegal_extentions']);
 /***** end loading $_config *****/
 
@@ -195,6 +198,67 @@ if (isset($_SESSION['user_id']) && $_SESSION['user_id'] > 0)
 /*** 9. register pages based on user's priviledge ***/
 require_once(TR_INCLUDE_PATH.'page_constants.inc.php');
 
+/* 10. initialize course information if $course_id or $cid is set 
+ * This section generates global variables: 
+ * $_content_id if set, 
+ * $_course_id if set or $cid is set
+ * $_SESSION['s_cid']: record the last content_id on (user_id + course_id) basis
+ * $_sequence_links: resume/first/next/previous content links
+ */ 
+if (intval($_REQUEST['_cid']) > 0) $_content_id = intval($_REQUEST['_cid']);
+else if (intval($_POST['_cid']) > 0) $_content_id = intval($_POST['_cid']);
+
+if (intval($_REQUEST['_course_id']) > 0) $_course_id = intval($_REQUEST['_course_id']);
+else if (intval($_POST['_course_id']) > 0) $_course_id = intval($_POST['_course_id']);
+
+// find course_id thru content_id
+if ($_content_id > 0)
+{
+       include_once(TR_INCLUDE_PATH.'classes/DAO/ContentDAO.class.php');
+       $contentDAO = new ContentDAO();
+       $content_row = $contentDAO->get($_content_id);
+       $_course_id = $content_row['course_id'];
+}
+
+// Generate $_SESSION['s_cid']: record the last visited content_id
+// for authors and the users who have the current course in "my courses" list, 
+//     save the last visited content_id into user_courses and set the session var.
+//     @see ContentUtility::saveLastCid()
+// for the users who don't have the current course in "my courses" list,
+//     set the session var as $_GET['cid']
+if ($_course_id > 0)
+{
+       if ($_SESSION['user_id'] > 0)
+       {
+               include_once(TR_INCLUDE_PATH.'classes/DAO/UserCoursesDAO.class.php');
+               $userCoursesDAO = new UserCoursesDAO();
+               $user_courses_row = $userCoursesDAO->get($_SESSION['user_id'], $_course_id);
+               
+               if ($user_courses_row && $user_courses_row['last_cid'] > 0) 
+                       $_SESSION['s_cid'] = $user_courses_row['last_cid'];
+               else if ($_content_id > 0)
+                       $_SESSION['s_cid'] = $_content_id;
+               else // first time accessing this course, no last cid yet
+                       unset($_SESSION['s_cid']);
+       }
+       else // guest
+       {
+               $_SESSION['s_cid'] = $_content_id;
+       }
+}
+
+// Generate contentManager. 
+// Must be called after generating $_SESSION['s_cid'] as it's used in contentManager class
+if ($_course_id > 0)
+{
+       global $contentManager;
+       
+       include_once(TR_INCLUDE_PATH. '../home/classes/ContentManager.class.php');
+       
+       $contentManager = new ContentManager($_course_id);
+       $_sequence_links = $contentManager->generateSequenceCrumbs($_content_id);
+}
+
 /**
  * This function is used for printing variables for debugging.
  * @access  public
@@ -239,7 +303,7 @@ function debug_to_log($var, $log='') {
                return;
        }
        
-       if ($log == '') $log = TR_TEMP_DIR. 'debug.log';
+       if ($log == '') $log = TR_CONTENT_DIR. 'debug.log';
        $handle = fopen($log, 'a');
        fwrite($handle, "\n\n");
        fwrite($handle, date("F j, Y, g:i a"));
@@ -298,6 +362,26 @@ if ( get_magic_quotes_gpc() == 1 ) {
        $stripslashes = 'my_null_slashes';
 }
 
+/**
+ * If MBString extension is loaded, then use it.
+ * Otherwise we will have to use include/utf8 library
+ */
+ if (extension_loaded('mbstring')){
+        $strtolower = 'mb_strtolower';
+        $strtoupper = 'mb_strtoupper';
+        $substr = 'mb_substr';
+        $strpos = 'mb_strpos';
+        $strrpos = 'mb_strrpos';
+        $strlen = 'mb_strlen';
+ } else {
+        $strtolower = 'utf8_strtolower';
+        $strtoupper = 'utf8_strtoupper';
+        $substr = 'utf8_substr';
+        $strpos = 'utf8_strpos';
+        $strrpos = 'utf8_strrpos';
+        $strlen = 'utf8_strlen';
+ }
+
 function get_default_theme() {
        $themesDAO = new ThemesDAO();
        
index c395298..5d1161d 100644 (file)
@@ -38,6 +38,15 @@ CREATE TABLE `content` (
   FULLTEXT(keywords, title, text)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
 \r
+# --------------------------------------------------------\r
+# Table structure for table `course_tests_assoc`\r
+# since 0.1\r
+CREATE TABLE `content_tests_assoc` (\r
+  `content_id` INTEGER UNSIGNED NOT NULL,\r
+  `test_id` INTEGER UNSIGNED NOT NULL,\r
+  PRIMARY KEY (`content_id`, `test_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
 # --------------------------------------------------------\r
 # Table structure for table `courses`\r
 # since 0.1\r
@@ -268,6 +277,155 @@ CREATE TABLE `privileges` (
   PRIMARY KEY  (`privilege_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\r
 \r
+# --------------------------------------------------------\r
+# Table structure for table `tests`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests` (\r
+  `test_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `course_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `title` VARCHAR(255) NOT NULL ,\r
+  `format` tinyint(4) NOT NULL default '0',\r
+  `start_date` datetime NOT NULL default '0000-00-00 00:00:00',\r
+  `end_date` datetime NOT NULL default '0000-00-00 00:00:00',\r
+  `randomize_order` tinyint(4) NOT NULL default '0',\r
+  `num_questions` tinyint(3) unsigned NOT NULL default '0',\r
+  `instructions` TEXT ,\r
+  `content_id` mediumint(8) NOT NULL default '0',\r
+  `result_release` tinyint(4) unsigned NOT NULL default '0',\r
+  `random` tinyint(4) unsigned NOT NULL default '0',\r
+  `difficulty` tinyint(4) unsigned NOT NULL default '0',\r
+  `num_takes` tinyint(4) unsigned NOT NULL default '0',\r
+  `anonymous` tinyint(4) NOT NULL default '0',\r
+  `out_of` varchar(4) NOT NULL default '',\r
+  `guests` TINYINT NOT NULL DEFAULT '0',\r
+  `display` TINYINT NOT NULL DEFAULT '0',\r
+  `description` TEXT,\r
+  `passscore` MEDIUMINT NOT NULL default '0',\r
+  `passpercent` MEDIUMINT NOT NULL default '0',\r
+  `passfeedback` TEXT,\r
+  `failfeedback` TEXT,\r
+  `show_guest_form` TINYINT(1) UNSIGNED NOT NULL default '0',\r
+  PRIMARY KEY  (`test_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
+\r
+# --------------------------------------------------------\r
+# Table structure for table `tests_answers`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests_answers` (\r
+  `result_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `question_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `member_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `answer` TEXT ,\r
+  `score` varchar(5) NOT NULL default '',\r
+  `notes` TEXT ,\r
+  PRIMARY KEY  (`result_id`,`question_id`,`member_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
+\r
+# --------------------------------------------------------\r
+# Table structure for table `tests_groups`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests_groups` (\r
+  `test_id` MEDIUMINT UNSIGNED NOT NULL default '0',\r
+  `group_id` MEDIUMINT UNSIGNED NOT NULL default '0',\r
+  PRIMARY KEY (`test_id`,`group_id`),\r
+  KEY `test_id` (`test_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
+\r
+# --------------------------------------------------------\r
+# Table structure for table `tests_questions`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests_questions` (\r
+  `question_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `category_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `course_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `type` tinyint(3) unsigned NOT NULL default '0',\r
+  `feedback` TEXT ,\r
+  `question` TEXT ,\r
+  `choice_0` TEXT ,\r
+  `choice_1` TEXT ,\r
+  `choice_2` TEXT ,\r
+  `choice_3` TEXT ,\r
+  `choice_4` TEXT ,\r
+  `choice_5` TEXT ,\r
+  `choice_6` TEXT ,\r
+  `choice_7` TEXT ,\r
+  `choice_8` TEXT ,\r
+  `choice_9` TEXT ,\r
+  `answer_0` tinyint(4) NOT NULL default '0',\r
+  `answer_1` tinyint(4) NOT NULL default '0',\r
+  `answer_2` tinyint(4) NOT NULL default '0',\r
+  `answer_3` tinyint(4) NOT NULL default '0',\r
+  `answer_4` tinyint(4) NOT NULL default '0',\r
+  `answer_5` tinyint(4) NOT NULL default '0',\r
+  `answer_6` tinyint(4) NOT NULL default '0',\r
+  `answer_7` tinyint(4) NOT NULL default '0',\r
+  `answer_8` tinyint(4) NOT NULL default '0',\r
+  `answer_9` tinyint(4) NOT NULL default '0',\r
+  `option_0` TEXT ,\r
+  `option_1` TEXT ,\r
+  `option_2` TEXT ,\r
+  `option_3` TEXT ,\r
+  `option_4` TEXT ,\r
+  `option_5` TEXT ,\r
+  `option_6` TEXT ,\r
+  `option_7` TEXT ,\r
+  `option_8` TEXT ,\r
+  `option_9` TEXT ,\r
+  `properties` tinyint(4) NOT NULL default '0',\r
+  `content_id` mediumint(8) NOT NULL,  \r
+  PRIMARY KEY  (`question_id`),\r
+  KEY `category_id` (category_id)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
+# --------------------------------------------------------\r
+# Table structure for table `tests_questions_assoc`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests_questions_assoc` (\r
+  `test_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `question_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `weight` varchar(4) NOT NULL default '',\r
+  `ordering` mediumint(8) unsigned NOT NULL default '0',\r
+  `required` tinyint(3) unsigned NOT NULL default '0',\r
+  PRIMARY KEY  (`test_id`,`question_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
+# --------------------------------------------------------\r
+# Table structure for table `tests_questions_categories`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests_questions_categories` (\r
+  `category_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `course_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `title` char(200) NOT NULL default '',\r
+  PRIMARY KEY  (`category_id`),\r
+  KEY `course_id` (`course_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
+# --------------------------------------------------------\r
+# Table structure for table `tests_results`\r
+# since 0.1\r
+\r
+CREATE TABLE `tests_results` (\r
+  `result_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `test_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `member_id` VARCHAR(10) NOT NULL default '',\r
+  `date_taken` TIMESTAMP NOT NULL,\r
+  `final_score` char(5) NOT NULL default '',\r
+  `status` TINYINT NOT NULL DEFAULT '0',\r
+  `end_time` TIMESTAMP NOT NULL ,\r
+  `max_pos` TINYINT UNSIGNED NOT NULL DEFAULT '0',\r
+  PRIMARY KEY  (`result_id`),\r
+  KEY `test_id` (`test_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r
+\r
 # --------------------------------------------------------\r
 # Table structure for table `themes`\r
 # since 0.1\r
@@ -301,6 +459,18 @@ CREATE TABLE `users` (
   PRIMARY KEY  (`user_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\r
 \r
+# --------------------------------------------------------\r
+# Table structure for table `user_courses`\r
+# since 0.1\r
+\r
+CREATE TABLE `user_courses` (\r
+  `user_id` mediumint(8) unsigned NOT NULL,\r
+  `course_id` mediumint(8) unsigned NOT NULL,\r
+  `role` mediumint(8) unsigned NOT NULL,\r
+  `last_cid` mediumint(8) unsigned NOT NULL default '0',\r
+  PRIMARY KEY  (`user_id`,`course_id`)\r
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\r
+\r
 # --------------------------------------------------------\r
 # Table structure for table `user_groups`\r
 # since 0.1\r
@@ -337,10 +507,61 @@ CREATE TABLE `user_links` (
   PRIMARY KEY  (`user_link_id`)\r
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\r
 \r
+#Setup Table for Access4All\r
+CREATE TABLE `primary_resources` (\r
+  `primary_resource_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `content_id` mediumint(8) unsigned NOT NULL default '0',\r
+  `resource` TEXT,\r
+  `language_code` varchar(20) default NULL,\r
+  PRIMARY KEY  (`primary_resource_id`)\r
+) TYPE = MYISAM;\r
+\r
+CREATE TABLE `primary_resources_types` (\r
+  `primary_resource_id` mediumint(8) unsigned NOT NULL,\r
+  `type_id` mediumint(8) unsigned NOT NULL,\r
+  PRIMARY KEY  (`primary_resource_id`,`type_id`)\r
+) TYPE = MYISAM;\r
+\r
+CREATE TABLE `resource_types` (\r
+  `type_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `type` TEXT,\r
+  PRIMARY KEY  (`type_id`)\r
+) TYPE = MYISAM;\r
+\r
+CREATE TABLE `secondary_resources` (\r
+  `secondary_resource_id` mediumint(8) unsigned NOT NULL auto_increment,\r
+  `primary_resource_id` mediumint(8) unsigned NOT NULL,\r
+  `secondary_resource` TEXT,\r
+  `language_code` varchar(20) default NULL,\r
+  PRIMARY KEY  (`secondary_resource_id`)\r
+) TYPE = MYISAM;\r
+\r
+CREATE TABLE `secondary_resources_types` (\r
+  `secondary_resource_id` mediumint(8) unsigned NOT NULL,\r
+  `type_id` mediumint(8) unsigned NOT NULL,\r
+  PRIMARY KEY  (`secondary_resource_id`,`type_id`)\r
+) TYPE = MYISAM;\r
+\r
+INSERT INTO `resource_types` VALUES\r
+(1, 'auditory'),\r
+(2, 'sign_language'),\r
+(3, 'textual'),\r
+(4, 'visual');\r
+\r
+INSERT INTO `config` (`name`, `value`) VALUES('encyclopedia', 'http://www.wikipedia.org');\r
+INSERT INTO `config` (`name`, `value`) VALUES('dictionary', 'http://dictionary.reference.com/');\r
+INSERT INTO `config` (`name`, `value`) VALUES('thesaurus', 'http://thesaurus.reference.com/');\r
+INSERT INTO `config` (`name`, `value`) VALUES('atlas', 'http://maps.google.ca/');\r
+INSERT INTO `config` (`name`, `value`) VALUES('calculator', 'http://www.calculateforfree.com/');\r
+INSERT INTO `config` (`name`, `value`) VALUES('note_taking', 'http://www.aypwip.org/webnote/');\r
+INSERT INTO `config` (`name`, `value`) VALUES('abacas', 'http://www.mandarintools.com/abacus.html');\r
+\r
+#End Access4All setup \r
+\r
 -- Dumping data for table `languages`\r
 \r
 INSERT INTO `languages` (`language_code`, `charset`, `reg_exp`, `native_name`, `english_name`, `status`) VALUES\r
-('eng', 'utf-8', 'en([-_][[:alpha:]]{2})?|english', 'English', 'English', 1);\r
+('en', 'utf-8', 'en([-_][[:alpha:]]{2})?|english', 'English', 'English', 1);\r
 \r
 -- Dumping data for table `lang_codes`\r
 \r
@@ -873,3 +1094,5 @@ INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3,
 INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3, 5);\r
 INSERT INTO `user_group_privilege` (`user_group_id`, `privilege_id`) VALUES (3, 7);\r
 \r
+# insert default atutor account\r
+INSERT INTO `users` (`user_id`, `login`, `password`, `user_group_id`, `first_name`, `last_name`, `web_service_id`, `status`, `create_date`) VALUES (1, 'ATutor', '0cbab2aec26a53b0107487d43b1b8eb29384ad10', 2, 'ATutor', 'ATutor', '90c3cd6f656739969847f3a99ac0f3c7', 1, now());\r
index 4f307bf..5ce215c 100644 (file)
@@ -11,313 +11,313 @@ CREATE TABLE `language_text` (
   PRIMARY KEY  (`language_code`,`variable`,`term`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_CONFIRM_DELETE_ITEM','Are you sure you want to delete the following items? <strong>%s</strong>','2009-03-17 15:19:54','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_CONFIRM_DELETE_LANG','Are you sure you want to delete the language (<strong>%s</strong>)?','2009-02-23 15:13:50','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_CONFIRM_DELETE_MYOWN_UPDATE','Are you sure you want to <strong>delete</strong> update <strong>%s</strong>?','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_CONFIRM_DELETE_USER','Are you sure you want to delete the following users? <strong>%s</strong>','2009-02-06 11:58:02','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_CONFIRM_DELETE_USER_GROUP','Are you sure you want to delete the following user groups? <strong>%s</strong>','2009-02-12 15:08:53','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_ACCOUNT_DISABLED','That account has been disabled.','2009-01-08 11:43:51','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_CANNOT_CONNECT','Cannot connect to URL: %s','2009-04-22 09:26:45','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_CANNOT_DEL_DEFAULT_LANG','Cannot delete default language <strong>%s</strong>. The system cannot run properly without it.','2009-02-23 15:47:44','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_CANNOT_UNZIP','Can NOT unzip the uploaded file.','2009-06-22 14:49:02','error msg');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_CHOOSE_ACTION','Please choose action for file <strong>%s</strong>','2009-06-22 14:49:02','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_CHOOSE_UNINSTALLED_UPDATE','Please choose an uninstalled update.','2009-06-22 14:49:02','Updater: error msg');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_CONFIRM_BAD','Your email address and account could not be confirmed.','2009-01-14 14:40:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_DB_NOT_UPDATED','Information could not be added to the database.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMAIL_EXISTS','An account with that email address already exists.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMAIL_INVALID','Email address was invalid.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMAIL_NOT_FOUND','No account found with that email address.','2009-01-14 14:40:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMPTY_FIELD','Field cannot be empty. Data is not saved.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMPTY_FIELDS','The following required field(s) are empty:<br />\r\n%s.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMPTY_SESSIONID','Empty Session ID.','2009-03-03 13:44:57','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMPTY_USER','Empty user.','2009-03-03 13:44:57','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_EMPTY_WEB_SERVICE_ID','Empty web service ID.','2009-03-04 14:53:18','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_FIRST_LAST_NAME_UNIQUE','First, second, and last names combination must be unique.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_INVALID_FORMAT','Invalid format.','2009-03-03 13:44:57','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_INVALID_LOGIN','Invalid login/password combination.','2009-01-08 11:43:51','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_INVALID_SESSION','Invalid session.','2009-03-03 13:44:57','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_INVALID_TOKEN_TYPE','Invalid token type.','2009-10-09 16:18:01','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_INVALID_WEB_SERVICE_ID','Invalid web service ID.','2009-03-04 14:49:59','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_LANG_EMPTY','The text for this language has not been translated yet.','2009-02-24 13:57:01','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_LANG_EXISTS','The language you are trying to create already exists.','2009-02-24 09:20:45','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_LANG_WRONG_VERSION','The language pack you are trying to import is not compatible with this version of Transformable.','2009-02-24 13:58:25','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_LOGIN_CHARS','Your Login Name must only contain letters, numbers, periods, or underscores (_\'s).','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_LOGIN_EXISTS','That login already exists, please choose another.','2009-01-09 11:34:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_NOT_LOCALHOST','Sorry, the IP address of localhost is not public. For security reasons, validating resources located at non-public IP addresses has been disabled in this service.','2009-04-22 09:26:45','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_NO_ACTION_SELECTED','No action selected.','2009-02-04 15:31:02','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_NO_ITEM_SELECTED','You must select an item before using a button.','2009-02-04 15:31:02','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_PAGE_NOT_FOUND','Page (%s) cannot be found','2008-12-12 13:28:09','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_PASSWORD_CHARS','The password must contain letters, numbers, and symbols.','2009-01-09 13:41:06','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_PASSWORD_LENGTH','Password must be at least 8 characters long.','2009-01-09 13:41:06','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_PASSWORD_MISMATCH','Passwords did not match.','2009-01-09 13:41:06','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_REMOVE_WRITE_PERMISSION','Please remove write permission from the listed files.','2009-06-22 14:49:02','error msg');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_SECRET_ERROR','Letters or numbers entered from the CAPTCHA image are incorrect. Try again.','2009-10-22 14:06:59','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_SELECT_ONE_ITEM','Only <em>one</em> item must be selected.','2009-02-04 15:31:02','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_SENDING_ERROR','There was an error sending the email message.','2009-01-16 13:14:08','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_UPDATE_ALREADY_INSTALLED','The selected update is already installed.','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_UPDATE_DEPENDENCY','Due to update dependency, please install the listed updates before installing this update: %s','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_UPDATE_XML_NOT_FOUND','Update XML file is not found.','2009-06-22 14:49:02','error msg');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_ERROR_WRONG_PASSWORD','Incorrect password.','2009-01-16 10:29:47','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_ACCOUNT_CONFIRMED','Account has been confirmed.','2009-01-14 14:40:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY','Action completed successfully.','2009-01-16 11:29:41','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_CANCELLED','Successfully cancelled without any changes.','2009-01-14 14:40:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_CHANGE_TO_SAME_EMAIL','The email address is same as what you currently have.','2009-01-16 11:54:46','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_CONFIRMATION_SENT','An email confirmation message has been sent.','2009-01-14 14:40:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_CONFIRM_EMAIL2','An email with instructions on retrieving your password has been sent.','2009-01-16 13:14:08','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_CONFIRM_GOOD','Your email address has been confirmed successfully.','2009-01-14 14:40:42','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_IMPORT_LANG_SUCCESS','New language was successfully imported.','2009-02-24 13:58:25','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_LOGIN_SUCCESS','You have logged in successfully.','2009-01-08 11:43:51','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_LOGOUT','You have successfully been logged out.','2009-01-08 09:38:14','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_ONLY_ENGLISH','Only English language is defined in the system. There is no foreign languages to translate.','2009-02-18 11:52:10','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_PASSWORD_CHANGED','Password changed successfully.','2009-01-16 10:35:40','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_PROFILE_UPDATED','Your Profile was successfully updated.','2009-01-15 10:59:58','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_REGISTER_SUCCESS','You have registered successfully. Your web service ID is %s. This ID must be presented when using web service. This ID can always be retrieved from \"Profile\" page.','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_REG_THANKS_CONFIRM','Thank-you for registering. Please follow the instructions in the email we sent you on how to confirm your account. You will need to confirm your account before you can login.','2009-01-09 14:07:11','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_UPDATE_CREATED_SUCCESSFULLY','The update has been created successfully.','2009-06-22 14:49:02','Updater: feedback msg');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_FEEDBACK_UPDATE_INSTALLED_SUCCESSFULLY','The update has been installed successfully.','2009-06-22 14:49:02','Updater: feedback msg');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_ADD_EDIT_LANGUAGE','<h2>Add/Edit Language</h2>\r\n\r\n     <p>Adding and Editing the language properties allows users to change the following:\r\n <ul>\r\n                <li>Language Code (3 digit ISO-639-2 language code)</li>\r\n            <li>Locale (two letter abritrary code to represent a variation of a language)</li>\r\n          <li>Character Set (should always be UTF-8)</li>\r\n             <li>Regular Expression (leave blank)</li>\r\n           <li>Language name translated</li>\r\n           <li>Language name in English</li>\r\n           <li>Status (enabled/disabled)</li>\r\n  </ul>\r\n       </p>\r\n        <p>When \"Status\" is set to enabled, the language is displayed in the selector at the bottom of Transformable pages, which allows users to switch to this language.</p>\r\n','2009-04-15 09:46:37','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_CHANGE_EMAIL','<h2>Change Email</h2>\r\n<p>This page allows users to change email addresses. </p>\r\n','2009-04-15 09:47:18','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_CHANGE_PASSWORD','<h2>Change Password</h2>\r\n<p>This page allows users to change passwords. The form authenticates users by checking their old password first, and then setting a new password and typing it again.</p>\r\n','2009-04-15 09:53:55','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_CREATE_EDIT_USER ','<h2>Create/Edit User</h2>\r\n\r\n<p>All fields on \"Create User\" and \"Edit User\" forms are required. Most fields are self-explanatory. When the \"Account Status\" field is set to disabled, the user is not able to login. </p>\r\n<p>User accounts can also be created by individuals using the Registration form available through the public pages of Transformable. The accounts created via the Registration form are automatically set to user group \"Regular User\". </p>','2009-06-04 13:00:03','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_CREATE_EDIT_USER_GROUP','<h2>Create/Edit User Group</h2>\r\n\r\n<p>All fields are relatively self-explanatory.</p>\r\n\r\n<p>There are six privileges provided by Transformable. Privileges are fixed and not changeable.\r\n      <dl>\r\n                <dt>Home</dt>\r\n               <dd>This is where user implements own functions.</dd>\r\n               <dt>User Management</dt>\r\n            <dd>Create, edit, delete users.</dd>\r\n                <dt>Language Management</dt>\r\n                <dd>Create, edit, delete, enable, disable languages.</dd>\r\n           <dt>Translation</dt>\r\n                <dd>Translate all Transformable terms into languages other than English, or edit existing English text.</dd>\r\n                <dt>Profile Management</dt>\r\n         <dd>Edit profile, change password or email.</dd>\r\n    </dl>\r\n</p>','2009-06-04 13:05:21','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_CREATE_UPDATE','<h2>Creating Update</h2>\r\n\r\n<p>If you happen to come across a bug you can fix, or have a new feature you would like added to the Transformable public distribution, you can use Create Update to put your changes into a form that can be easily added to the Transformable public code. Or, if you have a feature you are adding to one Transformable installation that you would like to have added to another, Create Update is ideal for reproducing your feature across installations. If you are creating new features that are not going to become part of the Transformable public source code, you can build them into a update so they can be reapplied from version to version as you upgrade your Transformable system. Creating updates does require knowledge of PHP, and of SQL if you plan on creating a update that changes the Transformable database. Please refer to the appropriate documentation for information on PHP and SQL. <p>\r\n\r\n<dl>\r\n     <dt>Transformable Update ID</dt>\r\n    <dd>The update id you give to your update must be different from all updates available for the particular version of Transformable it applies to. It is suggested you prefix your updates with a special identifier that represents the author or the authoring organization. If for example the University of Toronto is creating the update, a update ID might look like \"uoft_0002.\"</dd>\r\n      <dt>Transformable Version to Apply</dt>\r\n     <dd>This needs to be the exact version number of the Transformable version the update applies to (e.g 1.6). including any minor version numbers (e.g 1.6.1.2)  The exact version number can be found on the Administrator open screen under \"Statistics and Information.\" In most cases when applying a update created for an older version of Transformable, the \"Transformable version to Apply\" will need to be adjusted. Or, this can be adjusted manually in the patch.xml file included with the source code of the update.\r\n       </dd>\r\n       <dt>Description</dt>\r\n        <dd>This should be a detailed description of what the update does. Example might include \"fixes problem uploading files to filemanager\" for a bug fix, or \"added a timer function to tests\" for an added feature, or \"removes registration tab\" for a feature adjustment, etc. Include enough detail so those applying the update understand exactly what it will do..</dd>\r\n   <dt>SQL Statement</dt>\r\n      <dd>This optional field can be used to insert SQL commands which modify the Transformable database. It might be used to write an SQL statement to modify and existing table, such as changing a data type, or a field size, or to add or remove an field. It can also be used to insert SQL that generates a new table for a new feature created by a update, or it can be used to insert data into a table used by a feature created by the update. Any SQL can be included in this field. Be careful when running SQL, that that SQL is not going to interfere with upgrade SQL. If you are changing table structures and those same tables are being altered during an upgrade, the upgrade may fail.</dd>\r\n       <dt>Dependant Updates</dt>\r\n  <dd>It is common for later updates to require changes from earlier updates before they can be installed. If this is the case for the update you are creating, enter the update IDs into the Dependant Update ID field. Click on Add Dependent Update if additional dependencies are required. Be sure to check the updates on the opening screen of the Updater to see if the file you are modifying with your update is  being modified by an update.Transformable.ca update. If they are modifying the same files, you may need to include the ID numbers for those updates in the Dependant Updates for the update your are creating.</dd>\r\n       <dt>Files</dt>  \r\n    <dd>This area is where most Transformable updates are created. Click on <strong>Add File</strong>  to generate a update block. A update block can include one of four actions on the file being modified, as described below. As many update blocks as required can be added to a update. </dd>\r\n             <dl>\r\n        <dt>Add File</dt>\r\n   <dd>The <strong>Add</strong> action can be used to add a new file to Transformable. This action is often used in conjuction with other update blocks that alter or delete files, to add a replacement file for one deleted, or to perhaps add a required or include file needed by a modified section in the file being changed. In the <strong>File Name</strong> field enter the file name to be assigned to the file when it is installed. In the <strong>Directory</strong> field enter the <i>relative path</i> from the Transformable root directory in which the modified file is or will exist. Select  from <strong>Upload File</strong> using the Browse button to locate the file in your local computer\'s file system. Note that the upload file can have any name. It will be renamed to the file name listed in the File Name field when it is installed.</dd>\r\n       <dt>Alter File</dt>\r\n <dd>This option is used when you wish to make changes to a piece of code within an existing source code file. In the <strong>File Name</strong> field enter the name of the file in the Transformable source code that will be altered. In the <strong>Directory</strong> field enter the relative path to the directory in which the to be alter file exists, relative to the Transformable root directory. In the <strong>Code To Replace From</strong> field copy the code from the original file the will be replaced, or appended to, and in the <strong>Code To Replace To</strong> field enter to code that will replace the code above in the <i>From</i> field. Or, if you are adding code instead of replacing code, include the code from the field above so it gets added back if you are only using that code as a way of identifying a location in the file where new code is being added.</dd>\r\n       <dt>Delete File</dt>\r\n        <dd>This option will remove files from Transformable. In the <strong>File Name</strong>  field enter the name of the file to be deleted. In the <strong>Directory</strong> field enter the path to the directory in which the to be delete file exists, relative to the root directory of the Transformable installation. </dd>\r\n     <dt>Overwrite File</dt>\r\n     <dd>This option is used to replace an existing file in Transformable with a new one. In the <strong>File Name</strong>  field enter the name of the file to be replaced. In the <strong>Directory</strong> field enter the path to the directory in which the to be replaced file exists, relative to the root directory of the Transformable installation. In the <strong>Upload File</strong> field use the Browse button to choose a file from your local computer to replace the specified file. The upload file may be named anything. It will be renamed to the file it is replacing when the update is installed.</dd>\r\n       </dl>\r\n       <dt>Create Update</dt>\r\n      <dd>Click on this button to build the update into a downloadable zip file. This zip file can then be uploaded in the Upload field on the main Updater screen to apply a update to a system.</dd>\r\n    <dt>Save Update</dt>\r\n        <dd>Click on this button to save the developing update to the Transformable database for future reference. Though it is not required, you should save a copy of the update in this way, so it can be retrieved and edited if necessary. Or, if a update takes more than a single sitting to build, you can save it, then retrieve it later to continue.</dd>\r\n        <dt>Cancel</dt>\r\n     <dd>Press this button to ignore the latest changes to the update, and return to My Own Updates Screen.</dd>\r\n\r\n</dl>','2009-06-22 15:32:56','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_LANGUAGE','<h2>Language Management</h2>\r\n\r\n    <p>Transformable can be displayed in many different languages! Through the Language Manager language packs can be selected and imported.</p>\r\n\r\n<h3>Managing Existing Languages</h3>\r\n    <p>Installed languages can be edited, deleted, or exported as an Transformable language pack for redistribution. When exporting a language, a download prompt will appear asking to download a zip file of the language pack.</p>\r\n   <p>Note that the English language (language code: eng) cannot be deleted. This is the base language pack that ensures Transformable runs properly. When other languages are installed, users can disable it if they don\'t want Transformable to be displayed in English.</p>\r\n       \r\n<h3>Importing Languages</h3>\r\n    <p>Language packs can be imported by retreiving the package and then importing it into Transformable.</p>\r\n   <ol>\r\n                <li>Visit <a href=\"http://www.atutor.ca/transformable/translate/index.php\" target=\"_new\">Transformable Language Packs</a> to download one of the available language packs for your version.</li>\r\n                <li>Use the <code>Browse...</code> button to find the downloaded language pack.</li>\r\n                <li>Use the <code>Import</code> button to import the language.</li>\r\n </ol>\r\n\r\n   <p>You can contribute to the Transformable community by exporting a language pack from your Transformable installation, and attaching it to a message in the atutor.ca <a href=\"http://atutor.ca/forum/4/1.html\">Translation Forum</a>. Also see the <a href=\"http://atutor.ca/atutor/docs/translate.php\">Translator Documentation</a> for further details about translating Transformable.</p>','2009-06-04 13:08:15','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_LOGIN','<h2>Login</h2>\r\n\r\n<p>A user may login to Transformable with their Login Name or Email address, and the Password entered during <a href=\"../register.php\">registration</a>. Logging in gives users access to use more functions provided to regular user.</p>\r\n','2009-04-15 09:51:28','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_PASSWORD_REMINDER','<h2>Forgot Your Password</h2>\r\n\r\n<p>If you have forgotten your password, use the <em>Forgot your password?</em> link on the Login screen. The form will email the login name to you, along with a link you must follow to change your password.</p>\r\n','2009-04-15 09:51:37','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_PROFILE','<h2>Profile</h2>\r\n<p>This section allows a user to change elements of his/her personal profile.</p>\r\n\r\n<p>Although the login name cannot be altered, password, email address, and other personal information are editable.</p>\r\n','2009-04-15 09:51:47','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_REGISTRATION','<h2>Register</h2>\r\n\r\n<p>In order for a user to login to the Transformable system and save results from accessibility reviews, manage translate or administer the system, a unique system account needs to be created.  Use the <em>Register</em> link on the login screen to access the registration form. If email-confirmation has been enabled by the system administrator, a message will be sent to the email address entered, containing a link that must be followed to confirm the new account. Once this has been done, the login name or email address, and the password entered during registration can now be used on the <a href=\"../login.php\">Login</a> screen.</p>','2009-04-15 09:52:02','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_TRANSLATION','<h2>Translation</h2>\r\n\r\n <p>All fields are self-explanatory. Note that language drop down box lists all the languages defined in the current installation of Transformable, no matter the language status (enabled or disabled). If you are translating a new language for Transformable, first define the language using the Language management tool\'s Add Language feature. If you do not have access to the Language management tools, ask your Transformable administrators to add the language.</p>\r\n\r\n<p>You can contribute to the Transformable community by exporting a language pack from your Transformable installation, and attaching it to a message in the atutor.ca <a href=\"http://atutor.ca/forum/4/1.html\">Translation Forum</a>. Also see the <a href=\"http://atutor.ca/atutor/docs/translate.php\">Translator Documentation</a> for further details about translating Transformable.</p>','2009-06-04 13:17:38','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_UPDATER','<h2>Updater</h2>\r\n     <p>The Updater was introduce in Transformable 1.6 to allow administrators to update their systems with feature adjustments, security fixes, and other Transformable code changes in between Transformable releases. The Updater is included as a standard module with Transformable 1.6.1+, and installs as an extra module for 1.6.</p>\r\n<dl>\r\n    <dt>The Update List</dt>\r\n    <dd>On the opening screen of the Updater will appear a list of updates available for the version of Transformable you are using, along with a description of each update.  This list is retrieved from update.atutor.ca, as are the updates themselves, so you must be connected to the Internet. Updates are retrieved from update.atutor.ca by Transformable and applied as necessary. </dd>\r\n      <dt>File Permissions</dt>\r\n   <dd>In most cases you will be asked to temporarily grant write permission to the files that need to be updated or replaced, then once the update has been applied, you will be asked to change the permissions back to read only. It is important that you follow the instructions after updates have been applied, otherwise you run the risk of opening a security hole. \r\n </dd>\r\n       <dt>Types of Updates</dt>\r\n   <dd>Updates come in various forms. Some updates replace code in a file with new code. Others replace a file with a new file.  Others may do both on multiple files and multiple code changes. Other updates delete files that are no longer required.</dd>\r\n  <dt>Required and Non-Required Updates</dt>\r\n  <dd>In most cases you will want to install updates in the order they appear in the update list, but not all updates are required updates.  Some feature updates can be ignored if you do not need the features they would add or modify on your system. Other updates will have dependencies, requiring the administrator to install earlier updates before installing a later one. You will be prompted to install previous updates if there are dependencies.</dd>\r\n        <dt>Checks and File Backups</dt>\r\n    <dd>If you have made changes to a file the Updater wishes to change,  you will be prompted to continue or not. The updater compares your local file with the same file in the Transformable code repository, and if they differ the prompt will display. In many cases  the Updater can apply updates without changing the code you have modified, but if the code to be replaced was modified, the update will fail, or if the update replaces a file, your changes will be lost. In all cases the updater will create a backup of the files that were modified, identified by the filename plus the update number added as a suffix. Rename the file to its original name to restore that file back to its original state. You can list these files by clicking the view messages button next to the update listing after the update is installed. After you have confirmed that the updates were applied and are working properly, it is safe to delete the backup files, though it does not hurt to keep them around. </dd>\r\n     <dt>Private Updates</dt>\r\n    <dd>In some cases private updates can be applied by uploading a update file through the upload form below the update list.  Private updates are often those used to apply changes that are not being applied to the Transformable default source code, or to apply custom features, or to share updates between users, etc. When uploading a update, be sure the update id, defined in the patch.xml file, is unique . </dd>\r\n</dl>','2009-06-22 15:37:42','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_USER','<h2>User Management</h2>\r\n\r\n    <p>This section allows administrators to manage all user accounts. Each user belongs to a user group to which privileges are assigned.</p>\r\n\r\n<p>There are three types of default user groups that are created when Transformable is installed. These are described below along with the default privileges associated with each groups. \r\n       <dl>\r\n                <dt>Administrator</dt>\r\n              <dd>Administrators have privileges to use the Home, manage users, languages and manage their own profile.</dd>\r\n              <dt>Regular User</dt>\r\n               <dd>Regular users have privileges to use the Home and manage their own profile.</dd>\r\n                <dt>Translator</dt>\r\n         <dd>Translators have privileges to use the Home, translate Transformable terms from English to other languages, and to manage their own profile. The languages that can be used in the system are defined by users who have \"Language Management\" privileges.</dd>\r\n        </dl>\r\n</p>\r\n\r\n<h3>Creating User Accounts</h3>\r\n\r\n<p>The users who belong to a group that has \"User Management\" privileges can manually add users to the system by using <em>Create User</em>.</p>\r\n<p>User accounts can also be created by individuals using the Registration form available through the public pages of Transformable. The accounts created via the Registration form are automatically set to user group \"Regular User\". </p>\r\n\r\n<h3>User Group</h3>\r\n\r\n<p><em>User Group</em> is used to create new user groups and edit existing user groups.</p>','2009-06-04 12:55:56','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_USER_GROUP ','<h2>User Group</h2>\r\n\r\n<p>The User Group section allows administrators to manage user groups. User groups define the privileges that are granted to the users who are members of a group. Note that \"Administrator\" and \"Regular User\" groups can not  be deleted. They must exist for Transformable\'s proper operations. All other groups are optional.</p>\r\n\r\n<p>There are three default user groups in Transformable. Below is a description of the default privileges that are granted to each group. The privileges in user groups are editable by users who are a member of a group that has the \"User Management\" privilege.\r\n<dl>\r\n<dt>Administrator</dt>\r\n<dd>Administrators have privileges to use the Home, manage users, languages and manage their own profile.</dd>\r\n<dt>Regular User</dt>\r\n<dd>Regular users have privileges to use the Home and manage their own profile. </dd>\r\n<dt>Translator</dt>\r\n<dd>Translators have privileges to use the Home, translate Transformable terms from English to other languages, and to manage their own profile. The languages that can be used in the system are defined by users who have \"Language Management\" privileges.</dd>\r\n</dl>\r\n</p>','2009-06-04 13:04:37','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_HELP_USER_PASSWORD ','<h2>Change Password</h2>\r\n\r\n<p>All fields are required and self-explanatory. Once the new password is set successfully, an email notification is sent to the user.</p>\r\n','2009-04-15 09:53:11','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_INFOS_INVALID_USER','You must <a href=\"login.php\">login</a> to use this section.','2009-01-15 16:13:14','');
-INSERT INTO `language_text` VALUES ('eng', '_msgs','TR_INFOS_UPDATE_INSTALLED_AND_REMOVE_PERMISSION','The update has been installed. Please remove write permission as instruction.','2009-06-22 14:49:02','Updater: info msg');
-INSERT INTO `language_text` VALUES ('eng', '_template','15_max_chars','15 character maximum','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','20_max_chars','20 character maximum','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','add','Add','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','add_a_file','Add A File','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','add_dependent_update','Add A Dependent Update','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','add_edit_group','Add/Edit Group','2009-04-08 15:20:56','');
-INSERT INTO `language_text` VALUES ('eng', '_template','add_edit_language','Add/Edit Language','2009-02-23 13:27:38','');
-INSERT INTO `language_text` VALUES ('eng', '_template','add_language','Add Language','2009-02-18 15:56:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','add_privileges','Add Privileges','2009-02-17 09:45:53','');
-INSERT INTO `language_text` VALUES ('eng', '_template','transformable','Transformable','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','transformable_documentation','Transformable Documentation','2009-06-16 10:25:25','');
-INSERT INTO `language_text` VALUES ('eng', '_template','transformable_handbook','Transformable Handbook','2009-01-28 15:28:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','transformable_version_to_apply','Transformable Version to Apply','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','transformable_whatis','Transformable provides a basic frame to build an application. It has build-in functions to support multiple languages, translation, user/user group managment, updater and user profile managment.','2009-05-29 08:55:24','');
-INSERT INTO `language_text` VALUES ('eng', '_template','all','All','2008-11-27 09:49:41','');
-INSERT INTO `language_text` VALUES ('eng', '_template','alter','Alter','2009-06-22 14:49:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','audible_captcha','Audible Version of CAPTCHA','2009-10-22 14:02:18','');
-INSERT INTO `language_text` VALUES ('eng', '_template','author','Author','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','available_to','Available To','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','available_updates','Available Updates','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','back_to','Back To:','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','calendar','Calendar','2009-04-06 10:43:09','');
-INSERT INTO `language_text` VALUES ('eng', '_template','cancel','Cancel','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','change_email','Change Email','2009-01-15 11:29:34','');
-INSERT INTO `language_text` VALUES ('eng', '_template','change_password','Change Password','2009-01-15 11:29:34','');
-INSERT INTO `language_text` VALUES ('eng', '_template','charset','Character Set','2009-02-20 11:43:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','choose_lang','Choose a language to translate','2008-11-26 10:11:15','');
-INSERT INTO `language_text` VALUES ('eng', '_template','close_popup','Close Popup','2009-01-28 15:28:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','code_to_replace_from','Code To Replace From','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','code_to_replace_to','Code To Replace To','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','combination','Use a combination of letters, numbers and symbols','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','confirm_delete','Are you sure you want to delete these records?','2009-04-09 11:29:46','');
-INSERT INTO `language_text` VALUES ('eng', '_template','consumer','Consumer','2009-10-08 15:42:55','');
-INSERT INTO `language_text` VALUES ('eng', '_template','contact_email','Contact Email','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','contain_only','May contain only letters, numbers, underscores, hyphens or periods.','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','continue','Continue','2009-06-22 14:49:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','copyright','Web site engine\'s code is copyright &copy; 2009','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','create_edit_update','Create/Edit Update','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','create_edit_user','Create/Edit User','2009-02-05 10:25:08','');
-INSERT INTO `language_text` VALUES ('eng', '_template','create_edit_user_group','Create User Group','2009-02-18 11:13:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','create_update','Create Update','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','create_user','Create User','2009-01-21 15:58:32','');
-INSERT INTO `language_text` VALUES ('eng', '_template','date','Date','2009-02-27 16:07:19','');
-INSERT INTO `language_text` VALUES ('eng', '_template','date_created','Date Created','2009-02-17 12:02:27','');
-INSERT INTO `language_text` VALUES ('eng', '_template','default_language','Default Language','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','default_max_file_size','Default: 1048576','2009-10-21 15:25:08','');
-INSERT INTO `language_text` VALUES ('eng', '_template','default_use_captcha','Default: Disable','2009-10-21 15:25:08','');
-INSERT INTO `language_text` VALUES ('eng', '_template','delete','Delete','2009-01-22 16:02:07','');
-INSERT INTO `language_text` VALUES ('eng', '_template','delete_language','Delete Language','2009-02-18 15:56:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','delete_this_file','Delete This File','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','delete_update','Delete Update','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','delete_user','Delete User','2009-02-06 11:41:23','');
-INSERT INTO `language_text` VALUES ('eng', '_template','delete_user_group','Delete User Group','2009-02-12 15:08:53','');
-INSERT INTO `language_text` VALUES ('eng', '_template','dependent_updates','Dependent Updates','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','dependent_update_id','Dependent Update ID','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','dependent_update_not_installed','<br><span style=\"color: red\">Waring: Due to update dependency, please install the listed updates first: </span>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','description','Description','2008-11-24 14:25:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','directory','Directory','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','disable','Disable','2009-01-20 11:47:15','');
-INSERT INTO `language_text` VALUES ('eng', '_template','disabled','Disabled','2009-01-20 11:45:23','');
-INSERT INTO `language_text` VALUES ('eng', '_template','done','Done','2009-06-22 16:16:50','');
-INSERT INTO `language_text` VALUES ('eng', '_template','edit','Edit','2009-01-22 16:02:07','');
-INSERT INTO `language_text` VALUES ('eng', '_template','edit_function','Edit Function','2009-03-17 14:58:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','edit_profile','Edit Profile','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','edit_update','Edit Update','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','email','Email','2009-02-04 11:51:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','email_address','Email Address','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','email_confirmation_message','You have registered for an account on %1s. Please finish the registration process by confirming your email address by using the following link: %2s .','2009-01-14 13:25:55','');
-INSERT INTO `language_text` VALUES ('eng', '_template','email_confirmation_message2','To finish changing your account\'s email address on %1s, please confirm your email address by using the following link: %2s .','2009-01-16 11:07:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','email_confirmation_subject','Email Confirmation','2009-01-14 13:25:55','');
-INSERT INTO `language_text` VALUES ('eng', '_template','empty_param_consumer','Empty parameter \"consumer\".','2009-10-08 11:43:50','');
-INSERT INTO `language_text` VALUES ('eng', '_template','enable','Enable','2009-01-20 11:47:15','');
-INSERT INTO `language_text` VALUES ('eng', '_template','enabled','Enabled','2009-01-20 11:45:23','');
-INSERT INTO `language_text` VALUES ('eng', '_template','english_context','English Context','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','english_text','English Text','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','error','Error','2008-11-24 14:25:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','errors','Errors','2009-03-09 09:55:45','');
-INSERT INTO `language_text` VALUES ('eng', '_template','error_type','Error Type','2009-01-21 12:38:17','');
-INSERT INTO `language_text` VALUES ('eng', '_template','expand_add_privileges','Expand Add Privileges','2009-02-17 09:45:53','');
-INSERT INTO `language_text` VALUES ('eng', '_template','expected_result','Expected Result','2008-11-24 14:25:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','export','Export','2009-02-24 13:58:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','factory_default','Reset to Factory Defaults','2009-10-21 16:15:03','');
-INSERT INTO `language_text` VALUES ('eng', '_template','file','File','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','files','Files','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','file_name','File Name','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','filter','Filter','2008-11-27 09:48:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','first_name','First Name','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','get_my_update','Get My Update','2009-06-22 14:49:01','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','grant_write_permission','Please grant <strong>write</strong> permission to folders and files listed below:<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','handbook_toc','Handbook Toc','2009-01-28 15:28:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','hide_contents','Hide Contents','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','home','Home','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','illegal_extentions','Illegal File Extensions','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','image_validation_text','In the above image there are numbers and/or letters displayed.  Please type them into the following field.','2009-10-22 14:02:18','');
-INSERT INTO `language_text` VALUES ('eng', '_template','image_validation_text2','This helps ensure a live person is registering on this system.','2009-10-22 14:02:18','');
-INSERT INTO `language_text` VALUES ('eng', '_template','import','Import','2009-02-18 15:56:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','import_a_new_lang','Import a New Language','2009-02-24 13:58:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','info','Information','2009-03-06 11:29:10','');
-INSERT INTO `language_text` VALUES ('eng', '_template','input','Input','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','install','Install','2009-06-22 14:49:03','');
-INSERT INTO `language_text` VALUES ('eng', '_template','installed_date','Installed Date','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','interface_terms','Interface Terms','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','jump_to_content','Jump to Content','2009-05-25 10:17:46','');
-INSERT INTO `language_text` VALUES ('eng', '_template','language','Language','2009-04-14 10:35:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','lang_code','Language Code','2009-02-20 11:43:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','last_login','Last Login','2009-02-04 11:51:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','last_modified','Last Modified','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','last_name','Last Name','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','last_update','Last Update','2009-02-17 12:02:27','');
-INSERT INTO `language_text` VALUES ('eng', '_template','latex_server','MimeTex Server for the LaTex service','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','latex_server_info','For production purposes, please install mimeTeX on your own server.','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','lesson_builder','Lesson Builder','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','locale','Locale','2009-02-23 13:27:38','');
-INSERT INTO `language_text` VALUES ('eng', '_template','login','Login','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','login_name','Login Name','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','login_name_or_email','Login Name or Email','2009-01-09 10:40:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','login_text','Enter the Login Name (or email) and Password you chose at registration.<br /><br /><br />Not registered yet? <a href=\"register.php\" >Register</a> Or, <a href=\"password_reminder.php\">Forgot your password?</a><br /><br />','2009-01-29 14:24:45','');
-INSERT INTO `language_text` VALUES ('eng', '_template','logout','Logout','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','match_all_words','Match All Words','2009-02-04 11:51:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','match_any_word','Match Any Word','2009-02-04 11:51:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','max_file_size','Maximum File Size','2009-10-21 15:25:22','');
-INSERT INTO `language_text` VALUES ('eng', '_template','msg_terms','Message Terms','2009-05-05 09:05:33','');
-INSERT INTO `language_text` VALUES ('eng', '_template','myown_updates','My Own Updates','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','na','N/A','2009-02-23 14:31:55','');
-INSERT INTO `language_text` VALUES ('eng', '_template','name','Name','2009-03-18 14:53:42','');
-INSERT INTO `language_text` VALUES ('eng', '_template','name_in_english','Language name in English','2009-02-20 11:43:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','name_in_language','Language name translated','2009-02-23 13:28:12','');
-INSERT INTO `language_text` VALUES ('eng', '_template','name_in_translated','Language name translated','2009-02-20 11:43:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','never','Never','2009-02-05 11:25:19','');
-INSERT INTO `language_text` VALUES ('eng', '_template','new_or_translated','New or Translated Terms','2008-11-27 09:48:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','new_password','New Password','2009-01-16 10:52:03','');
-INSERT INTO `language_text` VALUES ('eng', '_template','new_terms','New Terms','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','next_chapter','Next Chapter','2009-01-28 15:28:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','no','No','2009-01-21 12:38:17','');
-INSERT INTO `language_text` VALUES ('eng', '_template','none_found','None Found.','2009-01-21 15:06:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','not_installed','Not Installed','2009-06-22 14:49:03','');
-INSERT INTO `language_text` VALUES ('eng', '_template','no_results_found','No results found.','2009-01-21 12:38:17','');
-INSERT INTO `language_text` VALUES ('eng', '_template','oauth_authenticate','OAuth User Authenticate','2009-10-19 10:45:38','');
-INSERT INTO `language_text` VALUES ('eng', '_template','oauth_server','OAuth server','2009-10-08 15:42:55','');
-INSERT INTO `language_text` VALUES ('eng', '_template','oauth_server_api','OAuth Server API','2009-10-19 10:45:38','');
-INSERT INTO `language_text` VALUES ('eng', '_template','options','Options','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','or','Or','2009-10-22 16:02:10','');
-INSERT INTO `language_text` VALUES ('eng', '_template','overwrite','Overwrite','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password','Password','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_again','Password Again','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_blurb','Enter your account\'s email address below and an email with instructions on retrieving your password will be sent to you. The email address must be the same as the one you used for registration.','2009-01-16 13:19:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_changed','Password Changed','2009-02-06 09:08:32','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_change_confirm','Your password on %s has been changed successfully. Go to %s to login.','2009-01-16 13:17:32','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_change_msg','Your password has been altered. Please use the information below.','2009-02-06 09:08:31','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_new_blurb','Enter a new password for your account.','2009-01-16 13:55:40','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_old','Old Password','2009-01-16 10:27:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_reminder','Password Reminder','2009-01-07 16:14:08','');
-INSERT INTO `language_text` VALUES ('eng', '_template','password_request2','Dear %1$s,\r\n\r\nYour login name is %1$s.\r\n\r\nTo set a new password, follow the link below.\r\n\r\n%4$s\r\n\r\n(If this link does not take you to the site, copy and paste it into the address bar of your internet browser)\r\n\r\nThe link will become invalid after %3$s days.','2009-01-16 13:05:25','');
-INSERT INTO `language_text` VALUES ('eng', '_template','previous_chapter','Previous Chapter','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','print_version','Print Version','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','privileges','Privileges','2009-02-12 14:15:23','');
-INSERT INTO `language_text` VALUES ('eng', '_template','profile','Profile','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','published_date','Published Date','2009-01-21 12:38:17','');
-INSERT INTO `language_text` VALUES ('eng', '_template','refresh_image','Refresh Image','2009-10-22 14:02:18','');
-INSERT INTO `language_text` VALUES ('eng', '_template','register','Register','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','registration','Registration','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','relative_directory','Directory is relative directory to Transformable root, for example: docs/images/ or tools/tests/. Leave empty if it is Transformable root directory.','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','remove','Remove','2009-01-23 14:04:46','');
-INSERT INTO `language_text` VALUES ('eng', '_template','remove_write_permission','<span style=\"color:red\">Please <strong>REMOVE</strong> write permission on the listed folders and files for your security:</span><p><strong>Note:</strong> To remove permissions on Unix use <kbd>chmod 755</kbd> then the file name..</p>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','repair_example','Repair Example','2008-11-24 14:25:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','replace_file','Replace File','2009-06-22 14:49:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','required_field','Required Field','2009-01-08 15:51:23','');
-INSERT INTO `language_text` VALUES ('eng', '_template','required_field_text','<div class=\"required\" title=\"Required Field\">*</div> indicates required fields.','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','requirement','Requirement','2008-11-24 14:25:44','');
-INSERT INTO `language_text` VALUES ('eng', '_template','reset_filter','Reset Filter','2008-11-27 09:48:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','result','Result','2008-12-01 14:45:48','');
-INSERT INTO `language_text` VALUES ('eng', '_template','results_found','Results Found: %s','2008-11-27 09:48:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','return_to_handbook','Return to Handbook','2009-01-28 15:28:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','save','Save','2009-01-15 10:01:07','');
-INSERT INTO `language_text` VALUES ('eng', '_template','save_and_close','Save and Close','2009-04-09 11:36:31','');
-INSERT INTO `language_text` VALUES ('eng', '_template','search','Search','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','search_phase','Search Phase','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','search_str','Search String','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','search_text','Search for terms that contains the given string. For example, search for phase \"desc\" returns all terms that contain string \"desc\".','2008-12-02 11:06:56','');
-INSERT INTO `language_text` VALUES ('eng', '_template','select','Select','2009-02-05 14:16:51','');
-INSERT INTO `language_text` VALUES ('eng', '_template','select_all','select/unselect all','2009-01-23 14:04:46','');
-INSERT INTO `language_text` VALUES ('eng', '_template','sent_via_transformable','Sent via an Transformable system at %s','2009-01-09 14:15:29','');
-INSERT INTO `language_text` VALUES ('eng', '_template','site_name','Site Name','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','sql_statement','SQL Statement','2009-06-22 14:49:02','');
-INSERT INTO `language_text` VALUES ('eng', '_template','status','Status','2009-01-21 12:38:52','');
-INSERT INTO `language_text` VALUES ('eng', '_template','submit','Submit','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','submit_no','No','2009-01-23 11:25:56','');
-INSERT INTO `language_text` VALUES ('eng', '_template','submit_yes','Yes','2009-01-23 11:25:56','');
-INSERT INTO `language_text` VALUES ('eng', '_template','system','System','2009-10-20 14:59:34','');
-INSERT INTO `language_text` VALUES ('eng', '_template','system_settings','System Settings','2009-10-21 10:48:59','');
-INSERT INTO `language_text` VALUES ('eng', '_template','system_update_id','System Update ID','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','term_type','Term Type','2009-03-24 13:47:37','');
-INSERT INTO `language_text` VALUES ('eng', '_template','theme','Theme','2009-10-21 15:19:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','the_follow_errors_occurred','The following errors occurred:','2008-12-15 09:25:06','');
-INSERT INTO `language_text` VALUES ('eng', '_template','title','Title','2009-01-20 11:45:23','');
-INSERT INTO `language_text` VALUES ('eng', '_template','translated_context','Translated Context','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','translated_terms','Translated Terms','2008-11-27 09:48:36','');
-INSERT INTO `language_text` VALUES ('eng', '_template','translated_text','Translated Text','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','translate_to','Translate to','2008-12-01 13:18:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','translation','Translation','2009-02-18 11:01:39','');
-INSERT INTO `language_text` VALUES ('eng', '_template','translator','Translator','2009-01-07 15:05:34','');
-INSERT INTO `language_text` VALUES ('eng', '_template','updated_terms','Updated Terms','2008-12-02 09:16:45','');
-INSERT INTO `language_text` VALUES ('eng', '_template','updater','Updater','2009-06-22 14:49:01','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','updater_alter_modified_files','The listed files have been modified locally. If you choose to proceed, your local file will be modified. The original\nfile will be backup before the modification. Please note that the modification on your customized code may break your customization.<br>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','updater_overwrite_modified_files','The listed files have been modified locally. If you choose to proceed, the update file will be copied to your local machine. \nYou have to manually merge this file and your local copy.<br>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','updater_show_backup_files','Below is the list of the backup files created by update installation. After ensuring Transformable works properly with the update, you may want to delete these files. If Transformable does not work properly with the update, you can always revert back to the old files by renaming the backup files \nto the original file names,  removing the [update_id].old portion of the file name. <br>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','updater_show_update_files','Below is the list of the update files copied to your computer. \nPlease manually merge the change between the update files and your local copy. <br>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','updates','Updates','2009-06-22 14:49:01','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','update_dependent_update_not_installed','<br /><span style=\"color: red\">Warning: There are update dependencies, please install the listed updates first: </span>','2009-06-22 14:49:03','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','update_local_file_not_exist','Cannot proceed. The listed files are not exist in your local machine. If you renamed them to your copy, in order to proceed, please rename back.<br>','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','upload','Upload','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','upload_file','Upload File','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','upload_update','Upload a zip file to install update:','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','user','User','2009-02-27 16:07:19','');
-INSERT INTO `language_text` VALUES ('eng', '_template','users','Users','2009-04-14 10:41:51','');
-INSERT INTO `language_text` VALUES ('eng', '_template','user_group','User Group','2009-02-04 11:51:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','user_status','User Status','2009-02-04 11:51:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','use_captcha','Allow the use of CAPTCHA','2009-10-21 15:25:18','');
-INSERT INTO `language_text` VALUES ('eng', '_template','version_not_match','This update is for Transformable version %s. Does not match with your current Transformable version. The installation of it may break Transformable. Are you sure you want to proceed?','2009-06-22 14:49:02','Updater');
-INSERT INTO `language_text` VALUES ('eng', '_template','view','View','2009-01-20 11:47:15','');
-INSERT INTO `language_text` VALUES ('eng', '_template','view_message','View Message','2009-06-22 14:49:01','');
-INSERT INTO `language_text` VALUES ('eng', '_template','warning','Warning','2009-05-29 16:19:57','');
-INSERT INTO `language_text` VALUES ('eng', '_template','web_service_api','Web Service API','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','web_service_id','Web Service ID','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','web_site','Web Site','2009-02-06 09:08:32','');
-INSERT INTO `language_text` VALUES ('eng', '_template','welcome','Welcome','2009-10-07 09:55:16','');
-INSERT INTO `language_text` VALUES ('eng', '_template','yes','Yes','2009-01-21 12:38:17','');
-INSERT INTO `language_text` VALUES ('eng', '_template','yyyy-mm-dd','yyyy-mm-dd','2009-01-21 15:06:01','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_CONFIRM_DELETE_ITEM','Are you sure you want to delete the following items? <strong>%s</strong>','2009-03-17 15:19:54','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_CONFIRM_DELETE_LANG','Are you sure you want to delete the language (<strong>%s</strong>)?','2009-02-23 15:13:50','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_CONFIRM_DELETE_MYOWN_UPDATE','Are you sure you want to <strong>delete</strong> update <strong>%s</strong>?','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_CONFIRM_DELETE_USER','Are you sure you want to delete the following users? <strong>%s</strong>','2009-02-06 11:58:02','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_CONFIRM_DELETE_USER_GROUP','Are you sure you want to delete the following user groups? <strong>%s</strong>','2009-02-12 15:08:53','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_ACCOUNT_DISABLED','That account has been disabled.','2009-01-08 11:43:51','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_CANNOT_CONNECT','Cannot connect to URL: %s','2009-04-22 09:26:45','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_CANNOT_DEL_DEFAULT_LANG','Cannot delete default language <strong>%s</strong>. The system cannot run properly without it.','2009-02-23 15:47:44','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_CANNOT_UNZIP','Can NOT unzip the uploaded file.','2009-06-22 14:49:02','error msg');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_CHOOSE_ACTION','Please choose action for file <strong>%s</strong>','2009-06-22 14:49:02','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_CHOOSE_UNINSTALLED_UPDATE','Please choose an uninstalled update.','2009-06-22 14:49:02','Updater: error msg');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_CONFIRM_BAD','Your email address and account could not be confirmed.','2009-01-14 14:40:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_DB_NOT_UPDATED','Information could not be added to the database.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMAIL_EXISTS','An account with that email address already exists.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMAIL_INVALID','Email address was invalid.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMAIL_NOT_FOUND','No account found with that email address.','2009-01-14 14:40:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMPTY_FIELD','Field cannot be empty. Data is not saved.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMPTY_FIELDS','The following required field(s) are empty:<br />\r\n%s.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMPTY_SESSIONID','Empty Session ID.','2009-03-03 13:44:57','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMPTY_USER','Empty user.','2009-03-03 13:44:57','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_EMPTY_WEB_SERVICE_ID','Empty web service ID.','2009-03-04 14:53:18','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_FIRST_LAST_NAME_UNIQUE','First, second, and last names combination must be unique.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_INVALID_FORMAT','Invalid format.','2009-03-03 13:44:57','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_INVALID_LOGIN','Invalid login/password combination.','2009-01-08 11:43:51','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_INVALID_SESSION','Invalid session.','2009-03-03 13:44:57','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_INVALID_TOKEN_TYPE','Invalid token type.','2009-10-09 16:18:01','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_INVALID_WEB_SERVICE_ID','Invalid web service ID.','2009-03-04 14:49:59','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_LANG_EMPTY','The text for this language has not been translated yet.','2009-02-24 13:57:01','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_LANG_EXISTS','The language you are trying to create already exists.','2009-02-24 09:20:45','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_LANG_WRONG_VERSION','The language pack you are trying to import is not compatible with this version of Transformable.','2009-02-24 13:58:25','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_LOGIN_CHARS','Your Login Name must only contain letters, numbers, periods, or underscores (_\'s).','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_LOGIN_EXISTS','That login already exists, please choose another.','2009-01-09 11:34:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_NOT_LOCALHOST','Sorry, the IP address of localhost is not public. For security reasons, validating resources located at non-public IP addresses has been disabled in this service.','2009-04-22 09:26:45','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_NO_ACTION_SELECTED','No action selected.','2009-02-04 15:31:02','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_NO_ITEM_SELECTED','You must select an item before using a button.','2009-02-04 15:31:02','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_PAGE_NOT_FOUND','Page (%s) cannot be found','2008-12-12 13:28:09','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_PASSWORD_CHARS','The password must contain letters, numbers, and symbols.','2009-01-09 13:41:06','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_PASSWORD_LENGTH','Password must be at least 8 characters long.','2009-01-09 13:41:06','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_PASSWORD_MISMATCH','Passwords did not match.','2009-01-09 13:41:06','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_REMOVE_WRITE_PERMISSION','Please remove write permission from the listed files.','2009-06-22 14:49:02','error msg');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_SECRET_ERROR','Letters or numbers entered from the CAPTCHA image are incorrect. Try again.','2009-10-22 14:06:59','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_SELECT_ONE_ITEM','Only <em>one</em> item must be selected.','2009-02-04 15:31:02','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_SENDING_ERROR','There was an error sending the email message.','2009-01-16 13:14:08','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_UPDATE_ALREADY_INSTALLED','The selected update is already installed.','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_UPDATE_DEPENDENCY','Due to update dependency, please install the listed updates before installing this update: %s','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_UPDATE_XML_NOT_FOUND','Update XML file is not found.','2009-06-22 14:49:02','error msg');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_ERROR_WRONG_PASSWORD','Incorrect password.','2009-01-16 10:29:47','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_ACCOUNT_CONFIRMED','Account has been confirmed.','2009-01-14 14:40:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY','Action completed successfully.','2009-01-16 11:29:41','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_CANCELLED','Successfully cancelled without any changes.','2009-01-14 14:40:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_CHANGE_TO_SAME_EMAIL','The email address is same as what you currently have.','2009-01-16 11:54:46','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_CONFIRMATION_SENT','An email confirmation message has been sent.','2009-01-14 14:40:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_CONFIRM_EMAIL2','An email with instructions on retrieving your password has been sent.','2009-01-16 13:14:08','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_CONFIRM_GOOD','Your email address has been confirmed successfully.','2009-01-14 14:40:42','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_IMPORT_LANG_SUCCESS','New language was successfully imported.','2009-02-24 13:58:25','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_LOGIN_SUCCESS','You have logged in successfully.','2009-01-08 11:43:51','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_LOGOUT','You have successfully been logged out.','2009-01-08 09:38:14','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_ONLY_ENGLISH','Only English language is defined in the system. There is no foreign languages to translate.','2009-02-18 11:52:10','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_PASSWORD_CHANGED','Password changed successfully.','2009-01-16 10:35:40','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_PROFILE_UPDATED','Your Profile was successfully updated.','2009-01-15 10:59:58','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_REGISTER_SUCCESS','You have registered successfully. Your web service ID is %s. This ID must be presented when using web service. This ID can always be retrieved from \"Profile\" page.','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_REG_THANKS_CONFIRM','Thank-you for registering. Please follow the instructions in the email we sent you on how to confirm your account. You will need to confirm your account before you can login.','2009-01-09 14:07:11','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_UPDATE_CREATED_SUCCESSFULLY','The update has been created successfully.','2009-06-22 14:49:02','Updater: feedback msg');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_FEEDBACK_UPDATE_INSTALLED_SUCCESSFULLY','The update has been installed successfully.','2009-06-22 14:49:02','Updater: feedback msg');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_ADD_EDIT_LANGUAGE','<h2>Add/Edit Language</h2>\r\n\r\n      <p>Adding and Editing the language properties allows users to change the following:\r\n <ul>\r\n                <li>Language Code (3 digit ISO-639-2 language code)</li>\r\n            <li>Locale (two letter abritrary code to represent a variation of a language)</li>\r\n          <li>Character Set (should always be UTF-8)</li>\r\n             <li>Regular Expression (leave blank)</li>\r\n           <li>Language name translated</li>\r\n           <li>Language name in English</li>\r\n           <li>Status (enabled/disabled)</li>\r\n  </ul>\r\n       </p>\r\n        <p>When \"Status\" is set to enabled, the language is displayed in the selector at the bottom of Transformable pages, which allows users to switch to this language.</p>\r\n','2009-04-15 09:46:37','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_CHANGE_EMAIL','<h2>Change Email</h2>\r\n<p>This page allows users to change email addresses. </p>\r\n','2009-04-15 09:47:18','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_CHANGE_PASSWORD','<h2>Change Password</h2>\r\n<p>This page allows users to change passwords. The form authenticates users by checking their old password first, and then setting a new password and typing it again.</p>\r\n','2009-04-15 09:53:55','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_CREATE_EDIT_USER ','<h2>Create/Edit User</h2>\r\n\r\n<p>All fields on \"Create User\" and \"Edit User\" forms are required. Most fields are self-explanatory. When the \"Account Status\" field is set to disabled, the user is not able to login. </p>\r\n<p>User accounts can also be created by individuals using the Registration form available through the public pages of Transformable. The accounts created via the Registration form are automatically set to user group \"Regular User\". </p>','2009-06-04 13:00:03','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_CREATE_EDIT_USER_GROUP','<h2>Create/Edit User Group</h2>\r\n\r\n<p>All fields are relatively self-explanatory.</p>\r\n\r\n<p>There are six privileges provided by Transformable. Privileges are fixed and not changeable.\r\n       <dl>\r\n                <dt>Home</dt>\r\n               <dd>This is where user implements own functions.</dd>\r\n               <dt>User Management</dt>\r\n            <dd>Create, edit, delete users.</dd>\r\n                <dt>Language Management</dt>\r\n                <dd>Create, edit, delete, enable, disable languages.</dd>\r\n           <dt>Translation</dt>\r\n                <dd>Translate all Transformable terms into languages other than English, or edit existing English text.</dd>\r\n                <dt>Profile Management</dt>\r\n         <dd>Edit profile, change password or email.</dd>\r\n    </dl>\r\n</p>','2009-06-04 13:05:21','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_CREATE_UPDATE','<h2>Creating Update</h2>\r\n\r\n<p>If you happen to come across a bug you can fix, or have a new feature you would like added to the Transformable public distribution, you can use Create Update to put your changes into a form that can be easily added to the Transformable public code. Or, if you have a feature you are adding to one Transformable installation that you would like to have added to another, Create Update is ideal for reproducing your feature across installations. If you are creating new features that are not going to become part of the Transformable public source code, you can build them into a update so they can be reapplied from version to version as you upgrade your Transformable system. Creating updates does require knowledge of PHP, and of SQL if you plan on creating a update that changes the Transformable database. Please refer to the appropriate documentation for information on PHP and SQL. <p>\r\n\r\n<dl>\r\n      <dt>Transformable Update ID</dt>\r\n    <dd>The update id you give to your update must be different from all updates available for the particular version of Transformable it applies to. It is suggested you prefix your updates with a special identifier that represents the author or the authoring organization. If for example the University of Toronto is creating the update, a update ID might look like \"uoft_0002.\"</dd>\r\n      <dt>Transformable Version to Apply</dt>\r\n     <dd>This needs to be the exact version number of the Transformable version the update applies to (e.g 1.6). including any minor version numbers (e.g 1.6.1.2)  The exact version number can be found on the Administrator open screen under \"Statistics and Information.\" In most cases when applying a update created for an older version of Transformable, the \"Transformable version to Apply\" will need to be adjusted. Or, this can be adjusted manually in the patch.xml file included with the source code of the update.\r\n       </dd>\r\n       <dt>Description</dt>\r\n        <dd>This should be a detailed description of what the update does. Example might include \"fixes problem uploading files to filemanager\" for a bug fix, or \"added a timer function to tests\" for an added feature, or \"removes registration tab\" for a feature adjustment, etc. Include enough detail so those applying the update understand exactly what it will do..</dd>\r\n   <dt>SQL Statement</dt>\r\n      <dd>This optional field can be used to insert SQL commands which modify the Transformable database. It might be used to write an SQL statement to modify and existing table, such as changing a data type, or a field size, or to add or remove an field. It can also be used to insert SQL that generates a new table for a new feature created by a update, or it can be used to insert data into a table used by a feature created by the update. Any SQL can be included in this field. Be careful when running SQL, that that SQL is not going to interfere with upgrade SQL. If you are changing table structures and those same tables are being altered during an upgrade, the upgrade may fail.</dd>\r\n       <dt>Dependant Updates</dt>\r\n  <dd>It is common for later updates to require changes from earlier updates before they can be installed. If this is the case for the update you are creating, enter the update IDs into the Dependant Update ID field. Click on Add Dependent Update if additional dependencies are required. Be sure to check the updates on the opening screen of the Updater to see if the file you are modifying with your update is  being modified by an update.Transformable.ca update. If they are modifying the same files, you may need to include the ID numbers for those updates in the Dependant Updates for the update your are creating.</dd>\r\n       <dt>Files</dt>  \r\n    <dd>This area is where most Transformable updates are created. Click on <strong>Add File</strong>  to generate a update block. A update block can include one of four actions on the file being modified, as described below. As many update blocks as required can be added to a update. </dd>\r\n             <dl>\r\n        <dt>Add File</dt>\r\n   <dd>The <strong>Add</strong> action can be used to add a new file to Transformable. This action is often used in conjuction with other update blocks that alter or delete files, to add a replacement file for one deleted, or to perhaps add a required or include file needed by a modified section in the file being changed. In the <strong>File Name</strong> field enter the file name to be assigned to the file when it is installed. In the <strong>Directory</strong> field enter the <i>relative path</i> from the Transformable root directory in which the modified file is or will exist. Select  from <strong>Upload File</strong> using the Browse button to locate the file in your local computer\'s file system. Note that the upload file can have any name. It will be renamed to the file name listed in the File Name field when it is installed.</dd>\r\n       <dt>Alter File</dt>\r\n <dd>This option is used when you wish to make changes to a piece of code within an existing source code file. In the <strong>File Name</strong> field enter the name of the file in the Transformable source code that will be altered. In the <strong>Directory</strong> field enter the relative path to the directory in which the to be alter file exists, relative to the Transformable root directory. In the <strong>Code To Replace From</strong> field copy the code from the original file the will be replaced, or appended to, and in the <strong>Code To Replace To</strong> field enter to code that will replace the code above in the <i>From</i> field. Or, if you are adding code instead of replacing code, include the code from the field above so it gets added back if you are only using that code as a way of identifying a location in the file where new code is being added.</dd>\r\n       <dt>Delete File</dt>\r\n        <dd>This option will remove files from Transformable. In the <strong>File Name</strong>  field enter the name of the file to be deleted. In the <strong>Directory</strong> field enter the path to the directory in which the to be delete file exists, relative to the root directory of the Transformable installation. </dd>\r\n     <dt>Overwrite File</dt>\r\n     <dd>This option is used to replace an existing file in Transformable with a new one. In the <strong>File Name</strong>  field enter the name of the file to be replaced. In the <strong>Directory</strong> field enter the path to the directory in which the to be replaced file exists, relative to the root directory of the Transformable installation. In the <strong>Upload File</strong> field use the Browse button to choose a file from your local computer to replace the specified file. The upload file may be named anything. It will be renamed to the file it is replacing when the update is installed.</dd>\r\n       </dl>\r\n       <dt>Create Update</dt>\r\n      <dd>Click on this button to build the update into a downloadable zip file. This zip file can then be uploaded in the Upload field on the main Updater screen to apply a update to a system.</dd>\r\n    <dt>Save Update</dt>\r\n        <dd>Click on this button to save the developing update to the Transformable database for future reference. Though it is not required, you should save a copy of the update in this way, so it can be retrieved and edited if necessary. Or, if a update takes more than a single sitting to build, you can save it, then retrieve it later to continue.</dd>\r\n        <dt>Cancel</dt>\r\n     <dd>Press this button to ignore the latest changes to the update, and return to My Own Updates Screen.</dd>\r\n\r\n</dl>','2009-06-22 15:32:56','Updater');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_LANGUAGE','<h2>Language Management</h2>\r\n\r\n     <p>Transformable can be displayed in many different languages! Through the Language Manager language packs can be selected and imported.</p>\r\n\r\n<h3>Managing Existing Languages</h3>\r\n    <p>Installed languages can be edited, deleted, or exported as an Transformable language pack for redistribution. When exporting a language, a download prompt will appear asking to download a zip file of the language pack.</p>\r\n   <p>Note that the English language (language code: eng) cannot be deleted. This is the base language pack that ensures Transformable runs properly. When other languages are installed, users can disable it if they don\'t want Transformable to be displayed in English.</p>\r\n       \r\n<h3>Importing Languages</h3>\r\n    <p>Language packs can be imported by retreiving the package and then importing it into Transformable.</p>\r\n   <ol>\r\n                <li>Visit <a href=\"http://www.atutor.ca/transformable/translate/index.php\" target=\"_new\">Transformable Language Packs</a> to download one of the available language packs for your version.</li>\r\n                <li>Use the <code>Browse...</code> button to find the downloaded language pack.</li>\r\n                <li>Use the <code>Import</code> button to import the language.</li>\r\n </ol>\r\n\r\n   <p>You can contribute to the Transformable community by exporting a language pack from your Transformable installation, and attaching it to a message in the atutor.ca <a href=\"http://atutor.ca/forum/4/1.html\">Translation Forum</a>. Also see the <a href=\"http://atutor.ca/atutor/docs/translate.php\">Translator Documentation</a> for further details about translating Transformable.</p>','2009-06-04 13:08:15','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_LOGIN','<h2>Login</h2>\r\n\r\n<p>A user may login to Transformable with their Login Name or Email address, and the Password entered during <a href=\"../register.php\">registration</a>. Logging in gives users access to use more functions provided to regular user.</p>\r\n','2009-04-15 09:51:28','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_PASSWORD_REMINDER','<h2>Forgot Your Password</h2>\r\n\r\n<p>If you have forgotten your password, use the <em>Forgot your password?</em> link on the Login screen. The form will email the login name to you, along with a link you must follow to change your password.</p>\r\n','2009-04-15 09:51:37','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_PROFILE','<h2>Profile</h2>\r\n<p>This section allows a user to change elements of his/her personal profile.</p>\r\n\r\n<p>Although the login name cannot be altered, password, email address, and other personal information are editable.</p>\r\n','2009-04-15 09:51:47','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_REGISTRATION','<h2>Register</h2>\r\n\r\n<p>In order for a user to login to the Transformable system and save results from accessibility reviews, manage translate or administer the system, a unique system account needs to be created.  Use the <em>Register</em> link on the login screen to access the registration form. If email-confirmation has been enabled by the system administrator, a message will be sent to the email address entered, containing a link that must be followed to confirm the new account. Once this has been done, the login name or email address, and the password entered during registration can now be used on the <a href=\"../login.php\">Login</a> screen.</p>','2009-04-15 09:52:02','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_TRANSLATION','<h2>Translation</h2>\r\n\r\n  <p>All fields are self-explanatory. Note that language drop down box lists all the languages defined in the current installation of Transformable, no matter the language status (enabled or disabled). If you are translating a new language for Transformable, first define the language using the Language management tool\'s Add Language feature. If you do not have access to the Language management tools, ask your Transformable administrators to add the language.</p>\r\n\r\n<p>You can contribute to the Transformable community by exporting a language pack from your Transformable installation, and attaching it to a message in the atutor.ca <a href=\"http://atutor.ca/forum/4/1.html\">Translation Forum</a>. Also see the <a href=\"http://atutor.ca/atutor/docs/translate.php\">Translator Documentation</a> for further details about translating Transformable.</p>','2009-06-04 13:17:38','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_UPDATER','<h2>Updater</h2>\r\n      <p>The Updater was introduce in Transformable 1.6 to allow administrators to update their systems with feature adjustments, security fixes, and other Transformable code changes in between Transformable releases. The Updater is included as a standard module with Transformable 1.6.1+, and installs as an extra module for 1.6.</p>\r\n<dl>\r\n    <dt>The Update List</dt>\r\n    <dd>On the opening screen of the Updater will appear a list of updates available for the version of Transformable you are using, along with a description of each update.  This list is retrieved from update.atutor.ca, as are the updates themselves, so you must be connected to the Internet. Updates are retrieved from update.atutor.ca by Transformable and applied as necessary. </dd>\r\n      <dt>File Permissions</dt>\r\n   <dd>In most cases you will be asked to temporarily grant write permission to the files that need to be updated or replaced, then once the update has been applied, you will be asked to change the permissions back to read only. It is important that you follow the instructions after updates have been applied, otherwise you run the risk of opening a security hole. \r\n </dd>\r\n       <dt>Types of Updates</dt>\r\n   <dd>Updates come in various forms. Some updates replace code in a file with new code. Others replace a file with a new file.  Others may do both on multiple files and multiple code changes. Other updates delete files that are no longer required.</dd>\r\n  <dt>Required and Non-Required Updates</dt>\r\n  <dd>In most cases you will want to install updates in the order they appear in the update list, but not all updates are required updates.  Some feature updates can be ignored if you do not need the features they would add or modify on your system. Other updates will have dependencies, requiring the administrator to install earlier updates before installing a later one. You will be prompted to install previous updates if there are dependencies.</dd>\r\n        <dt>Checks and File Backups</dt>\r\n    <dd>If you have made changes to a file the Updater wishes to change,  you will be prompted to continue or not. The updater compares your local file with the same file in the Transformable code repository, and if they differ the prompt will display. In many cases  the Updater can apply updates without changing the code you have modified, but if the code to be replaced was modified, the update will fail, or if the update replaces a file, your changes will be lost. In all cases the updater will create a backup of the files that were modified, identified by the filename plus the update number added as a suffix. Rename the file to its original name to restore that file back to its original state. You can list these files by clicking the view messages button next to the update listing after the update is installed. After you have confirmed that the updates were applied and are working properly, it is safe to delete the backup files, though it does not hurt to keep them around. </dd>\r\n     <dt>Private Updates</dt>\r\n    <dd>In some cases private updates can be applied by uploading a update file through the upload form below the update list.  Private updates are often those used to apply changes that are not being applied to the Transformable default source code, or to apply custom features, or to share updates between users, etc. When uploading a update, be sure the update id, defined in the patch.xml file, is unique . </dd>\r\n</dl>','2009-06-22 15:37:42','Updater');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_USER','<h2>User Management</h2>\r\n\r\n     <p>This section allows administrators to manage all user accounts. Each user belongs to a user group to which privileges are assigned.</p>\r\n\r\n<p>There are three types of default user groups that are created when Transformable is installed. These are described below along with the default privileges associated with each groups. \r\n       <dl>\r\n                <dt>Administrator</dt>\r\n              <dd>Administrators have privileges to use the Home, manage users, languages and manage their own profile.</dd>\r\n              <dt>Regular User</dt>\r\n               <dd>Regular users have privileges to use the Home and manage their own profile.</dd>\r\n                <dt>Translator</dt>\r\n         <dd>Translators have privileges to use the Home, translate Transformable terms from English to other languages, and to manage their own profile. The languages that can be used in the system are defined by users who have \"Language Management\" privileges.</dd>\r\n        </dl>\r\n</p>\r\n\r\n<h3>Creating User Accounts</h3>\r\n\r\n<p>The users who belong to a group that has \"User Management\" privileges can manually add users to the system by using <em>Create User</em>.</p>\r\n<p>User accounts can also be created by individuals using the Registration form available through the public pages of Transformable. The accounts created via the Registration form are automatically set to user group \"Regular User\". </p>\r\n\r\n<h3>User Group</h3>\r\n\r\n<p><em>User Group</em> is used to create new user groups and edit existing user groups.</p>','2009-06-04 12:55:56','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_USER_GROUP ','<h2>User Group</h2>\r\n\r\n<p>The User Group section allows administrators to manage user groups. User groups define the privileges that are granted to the users who are members of a group. Note that \"Administrator\" and \"Regular User\" groups can not  be deleted. They must exist for Transformable\'s proper operations. All other groups are optional.</p>\r\n\r\n<p>There are three default user groups in Transformable. Below is a description of the default privileges that are granted to each group. The privileges in user groups are editable by users who are a member of a group that has the \"User Management\" privilege.\r\n<dl>\r\n<dt>Administrator</dt>\r\n<dd>Administrators have privileges to use the Home, manage users, languages and manage their own profile.</dd>\r\n<dt>Regular User</dt>\r\n<dd>Regular users have privileges to use the Home and manage their own profile. </dd>\r\n<dt>Translator</dt>\r\n<dd>Translators have privileges to use the Home, translate Transformable terms from English to other languages, and to manage their own profile. The languages that can be used in the system are defined by users who have \"Language Management\" privileges.</dd>\r\n</dl>\r\n</p>','2009-06-04 13:04:37','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_HELP_USER_PASSWORD ','<h2>Change Password</h2>\r\n\r\n<p>All fields are required and self-explanatory. Once the new password is set successfully, an email notification is sent to the user.</p>\r\n','2009-04-15 09:53:11','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_INFOS_INVALID_USER','You must <a href=\"login.php\">login</a> to use this section.','2009-01-15 16:13:14','');
+INSERT INTO `language_text` VALUES ('en', '_msgs','TR_INFOS_UPDATE_INSTALLED_AND_REMOVE_PERMISSION','The update has been installed. Please remove write permission as instruction.','2009-06-22 14:49:02','Updater: info msg');
+INSERT INTO `language_text` VALUES ('en', '_template','15_max_chars','15 character maximum','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','20_max_chars','20 character maximum','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','add','Add','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','add_a_file','Add A File','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','add_dependent_update','Add A Dependent Update','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','add_edit_group','Add/Edit Group','2009-04-08 15:20:56','');
+INSERT INTO `language_text` VALUES ('en', '_template','add_edit_language','Add/Edit Language','2009-02-23 13:27:38','');
+INSERT INTO `language_text` VALUES ('en', '_template','add_language','Add Language','2009-02-18 15:56:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','add_privileges','Add Privileges','2009-02-17 09:45:53','');
+INSERT INTO `language_text` VALUES ('en', '_template','transformable','Transformable','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','transformable_documentation','Transformable Documentation','2009-06-16 10:25:25','');
+INSERT INTO `language_text` VALUES ('en', '_template','transformable_handbook','Transformable Handbook','2009-01-28 15:28:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','transformable_version_to_apply','Transformable Version to Apply','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','transformable_whatis','Transformable provides a basic frame to build an application. It has build-in functions to support multiple languages, translation, user/user group managment, updater and user profile managment.','2009-05-29 08:55:24','');
+INSERT INTO `language_text` VALUES ('en', '_template','all','All','2008-11-27 09:49:41','');
+INSERT INTO `language_text` VALUES ('en', '_template','alter','Alter','2009-06-22 14:49:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','audible_captcha','Audible Version of CAPTCHA','2009-10-22 14:02:18','');
+INSERT INTO `language_text` VALUES ('en', '_template','author','Author','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','available_to','Available To','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','available_updates','Available Updates','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','back_to','Back To:','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','calendar','Calendar','2009-04-06 10:43:09','');
+INSERT INTO `language_text` VALUES ('en', '_template','cancel','Cancel','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','change_email','Change Email','2009-01-15 11:29:34','');
+INSERT INTO `language_text` VALUES ('en', '_template','change_password','Change Password','2009-01-15 11:29:34','');
+INSERT INTO `language_text` VALUES ('en', '_template','charset','Character Set','2009-02-20 11:43:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','choose_lang','Choose a language to translate','2008-11-26 10:11:15','');
+INSERT INTO `language_text` VALUES ('en', '_template','close_popup','Close Popup','2009-01-28 15:28:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','code_to_replace_from','Code To Replace From','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','code_to_replace_to','Code To Replace To','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','combination','Use a combination of letters, numbers and symbols','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','confirm_delete','Are you sure you want to delete these records?','2009-04-09 11:29:46','');
+INSERT INTO `language_text` VALUES ('en', '_template','consumer','Consumer','2009-10-08 15:42:55','');
+INSERT INTO `language_text` VALUES ('en', '_template','contact_email','Contact Email','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','contain_only','May contain only letters, numbers, underscores, hyphens or periods.','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','continue','Continue','2009-06-22 14:49:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','copyright','Web site engine\'s code is copyright &copy; 2009','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','create_edit_update','Create/Edit Update','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','create_edit_user','Create/Edit User','2009-02-05 10:25:08','');
+INSERT INTO `language_text` VALUES ('en', '_template','create_edit_user_group','Create User Group','2009-02-18 11:13:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','create_update','Create Update','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','create_user','Create User','2009-01-21 15:58:32','');
+INSERT INTO `language_text` VALUES ('en', '_template','date','Date','2009-02-27 16:07:19','');
+INSERT INTO `language_text` VALUES ('en', '_template','date_created','Date Created','2009-02-17 12:02:27','');
+INSERT INTO `language_text` VALUES ('en', '_template','default_language','Default Language','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','default_max_file_size','Default: 1048576','2009-10-21 15:25:08','');
+INSERT INTO `language_text` VALUES ('en', '_template','default_use_captcha','Default: Disable','2009-10-21 15:25:08','');
+INSERT INTO `language_text` VALUES ('en', '_template','delete','Delete','2009-01-22 16:02:07','');
+INSERT INTO `language_text` VALUES ('en', '_template','delete_language','Delete Language','2009-02-18 15:56:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','delete_this_file','Delete This File','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','delete_update','Delete Update','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','delete_user','Delete User','2009-02-06 11:41:23','');
+INSERT INTO `language_text` VALUES ('en', '_template','delete_user_group','Delete User Group','2009-02-12 15:08:53','');
+INSERT INTO `language_text` VALUES ('en', '_template','dependent_updates','Dependent Updates','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','dependent_update_id','Dependent Update ID','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','dependent_update_not_installed','<br><span style=\"color: red\">Waring: Due to update dependency, please install the listed updates first: </span>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','description','Description','2008-11-24 14:25:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','directory','Directory','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','disable','Disable','2009-01-20 11:47:15','');
+INSERT INTO `language_text` VALUES ('en', '_template','disabled','Disabled','2009-01-20 11:45:23','');
+INSERT INTO `language_text` VALUES ('en', '_template','done','Done','2009-06-22 16:16:50','');
+INSERT INTO `language_text` VALUES ('en', '_template','edit','Edit','2009-01-22 16:02:07','');
+INSERT INTO `language_text` VALUES ('en', '_template','edit_function','Edit Function','2009-03-17 14:58:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','edit_profile','Edit Profile','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','edit_update','Edit Update','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','email','Email','2009-02-04 11:51:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','email_address','Email Address','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','email_confirmation_message','You have registered for an account on %1s. Please finish the registration process by confirming your email address by using the following link: %2s .','2009-01-14 13:25:55','');
+INSERT INTO `language_text` VALUES ('en', '_template','email_confirmation_message2','To finish changing your account\'s email address on %1s, please confirm your email address by using the following link: %2s .','2009-01-16 11:07:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','email_confirmation_subject','Email Confirmation','2009-01-14 13:25:55','');
+INSERT INTO `language_text` VALUES ('en', '_template','empty_param_consumer','Empty parameter \"consumer\".','2009-10-08 11:43:50','');
+INSERT INTO `language_text` VALUES ('en', '_template','enable','Enable','2009-01-20 11:47:15','');
+INSERT INTO `language_text` VALUES ('en', '_template','enabled','Enabled','2009-01-20 11:45:23','');
+INSERT INTO `language_text` VALUES ('en', '_template','english_context','English Context','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','english_text','English Text','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','error','Error','2008-11-24 14:25:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','errors','Errors','2009-03-09 09:55:45','');
+INSERT INTO `language_text` VALUES ('en', '_template','error_type','Error Type','2009-01-21 12:38:17','');
+INSERT INTO `language_text` VALUES ('en', '_template','expand_add_privileges','Expand Add Privileges','2009-02-17 09:45:53','');
+INSERT INTO `language_text` VALUES ('en', '_template','expected_result','Expected Result','2008-11-24 14:25:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','export','Export','2009-02-24 13:58:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','factory_default','Reset to Factory Defaults','2009-10-21 16:15:03','');
+INSERT INTO `language_text` VALUES ('en', '_template','file','File','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','files','Files','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','file_name','File Name','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','filter','Filter','2008-11-27 09:48:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','first_name','First Name','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','get_my_update','Get My Update','2009-06-22 14:49:01','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','grant_write_permission','Please grant <strong>write</strong> permission to folders and files listed below:<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','handbook_toc','Handbook Toc','2009-01-28 15:28:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','hide_contents','Hide Contents','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','home','Home','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','illegal_extentions','Illegal File Extensions','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','image_validation_text','In the above image there are numbers and/or letters displayed.  Please type them into the following field.','2009-10-22 14:02:18','');
+INSERT INTO `language_text` VALUES ('en', '_template','image_validation_text2','This helps ensure a live person is registering on this system.','2009-10-22 14:02:18','');
+INSERT INTO `language_text` VALUES ('en', '_template','import','Import','2009-02-18 15:56:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','import_a_new_lang','Import a New Language','2009-02-24 13:58:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','info','Information','2009-03-06 11:29:10','');
+INSERT INTO `language_text` VALUES ('en', '_template','input','Input','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','install','Install','2009-06-22 14:49:03','');
+INSERT INTO `language_text` VALUES ('en', '_template','installed_date','Installed Date','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','interface_terms','Interface Terms','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','jump_to_content','Jump to Content','2009-05-25 10:17:46','');
+INSERT INTO `language_text` VALUES ('en', '_template','language','Language','2009-04-14 10:35:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','lang_code','Language Code','2009-02-20 11:43:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','last_login','Last Login','2009-02-04 11:51:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','last_modified','Last Modified','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','last_name','Last Name','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','last_update','Last Update','2009-02-17 12:02:27','');
+INSERT INTO `language_text` VALUES ('en', '_template','latex_server','MimeTex Server for the LaTex service','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','latex_server_info','For production purposes, please install mimeTeX on your own server.','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','lesson_builder','Lesson Builder','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','locale','Locale','2009-02-23 13:27:38','');
+INSERT INTO `language_text` VALUES ('en', '_template','login','Login','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','login_name','Login Name','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','login_name_or_email','Login Name or Email','2009-01-09 10:40:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','login_text','Enter the Login Name (or email) and Password you chose at registration.<br /><br /><br />Not registered yet? <a href=\"register.php\" >Register</a> Or, <a href=\"password_reminder.php\">Forgot your password?</a><br /><br />','2009-01-29 14:24:45','');
+INSERT INTO `language_text` VALUES ('en', '_template','logout','Logout','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','match_all_words','Match All Words','2009-02-04 11:51:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','match_any_word','Match Any Word','2009-02-04 11:51:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','max_file_size','Maximum File Size','2009-10-21 15:25:22','');
+INSERT INTO `language_text` VALUES ('en', '_template','msg_terms','Message Terms','2009-05-05 09:05:33','');
+INSERT INTO `language_text` VALUES ('en', '_template','myown_updates','My Own Updates','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','na','N/A','2009-02-23 14:31:55','');
+INSERT INTO `language_text` VALUES ('en', '_template','name','Name','2009-03-18 14:53:42','');
+INSERT INTO `language_text` VALUES ('en', '_template','name_in_english','Language name in English','2009-02-20 11:43:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','name_in_language','Language name translated','2009-02-23 13:28:12','');
+INSERT INTO `language_text` VALUES ('en', '_template','name_in_translated','Language name translated','2009-02-20 11:43:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','never','Never','2009-02-05 11:25:19','');
+INSERT INTO `language_text` VALUES ('en', '_template','new_or_translated','New or Translated Terms','2008-11-27 09:48:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','new_password','New Password','2009-01-16 10:52:03','');
+INSERT INTO `language_text` VALUES ('en', '_template','new_terms','New Terms','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','next_chapter','Next Chapter','2009-01-28 15:28:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','no','No','2009-01-21 12:38:17','');
+INSERT INTO `language_text` VALUES ('en', '_template','none_found','None Found.','2009-01-21 15:06:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','not_installed','Not Installed','2009-06-22 14:49:03','');
+INSERT INTO `language_text` VALUES ('en', '_template','no_results_found','No results found.','2009-01-21 12:38:17','');
+INSERT INTO `language_text` VALUES ('en', '_template','oauth_authenticate','OAuth User Authenticate','2009-10-19 10:45:38','');
+INSERT INTO `language_text` VALUES ('en', '_template','oauth_server','OAuth server','2009-10-08 15:42:55','');
+INSERT INTO `language_text` VALUES ('en', '_template','oauth_server_api','OAuth Server API','2009-10-19 10:45:38','');
+INSERT INTO `language_text` VALUES ('en', '_template','options','Options','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','or','Or','2009-10-22 16:02:10','');
+INSERT INTO `language_text` VALUES ('en', '_template','overwrite','Overwrite','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','password','Password','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_again','Password Again','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_blurb','Enter your account\'s email address below and an email with instructions on retrieving your password will be sent to you. The email address must be the same as the one you used for registration.','2009-01-16 13:19:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_changed','Password Changed','2009-02-06 09:08:32','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_change_confirm','Your password on %s has been changed successfully. Go to %s to login.','2009-01-16 13:17:32','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_change_msg','Your password has been altered. Please use the information below.','2009-02-06 09:08:31','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_new_blurb','Enter a new password for your account.','2009-01-16 13:55:40','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_old','Old Password','2009-01-16 10:27:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_reminder','Password Reminder','2009-01-07 16:14:08','');
+INSERT INTO `language_text` VALUES ('en', '_template','password_request2','Dear %1$s,\r\n\r\nYour login name is %1$s.\r\n\r\nTo set a new password, follow the link below.\r\n\r\n%4$s\r\n\r\n(If this link does not take you to the site, copy and paste it into the address bar of your internet browser)\r\n\r\nThe link will become invalid after %3$s days.','2009-01-16 13:05:25','');
+INSERT INTO `language_text` VALUES ('en', '_template','previous_chapter','Previous Chapter','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','print_version','Print Version','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','privileges','Privileges','2009-02-12 14:15:23','');
+INSERT INTO `language_text` VALUES ('en', '_template','profile','Profile','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','published_date','Published Date','2009-01-21 12:38:17','');
+INSERT INTO `language_text` VALUES ('en', '_template','refresh_image','Refresh Image','2009-10-22 14:02:18','');
+INSERT INTO `language_text` VALUES ('en', '_template','register','Register','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','registration','Registration','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','relative_directory','Directory is relative directory to Transformable root, for example: docs/images/ or tools/tests/. Leave empty if it is Transformable root directory.','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','remove','Remove','2009-01-23 14:04:46','');
+INSERT INTO `language_text` VALUES ('en', '_template','remove_write_permission','<span style=\"color:red\">Please <strong>REMOVE</strong> write permission on the listed folders and files for your security:</span><p><strong>Note:</strong> To remove permissions on Unix use <kbd>chmod 755</kbd> then the file name..</p>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','repair_example','Repair Example','2008-11-24 14:25:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','replace_file','Replace File','2009-06-22 14:49:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','required_field','Required Field','2009-01-08 15:51:23','');
+INSERT INTO `language_text` VALUES ('en', '_template','required_field_text','<div class=\"required\" title=\"Required Field\">*</div> indicates required fields.','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','requirement','Requirement','2008-11-24 14:25:44','');
+INSERT INTO `language_text` VALUES ('en', '_template','reset_filter','Reset Filter','2008-11-27 09:48:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','result','Result','2008-12-01 14:45:48','');
+INSERT INTO `language_text` VALUES ('en', '_template','results_found','Results Found: %s','2008-11-27 09:48:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','return_to_handbook','Return to Handbook','2009-01-28 15:28:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','save','Save','2009-01-15 10:01:07','');
+INSERT INTO `language_text` VALUES ('en', '_template','save_and_close','Save and Close','2009-04-09 11:36:31','');
+INSERT INTO `language_text` VALUES ('en', '_template','search','Search','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','search_phase','Search Phase','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','search_str','Search String','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','search_text','Search for terms that contains the given string. For example, search for phase \"desc\" returns all terms that contain string \"desc\".','2008-12-02 11:06:56','');
+INSERT INTO `language_text` VALUES ('en', '_template','select','Select','2009-02-05 14:16:51','');
+INSERT INTO `language_text` VALUES ('en', '_template','select_all','select/unselect all','2009-01-23 14:04:46','');
+INSERT INTO `language_text` VALUES ('en', '_template','sent_via_transformable','Sent via an Transformable system at %s','2009-01-09 14:15:29','');
+INSERT INTO `language_text` VALUES ('en', '_template','site_name','Site Name','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','sql_statement','SQL Statement','2009-06-22 14:49:02','');
+INSERT INTO `language_text` VALUES ('en', '_template','status','Status','2009-01-21 12:38:52','');
+INSERT INTO `language_text` VALUES ('en', '_template','submit','Submit','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','submit_no','No','2009-01-23 11:25:56','');
+INSERT INTO `language_text` VALUES ('en', '_template','submit_yes','Yes','2009-01-23 11:25:56','');
+INSERT INTO `language_text` VALUES ('en', '_template','system','System','2009-10-20 14:59:34','');
+INSERT INTO `language_text` VALUES ('en', '_template','system_settings','System Settings','2009-10-21 10:48:59','');
+INSERT INTO `language_text` VALUES ('en', '_template','system_update_id','System Update ID','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','term_type','Term Type','2009-03-24 13:47:37','');
+INSERT INTO `language_text` VALUES ('en', '_template','theme','Theme','2009-10-21 15:19:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','the_follow_errors_occurred','The following errors occurred:','2008-12-15 09:25:06','');
+INSERT INTO `language_text` VALUES ('en', '_template','title','Title','2009-01-20 11:45:23','');
+INSERT INTO `language_text` VALUES ('en', '_template','translated_context','Translated Context','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','translated_terms','Translated Terms','2008-11-27 09:48:36','');
+INSERT INTO `language_text` VALUES ('en', '_template','translated_text','Translated Text','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','translate_to','Translate to','2008-12-01 13:18:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','translation','Translation','2009-02-18 11:01:39','');
+INSERT INTO `language_text` VALUES ('en', '_template','translator','Translator','2009-01-07 15:05:34','');
+INSERT INTO `language_text` VALUES ('en', '_template','updated_terms','Updated Terms','2008-12-02 09:16:45','');
+INSERT INTO `language_text` VALUES ('en', '_template','updater','Updater','2009-06-22 14:49:01','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','updater_alter_modified_files','The listed files have been modified locally. If you choose to proceed, your local file will be modified. The original\nfile will be backup before the modification. Please note that the modification on your customized code may break your customization.<br>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','updater_overwrite_modified_files','The listed files have been modified locally. If you choose to proceed, the update file will be copied to your local machine. \nYou have to manually merge this file and your local copy.<br>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','updater_show_backup_files','Below is the list of the backup files created by update installation. After ensuring Transformable works properly with the update, you may want to delete these files. If Transformable does not work properly with the update, you can always revert back to the old files by renaming the backup files \nto the original file names,  removing the [update_id].old portion of the file name. <br>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','updater_show_update_files','Below is the list of the update files copied to your computer. \nPlease manually merge the change between the update files and your local copy. <br>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','updates','Updates','2009-06-22 14:49:01','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','update_dependent_update_not_installed','<br /><span style=\"color: red\">Warning: There are update dependencies, please install the listed updates first: </span>','2009-06-22 14:49:03','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','update_local_file_not_exist','Cannot proceed. The listed files are not exist in your local machine. If you renamed them to your copy, in order to proceed, please rename back.<br>','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','upload','Upload','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','upload_file','Upload File','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','upload_update','Upload a zip file to install update:','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','user','User','2009-02-27 16:07:19','');
+INSERT INTO `language_text` VALUES ('en', '_template','users','Users','2009-04-14 10:41:51','');
+INSERT INTO `language_text` VALUES ('en', '_template','user_group','User Group','2009-02-04 11:51:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','user_status','User Status','2009-02-04 11:51:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','use_captcha','Allow the use of CAPTCHA','2009-10-21 15:25:18','');
+INSERT INTO `language_text` VALUES ('en', '_template','version_not_match','This update is for Transformable version %s. Does not match with your current Transformable version. The installation of it may break Transformable. Are you sure you want to proceed?','2009-06-22 14:49:02','Updater');
+INSERT INTO `language_text` VALUES ('en', '_template','view','View','2009-01-20 11:47:15','');
+INSERT INTO `language_text` VALUES ('en', '_template','view_message','View Message','2009-06-22 14:49:01','');
+INSERT INTO `language_text` VALUES ('en', '_template','warning','Warning','2009-05-29 16:19:57','');
+INSERT INTO `language_text` VALUES ('en', '_template','web_service_api','Web Service API','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','web_service_id','Web Service ID','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','web_site','Web Site','2009-02-06 09:08:32','');
+INSERT INTO `language_text` VALUES ('en', '_template','welcome','Welcome','2009-10-07 09:55:16','');
+INSERT INTO `language_text` VALUES ('en', '_template','yes','Yes','2009-01-21 12:38:17','');
+INSERT INTO `language_text` VALUES ('en', '_template','yyyy-mm-dd','yyyy-mm-dd','2009-01-21 15:06:01','');
index af43c44..e258f7d 100644 (file)
@@ -31,7 +31,7 @@ $_defaults['ill_ext'] = 'exe, asp, php, php3, bat, cgi, pl, com, vbs, reg, pcd,
 $_defaults['cache_dir'] = '';
 
 $_defaults['theme_categories'] = 'FALSE';
-$_defaults['content_dir'] = realpath('../').DIRECTORY_SEPARATOR.'temp';
+$_defaults['content_dir'] = realpath('../').DIRECTORY_SEPARATOR.'content';
 
 require('include/classes/sqlutility.php');
 
index 5f973ea..6255ca8 100644 (file)
@@ -21,7 +21,7 @@ function write_config_file($filename, $comments) {
                                        '{PORT}',
                                        '{DBNAME}',
                                        '{TABLE_PREFIX}',
-                                       '{TEMP_DIR}',
+                                       '{CONTENT_DIR}',
                                        '{GENERATED_COMMENTS}',
                                );
 
@@ -82,11 +82,11 @@ define('DB_NAME',                      '{DBNAME}');
 /* tables. Default: TR_                                                 */
 define('TABLE_PREFIX',                 '{TABLE_PREFIX}');
 
-/* Where the temporary files are located.  This includes all file       */
+/* Where the content files are located.  This includes all file       */
 /* manager and imported files.  If security is a concern, it is         */
-/* recommended that the temporary directory be moved outside of the web        */
+/* recommended that the content directory be moved outside of the web  */
 /* accessible area.                                                                                                            */
-define('TR_TEMP_DIR', '{TEMP_DIR}');
+define('TR_CONTENT_DIR', '{CONTENT_DIR}');
 
 /* DO NOT ALTER THIS LAST LINE                                          */
 define('TR_INSTALL', TRUE);
index 64c556e..23e1c5b 100644 (file)
@@ -27,7 +27,7 @@ $install_steps[0] = array('name' => 'Introduction');
 $install_steps[1] = array('name' => 'Terms of Use');
 $install_steps[2] = array('name' => 'Database');
 $install_steps[3] = array('name' => 'Accounts & Preferences');
-$install_steps[4] = array('name' => 'Temporary Directory');
+$install_steps[4] = array('name' => 'Content Directory');
 $install_steps[5] = array('name' => 'Save Configuration');
 $install_steps[6] = array('name' => 'Anonymous Usage Collection');
 $install_steps[7] = array('name' => 'Done!');
index f959af2..1a42f96 100644 (file)
@@ -55,7 +55,7 @@ if(isset($_POST['submit']) && ($_POST['action'] == 'process')) {
                $status = 3; // for instructor account
 
                $sql = "INSERT INTO ".$_POST['step2']['tb_prefix']."users (login, password, user_group_id, email, web_service_id, create_date)
-               VALUES ('$_POST[admin_username]', '$_POST[form_admin_password_hidden]', 1, '$_POST[admin_email]', '".sha1(mt_rand() . microtime(TRUE))."', NOW())";
+               VALUES ('$_POST[admin_username]', '$_POST[form_admin_password_hidden]', 1, '$_POST[admin_email]', '".substr(md5(uniqid(rand(), true)),0,32)."', NOW())";
                $result= mysql_query($sql, $db);
 
                $_POST['site_name'] = $addslashes($_POST['site_name']);
index 4f18deb..bdb957a 100644 (file)
@@ -18,11 +18,11 @@ if (isset($_POST['submit'])) {
        unset($errors);
 
        if (!file_exists($_POST['content_dir']) || !realpath($_POST['content_dir'])) {
-               $errors[] = '<strong>Temporary Directory</strong> entered does not exist.';
+               $errors[] = '<strong>Content Directory</strong> entered does not exist.';
        } else if (!is_dir($_POST['content_dir'])) {
-               $errors[] = '<strong>Temporary Directory</strong> is not a directory.';
+               $errors[] = '<strong>Content Directory</strong> is not a directory.';
        } else if (!is_writable($_POST['content_dir'])){
-               $errors[] = 'The Temporary Directory is not writable.';
+               $errors[] = 'The Content Directory is not writable.';
        } else {
 
                $_POST['content_dir'] = realpath(urldecode($_POST['content_dir']));
@@ -170,7 +170,7 @@ else
        <input type="hidden" name="content_dir" value="<?php echo $_defaults['content_dir']; ?>" />
        <table width="80%" class="tableborder" cellspacing="0" cellpadding="1" align="center">  
        <tr>
-               <td class="row1">The temporary directory at <strong><?php echo $_defaults['content_dir']; ?> </strong> will be used for this installation. Please create it if it does not already exist.</td>
+               <td class="row1">The content directory at <strong><?php echo $_defaults['content_dir']; ?> </strong> will be used for this installation. Please create it if it does not already exist.</td>
        </tr>
        </table>
 <?php elseif ($get_file == 'FALSE') : ?>
@@ -178,9 +178,9 @@ else
 
        <table width="80%" class="tableborder" cellspacing="0" cellpadding="1" align="center">  
        <tr>
-               <td class="row1"><div class="required" title="Required Field">*</div><strong><label for="contentdir">Temporary Directory</label></strong>
-               <p>It has been detected that your webserver does not support the protected temporary directory feature. The temporary directory stores all of the temporary files.</p>
-               <p>Due to that restriction your temporary directory must exist within your Transformable installation directory and cannot be moved. Its path is specified below. Please create it if it does not already exist.</p>
+               <td class="row1"><div class="required" title="Required Field">*</div><strong><label for="contentdir">Content Directory</label></strong>
+               <p>It has been detected that your webserver does not support the protected content directory feature. The content directory stores all of the content files.</p>
+               <p>Due to that restriction your content directory must exist within your Transformable installation directory and cannot be moved. Its path is specified below. Please create it if it does not already exist.</p>
                <br /><br />
                <input type="text" name="content_dir_disabled" id="contentdir" value="<?php if (!empty($_POST['content_dir'])) { echo $_POST['content_dir']; } else { echo $_defaults['content_dir']; } ?>" class="formfield" size="70" disabled="disabled" /></td>
        </tr>
@@ -188,12 +188,12 @@ else
 <?php else: ?>
        <table width="80%" class="tableborder" cellspacing="0" cellpadding="1" align="center">  
        <tr>
-               <td class="row1"><div class="required" title="Required Field">*</div><strong><label for="contentdir">Temporary Directory</label></strong>
-               <p>Please specify where the temporary directory should be. The temporary directory stores all of the temporary files. As a security measure, the temporary directory should be placed <em>outside</em> of your Transformable installation (for example, to a non-web-accessible location that is not publically available).</p>
+               <td class="row1"><div class="required" title="Required Field">*</div><strong><label for="contentdir">Content Directory</label></strong>
+               <p>Please specify where the content directory should be. The content directory stores all of the content files. As a security measure, the content directory should be placed <em>outside</em> of your Transformable installation (for example, to a non-web-accessible location that is not publically available).</p>
                
-               <p>On a Windows machine, the path should look like <kbd>C:\temp</kbd>, while on Unix it should look like <kbd>/var/temp</kbd>.</p>
+               <p>On a Windows machine, the path should look like <kbd>C:\content</kbd>, while on Unix it should look like <kbd>/var/content</kbd>.</p>
                
-               <p>The directory you specify must be created if it does not already exist and be writeable by the webserver. On Unix machines issue the command <kbd>chmod a+rwx temp</kbd>, additionally the path may not contain any symbolic links.</p>
+               <p>The directory you specify must be created if it does not already exist and be writeable by the webserver. On Unix machines issue the command <kbd>chmod a+rwx content</kbd>, additionally the path may not contain any symbolic links.</p>
 
                <input type="text" name="content_dir" id="contentdir" value="<?php if (!empty($_POST['content_dir'])) { echo $_POST['content_dir']; } else { echo $_defaults['content_dir']; } ?>" class="formfield" size="70" /></td>
        </tr>
index f154b9b..9706f79 100644 (file)
@@ -31,7 +31,7 @@ $install_steps[0] = array('name' => 'Introduction');
 $install_steps[1] = array('name' => 'Locate Old Version');\r
 $install_steps[2] = array('name' => 'Database');\r
 $install_steps[3] = array('name' => 'New '.$new_version.' Configuration Options');\r
-$install_steps[4] = array('name' => 'Temporary Directory');\r
+$install_steps[4] = array('name' => 'Content Directory');\r
 $install_steps[5] = array('name' => 'Save Configuration');\r
 $install_steps[6] = array('name' => 'Anonymous Usage Collection');\r
 $install_steps[7] = array('name' => 'Done!');\r
index d59abad..9c8f32e 100644 (file)
@@ -123,8 +123,8 @@ if (isset($_POST['submit']) && (trim($_POST['old_path']) != '')) {
                                        echo '<input type="hidden" name="cache_dir" value="' . $_defaults['cache_dir'] . '" />';
                                }
 
-                               if (defined('TR_TEMP_DIR')) {
-                                       echo '<input type="hidden" name="content_dir" value="'.TR_TEMP_DIR.'" />';
+                               if (defined('TR_CONTENT_DIR')) {
+                                       echo '<input type="hidden" name="content_dir" value="'.TR_CONTENT_DIR.'" />';
                                } else {
                                        echo '<input type="hidden" name="content_dir" value="'.$_defaults['content_dir'].'" />';
                                }
index 14732ad..a7439cc 100644 (file)
@@ -64,7 +64,7 @@ $_POST['db_password'] = urldecode($_POST['db_password']);
 //                             }
 //                     }
 
-                       $sql = "DELETE FROM ".$_POST['tb_prefix']."languages WHERE language_code<>'eng'";
+                       $sql = "DELETE FROM ".$_POST['tb_prefix']."languages WHERE language_code<>'en'";
                        @mysql_query($sql, $db);
 
                        //get list of all update scripts minus sql extension
@@ -85,7 +85,7 @@ $_POST['db_password'] = urldecode($_POST['db_password']);
                        }
                        
                        /* reset all the accounts to English */
-//                     $sql = "UPDATE ".$_POST['tb_prefix']."users SET language='eng', creation_date=creation_date, last_login=last_login";
+//                     $sql = "UPDATE ".$_POST['tb_prefix']."users SET language='en', creation_date=creation_date, last_login=last_login";
 //                     @mysql_query($sql, $db);
 
                        queryFromFile('db/language_text.sql');
index f3b1d0e..dffd07a 100644 (file)
@@ -38,7 +38,6 @@ else if ($_POST['delete'])
        \r
        if (!$msg->containsErrors())\r
        {\r
-               $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
                header('Location: language_delete.php?id='.$_POST['id']);\r
                exit;\r
        }\r
index 4611fc3..c584579 100644 (file)
@@ -28,6 +28,7 @@ if (isset($_POST['field']) && isset($_POST['value']) && $_POST['value'] <> '')
        $pieces = explode(':', $_POST['field']);\r
        $languagesDAO->UpdateField($pieces[1], $pieces[2], $pieces[0], $_POST['value']);\r
        $rtn['status'] = 'success';\r
+       $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');\r
 }\r
 \r
 echo json_encode($rtn);\r
index 766e7ba..f306b6c 100644 (file)
@@ -36,7 +36,7 @@ if (isset($_POST['cancel']))
 } \r
 else if (isset($_POST['save']))\r
 {\r
-       if (isset($_GET["id"]))  // edit existing guideline\r
+       if (isset($_GET["id"]))  // edit existing language\r
        {\r
                if ($languagesDAO->Update($lang_code, \r
                                      $charset,\r
@@ -50,7 +50,7 @@ else if (isset($_POST['save']))
                        exit;\r
                }\r
        }\r
-       else  // create a new guideline\r
+       else  // create a new language\r
        {\r
                if (isset($_POST['locale']) && $_POST['locale'] <> '')\r
                        $language_code = $_POST['lang_code'] . TR_LANGUAGE_LOCALE_SEP. $_POST['locale'];\r
diff --git a/docs/search.php b/docs/search.php
new file mode 100644 (file)
index 0000000..2fccfa7
--- /dev/null
@@ -0,0 +1,86 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+/*\r
+ * This is the web service interface to search transformable and return\r
+ * search results in REST\r
+ * Expected parameters:\r
+ * id: to identify the user. must be given\r
+ * keywords: The keywords to search for. must be given\r
+ * start: start receiving from this record number, 0 if not specified\r
+ * maxResults: Number of results desired, 10 if not specified\r
+ */\r
+\r
+define('TR_INCLUDE_PATH', 'include/');\r
+\r
+include(TR_INCLUDE_PATH.'vitals.inc.php');\r
+include_once(TR_INCLUDE_PATH. 'classes/Utility.class.php');\r
+include_once(TR_INCLUDE_PATH. 'classes/DAO/UsersDAO.class.php');\r
+include_once(TR_INCLUDE_PATH. 'classes/DAO/CoursesDAO.class.php');\r
+include_once(TR_INCLUDE_PATH. 'classes/RESTWebServiceOutput.class.php');\r
+\r
+$keywords = trim(urldecode($_REQUEST['keywords']));\r
+$web_service_id = trim($_REQUEST['id']);\r
+$start = intval(trim(strtolower($_REQUEST['start'])));\r
+$maxResults = intval(trim(strtolower($_REQUEST['maxResults'])));\r
+\r
+if ($maxResults == 0) $maxResults = 10;  // default\r
+\r
+// validate parameters\r
+if ($keywords == '')\r
+{\r
+       $errors[] = 'TR_ERROR_EMPTY_KEYWORDS';\r
+}\r
+\r
+if ($web_service_id == '')\r
+{\r
+       $errors[] = 'TR_ERROR_EMPTY_WEB_SERVICE_ID';\r
+}\r
+else\r
+{ // validate web service id\r
+       $usersDAO = new UsersDAO();\r
+       $user_row = $usersDAO->getUserByWebServiceID($web_service_id);\r
+\r
+       if (!$user_row) $errors[] = 'TR_ERROR_INVALID_WEB_SERVICE_ID';\r
+       \r
+       $user_id = $user_row['user_id'];\r
+}\r
+\r
+// return errors\r
+if (is_array($errors))\r
+{\r
+       echo RESTWebServiceOutput::generateErrorRpt($errors);\r
+       exit;\r
+}\r
+\r
+$coursesDAO = new CoursesDAO();\r
+$results = $coursesDAO->getSearchResult($keywords, $start, $maxResults);\r
+\r
+// get total number of search results regardless of $maxResults\r
+$all_results = $coursesDAO->getSearchResult($keywords);\r
+if (is_array($all_results)) $total_num = count($all_results);\r
+else $total_num = 0;\r
+\r
+// calculate the last record number\r
+if (is_array($results))\r
+{\r
+       $num_of_results = count($results);\r
+       \r
+       if ($maxResults > $num_of_results) $last_rec_number = $start + $num_of_results;\r
+       else $last_rec_number = $start + $maxResults;\r
+}\r
+else $last_rec_number = $total_num;\r
+\r
+//debug($results);exit;\r
+$restWebServiceOutput = new RESTWebServiceOutput($results, $total_num, $last_rec_number);\r
+echo $restWebServiceOutput->getWebServiceOutput();\r
+?>\r
diff --git a/docs/themes/default/home/course/content.tmpl.php b/docs/themes/default/home/course/content.tmpl.php
new file mode 100644 (file)
index 0000000..efa12c9
--- /dev/null
@@ -0,0 +1,57 @@
+<?php\r
+/************************************************************************/\r
+/* Transformable                                                        */\r
+/************************************************************************/\r
+/* Copyright (c) 2009                                                   */\r
+/* Adaptive Technology Resource Centre / University of Toronto          */\r
+/*                                                                      */\r
+/* This program is free software. You can redistribute it and/or        */\r
+/* modify it under the terms of the GNU General Public License          */\r
+/* as published by the Free Software Foundation.                        */\r
+/************************************************************************/\r
+\r
+if (!defined('TR_INCLUDE_PATH')) { exit; } ?>\r
+\r
+<?php if ($this->shortcuts): ?>\r
+<input type="hidden" name="course_id" value="<?php echo $this->course_id; ?>" />\r
+\r
+<fieldset id="shortcuts"><legend><?php echo _AT('shortcuts'); ?></legend>\r
+       <ul>\r
+               <?php foreach ($this->shortcuts as $link): ?>\r
+                       <li><a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a></li>\r
+               <?php endforeach; ?>\r
+       </ul>\r
+</fieldset>\r
+<?php endif; ?>\r
+\r
+<?php \r
+if ($_SESSION["prefs"]["PREF_SHOW_CONTENTS"] && $this->content_table <> "") \r
+       echo $this->content_table;\r
+?>\r
+\r
+<div id="content-text">\r
+       <?php echo $this->body; ?>\r
+</div>\r
+\r
+<?php if (!empty($this->test_ids)): ?>\r
+<div id="content-test" class="input-form">\r
+       <ol>\r
+               <strong><?php echo _AT('tests') . ':' ; ?></strong>\r
+               <li class="top-tool"><?php echo $this->test_message; ?></li>\r
+               <ul class="tools">\r
+               <?php \r
+                       foreach ($this->test_ids as $id => $test_obj){\r
+//                             echo '<li><a href="'.url_rewrite('tools/test_intro.php?tid='.$test_obj['test_id'], AT_PRETTY_URL_IS_HEADER).'">'.\r
+                               echo '<li><a href="tools/test_intro.php?tid='.$test_obj['test_id'].'">'.\r
+                               AT_print($test_obj['title'], 'tests.title').'</a><br /></li>';\r
+                       }\r
+               ?>\r
+               </ul>\r
+       </li></ol>\r
+</div>\r
+<?php endif; ?>\r
+\r
+<div id="content-info">\r
+       <?php echo $this->content_info; ?>\r
+\r
+</div>
\ No newline at end of file
diff --git a/docs/themes/default/home/course/course_property.tmpl.php b/docs/themes/default/home/course/course_property.tmpl.php
new file mode 100644 (file)
index 0000000..458706d
--- /dev/null
@@ -0,0 +1,68 @@
+<?php 
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+global $languageManager;
+
+?>
+
+<form method="post" action="<?php echo $_SERVER['PHP_SELF'].'?_course_id='.$this->course_id; ?>" name="form">
+<input type="hidden" name="_course_id" value="<?php echo $this->course_id; ?>" />
+
+<div class="input-form">
+<fieldset class="group_form"><legend class="group_form"><?php echo _AT('course_property'); ?></legend>
+
+       <table class="form-data" align="center">
+               <tr>
+                       <td colspan="2" align="left"><br/><?php echo _AT('required_field_text') ;?></td>
+               </tr>
+
+               <tr>
+                       <td align="left"><div class="required" title="<?php echo _AT('required_field'); ?>">*</div>
+                       <label for="title"><?php echo _AT('title'); ?></label>:</td>
+                       <td align="left"><input id="title" name="title" type="text" maxlength="255" size="45" value="<?php if (isset($_POST['login'])) echo stripslashes(htmlspecialchars($_POST['title'])); else echo stripslashes(htmlspecialchars($this->course_row['title'])); ?>" /></td>
+               </tr>
+
+               <tr>
+                       <td align="left"><label for="pri_lang"><?php  echo _AT('primary_language'); ?></label></td>
+                       <td align="left"><?php $languageManager->printDropdown($this->course_row['primary_language'], 'pri_lang', 'pri_lang'); ?></td>
+               </tr>
+
+               <tr>
+                       <td align="left"><label for="description"><?php echo _AT('description'); ?></label></td>
+                       <td align="left"><textarea id="description" cols="45" rows="2" name="description"><?php if (isset($_POST['description'])) echo stripslashes(htmlspecialchars($_POST['description'])); else echo stripslashes(htmlspecialchars($this->course_row['description'])); ?></textarea></td>
+               </tr>
+               
+               <tr>
+                       <td align="left"><label for="copyright"><?php echo _AT('course_copyright'); ?></label></td>
+                       <td align="left"><textarea name="copyright" rows="2" cols="65" id="copyright"><?php if (isset($_POST['copyright'])) echo stripslashes(htmlspecialchars($_POST['copyright'])); else echo $this->course_row['copyright']; ?></textarea></td>
+               </tr>
+
+               <tr>
+                       <td colspan="2" align="left">
+                         <input type="checkbox" name="hide_course" id="hide_course" value="1" <?php if ($this->course_row['access']=='private') echo "checked"; ?> />
+                         <label for="hide_course"><?php echo _AT('hide_course'); ?></label>
+                       </td>
+               </tr>
+
+               <tr>
+                       <td colspan="2">
+                       <p class="submit_button">
+                               <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" class="submit" /> 
+                               <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" class="submit" />
+                       </p>
+                       </td>
+               </tr>
+       </table>
+
+</fieldset>
+</div>
+</form>
diff --git a/docs/themes/default/home/create_course.tmpl.php b/docs/themes/default/home/create_course.tmpl.php
new file mode 100644 (file)
index 0000000..5e0e21f
--- /dev/null
@@ -0,0 +1,18 @@
+<?php 
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+require(TR_INCLUDE_PATH.'header.inc.php'); 
+
+include('create_course_tmpl.tmpl.php');
+
+require(TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/themes/default/home/create_course_tmpl.tmpl.php b/docs/themes/default/home/create_course_tmpl.tmpl.php
new file mode 100644 (file)
index 0000000..df73faf
--- /dev/null
@@ -0,0 +1,61 @@
+<?php 
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+global $_current_user;
+
+if (isset($_current_user) && $_current_user->isAuthor())
+{
+?>
+       <div class="input-form">
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('create_course'); ?></legend>
+       <form name="form1" method="post" action="home/ims/ims_import.php" enctype="multipart/form-data" onsubmit="openWindow('<?php echo TR_BASE_HREF; ?>home/prog.php');">
+               <table class="form_data">
+               <tr><td>
+               <?php echo _AT('create_course_1'); ?>
+               <a href="course_wizard.php"><?php echo htmlentities(_AT('course_wizard')); ?></a><br /><br />
+               </td></tr>
+
+               <tr><td>
+               <?php echo _AT('create_course_2'); ?>
+               </td></tr>
+               <tr><td>
+                       <label for="to_file"><?php echo _AT('upload_content_package'); ?></label>
+                       <input type="file" name="file" id="to_file" />
+               </td></tr>
+       
+               <tr><td>
+                       <label for="to_url"><?php echo _AT('specify_url_to_content_package'); ?></label>
+                       <input type="text" name="url" value="http://" size="40" id="to_url" />
+               </td></tr>
+       
+               <tr><td>
+                       <input type="checkbox" name="hide_course" id="hide_course" value="1" /><label for="hide_course"><?php echo _AT('hide_course'); ?></label>
+               </td></tr>
+       
+               <tr align="center"><td>
+                       <input type="submit" name="submit" value="<?php echo _AT('import'); ?>" />
+               </td></tr>
+               </table>
+       </form>
+       </fieldset>
+       </div>
+
+<script language="javascript" type="text/javascript">
+function openWindow(page) {
+       newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
+       newWindow.focus();
+}
+</script>
+
+<?php 
+}
+?>
\ No newline at end of file
diff --git a/docs/themes/default/home/index_course.tmpl.php b/docs/themes/default/home/index_course.tmpl.php
new file mode 100644 (file)
index 0000000..7e023d8
--- /dev/null
@@ -0,0 +1,127 @@
+<?php 
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+// determine the from url is search.php or index.php
+global $_base_path;
+require_once(TR_INCLUDE_PATH.'classes/Utility.class.php');
+
+// This template is called by home/index.php and home/search.php
+// Find out the caller URL and direct the page back to the caller 
+// after adding/removing the course from "My Courses"
+$caller_url_parts = explode('/', $_SERVER['PHP_SELF']); 
+$caller_script = $caller_url_parts[count($caller_url_parts)-1];
+
+// construct the caller query string
+if (count($_GET) > 0)
+{
+       $url_param = '?';
+       $counter = 0;
+       foreach ($_GET as $param => $value)
+       {
+               $counter++;
+               if ($param == 'action' || $param == 'cid') 
+               {
+                       $counter--;
+                       continue;
+               }
+               else if ($counter > 1)
+               {
+                       $url_param .= '&';
+               }
+               $url_param .= $param.'='.$value;
+       }
+}
+$caller_url = $caller_script. (isset($url_param) ? $url_param.'&' : '?');
+
+if (isset($this->search_text)) $keywords = explode(' ', $this->search_text);
+
+require(TR_INCLUDE_PATH.'header.inc.php'); 
+?>
+
+<div class="input-form">
+<fieldset class="group_form"><legend class="group_form"><?php echo $this->title; ?></legend>
+<?php if (is_array($this->courses)) { ?>
+  <div class="results">
+    <ol>
+<?php 
+       $num_results = count($this->courses);
+       
+       // if the requested page number exceeds the max number of pages, set the current page to the last page
+       $num_pages = ceil($num_results / RESULTS_PER_PAGE);
+       if ($this->curr_page_num > $num_pages) $this->curr_page_num = $num_pages;
+       
+       
+       $start_num = ($this->curr_page_num - 1) * RESULTS_PER_PAGE;
+       $end_num = min($this->curr_page_num * RESULTS_PER_PAGE, $num_results);
+?>
+      <li class="course" style="font-weight:bold">
+        <div><?php echo _AT('results').' '.($start_num+1) .'-'.$end_num.' '._AT('of').' '.$num_results.' '. ($this->search_text<>'' ? _AT('for').' "<em>'.$this->search_text.'</em>"':'');?>
+          <span style="float: right"><img src="<?php echo TR_BASE_HREF; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/my_own_course.png" alt="<?php echo _AT('my_authoring_course'); ?>" title="<?php echo _AT('my_authoring_course'); ?>" />&nbsp;&nbsp;&nbsp;<?php echo _AT('authoring_img_info'); ?></span>
+        </div>
+                               
+      </li>
+<?php  for ($i = $start_num; $i < $end_num; $i++) {
+               // only display the first 200 character of course description
+               $row = $this->courses[$i];
+               
+               $len_description = 330;
+               if (strlen($row['description']) > $len_description)
+                       $description = Utility::highlightKeywords(substr($row['description'], 0, $len_description), $keywords).' ...';
+               else
+                       $description = Utility::highlightKeywords($row['description'], $keywords);
+?>
+      <li class="course">
+        <h3>
+<?php if ($row['role'] == TR_USERROLE_AUTHOR) {?>
+          <img src="<?php echo TR_BASE_HREF; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/my_own_course.png" alt="<?php echo _AT('my_authoring_course'); ?>" title="<?php echo _AT('my_authoring_course'); ?>" />
+<?php }?>
+          <a href="<?php echo TR_BASE_HREF; ?>home/course/index.php?_course_id=<?php echo $row['course_id']; ?>"><?php echo Utility::highlightKeywords($row['title'], $keywords); ?></a>
+<?php if ($row['role'] == TR_USERROLE_VIEWER) {?>
+          <a href="<?php echo TR_BASE_HREF; ?>home/<?php echo $caller_url; ?>action=remove&cid=<?php echo $row['course_id']; ?>">
+            <img src="<?php echo TR_BASE_HREF; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/delete.gif" alt='<?php echo htmlspecialchars(_AT('remove_from_list')); ?>' title='<?php echo htmlspecialchars(_AT('remove_from_list')); ?>' border="0" />
+          </a>
+<?php } if ($row['role'] == NULL && $_SESSION['user_id']>0) {?>
+          <a href="<?php echo TR_BASE_HREF; ?>home/<?php echo $caller_url; ?>action=add&cid=<?php echo $row['course_id'];?>">
+            <img src="<?php echo TR_BASE_HREF; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/add.gif" alt="<?php echo htmlspecialchars(_AT('add_into_list')); ?>" title="<?php echo htmlspecialchars(_AT('add_into_list')); ?>" border="0" />
+          </a>
+<?php }?>
+          <a href="<?php echo TR_BASE_HREF; ?>home/imscc/ims_export.php?course_id=<?php echo $row['course_id']; ?>">
+            <img src="<?php echo TR_BASE_HREF; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/export.png" alt="<?php echo _AT('export'); ?>" title="<?php echo _AT('export'); ?>" border="0" />
+          </a>
+        </h3>
+        <div><?php echo $description; ?></div>
+      </li>                            
+<?php } // end of foreach; ?>
+    </ol>
+<?php  print_paginator($this->curr_page_num, $num_results, '', RESULTS_PER_PAGE);?>
+  </div>
+<?php } // end of if
+else {
+       echo _AT("no_results_for_keywords", $this->search_text);
+} // end of else?>
+</fieldset>
+</div>
+
+<script type="text/javascript">
+//var Trans = Trans || {};
+//Trans.course = Trans.course || {};
+namespace('Trans.course'); 
+/**
+* Add the course into "My Courses" list
+*/
+Trans.course.addCourse = function (course_id) {
+       alert(course_id);
+       return false;
+};
+</script>
+
+<?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
diff --git a/docs/themes/default/home/index_search.tmpl.php b/docs/themes/default/home/index_search.tmpl.php
new file mode 100644 (file)
index 0000000..47fd985
--- /dev/null
@@ -0,0 +1,43 @@
+<?php 
+/************************************************************************/
+/* Transformable                                                        */
+/************************************************************************/
+/* Copyright (c) 2009                                                   */
+/* Adaptive Technology Resource Centre / University of Toronto          */
+/*                                                                      */
+/* 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.                        */
+/************************************************************************/
+
+global $onload;
+$onload .="document.frm_search.search_text.focus();";
+
+require(TR_INCLUDE_PATH.'header.inc.php'); 
+global $_current_user;
+
+if (!isset($_current_user))
+{
+?>
+       <div class="input-form">
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('getting_start'); ?></legend>
+       <?php echo _AT('getting_start_info');?>
+       </fieldset>
+       </div>
+<?php } // end of if
+?>
+       <div class="input-form">
+       <fieldset class="group_form"><legend class="group_form"><?php echo _AT('search'); ?></legend>
+               <form target="_top" action="<?php echo TR_BASE_HREF; ?>home/search.php" method="get" name="frm_search">
+               <?php if (isset($this->user_row)) echo _AT('search_and_add').':'; ?>
+               <input type="text" name="search_text" id="search_text" value="<?php if (isset($_POST['search_text'])) echo $_POST['search_text']; ?>" size="50"   />
+               <input type="submit" name="search" size="100" value="<?php echo _AT("search"); ?>" />
+               </form>
+       </fieldset>
+       </div>
+
+<?php 
+include('create_course_tmpl.tmpl.php');
+
+require(TR_INCLUDE_PATH.'footer.inc.php'); 
+?>
\ No newline at end of file
diff --git a/docs/themes/default/images/Thumbs.db b/docs/themes/default/images/Thumbs.db
new file mode 100644 (file)
index 0000000..37a0f8c
Binary files /dev/null and b/docs/themes/default/images/Thumbs.db differ
diff --git a/docs/themes/default/images/bottom-right.gif b/docs/themes/default/images/bottom-right.gif
new file mode 100644 (file)
index 0000000..85c3f77
Binary files /dev/null and b/docs/themes/default/images/bottom-right.gif differ
diff --git a/docs/themes/default/images/bottom.gif b/docs/themes/default/images/bottom.gif
new file mode 100644 (file)
index 0000000..46d18f3
Binary files /dev/null and b/docs/themes/default/images/bottom.gif differ
diff --git a/docs/themes/default/images/course_property.png b/docs/themes/default/images/course_property.png
new file mode 100644 (file)
index 0000000..ee42c97
Binary files /dev/null and b/docs/themes/default/images/course_property.png differ
diff --git a/docs/themes/default/images/exit.png b/docs/themes/default/images/exit.png
new file mode 100644 (file)
index 0000000..0d154d5
Binary files /dev/null and b/docs/themes/default/images/exit.png differ
diff --git a/docs/themes/default/images/export.png b/docs/themes/default/images/export.png
new file mode 100644 (file)
index 0000000..7e6636e
Binary files /dev/null and b/docs/themes/default/images/export.png differ
diff --git a/docs/themes/default/images/goto_top.gif b/docs/themes/default/images/goto_top.gif
new file mode 100644 (file)
index 0000000..5e61588
Binary files /dev/null and b/docs/themes/default/images/goto_top.gif differ
diff --git a/docs/themes/default/images/leftside.gif b/docs/themes/default/images/leftside.gif
new file mode 100644 (file)
index 0000000..1a61acf
Binary files /dev/null and b/docs/themes/default/images/leftside.gif differ
diff --git a/docs/themes/default/images/my_own_course.png b/docs/themes/default/images/my_own_course.png
new file mode 100644 (file)
index 0000000..c2b31c2
Binary files /dev/null and b/docs/themes/default/images/my_own_course.png differ
diff --git a/docs/themes/default/images/next.gif b/docs/themes/default/images/next.gif
new file mode 100644 (file)
index 0000000..b756085
Binary files /dev/null and b/docs/themes/default/images/next.gif differ
diff --git a/docs/themes/default/images/previous.gif b/docs/themes/default/images/previous.gif
new file mode 100644 (file)
index 0000000..7391bfd
Binary files /dev/null and b/docs/themes/default/images/previous.gif differ
diff --git a/docs/themes/default/images/resume.gif b/docs/themes/default/images/resume.gif
new file mode 100644 (file)
index 0000000..1a16515
Binary files /dev/null and b/docs/themes/default/images/resume.gif differ
diff --git a/docs/themes/default/images/rightside.gif b/docs/themes/default/images/rightside.gif
new file mode 100644 (file)
index 0000000..f1e7585
Binary files /dev/null and b/docs/themes/default/images/rightside.gif differ
diff --git a/docs/themes/default/images/top-right.gif b/docs/themes/default/images/top-right.gif
new file mode 100644 (file)
index 0000000..eff7948
Binary files /dev/null and b/docs/themes/default/images/top-right.gif differ
diff --git a/docs/themes/default/images/top.gif b/docs/themes/default/images/top.gif
new file mode 100644 (file)
index 0000000..be2ac47
Binary files /dev/null and b/docs/themes/default/images/top.gif differ
diff --git a/docs/themes/default/include/box.tmpl.php b/docs/themes/default/include/box.tmpl.php
new file mode 100644 (file)
index 0000000..4b4d56a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php 
+if (!defined('TR_INCLUDE_PATH')) { exit; } 
+global $_base_path;
+
+$compact_title = str_replace(' ', '', $this->title);
+?>
+
+<br />
+<script language="javascript" type="text/javascript">
+       printSubmenuHeader("<?php echo $this->title; ?>", "<?php echo $_base_path; ?>", "<?php echo _AT('show'); ?>", "<?php echo _AT('hide'); ?>");
+</script>
+
+<div class="box" id="menu_<?php echo $compact_title ?>">
+       <?php echo $this->dropdown_contents; ?>
+</div>
+
+<script language="javascript" type="text/javascript">
+if (getcookie("m_<?php echo $this->title; ?>") == "0")
+{
+       jQuery("#menu_<?php echo $compact_title; ?>").hide();
+}
+else
+{
+       jQuery("#menu_<?php echo $compact_title; ?>").show();
+}
+</script>
\ No newline at end of file
index 7b1babb..c26d6d6 100644 (file)
@@ -14,65 +14,63 @@ if (!defined('TR_INCLUDE_PATH')) { exit; }
 
 global $languageManager, $_my_uri;
 
+if ($this->course_id > 0) { ?>
+        <div style="clear:both;text-align:right;" id="gototop">                
+          <br />
+          <span style="font-size:smaller;padding-right:3px;">
+            <a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content" title="<?php echo _AT('goto_top'); ?> Alt-c" ><?php echo _AT('goto_top'); ?>
+              <img src="<?php echo $this->base_path; ?>themes/<?php echo $this->theme; ?>/images/goto_top.gif" alt="<?php echo _AT('goto_top'); ?> Alt-c" border="0"/> 
+                       </a>
+          </span>
+        </div>  
+<?php 
+} // end of goto top
+?>
+      </div> <!-- end of contentcolumn -->
+    </div> <!-- end of contentwrapper -->
+       
+       <div id="footer">
+<?php 
 if($languageManager->getNumEnabledLanguages() > 1)
 {
 ?>
-
-<div align="center" id="lang" style="clear: left"><br />
+      <div align="center" id="lang" style="clear: left"><br />
 <?php
-
        if ($languageManager->getNumEnabledLanguages() > 5) {
-               echo '<form method="get" action="'.htmlspecialchars($_my_uri, ENT_QUOTES).'">';
-               echo '<label for="lang" style="display:none;">'._AT('translate_to').' </label>';
+               echo '        <form method="get" action="'.htmlspecialchars($_my_uri, ENT_QUOTES).'">';
+               echo '          <label for="lang" style="display:none;">'._AT('translate_to').' </label>';
                $languageManager->printDropdown($_SESSION['lang'], 'lang', 'lang');
-               echo ' <input type="submit" name="submit_language" class="button" value="'._AT('translate').'" />';
-               echo '</form>';
+               echo '          <input type="submit" name="submit_language" class="button" value="'._AT('translate').'" />';
+               echo '        </form>';
        } else {
-               echo '<small><label for="lang">'._AT('translate_to').' </label></small>';
+               echo '        <small><label for="lang">'._AT('translate_to').' </label></small>';
                $languageManager->printList($_SESSION['lang'], 'lang', 'lang', htmlspecialchars($_my_uri));
        }
 ?>
-<br/><br/><br/>
-</div>
-<?php } ?>
+        <br/><br/>
+      </div>
+<?php } // end of displaying language selection ?>
+               
+      <div align="center" style="clear:both;margin-left:auto; width:30em;margin-right:auto;">
+        <a href="documentation/web_service_api.php" title="<?php echo _AT("web_service_api"); ?>" target="_new"><?php echo _AT('web_service_api'); ?></a>
+          &nbsp;&nbsp;&nbsp;&nbsp;
+        <a href="documentation/oauth_server_api.php" title="<?php echo _AT("oauth_server_api"); ?>" target="_new"><?php echo _AT('oauth_server_api'); ?></a>
+        <br /><br />
+      </div>
 
-<div style="margin-left:auto; margin-right:auto; width:20em;">
-       <small><?php echo _AT("copyright"); ?></small><br />
-</div>
-
-</div> <!--  end center-content div -->
-<div class="bottom"><span></span></div><!--  bottom for liquid-round theme -->
+      <div style="margin-left: auto; margin-right: auto; width: 6em;">
+        <a href="http://atrc.utoronto.ca/"><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/atrclogo.gif" width="84" height="52" alt="Adaptive Technology Resource Centre" title="Adaptive Technology Resource Centre" border="0" /></a>
+      </div>
+               
+      <div style="margin-left:auto; margin-right:auto; width:20em;">
+        <small><?php if (isset($this->course_copyright)) echo $this->course_copyright.'<br />'; echo _AT("copyright"); ?></small><br />
+      </div>
+               
+    </div>
+  </div> <!--  end center-content div -->
+  
+  <div class="bottom"><span></span></div><!--  bottom for liquid-round theme -->
 </div> <!-- end liquid-round div -->
-
-<div style="margin-left: auto; margin-right: auto; width: 6em;">
-       <a href="http://atrc.utoronto.ca/"><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/atrclogo.gif" width="84" height="52" alt="Adaptive Technology Resource Centre" title="Adaptive Technology Resource Centre" border="0" /></a>
-</div>
-
-<script language="javascript" type="text/javascript">
-//<!--
-var selected;
-function rowselect(obj) {
-       obj.className = 'selected';
-       if (selected && selected != obj.id)
-               document.getElementById(selected).className = '';
-       selected = obj.id;
-}
-function rowselectbox(obj, checked, handler) {
-       var functionDemo = new Function(handler + ";");
-       functionDemo();
-
-       if (checked)
-               obj.className = 'selected';
-       else
-               obj.className = '';
-}
-//-->
-</script>
-<div align="center" style="clear:both;margin-left:auto; width:30em;margin-right:auto;">
-       <a href="documentation/web_service_api.php" title="<?php echo _AT("web_service_api"); ?>" target="_new"><?php echo _AT('web_service_api'); ?></a>
-       &nbsp;&nbsp;&nbsp;&nbsp;
-       <a href="documentation/oauth_server_api.php" title="<?php echo _AT("oauth_server_api"); ?>" target="_new"><?php echo _AT('oauth_server_api'); ?></a>
-</div>
 </body>
 </html>
 
@@ -80,7 +78,7 @@ function rowselectbox(obj, checked, handler) {
 // Timer, calculate how much time to load the page
 // starttime is in include/header.inc.php
 $mtime = microtime(); 
-$mtime = explode(" ", $mtime); 
+$mtime = explode(" ", $mtime);
 $mtime = $mtime[1] + $mtime[0]; 
 $endtime = $mtime; 
 $totaltime = ($endtime - $starttime); 
index e7ce722..4dc63ac 100644 (file)
@@ -26,7 +26,6 @@ if (!defined('TR_INCLUDE_PATH')) { exit; }
  * $this->lang_charset         the ISO language character set
  * $this->base_path                    the absolute path to this Transformable installation
  * $this->theme                                the directory name of the current theme
- * $this->img                          the theme image
  * $this->custom_head          the custom head script used in <head> section
  * $this->$onload                      the html body onload event
 
@@ -48,6 +47,8 @@ if (!defined('TR_INCLUDE_PATH')) { exit; }
  * $this->back_to_page                         if set, the path and file name to the part of this page (if parent is not a top level nav)
  * $this->current_sub_level_page       the full path to the current sub level page with file name
  * $this->guide                                the full path and file name to the guide page
+ * $this->user_name                    string, the name of the current login user
+ * $this->isAuthor                     boolean, whether the current login user is the author of the selected course. Only passed in when there is login user and selected course
  * ======================================
  * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
  */
@@ -71,62 +72,30 @@ $starttime = $mtime;
        <meta name="Generator" content="Transformable - Copyright 2009 by ATRC http://atrc.utoronto.ca/" />
        <meta name="keywords" content="Transformable,free, open source, accessibility checker, accessibility reviewer, accessibility evaluator, accessibility evaluation, WCAG evaluation, 508 evaluation, BITV evaluation, evaluate accessibility, test accessibility, review accessibility, ATRC, WCAG 2, STANCA, BITV, Section 508." />
        <meta name="description" content="Transformable is a Web accessibility evalution tool designed to help Web content developers and Web application developers ensure their Web content is accessible to everyone regardless to the technology they may be using, or their abilities or disabilities." />
-       <base href="<?php echo $this->base_path; ?>" />
+       <base href="<?php echo $this->content_base_href; ?>" />
        <link rel="shortcut icon" href="<?php echo $this->base_path; ?>images/favicon.ico" type="image/x-icon" />
        <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
        <link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/styles.css" type="text/css" />
 <?php echo $this->rtl_css; ?>
-       <script src="<?php echo $this->base_path; ?>include/jscripts/handleResponse.js" type="text/javascript"></script>
        <script src="<?php echo $this->base_path; ?>include/jscripts/infusion/InfusionAll.js" type="text/javascript"></script>
-       <script language="javascript" type="text/javascript">
-       //<!--
-       jQuery.noConflict();
-
-       var newwindow;
-       function popup(url) 
-       {
-               newwindow=window.open(url,'popup','height=600,width=800,scrollbars=yes,resizable=yes');
-               if (window.focus) {newwindow.focus()}
-       }
-       
-       function toggleToc(objId) {
-               var toc = document.getElementById(objId);
-               if (toc == null) return;
-
-               if (toc.style.display == 'none')
-               {
-                       toc.style.display = '';
-                       document.getElementById("toggle_image").src = "images/arrow-open.png";
-                       document.getElementById("toggle_image").alt = "Collapse";
-                       document.getElementById("toggle_image").title = "Collapse";
-               }
-               else
-               {
-                       toc.style.display = 'none';
-                       document.getElementById("toggle_image").src = "images/arrow-closed.png";
-                       document.getElementById("toggle_image").alt = "Expand";
-                       document.getElementById("toggle_image").title = "Expand";
-               }
-       }
-
-       //-->
-       </script>
-       <?php echo $this->custom_head; ?>
+       <script src="<?php echo $this->base_path; ?>jscripts/infusion/jquery.autoHeight.js" type="text/javascript"></script>
+       <script src="<?php echo $this->base_path; ?>include/jscripts/handleAjaxResponse.js" type="text/javascript"></script>
+       <script src="<?php echo $this->base_path; ?>include/jscripts/transformable.js" type="text/javascript"></script>
+<?php echo $this->custom_css; ?>
 </head>
 
 <body onload="<?php echo $this->onload; ?>">
 
-<?php if (isset($this->show_jump_to_report)){ ?>
-<a href="checker/index.php#output_div"><img src="images/clr.gif" height="1" width="1" alt="<?php echo _AT("jump_to_report"); ?>" border="0" /></a>
-<?php } ?>
-<div id="liquid-round"><div class="top"><span></span></div>
-<div class="center-content">
-               <div id="logo">
-                       <a href="http://www.atutor.ca/"><img width="100" src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/logo.png" height="30" alt="Transformable Logo" style="border:none;" /></a>
-               </div>
-       <div id="banner">
-
-       <span id="logininfo">
+<div id="liquid-round">
+  <div class="top"><span></span></div>
+  
+  <div class="center-content">
+    <div id="logo">
+      <a href="http://www.atutor.ca/"><img width="100" src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/logo.png" height="30" alt="Transformable Logo" style="border:none;" /></a>
+    </div>
+  
+  <div id="banner">
+    <span id="logininfo">
         <?php
         if (isset($this->user_name))
         {
@@ -145,77 +114,94 @@ $starttime = $mtime;
         <?php
         }
         ?>
-       </span>
+    </span>
                
-       <div id="versioninfo">
-               <form target="_top" action="<?php echo TR_BASE_HREF; ?>home/search.php" method="get">
-               <input type="text" name="search_text" id="search_text" value="<?php if (isset($_GET['search_text'])) echo $_GET['search_text']; ?>" size="30" />
-               <input type="submit" name="search" value="<?php echo _AT("search"); ?>" />
-               </form>
-       </div>
-       </div>
+    <div id="versioninfo">
+      <form target="_top" action="<?php echo TR_BASE_HREF; ?>home/search.php" method="get">
+        <input type="text" name="search_text" id="search_text" value="<?php if (isset($_GET['search_text'])) echo $_GET['search_text']; ?>" size="30" />
+        <input type="submit" name="search" value="<?php echo _AT("search"); ?>" />
+      </form>
+    </div>
+  </div>
 
-       <div class="topnavlistcontainer">
-       <!-- the main navigation. in our case, tabs -->
-               <ul class="navigation">
-                       <?php foreach ($this->top_level_pages as $page): ?>
-                               <?php if ($page['url'] == $this->current_top_level_page): ?>
-                                       <li class="navigation"><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><span><?php echo $page['title']; ?></span></a></li>
-                               <?php else: ?>
-                                       <li class="navigation"><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><span><?php echo $page['title']; ?></span></a></li>
-                               <?php endif; ?>
-                       <?php endforeach; ?>
-               </ul>
-       </div>
+  <div class="topnavlistcontainer">
+  <!-- the main navigation. in our case, tabs -->
+    <ul class="navigation">
+<?php 
+foreach ($this->top_level_pages as $page) {
+       if ($page['url'] == $this->current_top_level_page) { 
+?>
+      <li class="navigation"><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><span><?php echo $page['title']; ?></span></a></li>
+<?php } else { ?>
+      <li class="navigation"><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><span><?php echo $page['title']; ?></span></a></li>
+<?php } // endif
+} //endforeach ?>
+    </ul>
+  </div>
 
 <!--
-       <div class="topnavlistcontainer">
-               <ul class="topnavlist">
-                       <?php foreach ($this->top_level_pages as $page): ?>
-                               <?php if ($page['url'] == $this->current_top_level_page): ?>
-                                       <li><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><?php echo $page['title']; ?></a></li>
-                               <?php else: ?>
-                                       <li><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
-                               <?php endif; ?>
-                       <?php endforeach; ?>
-               </ul>
-       </div>
+  <div class="topnavlistcontainer">
+    <ul class="topnavlist">
+    <?php foreach ($this->top_level_pages as $page): ?>
+    <?php if ($page['url'] == $this->current_top_level_page): ?>
+      <li><a href="<?php echo $page['url']; ?>" title="<?php echo $page['title']; ?>" class="active"><?php echo $page['title']; ?></a></li>
+    <?php else: ?>
+      <li><a href="<?php echo $page['url']; ?>"  title="<?php echo $page['title']; ?>"><?php echo $page['title']; ?></a></li>
+    <?php endif; ?>
+    <?php endforeach; ?>
+    </ul>
+  </div>
 -->
        <!-- the sub navigation and guide -->
-       <div id="sub-menu">
-               <!-- guide -->
-               <?php if (isset($this->guide)) {?>
-               <div>
-                       <a href="<?php echo $this->guide; ?>" onclick="popup('<?php echo $this->guide; ?>'); return false;" id="guide" target="_new"><em><?php echo $this->page_title; ?></em></a>
-               </div>
-               <?php }?>
-
-               <!-- the sub navigation -->
-               <div id="sub-navigation">
-               <?php if ($this->sub_menus): ?>
-                       <?php if (isset($this->back_to_page)): ?>
-                               <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo _AT('back_to').' '.$this->back_to_page['title']; ?></a> | 
-                       <?php endif; ?>
-       
-                       <?php $num_pages = count($this->sub_menus); ?>
-                       <?php for ($i=0; $i<$num_pages; $i++): ?>
-                               <?php if ($this->sub_menus[$i]['url'] == $this->current_page): ?>
-                                       <strong><?php echo $this->sub_menus[$i]['title']; ?></strong>
-                               <?php else: ?>
-                                       <a href="<?php echo $this->sub_menus[$i]['url']; ?>"><?php echo $this->sub_menus[$i]['title']; ?></a>
-                               <?php endif; ?>
-                               <?php if ($i < $num_pages-1): ?>
-                                       |
-                               <?php endif; ?>
-                       <?php endfor; ?>
-               <?php else: ?>
-                       &nbsp;
-               <?php endif; ?>
-               </div>
-       </div>
+  <div id="sub-menu">
+    <!-- guide -->
+    <?php if (isset($this->guide)) {?>
+    <div>
+      <a href="<?php echo $this->guide; ?>" onclick="popup('<?php echo $this->guide; ?>'); return false;" id="guide" target="_new"><em><?php echo $this->page_title; ?></em></a>
+    </div>
+    <?php }?>
+
+       <?php if (isset($this->course_id) && $this->course_id > 0) {?>
+    <div id="course-tools">
+      <?php if ($this->isAuthor) { // only for authors ?>
+      <a href="<?php echo $this->base_path; ?>home/course/course_property.php?_course_id=<?php echo $this->course_id; ?>">
+        <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/course_property.png"; ?>" title="<?php echo _AT('course_property'); ?>" alt="<?php echo _AT('course_property'); ?>" border="0" />
+      </a> &nbsp;
+      <a href="<?php echo $this->base_path; ?>home/course/del_course.php?_course_id=<?php echo $this->course_id; ?>">
+        <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/delete.gif"; ?>" title="<?php echo _AT('del_course'); ?>" alt="<?php echo _AT('del_course'); ?>" border="0" />
+      </a> &nbsp;
+      <?php }?>
+      <a href="<?php echo $this->base_path; ?>home/index.php">
+        <img src="<?php echo $this->base_path. "themes/".$this->theme."/images/exit.png"; ?>" title="<?php echo _AT('exit_course'); ?>" alt="<?php echo _AT('exit_course'); ?>" border="0" />
+      </a>
+    </div>
+    <?php }?>
 
-<!--<div>
-        the bread crumbs 
+    <!-- the sub navigation -->
+    <div id="sub-navigation">
+      <?php if ($this->sub_menus): ?>
+      <?php if (isset($this->back_to_page)): ?>
+      <a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo _AT('back_to').' '.$this->back_to_page['title']; ?></a> | 
+      <?php endif; ?>
+       
+      <?php $num_pages = count($this->sub_menus); ?>
+      <?php for ($i=0; $i<$num_pages; $i++): ?>
+      <?php if ($this->sub_menus[$i]['url'] == $this->current_page): ?>
+      <strong><?php echo $this->sub_menus[$i]['title']; ?></strong>
+      <?php else: ?>
+      <a href="<?php echo $this->sub_menus[$i]['url']; ?>"><?php echo $this->sub_menus[$i]['title']; ?></a>
+      <?php endif; ?>
+      <?php if ($i < $num_pages-1): ?>
+      |
+      <?php endif; ?>
+      <?php endfor; ?>
+      <?php else: ?>
+      &nbsp;
+      <?php endif; ?>
+    </div>
+  </div>
+<!-- 
+<div>
        <div id="breadcrumbs">
                <?php if (is_array($this->path)) {?>
                <?php foreach ($this->path as $page){ ?>
@@ -227,10 +213,128 @@ $starttime = $mtime;
                <a href="<?php echo $this->guide; ?>" id="guide" onclick="poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><em><?php echo $this->page_title; ?></em></a>
        <?php } ?>
 </div>
--->
-<a name="content" title="<?php echo _AT("content_start"); ?>"></a>
+!-->
+  <a name="content" title="<?php echo _AT("content_start"); ?>"></a>
+  <div id="rtn-msg">
+  </div>
 
-<div id="rtn-msg">
-</div>
+<?php  
+//if ($this->course_id > 0) {
+?>
+  <div id="contentwrapper">
+    <?php if ((isset($this->course_id) && $this->course_id > 0)): ?>
+    <div id="leftcolumn">
+      <script type="text/javascript">
+      //<![CDATA[
+      var state = getcookie("side-menu");
+      if (state && (state == 'none')) {
+          document.writeln('<a name="menu"></a><div style="display:none;" id="side-menu">');
+      } else {
+          document.writeln('<a name="menu"></a><div id="side-menu">');
+      }
+      //]]>
+      </script>
+
+      <?php require(TR_INCLUDE_PATH.'side_menu.inc.php'); ?>
+
+      <script type="text/javascript">
+      //<![CDATA[
+      document.writeln('</div>');
+      //]]>
+      </script>
+    </div>
+       <?php endif; ?>
+
+    <div id="contentcolumn"
+    <?php if (isset($this->course_id) && $this->course_id <= 0): ?>
+      style="margin-left:0.5em;width:99%;"
+    <?php endif; ?>
+    >
+
+    <?php if (isset($this->course_id) && $this->course_id > 0): ?>
+      <div id="menutoggle">
+        <?php if ($this->course_id > 0): ?>
+        <script type="text/javascript" language="javascript">
+        //<![CDATA[
+        var state = getcookie("side-menu");
+        if (state && (state == 'none')) {
+            showTocToggle("side-menu", "<?php echo _AT('show'); ?>","<?php echo _AT('hide'); ?>", "", "show");
+        } else {
+            document.getElementById('contentcolumn').id="contentcolumn_shiftright";
+            showTocToggle("side-menu", "<?php echo _AT('show'); ?>","<?php echo _AT('hide'); ?>", "", "hide");
+        }
+        //]]>
+        </script>
+        <?php endif; ?>
+      </div>
+
+      <div id="sequence-links">
+        <?php //if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
+          <?php if ($this->sequence_links['resume']): ?>
+        <a style="color:white;" href="<?php echo $this->sequence_links['resume']['url']; ?>" accesskey="."><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/resume.gif" border="0" title="<?php echo _AT('resume').': '.$this->sequence_links['resume']['title']; ?> Alt+." alt="<?php echo $this->sequence_links['resume']['title']; ?> Alt+." class="img-size-ascdesc" /></a>
+          <?php else:
+          if ($this->sequence_links['previous']): ?>
+        <a href="<?php echo $this->sequence_links['previous']['url']; ?>" title="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," accesskey=","><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/previous.gif" border="0" alt="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," class="img-size-ascdesc" /></a>
+          <?php endif;
+          if ($this->sequence_links['next']): ?>
+        <a href="<?php echo $this->sequence_links['next']['url']; ?>" title="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." accesskey="."><img src="<?php echo $this->base_path.'themes/'.$this->theme; ?>/images/next.gif" border="0" alt="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." class="img-size-ascdesc" /></a>
+          <?php endif; ?>
+        <?php endif; ?>
+               <?php // } ?>
+                       &nbsp;
+      </div>
+        <?php endif; ?>
+
+      <!-- the page title -->
+      <a name="content" title="<?php echo _AT('content'); ?>"></a>
+      <h2 class="page-title"><?php echo $this->page_title; ?></h2>
+      <?php global $msg; $msg->printAll(); ?>
+
+      <?php if (count($this->sub_level_pages) > 0): ?>
+
+<!-- <div id="topnavlistcontainer">
+       <ul id="topnavlist">
+               <?php $accesscounter = 0; //initialize ?>
+               <?php foreach ($this->top_level_pages as $page): ?>
+                       <?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
+                       <?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
+                       <?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
+                       <?php if ($page['url'] == $this->current_top_level_page): ?>
+                               <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>" class="active"><?php echo $page['title']; ?></a></li>
+                       <?php else: ?>
+                               <li><a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>"><?php echo $page['title']; ?></a></li>
+                       <?php endif; ?>
+                       <?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
+               <?php endforeach; ?>
+       </ul>
+</div> -->
+
+<!--       <div id="subnavlistcontainer">
+        <div id="subnavbacktopage">
+          <?php if (isset($this->back_to_page)): ?>
+          <a href="<?php echo $this->back_to_page['url']; ?>">
+          <img border="0" width="10" height="11" alt="<?php echo _AT('back_to').' '.$this->back_to_page['title']; ?>" src="<?php echo $this->base_href; ?>images/arrowicon.gif" style="float:left;"/></a>&nbsp;
+          <?php endif; ?>
+        </div>
+
+        <ul id="subnavlist">
+          <?php $num_pages = count($this->sub_level_pages); ?>
+          <?php for ($i=0; $i<$num_pages; $i++): ?>
+                               
+                 <?php if ($this->sub_level_pages[$i]['url'] == $this->current_sub_level_page): ?>
+                 <li><?php echo $this->sub_level_pages[$i]['title']; ?></li>
+                 <?php else: ?>
+                 <li><a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?></a></li>
+                 <?php endif; ?>
+                 <?php if ($i < $num_pages-1): 
+                   echo " ";?>
+                 <?php endif; ?>
+          <?php endfor; ?>
+                       </ul>
+      </div> -->
+<?php endif; ?>
+<!-- the main navigation. in our case, tabs -->
 
-<?php global $msg; $msg->printAll();?>
+<?php 
+//} // end of else
+?>
index 0ffce29..aaee9cf 100644 (file)
@@ -110,7 +110,7 @@ jQuery(document).ready(function () {
                        afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {\r
                                if (newValue != oldValue)\r
                                        rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>language/index_inline_editor_submit.php", { "field":viewNode.id, "value":newValue }, \r
-                                                         function(data) {handleResponse(data, viewNode, oldValue); }, "json");\r
+                                                         function(data) {handleAjaxResponse(data, viewNode, oldValue); }, "json");\r
                        }\r
                }\r
        });\r
index af591ba..6748eff 100644 (file)
@@ -27,9 +27,9 @@ include(TR_INCLUDE_PATH.'header.inc.php');
 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('add_edit_language'); ?></legend>\r
        <table class="form-data" align="center">\r
                <tr>\r
-                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?><br /><br /></td>\r
+                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?></td>\r
                </tr>\r
-\r
+<!-- \r
                <tr align="left">\r
                        <th><div class="required" title="<?php echo _AT('required_field'); ?>">*</div>\r
                        <label for="lang_code"><?php echo _AT('lang_code'); ?></label></th>\r
@@ -46,6 +46,15 @@ include(TR_INCLUDE_PATH.'header.inc.php');
        }\r
 ?>\r
                        </select>\r
+<?php }?>\r
+                       </td>\r
+               </tr>\r
+ -->\r
+               <tr align="left">\r
+                       <th><label for="lang_code">&nbsp;&nbsp;&nbsp;<?php echo _AT('lang_code'); ?></label></th>\r
+                       <td>\r
+<?php if (isset($this->row['language_code'])) echo $this->row['language_code']; else {?>\r
+                               <input id="lang_code" name="lang_code" type="text" size="2" maxlength="2" value="<?php if (isset($_POST['lang_code'])) echo $_POST['lang_code']; else echo $this->row['language_code']; ?>" />\r
 <?php }?>\r
                        </td>\r
                </tr>\r
@@ -90,9 +99,9 @@ include(TR_INCLUDE_PATH.'header.inc.php');
                </tr>\r
 \r
                <tr>\r
-                       <td colspan="2">\r
+                       <td colspan="2" align="center">\r
                        <p class="submit_button">\r
-                       <input type="submit" name="save" value="<?php echo _AT('save'); ?>" />\r
+                       <input type="submit" name="save" value="<?php echo _AT('save'); ?>" />&nbsp;&nbsp;\r
                        <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />\r
                        </p>\r
                        </td>\r
index f407568..2e93f8e 100644 (file)
@@ -47,12 +47,12 @@ function encrypt_password() {
 \r
                                <tr>\r
                                        <td align="left"><div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="login"><?php echo _AT('login_name_or_email'); ?></label></td>\r
-                                       <td><input type="text" name="form_login" size="50" id="login"  class="formfield" style="max-width:70%;width:70%;"/><br /></td>\r
+                                       <td><input type="text" name="form_login" size="50" id="login"  class="formfield" /><br /></td>\r
                                </tr>\r
                                \r
                                <tr>\r
                                        <td align="left"><div class="required" align="right" title="<?php echo _AT('required_field'); ?>">*</div><label for="pass"><?php echo _AT('password'); ?></label></td>\r
-                                       <td><input type="password" class="formfield" name="form_password" size="50" id="pass" style="max-width:70%;width:70%;"/></td>\r
+                                       <td><input type="password" name="form_password" size="50" id="pass" class="formfield" /></td>\r
                                </tr>\r
 \r
                                <tr align="center">\r
index 5e3b478..b64cae9 100644 (file)
@@ -28,7 +28,7 @@ require(TR_INCLUDE_PATH.'header.inc.php');
                <tr align="center"><td>
                <table>
                <tr>
-                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?><br /><br /><br /></td>
+                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?></td>
                </tr>
 
                <tr>
index 0b11795..813c28d 100644 (file)
@@ -32,7 +32,12 @@ $default_user_group_id = TR_USER_GROUP_USER;
 
 // show or hide the author information based on the status of the checkbox "author content" 
 global $onload;
-$onload = "if (jQuery('#is_author').attr('checked')) jQuery('#table_is_author').show(); else jQuery('#table_is_author').hide();";
+$onload = "
+document.form.login.focus(); 
+
+if (jQuery('#is_author').attr('checked')) jQuery('#table_is_author').show(); 
+else jQuery('#table_is_author').hide();
+";
 
 require(TR_INCLUDE_PATH.'header.inc.php'); 
 ?>
@@ -70,7 +75,7 @@ function encrypt_password()
        <tr align="center"><td>
                <table>
                <tr>
-                       <td colspan="2" align="left"><br/><?php echo _AT('required_field_text') ;?><br /><br /><br/></td>
+                       <td colspan="2" align="left"><br/><?php echo _AT('required_field_text') ;?><br/></td>
                </tr>
 
                <tr>
index 8eb9114..fc71e51 100644 (file)
@@ -2,7 +2,7 @@
 /* Transformable                                                        */
 /************************************************************************/
 /* Copyright (c) 2009                                                   */
-/* Adaptive Technology Resource Centre / University of Toronto                     */
+/* Adaptive Technology Resource Centre / University of Toronto          */
 /*                                                                      */
 /* This program is free software. You can redistribute it and/or        */
 /* modify it under the terms of the GNU General Public License          */
 /************************************************************************/
 
 html,body{
-       height:100%;
+  height:100%;
 }
 
 
 /* main body attributes */
 body {
-       font-family: Arial, sans-serif;
-       margin:0px;
-       background-color: white;
+  font-family: Arial, sans-serif;
+  margin:0px;
+  background-color: white;
 }
 
 p {
     /*text-align: justify;*/
     line-height: 150%;
-       font-size: 1em;
+  font-size: 1em;
 }
 
 p a {
@@ -32,12 +32,12 @@ p a {
 }
 
 p a:visited {
-       color: #3F2670;
+  color: #3F2670;
     background-color: transparent;
 }
 
 p a:active {
-       color: #A50707;
+  color: #A50707;
     background-color: transparent;
 }
 
@@ -45,7 +45,7 @@ h1, h2, h3, h4, h5, h6 {
     color: #A50707;
     clear: right;
     font: 100% Verdana, Helvetica, Arial, sans-serif;
-       font-weight: bold;
+  font-weight: bold;
     margin: 0;
     padding-top: 0.5em;
     /*border-bottom: 1px solid #B8AE9C;*/
@@ -53,7 +53,7 @@ h1, h2, h3, h4, h5, h6 {
 
 h1 {
     font-size: 160%;
-       color: #000;
+  color: #000;
 
 }
 
@@ -66,44 +66,42 @@ h3 {
 
 h4 {
     font-size: 90%;
-    margin:0 0 0 2em;
 }
 
-
 h5 {
     font-size: 100%;
 }
 
 p.subgroup {
-       margin:0 0 0 2em;
+  margin:0 0 0 2em;
 }
 
 /* list attributes */
 ul {
-       font-family: Verdana, Helevetica, Arial, sans-serif;
-       margin-bottom: 0px;
-       margin-top: 0px;
-       margin-right: 0px;
+  font-family: Verdana, Helevetica, Arial, sans-serif;
+  margin-bottom: 0px;
+  margin-top: 0px;
+  margin-right: 0px;
 }
 
 li {
-       font-family: Verdana, Helevetica, Arial, sans-serif;
-       margin-bottom: 0px;
-       margin-top: 0px;
-       margin-right: 0px;
+  font-family: Verdana, Helevetica, Arial, sans-serif;
+  margin-bottom: 0px;
+  margin-top: 0px;
+  margin-right: 0px;
 }
 ul.msg {
-       line-height: 150%
+  line-height: 150%
 }
 
 li.msg_err, li.msg_info {
-       font-family: Verdana, Helevetica, Arial, sans-serif;
-       margin-bottom: 30px;
-       margin-top: 0px;
-       margin-right: 10px;
-       margin-left: 10px;
-       font-size: 110%;
-       list-style: none;
+  font-family: Verdana, Helevetica, Arial, sans-serif;
+  margin-bottom: 30px;
+  margin-top: 0px;
+  margin-right: 10px;
+  margin-left: 10px;
+  font-size: 110%;
+  list-style: none;
 }
 
 /* span attributes */
@@ -113,7 +111,7 @@ span.err_type{
 }
 
 span.msg{
-       font-family: Verdana, Helevetica, Arial, sans-serif;
+  font-family: Verdana, Helevetica, Arial, sans-serif;
   line-height: 150%;
 }
 
@@ -139,77 +137,77 @@ span.padding_left {
 }
 
 em {
-       font-weight: bold;
+  font-weight: bold;
 }
 
 span.small_font {
-       font-size: smaller;
+  font-size: smaller;
 }
 
 /* link attributes */
 a:link, a:visited  {
-       color: #1A4A72;
+  color: #1A4A72;
 }
 a:hover {
-       color: #932318;
+  color: #932318;
 color:#ffffff;
 }
 a:active {
-       color: #932318;
+  color: #932318;
 }
 /* align text to the left */
 .left {
-       text-align: left;
+  text-align: left;
 }
 
 /* main submit button */
 
 input[type=button] {
-       cursor:pointer;
-       border:outset 1px #ccc;
-       background:#999;
-       color:#666;
-       font-weight:bold;
-       padding: 1px 2px;
-       background:url(images/formbg.gif) repeat-x left top;
+  cursor:pointer;
+  border:outset 1px #ccc;
+  background:#999;
+  color:#666;
+  font-weight:bold;
+  padding: 1px 2px;
+  background:url(images/formbg.gif) repeat-x left top;
 }
 
 input[type=submit] {
-       cursor:pointer;
-       border:outset 1px #ccc;
-       background:#999;
-       color:#666;
-       font-weight:bold;
-       padding: 1px 2px;
-       background:url(images/formbg.gif) repeat-x left top;
+  cursor:pointer;
+  border:outset 1px #ccc;
+  background:#999;
+  color:#666;
+  font-weight:bold;
+  padding: 1px 2px;
+  background:url(images/formbg.gif) repeat-x left top;
 }
 input[type=text] {
-       cursor:pointer;
-       border-bottom:solid 1px #ccc;
-       border-right:solid 1px #ccc;
-       border-top:solid 1px #000;
-       border-left:solid 1px #000;
-       font-weight:bold;
-       background:#fff;
-       padding: 1px 2px;
+  cursor:pointer;
+  border-bottom:solid 1px #ccc;
+  border-right:solid 1px #ccc;
+  border-top:solid 1px #000;
+  border-left:solid 1px #000;
+  font-weight:bold;
+  background:#fff;
+  padding: 1px 2px;
 }
 .button:focus {
-       border:1px solid #A50707;
-       background-color:  #FFDAB9;     
+  border:1px solid #A50707;
+  background-color:  #FFDAB9;  
 }
 /* small submit button at top */
 .button2 {
-       font-family: Verdana, Helevetica, Arial, sans-serif;
-       background-color: #E9F4F3;
+  font-family: Verdana, Helevetica, Arial, sans-serif;
+  background-color: #E9F4F3;
 
 }
 .button2:focus {
-       background-color: #E9F4F3;
-       border:  #ACCFCC  solid 1px;
+  background-color: #E9F4F3;
+  border:  #ACCFCC  solid 1px;
 }
 
 .center {
-       text-align: center;
+  text-align: center;
 }
 
 /* paging */
@@ -225,495 +223,514 @@ div.paging ul {
    padding: 0px;
 }
 div.paging li { 
-       display: inline; 
-       padding-left: 1px; 
-       padding-right: 1px;
+  display: inline; 
+  padding-left: 1px; 
+  padding-right: 1px;
 }
 
 div.paging li a {
-       padding-left: 4px;
-       padding-right: 4px;
+  padding-left: 4px;
+  padding-right: 4px;
 }
 
 div.paging li a:hover, div.paging li a.current {
    color: #FFA20C;
 }
 
+/* floating layout */
+#contentwrapper{
+  width: 99%;
+}
+#contentcolumn {
+  margin-left: 0.5em;
+  padding-right: 5px;
+}
+#contentcolumn_shiftright {
+  margin-left: 18em;
+}
+
+#leftcolumn{
+  float: left;
+  width: 17em;
+  margin-left: 5px;
+  margin-top:-10px;
+}
+
+#footer{
+  /*position:absolute;
+  bottom:0px;*/
+  clear: left;
+  width: 100%;
+  text-align: center;
+  padding: 4px 0px;
+}
+
+#side-menu{
+  overflow:hidden;
+}
+
+/* sequence links */
+div#sequence-links {
+  float:right;
+  margin-top: 10px;
+  padding-right: 5px;
+  padding-top:7px;
+}
+div#sequence-links a {
+  text-decoration: none;
+}
+
 /***************************************************************/
 /* NEW STUFF */
 
 table.tabbed-table {
-       width: 100%;
-       border:thin black solid;
+  width: 100%;
+  border:thin black solid;
 }
 table.tabbed-table th#left-empty-tab {
-       background-color: transparent;
-       width: 15px;
-       border-bottom: 1px solid #B8AE9C;
+  background-color: transparent;
+  width: 15px;
+  border-bottom: 1px solid #B8AE9C;
 }
 table.tabbed-table th#right-empty-tab {
-       text-align: right;
-       background-color: transparent;
-       border-bottom: 1px solid #B8AE9C;
-       width: 400px;
-       padding-right: 5px;
+  text-align: right;
+  background-color: transparent;
+  border-bottom: 1px solid #B8AE9C;
+  width: 400px;
+  padding-right: 5px;
 }
 table.tabbed-table th#right-empty-tab a {
-       text-decoration: underline;
+  text-decoration: underline;
 }
 table.tabbed-table th.tab-spacer {
-       background-color: transparent;
-       width: 5px;
-       border-bottom: 1px solid #B8AE9C;
+  background-color: transparent;
+  width: 5px;
+  border-bottom: 1px solid #B8AE9C;
 }
 
 table.tabbed-table th.tab {
-       padding-top: 2px;
-       padding-bottom: 2px;
-       width: 110px;
-       background-color: #E9F4F3;
-       border-bottom: 1px solid #B8AE9C;
-       border-left: 1px solid #B8AE9C;
-       border-top: 1px solid #B8AE9C;
-       border-right: 1px solid #B8AE9C;
+  padding-top: 2px;
+  padding-bottom: 2px;
+  width: 110px;
+  background-color: #E9F4F3;
+  border-bottom: 1px solid #B8AE9C;
+  border-left: 1px solid #B8AE9C;
+  border-top: 1px solid #B8AE9C;
+  border-right: 1px solid #B8AE9C;
 }
 table.tabbed-table th.tab:hover {
-       background-color: #ACCFCC;
+  background-color: #ACCFCC;
 }
 
 table.tabbed-table th.tab a:focus {
-       color: white;
+  color: white;
 }
 table.tabbed-table th.selected {
-       padding-top: 2px;
-       padding-bottom: 2px;
-       width: 110px;
-       background-color: #ACCFCC;
-       border-left: 1px solid #B8AE9C;
-       border-top: 1px solid #B8AE9C;
-       border-right: 1px solid #B8AE9C;
+  padding-top: 2px;
+  padding-bottom: 2px;
+  width: 110px;
+  background-color: #ACCFCC;
+  border-left: 1px solid #B8AE9C;
+  border-top: 1px solid #B8AE9C;
+  border-right: 1px solid #B8AE9C;
 }
 
 table.tabbed-table a, table.tabbed-table a:visited, table.tabbed-table a:hover {
-       color: black;
-       text-decoration: none;
+  color: black;
+  text-decoration: none;
 }
 
 #banner h1 {
-       display: inline; 
-       font-size: 130%;
+  display: inline; 
+  font-size: 130%;
 }
 #banner {
-       /* border: thin #365D95 solid; */
-       margin: 1.5em 1em 0em 1em;
-       /* border-bottom: black 1px solid; */
-       padding-top:4px;
-       padding-left:4px; 
-       vertical-align:middle;
+  /* border: thin #365D95 solid; */
+  margin: 1.5em 1em 0em 1em;
+  /* border-bottom: black 1px solid; */
+  padding-top:4px;
+  padding-left:4px; 
+  vertical-align:middle;
 }
 #banner a:visited {
-       color: #365D95;
+  color: #365D95;
 }
 
 #banner a:hover {
-       color: white; background-color: #365D95
+  color: white; background-color: #365D95
 }
 #banner a:active {
-       color: white; background-color: #365D95
+  color: white; background-color: #365D95
 }
 #banner #logininfo {
-       font-size: small; 
-       font-weight:bold;
-       margin-left: 10px; 
-       margin-top: 2px; 
-       position: absolute; 
-       left: 0px; 
-       top: 0px; 
-       color: black; 
-       background-color: white; 
-       padding-left: 5px; 
-       padding-right: 5px;
+  font-size: small; 
+  font-weight:bold;
+  margin-left: 10px; 
+  margin-top: 2px; 
+  position: absolute; 
+  left: 0px; 
+  top: 0px; 
+  color: black; 
+  background-color: white; 
+  padding-left: 5px; 
+  padding-right: 5px;
 }
 #banner #versioninfo {
-       font-size: 8pt; 
-       margin-right: 500px; 
-       margin-top: 2px; 
-       position: absolute; 
-       right: 0px; 
-       top: 0px; 
-       color: black; 
-       background-color: white; 
-       padding-left: 5px; 
-       padding-right: 5px;
+  font-size: 8pt; 
+  margin-right: 500px; 
+  margin-top: 2px; 
+  position: absolute; 
+  right: 0px; 
+  top: 0px; 
+  color: black; 
+  background-color: white; 
+  padding-left: 5px; 
+  padding-right: 5px;
 }
 
 h2 #title {
-       padding: 0px 0px 0px 0px;
-       margin: 0px 0px 0px 0px; 
-       color: #053188;
+  padding: 0px 0px 0px 0px;
+  margin: 0px 0px 0px 0px; 
+  color: #053188;
 }
 
 a#back-to {
-       padding-left: 20px;
-       background-image: url(images/back.gif);
-       background-repeat: no-repeat;
-       background-position: 0px 0px;
+  padding-left: 20px;
+  background-image: url(images/back.gif);
+  background-repeat: no-repeat;
+  background-position: 0px 0px;
 }
 
-
-
 div#breadcrumbs {
     /* The path bar, including breadcrumbs and add to favorites */
   font-size: 0.85em;
-       margin: 0em 2em 1em 2em;
-       padding-left:4px; 
+  margin: 0em 2em 1em 2em;
+  padding-left:4px; 
 }
+
 h2.page-title {
-       clear:right;
-       margin-bottom: 10px;
-       padding:0px;
+  clear:right;
 }
 
 h1 {
-       margin-bottom: 5px;
+  margin-bottom: 5px;
 }
 
 div#sub-menu {
-       color: #555;
-       background-color:#E6E6E6; 
-       padding-top: 5px; 
-       font-size:0.85em; 
-       border-bottom:1px solid black;
-       margin-bottom: 1em; 
-       height:2em;
+  color: #555;
+  background-color:#E6E6E6; 
+  padding-top: 5px; 
+  font-size:0.85em; 
+  border-bottom:1px solid black;
+  height:2em;
 }
 
 div#sub-navigation {
-       padding: 3px;
-       float:left;
+  padding: 3px;
+  float:left;
+}
+
+div#course-tools {
+  float: right; 
+  padding-right: 1em; 
+  text-transform: lowercase;
 }
 
 div#guide {
-       padding-right: 5px;
-       float:right;
+  padding-right: 5px;
+  float:right;
 }
 
 div#sub-navigation strong {
-       color: black;
+  color: black;
 }
 
 div#help {
-       border-left: 1px solid black;
-       border-right: 1px solid black;
-       border-bottom: 1px solid black;
-       padding-left: 5px;
-       padding-right: 5px;
-       padding-bottom: 5px;
-       background-color: #F7F3ED;
-       margin-left: 5px;
-       margin-right: 5px;
-       font-size: small;
+  border-left: 1px solid black;
+  border-right: 1px solid black;
+  border-bottom: 1px solid black;
+  padding-left: 5px;
+  padding-right: 5px;
+  padding-bottom: 5px;
+  background-color: #F7F3ED;
+  margin-left: 5px;
+  margin-right: 5px;
+  font-size: small;
 }
 
 h3#help-title {
-       margin-left: 5px;
-       margin-right: 5px;
-       border-left: 1px solid black;
-       border-right: 1px solid black;
-       padding: 1px;
-       background-color: #F7F3ED;
+  margin-left: 5px;
+  margin-right: 5px;
+  border-left: 1px solid black;
+  border-right: 1px solid black;
+  padding: 1px;
+  background-color: #F7F3ED;
 }
 .line {
-       border-bottom: 1px solid black;
+  border-bottom: 1px solid black;
 }
 div#help p {
-       padding: 0px;
-       margin: 0px;
+  padding: 0px;
+  margin: 0px;
 }
 
 div#toctoggle {
-       float: left;
-       padding-left: 10px;
+  float: left;
+  padding-left: 10px;
 }
 
 h1#section-title {
-       float: left;
-       white-space:nowrap;
-       margin-left:1em;
-       margin-bottom: -0.5em;
+  float: left;
+  white-space:nowrap;
+  margin-left:1em;
+  margin-bottom: -0.5em;
 }
 
 div#top-links {
-       float:right;
-       padding-right: 5px;
-       margin-right:205px;
-       margin-top:1em;
-       white-space:nowrap;
+  float:right;
+  padding-right: 5px;
+  margin-right:205px;
+  margin-top:1em;
+  white-space:nowrap;
 }
 
 div#top-links a:link, div#top-links a:visited {
-       text-decoration:none;
-       margin-left:10px;
+  text-decoration:none;
+  margin-left:10px;
 }
 div#top-links a:focus{
-       color:black;
-       background-color:#F6EAD6;
+  color:black;
+  background-color:#F6EAD6;
 }
 
 /* for filter tables */
 table.filter {
-       clear:left;
-       margin-left: auto; 
-       margin-right: auto;
-       text-align: left;
+  clear:left;
+  margin-left: auto; 
+  margin-right: auto;
+  text-align: left;
 } 
 
 table.filter th {
-       font-weight: bold;
+  font-weight: bold;
 }
 
 table.filter td {
-       padding: 5px;
-       white-space: nowrap;
+  padding: 5px;
+  white-space: nowrap;
 }
 
 /* for data tables */
 table.data {
-       clear:right;
-       width: 95%; 
-       margin-left: 2em;; 
-       margin-right: auto;
-       text-align: left;
+  clear:right;
+  width: 95%; 
+  margin-left: 2em;; 
+  margin-right: auto;
+  text-align: left;
 
 
 } 
 
 table.data th {
-       background-color: #F6EAD6;
-       padding: 3px;
-       white-space: nowrap;
+  background-color: #F6EAD6;
+  padding: 3px;
+  white-space: nowrap;
 }
 
 table.data th a {
-       color: #595241;
-       padding-right: 15px;
-       margin-right: 15px;
-       background-image: url('../default/images/sort.gif');
-       background-repeat: no-repeat;
-       background-position: right;
+  color: #595241;
+  padding-right: 15px;
+  margin-right: 15px;
+  background-image: url('../default/images/sort.gif');
+  background-repeat: no-repeat;
+  background-position: right;
 }
 
 table.data tbody {
-       border-top: 1px solid #B8AE9C;
-       border-bottom: 1px solid #B8AE9C;
+  border-top: 1px solid #B8AE9C;
+  border-bottom: 1px solid #B8AE9C;
 }
 
 table.data tbody th {
-       text-align: left;
-       background-color: #F7F3ED;
-       cursor: auto;
+  text-align: left;
+  background-color: #F7F3ED;
+  cursor: auto;
 }
 
 table.data td {
-       padding: 3px;
+  padding: 3px;
 }
 
 table.data tbody tr:hover {
-       background-color: #efefef;
-       cursor: pointer;
+  background-color: #efefef;
+  cursor: pointer;
 }
 
 table.data tbody tr.selected {
-       background-color: #E9F4F3;
-       cursor: auto;
+  background-color: #E9F4F3;
+  cursor: auto;
 }
 
 table.data tfoot {
-       background-color: #F7F3ED;
-       /*border-top: 1px solid #B8AE9C;*/
+  background-color: #F7F3ED;
+  /*border-top: 1px solid #B8AE9C;*/
 }
 
 table.data tfoot tr:first-child td {
-       /*border-top: 1px solid #B8AE9C;*/
-       padding: 5px;
-       background-image: url('images/arrow_ltr.gif');
-       background-repeat: no-repeat;
-       background-position: 4px 5px;
-       padding-left: 40px;
+  /*border-top: 1px solid #B8AE9C;*/
+  padding: 5px;
+  background-image: url('images/arrow_ltr.gif');
+  background-repeat: no-repeat;
+  background-position: 4px 5px;
+  padding-left: 40px;
 }
 
 table.data.static tfoot td, table.data.static tfoot tr:first-child td {
-       border-top: 1px solid #B8AE9C;
-       padding: 15px;
-       background-image: none;
-       padding-left: 0px;
+  border-top: 1px solid #B8AE9C;
+  padding: 15px;
+  background-image: none;
+  padding-left: 0px;
 }
 
 /*buttons*/
 table.data tfoot input {
-       background-color: #efefef;
-       font-weight: normal;
-       border:  #AAA  solid 1px;
+  background-color: #efefef;
+  font-weight: normal;
+  border:  #AAA  solid 1px;
 }
 
 table.data tfoot input:focus {
-       background-color: #FFDAB9;
-       border:  #AAA  solid 1px;
+  background-color: #FFDAB9;
+  border:  #AAA  solid 1px;
 }
 
 
 /* used for static tables with no form elements: */
 table.data.static tbody tr:hover {
-       background-color: transparent;
-       cursor: auto;
+  background-color: transparent;
+  cursor: auto;
 }
 
-
-/* report styles */
-#errors{
-       width:95%;
-       border:thin #cccccc solid;
-       padding:1em;
-}
-#likely_problems{
-       width:95%;
-       border:thin #cccccc solid;
-       padding:1em;
-}
-#potential_problems{
-       width:95%;
-       border:thin #cccccc solid;
-       padding:1em;
-}
-#html_validation_result{
-        white-space:nowrap;
-       width:95%;
-       border:thin #cccccc solid;
-       padding:1em;
-}
-/* feedback /errors */
-
-
 div#error {
-       width: 50%;
-       margin-left: auto;
-       margin-right: auto;
-       margin-top: 15px;
-       margin-bottom: 15px;
-       border: 1px solid #DD0000;
-       padding: 5px;
-       background-color: #F4DCDC;
-       color: #A50707;
-       background-color: #F4DCDC;
-       padding-left: 25px;
-       font-weight: bold;
+  width: 50%;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 15px;
+  margin-bottom: 15px;
+  border: 1px solid #DD0000;
+  padding: 5px;
+  background-color: #F4DCDC;
+  color: #A50707;
+  background-color: #F4DCDC;
+  padding-left: 25px;
+  font-weight: bold;
 }
 div#error h4 {
-       color: black;
-       margin-left: 0px;
+  color: black;
+  margin-left: 0px;
 }
 
 div#error ul, div#feedback ul, div#help ul {
-       position: relative;
-       list-style: none;
-       margin-left: 0px;
-       padding-left: 0px;
+  position: relative;
+  list-style: none;
+  margin-left: 0px;
+  padding-left: 0px;
 }
 
 div#error ul li{
-       margin-top: 5px;
+  margin-top: 5px;
 }
 
 div#feedback {
-       width: 50%;
-       margin-left: auto;
-       margin-right: auto;
-       margin-top: 15px;
-       margin-bottom: 15px;
-       border: 1px solid #17B506;
-       padding: 5px;
-       background-color: #F2FCF0;
-       color: #595241;
-       font-weight: bold;
+  width: 50%;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 15px;
+  margin-bottom: 15px;
+  border: 1px solid #17B506;
+  padding: 5px;
+  background-color: #F2FCF0;
+  color: #595241;
+  font-weight: bold;
 }
 
 div#help {
-       width: 50%;
-       margin-left: auto;
-       margin-right: auto;
-       margin-top: 15px;
-       margin-bottom: 15px;
-       border: 1px solid #ACCFCC;
-       padding: 5px;
-       background-color: #E9F4F3;
-       color: #024C41;
+  width: 50%;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 15px;
+  margin-bottom: 15px;
+  border: 1px solid #ACCFCC;
+  padding: 5px;
+  background-color: #E9F4F3;
+  color: #024C41;
 }
 
 div#info {
-       width: 50%;
-       margin-left: auto;
-       margin-right: auto;
-       margin-top: 15px;
-       margin-bottom: 15px;
-       border: 1px solid #B8AE9C;
-       padding: 5px;
-       background-color: #EFE6FF;
-       color: #595241;
-       font-weight: bold;
+  width: 50%;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 15px;
+  margin-bottom: 15px;
+  border: 1px solid #B8AE9C;
+  padding: 5px;
+  background-color: #EFE6FF;
+  color: #595241;
+  font-weight: bold;
 }
 
 div#warning {
-       width: 50%;
-       margin-left: auto;
-       margin-right: auto;
-       margin-top: 15px;
-       margin-bottom: 15px;
-       border: 1px solid #FF8400;
-       padding: 5px;
-       background-color: #FFF6ED;
-       color: #D95900;
-       font-weight: bold;
+  width: 50%;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 15px;
+  margin-bottom: 15px;
+  border: 1px solid #FF8400;
+  padding: 5px;
+  background-color: #FFF6ED;
+  color: #D95900;
+  font-weight: bold;
 }
 acronym {
-       cursor: help;
+  cursor: help;
 }
 
 div.required {
-       font-weight: bold;
-       color: red;
-       font-size: large;
-       float: left;
-       position: relative;
-       margin-top: -5px;
-       height: 15px;
-       padding-right: 2px;
+  font-weight: bold;
+  color: red;
+  font-size: large;
+  float: left;
+  position: relative;
+  margin-top: -5px;
+  height: 15px;
+  padding-right: 2px;
   text-align: left;
 }
 
 form {
-       clear: none;
-       display:inline;
+  clear: none;
+  display:inline;
 }
 
 h3.indent {
-       width: 90%;
-       padding: 0px 0px 10px 60px;
+  width: 90%;
+  padding: 0px 0px 10px 60px;
 }
 
 h4.box {
-       font-size:0.85em;
-       padding: 2px;
+  font-size:0.85em;
+  padding: 2px;
 }
 
 div.box {
-       padding: 5px;
-       background-color: #F5F5F5;
-       color: black;
-       border: 1px solid #B8AE9C;
+  padding: 5px;
+  background-color: #F5F5F5;
+  color: black;
+  border: 1px solid #B8AE9C;
 
-       font-size:0.85em;
-       font-weight: normal;
-       padding:2px;
+  font-size:0.85em;
+  font-weight: normal;
+  padding:2px;
 }
 
 h5.box { 
@@ -724,21 +741,21 @@ h5.box {
     padding: 0em 1em 0em 1em;
     
     display: inline;
-       font-size:  1em;
+  font-size:  1em;
     height: 1em;
 }
 
 div.box a:link {
-       text-decoration: none;
+  text-decoration: none;
 }
 
 div.box a:visited {
-       color: #2A6C28;
-       text-decoration: none;
+  color: #2A6C28;
+  text-decoration: none;
 }
 
 div.box a:hover {
-       text-decoration: underline;
+  text-decoration: underline;
 }
 
 .boxDetails {
@@ -747,7 +764,7 @@ div.box a:hover {
 
 div.box .content {
     padding: 1em;
-       font-size:  1em;
+  font-size:  1em;
 }
 
 div.box a.close {
@@ -774,113 +791,79 @@ div.box .odd {
 }
 
 fieldset {
-       margin-bottom: 10pt;
-}
-#shortcuts legend {
-}
-#shortcuts ul {
-       position: relative;
-       margin-top: 0pt;
-       margin-bottom: 0pt;
-       margin-left: 0pt;
-       list-style-type:  none;
-       padding-left: 0pt; 
+  margin-bottom: 10pt;
 }
 
 a#guide {
-       background-image: url(images/guide.jpg); background-repeat: no-repeat; background-position: 0px 0px;
-       background-color: #eee;
-       padding: 2px 10px 2px 26px;
-       border: 1px solid #ccc;
-       float:right;
-       text-decoration:none;
-       font-size:0.85em;
-}
-div#content-text {
-       padding-right: 5pt;
-       line-height:150%;
-}
-
-div#content-text li {
-       margin-left: 15pt;
-}
-
-div#content-info {
-       margin: 5pt;
-       font-size: small;
-       color: #b8ae9c;
-       clear: both;
+  background-image: url(images/guide.jpg); background-repeat: no-repeat; background-position: 0px 0px;
+  background-color: #eee;
+  padding: 2px 10px 2px 26px;
+  border: 1px solid #ccc;
+  float:right;
+  text-decoration:none;
+  font-size:0.85em;
 }
 
 div#container {
-       text-align: left;
-       margin: 0px auto;
-       padding: 0px;
-       border:0;
-       width: 95%;
+  text-align: left;
+  margin: 0px auto;
+  padding: 0px;
+  border:0;
+  width: 95%;
 }
 
 div#menutoggle{
-       text-align: right; 
-       padding-bottom: 10px; 
-       padding-right: 10px; 
-       float: left; 
-       margin-top: 10px; 
-       padding-right: 5px; 
-       font-size:0.95em;
-}
-
-pre.code {
-       padding: 10px;
-       background:#F6EAD6 none repeat scroll 0 0;
-       border:1px solid black;
-       font-family:"Bitstream Vera Sans Mono",monospace;
-       margin-top:1em;
-       line-height: 150%;
+  text-align: right; 
+  padding-bottom: 10px; 
+  padding-right: 10px; 
+  float: left; 
+  margin-top: 10px; 
+  padding-right: 5px; 
+  font-size:0.95em;
 }
 
 /*** header ***/
 div.topnavlistcontainer {
-       margin-left:auto; 
-       margin-right:auto;
+  margin-left:auto; 
+  margin-right:auto;
   margin-bottom:1em;
-/*     border: thin #CCCCCC solid;*/
-       line-height:100%;
-/*     background-color: #365D95;*/
-       background-position:  top right;
-       background-repeat: no-repeat;
+/*  border: thin #CCCCCC solid;*/
+  line-height:100%;
+/*  background-color: #365D95;*/
+  background-position:  top right;
+  background-repeat: no-repeat;
 }
 ul.topnavlist {
-       padding-top: 10px;
-       white-space: nowrap;
-       margin-left:0px;
-       margin-left:0px;
-       list-style-position:inside;
-       list-style: disc inside;
+  padding-top: 10px;
+  white-space: nowrap;
+  margin-left:0px;
+  margin-left:0px;
+  list-style-position:inside;
+  list-style: disc inside;
 }
 
 ul.topnavlist li {
-       list-style: none;
-       list-style-position:inside;
+  list-style: none;
+  list-style-position:inside;
 
-       display: inline;
-       margin: 0px;
+  display: inline;
+  margin: 0px;
 }
 
 ul.topnavlist li a:hover, ul.topnavlist li a:focus, ul.topnavlist li a.active {
     background-color: #E6E6E6;
     color: black;
-       text-decoration:none;
+  text-decoration:none;
 }
 
 ul.topnavlist li a {
     /* The normal, unselected tabs. They are all links */
     color: #555;
-       font-weight:bold;
+  font-weight:bold;
     height: 1.5em;
     padding: 0em 2em 0em;
-       text-decoration:none;
-       background-color:white;
+     text-decoration:none;
+  background-color:white;
 }
 
 ul.topnavlist li a.selected {
@@ -891,52 +874,31 @@ ul.topnavlist li a.selected {
 
 /*  form fields grouping for WCAG 2.0 conformance*/
 fieldset.group_form{
-       margin:.5em;
-       border:thin #6D7B8D solid;
-       min-height: 100px;
-       padding:.5em;
-       background-color:#F8F8F8;;
+  margin:.5em;
+  border:thin #6D7B8D solid;
+     min-height: 100px;
+  padding:.5em;
+  background-color:#F8F8F8;;
 
 }
 
 legend.group_form{
-       border:thin #6D7B8D solid;
-       background-color: #ffa20c;
-       font-weight: 600;
-       color: black;
-       padding:.2em;
+  border:thin #6D7B8D solid;
+  background-color: #ffa20c;
+  font-weight: 600;
+  color: black;
+  padding:.2em;
 }
 
 /* highlight active links for WCAG 2.0 conformance */
 a:active,a:hover,a:focus{
-       background-color:#F6EAD6;
-       color:#000000;
+  background-color:#F6EAD6;
+  color:#000000;
 }
 
-code.input {
-  margin-bottom: 2ex;
-  background-color: white;
-  line-height: 130%;
-}
-
-code.input strong {
-  color: red;
-  padding-left: .5ex;
-  padding-right: .5ex;
-  font-weight: bolder;
-}
-
-p.helpwanted {
-  padding: 0;
-  margin-left:  auto;
-  margin-right: 5px;
-  color:        #888;
-  text-align:       right;
-}
-
-p.helpwanted a {
-  color: #88f;
-  text-decoration: none;
+.highlight, a.highlight {
+       background-color: #5B8E88;
+       color: white;
 }
 
 .selected {
@@ -950,186 +912,247 @@ p.helpwanted a {
 }
 
 table.form-data th,table.form-data td {
-       padding: 4px;
+  padding: 4px;
 }
 table.form-data{
 width:80%;
 }
 th.box {
-       border-bottom: #006699 solid 1px;
-       color: white;
+  border-bottom: #006699 solid 1px;
+  color: white;
   background-color: #006699;
 }
 
 table.box {
-       background-color: white;
-       border-right: #006699 solid 1px;
-       border-left: #006699 solid 1px;
-       border-top: #006699 solid 1px;
-       margin-right: 500px;
-       margin-bottom: 10px;
+  background-color: white;
+  border-right: #006699 solid 1px;
+  border-left: #006699 solid 1px;
+  border-top: #006699 solid 1px;
+  margin-right: 500px;
+  margin-bottom: 10px;
 }
 
 table.box th, table.box td {
-       border-bottom: #006699 solid 1px;
-       font-size: smaller;
+  border-bottom: #006699 solid 1px;
+  font-size: smaller;
 }
 
 #source ol {
-       background:#F6EAD6 none repeat scroll 0 0;
-       border:1px solid black;
-       font-family:"Bitstream Vera Sans Mono",monospace;
-       list-style-position:inside;
-       list-style-type:decimal;
-       margin-top:1em;
-       line-height: 200%;
+  background:#F6EAD6 none repeat scroll 0 0;
+  border:1px solid black;
+  font-family:"Bitstream Vera Sans Mono",monospace;
+  list-style-position:inside;
+  list-style-type:decimal;
+  margin-top:1em;
+  line-height: 200%;
 }
 
 img.inline-badge {
-       float:left;
-       margin-left:3em;
-       padding:12px;
+  float:left;
+  margin-left:3em;
+  padding:12px;
 }
 
 pre.badgeSnippet {
-       margin-bottom:2em;
-       margin-left:108px;
-       padding-left:3em;
+  margin-bottom:2em;
+  margin-left:108px;
+  padding-left:3em;
 }
 
 /* Liquid Round theme elements */
 
 #liquid-round {
-    /*width:85em;*/
-       margin:0px auto;
-       background:#fff url(images/leftside.gif) repeat-y left top;
+  margin:0px auto;
+  background:#fff url(images/leftside.gif) repeat-y left top;
 }
 
 .top {
-       width:100%;
-       height:15px;
-       background:url(images/top.gif) no-repeat left top;
+    width:100%;
+  height:15px;
+  background:url(images/top.gif) no-repeat left top;
 }
 .top span {
-       display:block;
-       position:relative;
-       height:20px;
-       background:url(images/top-right.gif) no-repeat right top;
+  display:block;
+  position:relative;
+  height:20px;
+  background:url(images/top-right.gif) no-repeat right top;
 }
 
 .center-content {
-       position:relative;
-       background:url(images/rightside.gif) repeat-y right top;
-       padding:1px 5px 1px 5px;
-       margin:-1px 0 -50px 0;
+  position:relative;
+  background:url(images/rightside.gif) repeat-y right top;
+  padding:1px 5px 1px 5px;
+  margin:-1px 0 -50px 0;
 }
 
 
 .bottom {
-       width:85em;
-       margin-left:auto;
-       margin-right:auto;
-       height:60px;
-       background:url(images/bottom.gif) no-repeat left bottom;
+  margin-left:auto;
+  margin-right:auto;
+  height:60px;
+  background:url(images/bottom.gif) no-repeat left bottom;
 }
 .bottom span {
-       display:block;
-       position:relative;
-       height:60px;
-       background:url(images/bottom-right.gif) no-repeat right top;
+  display:block;
+  position:relative;
+  height:60px;
+  background:url(images/bottom-right.gif) no-repeat right top;
 }
 
 
 /* Navigation tab style */
 .navigation a
 {
-       color: #000;
-       font-weight:bold;
-       background: #ffa20c url(images/navl.gif) left top no-repeat;
-       text-decoration: none;
-       padding-left: 10px;
+  color: #000;
+  font-weight:bold;
+  background: #ffa20c url(images/navl.gif) left top no-repeat;
+  text-decoration: none;
+  padding-left: 10px;
 } 
 
 .navigation a span
 {
-       background: url(images/navr.gif) right top no-repeat;
-       padding-right: 10px;
+  background: url(images/navr.gif) right top no-repeat;
+  padding-right: 10px;
 } 
 .navigation a:hover
 {
-       color: #fff;
-       background: #781351 url(images/navlh.gif) left top no-repeat;
-       padding-left: 10px
+  color: #fff;
+  background: #781351 url(images/navlh.gif) left top no-repeat;
+  padding-left: 10px
 }
 
 .navigation a:hover span
 {
-       background: url(images/navrh.gif) right top no-repeat;
-       padding-right: 10px
+  background: url(images/navrh.gif) right top no-repeat;
+  padding-right: 10px
 }
 .navigation a:active span
 {
-       background: url(images/navrh.gif) right top no-repeat;
-       padding-right: 10px
+  background: url(images/navrh.gif) right top no-repeat;
+  padding-right: 10px
 }
 
 .navigation ul
 {
-       list-style: none;
-       padding: 0;
-       margin: 0
+  list-style: none;
+  padding: 0;
+  margin: 0
 }
 
 .navigation li
 {
-       list-style: none;
-       list-style-position:inside;
-       display: inline;
-       float: left;
-       margin: 0;
+  list-style: none;
+  list-style-position:inside;
+  display: inline;
+  float: left;
+  margin: 0;
 }
 #logo{
-       float:right;
-       margin-right:1em;
-       margin-top:-1em;
+  float:right;
+  margin-right:1em;
+  margin-top:-1em;
 }
 
 
 ul.navigation li a:hover, ul.navigation li a:focus, ul.navigation li a.active {
-       background-color: #781351; 
-       background: #781351 url(images/navlh.gif) left top no-repeat;
-       color: white;
-       text-decoration:none;
+      background-color: #781351; 
+  background: #781351 url(images/navlh.gif) left top no-repeat;
+      color: white;
+  text-decoration:none;
 }
 
 ul.navigation li a.active span{
-       background-color: #781351; 
-       background: #781351 url(images/navrh.gif) right top no-repeat;
-       padding-right: 10px;
+      background-color: #781351; 
+  background: #781351 url(images/navrh.gif) right top no-repeat;
+  padding-right: 10px;
 }
 
 /* course search result display */
 .results {
-       margin: 0 16px;
-       padding-right: 1em;
+  margin: 0 16px;
+  padding-right: 1em;
 }
 
 li.course {
-       font-family:arial,sans-serif;
-       font-size:small;
-       margin:1em 0;
+  font-family:arial,sans-serif;
+  font-size:small;
+  margin:1em 0;
 }
 
 ol li {
-       list-style-image:none;
-       list-style-position:outside;
-       list-style-type:none;
+  list-style-image:none;
+  list-style-position:outside;
+  list-style-type:none;
 }
 
 .results h3 {
-       display:inline;
-       font-size:medium;
-       font-weight:normal;
-       margin:0;
-       padding:0;
+  display:inline;
+  font-size:medium;
+  font-weight:normal;
+  margin:0;
+  padding:0;
+}
+
+/* content display */
+div#content-text {
+  padding-right: 5pt;
+  line-height:150%;
+}
+
+div#content-text li {
+  margin-left: 15pt;
+}
+
+div#content-test {  
+  float: left;
+  margin-top: 2em;
+  padding-right: 5pt;
+  width: 80%;
+}
+div#content-test ol{  
+  margin-right: 5pt;;  
+}
+
+div#content-test ol ul li{
+  list-style: none;
+  padding: 0px 2px 0px 15px;
+  margin-bottom: 1px; 
+  line-height: 200%; 
+  background-color: #fdfdfd; 
+  border-bottom: 1px solid #efefef; 
+  /* -moz-border-radius: 4px;  */
+  border: 1px solid #eeeeff;
+}
+
+div#content-info {
+  margin: 5pt;
+  font-size: small;
+  color: #b8ae9c;
+  clear: both;
+}
+
+fieldset#shortcuts {
+  float: right;
+  background-color: #FEFDEF;
+  border: 1pt solid #B8AE9C;
+  margin: -5pt 5pt 5pt 5pt;
+  padding-right: 10pt;
+  padding-bottom: 5pt;
+  padding-left: 10pt;
+}
+
+#shortcuts ul {
+  position: relative;
+  margin-top: 0pt;
+  margin-bottom: 0pt;
+  margin-left: 0pt;
+  list-style-type:  none;
+  padding-left: 0pt; 
+}
+
+div.menuedit{
+  float:right;
+  margin-top:-1.2em; 
+  border:1px solid #cccccc;"
 }
index f67968d..c36479b 100644 (file)
@@ -42,7 +42,7 @@ require(TR_INCLUDE_PATH.'header.inc.php');
 
        <table class="form-data" align="center">
                <tr>
-                       <td colspan="2" align="left"><br/><?php echo _AT('required_field_text') ;?><br /><br /><br/></td>
+                       <td colspan="2" align="left"><br/><?php echo _AT('required_field_text') ;?></td>
                </tr>
 
                <tr>
index 9939415..b541663 100644 (file)
@@ -83,7 +83,7 @@ jQuery(document).ready(function () {
                                if (newValue != oldValue)\r
                                        rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>updater/myown_patches_inline_editor_submit.php", \r
                                          { "field":viewNode.id, "value":newValue }, \r
-                                 function(data) { handleResponse(data, viewNode, oldValue); }, \r
+                                 function(data) { handleAjaxResponse(data, viewNode, oldValue); }, \r
                                  "json");\r
                        }\r
                }\r
index dee2c01..78bea2e 100644 (file)
@@ -25,7 +25,7 @@ require (TR_INCLUDE_PATH.'header.inc.php');
 <div id="messageDIV"></div>\r
        <table class="form-data">\r
                <tr>\r
-                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?><br /><br/></td>\r
+                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?></td>\r
                </tr>\r
 \r
                <tr>\r
index 94ca76f..f3a46fe 100644 (file)
@@ -205,7 +205,7 @@ jQuery(document).ready(function () {
                        afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {\r
                                if (newValue != oldValue)\r
                                        rtn = jQuery.post("<?php echo TR_BASE_HREF; ?>user/index_inline_editor_submit.php", { "field":viewNode.id, "value":newValue }, \r
-                                         function(data) { handleResponse(data, viewNode, oldValue); }, "json");\r
+                                         function(data) { handleAjaxResponse(data, viewNode, oldValue); }, "json");\r
                        }\r
                }\r
        });\r
index cac0e1d..6c1c566 100644 (file)
@@ -116,7 +116,7 @@ jQuery(document).ready(function () {
                                                  }\r
                                                    }\r
                                                \r
-                                       handleResponse(data); \r
+                                       handleAjaxResponse(data); \r
                                          }, "json");\r
                                }\r
                        }\r
index 3962693..1633de3 100644 (file)
@@ -26,7 +26,7 @@ include(TR_INCLUDE_PATH.'header.inc.php');
 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('create_edit_user_group'); ?></legend>\r
        <table class="form-data">\r
                <tr>\r
-                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?><br /><br /></td>\r
+                       <td colspan="2" align="left"><?php echo _AT('required_field_text') ;?></td>\r
                </tr>\r
 \r
                <tr>\r
index d3e2568..b7758fa 100644 (file)
@@ -99,8 +99,6 @@ include(TR_INCLUDE_PATH.'header.inc.php');
                        <label for="lang_code"><?php echo _AT('choose_lang'); ?></label>:
                        <select name="lang_code" id="lang_code"> 
 <?php 
-debug($rows_lang);
-debug($_REQUEST["lang_code"]); 
 foreach ($rows_lang as $row_lang)
        {
 ?>
index 0824c6c..e625dee 100644 (file)
@@ -77,7 +77,7 @@ class Patch {
                $this ->patch_suffix = $patch_array['system_patch_id'];
                $this->skipFilesModified = $skipFilesModified;
                
-               $this->module_content_dir = TR_TEMP_DIR . "updater";
+               $this->module_content_dir = TR_CONTENT_DIR . "updater";
                $this->patchesDAO = new PatchesDAO();
                $this->patchesFilesDAO = new PatchesFilesDAO();
                $this->patchesFilesActionsDAO = new PatchesFilesActionsDAO();
index 8b4c6db..2c7dadf 100644 (file)
@@ -97,9 +97,9 @@ class PatchCreator {
                $this->patch_info_array = $patch_info_array; 
                $this->current_patch_id = $patch_id;
                
-               $this->patch_xml_file = TR_TEMP_DIR . "updater/patch.xml";
+               $this->patch_xml_file = TR_CONTENT_DIR . "updater/patch.xml";
 
-               $this->version_folder = TR_TEMP_DIR . "updater/" . str_replace('.', '_', $this->patch_info_array["transformable_version_to_apply"]) . "/";
+               $this->version_folder = TR_CONTENT_DIR . "updater/" . str_replace('.', '_', $this->patch_info_array["transformable_version_to_apply"]) . "/";
                $this->patch_folder = $this->version_folder . $this->patch_info_array["system_patch_id"] . "/";
                
                $this->myownPatchesDAO = new MyownPatchesDAO();
index afa5f1c..c52732f 100644 (file)
@@ -108,7 +108,7 @@ if ($server_connected)
 }\r
 // end of get patch list\r
 \r
-$module_content_folder = TR_TEMP_DIR . "updater/temp";\r
+$module_content_folder = TR_CONTENT_DIR . "updater/temp";\r
 if (!is_dir($module_content_folder)) mkdir($module_content_folder);\r
 \r
 if ($_POST['install_upload'] && $_POST['uploading'])\r
index 3bb1492..cbc9a4f 100644 (file)
@@ -31,6 +31,7 @@ if (isset($_POST['field']))
        else\r
        {\r
                $rtn['status'] = 'success';\r
+               $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');\r
        }\r
        echo json_encode($rtn);\r
 }\r
index 410d81d..ff3cca3 100644 (file)
@@ -37,6 +37,7 @@ if (isset($_POST['field']) && isset($_POST['value']) && $_POST['value'] <> '')
        else\r
        {\r
                $rtn['status'] = 'success';\r
+               $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');\r
        }\r
 }\r
 \r
index 23de378..7f6bc0d 100644 (file)
@@ -31,6 +31,7 @@ if (isset($_POST['field']))
        else\r
        {\r
                $rtn['status'] = 'success';\r
+               $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');\r
        }\r
 }\r
 \r