Actualización

This commit is contained in:
Xes
2025-04-10 12:49:05 +02:00
parent 4aff98e77b
commit 1cdd00920f
9151 changed files with 1800913 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
<?php
/* For licensing terms, see /license.txt */
class Cc1p3Convert extends CcBase
{
public const CC_TYPE_FORUM = 'imsdt_xmlv1p3';
public const CC_TYPE_QUIZ = 'imsqti_xmlv1p3/imscc_xmlv1p3/assessment';
public const CC_TYPE_QUESTION_BANK = 'imsqti_xmlv1p3/imscc_xmlv1p3/question-bank';
public const CC_TYPE_WEBLINK = 'imswl_xmlv1p3';
public const CC_TYPE_ASSOCIATED_CONTENT = 'associatedcontent/imscc_xmlv1p3/learning-application-resource';
public const CC_TYPE_WEBCONTENT = 'webcontent';
public const CC_TYPE_BASICLTI = 'imsbasiclti_xmlv1p3';
public static $namespaces = ['imscc' => 'http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1',
'lomimscc' => 'http://ltsc.ieee.org/xsd/imsccv1p3/LOM/manifest',
'lom' => 'http://ltsc.ieee.org/xsd/imsccv1p3/LOM/resource',
'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'cc' => 'http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p1', ];
public static $restypes = ['associatedcontent/imscc_xmlv1p3/learning-application-resource', 'webcontent'];
public static $forumns = ['dt' => 'http://www.imsglobal.org/xsd/imsccv1p3/imsdt_v1p3'];
public static $quizns = ['xmlns' => 'http://www.imsglobal.org/xsd/ims_qtiasiv1p2'];
public static $resourcens = ['wl' => 'http://www.imsglobal.org/xsd/imsccv1p3/imswl_v1p3'];
public static $basicltins = [
'xmlns' => 'http://www.imsglobal.org/xsd/imslticc_v1p0',
'blti' => 'http://www.imsglobal.org/xsd/imsbasiclti_v1p0',
'lticm' => 'http://www.imsglobal.org/xsd/imslticm_v1p0',
'lticp' => 'http://www.imsglobal.org/xsd/imslticp_v1p0',
];
public function __construct($path_to_manifest)
{
parent::__construct($path_to_manifest);
}
/**
* Scan the imsmanifest.xml structure to find elements to import to documents, links, forums, quizzes.
*/
public function generateImportData(): void
{
$countInstances = 0;
$xpath = static::newxPath(static::$manifest, static::$namespaces);
// Scan for detached resources of type 'webcontent'
$resources = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@type="'.static::CC_TYPE_WEBCONTENT.'"]');
$this->createInstances($resources, 0, $countInstances);
// Scan for organization items or resources that are tests (question banks)
$items = $xpath->query('/imscc:manifest/imscc:organizations/imscc:organization/imscc:item | /imscc:manifest/imscc:resources/imscc:resource[@type="'.static::CC_TYPE_QUESTION_BANK.'"]');
$this->createInstances($items, 0, $countInstances);
$resources = new Cc13Resource();
$forums = new Cc13Forum();
$quiz = new Cc13Quiz();
// Get the embedded XML files describing resources to import
$documentValues = $resources->generateData('document');
$linkValues = $resources->generateData('link');
$forumValues = $forums->generateData();
$quizValues = $quiz->generateData();
if (!empty($forums) or !empty($quizValues) or !empty($documentValues)) {
$courseInfo = api_get_course_info();
$sessionId = api_get_session_id();
$groupId = api_get_group_id();
$documentPath = api_get_path(SYS_COURSE_PATH).$courseInfo['directory'].'/document';
create_unexisting_directory(
$courseInfo,
api_get_user_id(),
$sessionId,
$groupId,
null,
$documentPath,
'/commoncartridge',
'Common Cartridge folder',
0
);
}
// Import the resources, by type
if (!empty($forums)) {
$saved = $forums->storeForums($forumValues);
}
if (!empty($quizValues)) {
$saved = $quiz->storeQuizzes($quizValues);
}
if (!empty($documentValues)) {
$saved = $resources->storeDocuments($documentValues, static::$pathToManifestFolder);
}
if (!empty($linkValues)) {
$saved = $resources->storeLinks($linkValues);
}
}
}

View File

@@ -0,0 +1,99 @@
<?php
/* For licensing terms, see /license.txt */
class Imscc13Import
{
public const FORMAT_IMSCC13 = 'imscc13';
public function log($message, $level, $a = null, $depth = null, $display = false)
{
error_log("(imscc1) $message , level : $level , extra info: $a, message depth : $depth");
}
public static function detectFormat($filepath)
{
$manifest = Cc1p3Convert::getManifest($filepath);
if (file_exists($manifest)) {
// Looks promising, lets load some information.
$handle = fopen($manifest, 'r');
$xmlSnippet = fread($handle, 1024);
fclose($handle);
// Check if it has the required strings.
$xmlSnippet = strtolower($xmlSnippet);
$xmlSnippet = preg_replace('/\s*/m', '', $xmlSnippet);
$xmlSnippet = str_replace("'", '', $xmlSnippet);
$xmlSnippet = str_replace('"', '', $xmlSnippet);
$search_string = "xmlns=http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1";
if (strpos($xmlSnippet, $search_string) !== false) {
return self::FORMAT_IMSCC13;
}
}
return null;
}
/**
* Read the imsmanifest.xml file in the app/cache/imsccImport temp folder.
*
* @param $filepath
*
* @return void
*/
public function execute($filepath)
{
$manifest = Cc1p3Convert::getManifest($filepath);
if (empty($manifest)) {
throw new RuntimeException('No Manifest detected!');
}
$validator = new ManifestValidator('schemas13');
if (!$validator->validate($manifest)) {
throw new RuntimeException('validation error(s): '.PHP_EOL.ErrorMessages::instance());
}
$cc113Convert = new Cc1p3Convert($manifest);
if ($cc113Convert->isAuth()) {
throw new RuntimeException('protected_cc_not_supported');
}
$cc113Convert->generateImportData();
}
/**
* Unzip a file into the specified directory. Throws a RuntimeException
* if the extraction failed.
*/
public static function unzip($file, $to = 'cache/zip')
{
@ini_set('memory_limit', '256M');
if (!is_dir($to)) {
mkdir($to);
chmod($to, 0777);
}
if (class_exists('ZipArchive')) {
// use ZipArchive
$zip = new ZipArchive();
$res = $zip->open($file);
if ($res === true) {
$zip->extractTo($to);
$zip->close();
} else {
throw new RuntimeException('Could not open zip file [ZipArchive].');
}
} else {
// use PclZip
$zip = new PclZip($file);
if ($zip->extract(PCLZIP_OPT_PATH, $to) === 0) {
throw new RuntimeException('Could not extract zip file [PclZip].');
}
}
return true;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
<?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/imsccv1p3/imscp_v1p1"
xmlns:lomimscc ="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/manifest"
xmlns:lom ="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/resource"
xmlns:cc ="http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p3"
version="IMS CC 1.3 CP 1.2"
elementFormDefault ="qualified"
attributeFormDefault="unqualified"
>
<xs:import namespace="http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1" schemaLocation="ccv1p3_imscp_v1p2_v1p0.xsd" />
<!--xs:import namespace="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/manifest" schemaLocation="LOM/ccv1p3_lommanifest_v1p0.xsd"/-->
<!--xs:import namespace="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/resource" schemaLocation="LOM/ccv1p3_lomresource_v1p0.xsd"/-->
<!--xs:import namespace="http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p3" schemaLocation="ccv1p3_imsccauth_v1p3.xsd" /-->
</xs:schema>

View File

@@ -0,0 +1,223 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p3/imscp_extensionv1p2"
targetNamespace="http://www.imsglobal.org/xsd/imsccv1p3/imscp_extensionv1p2"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="IMS CPX 1.2 CCv1.3"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace = "http://www.w3.org/1999/xlink" schemaLocation = "http://www.imsglobal.org/xsd/w3/1999/xlink.xsd" />
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Colin Smythe (IMS Global, UK)
Date: 30th June, 2013
Version: 1.0
Status: Final Release
Description: This is the PSM for the CCv1.3 profile of the IMS Content Packaging Extension v1.0 specification.
History: The original Final Release.
PROFILE: This is the "CC-CP-Extensions". THIS IS A PROFILE OF THE BASE SPECIFICATION.
The changes to the base specification are:
* The schema namespace has been changed to "http://www.imsglobal.org/xsd/imsccv1p3/imscp_extensionv1p2".
* The schema version has been changed to "IMS CPX 1.2 CCv1.3".
* The "IPointer" class/complexType and set of XML attributes have been deleted;
* The "LingualTitle" class/complexType and set of XML attributes have been deleted;
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS Common Cartridge v1.3 Content Packaging Extension (CPX) v1.0 Profile Version 1.0
found at http://www.imsglobal.org/cpx and the original IMS Global schema binding or code base
http://www.imsglobal.org/cpx.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
(b) Papyrus - v0.9.2 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st March, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-06-25
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded" />
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="Metadata.Type" abstract="false" mixed="false">
<xs:sequence>
<xs:group ref="grpStrict.any" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Variant.Type" abstract="false" mixed="false">
<xs:sequence>
<xs:element name="metadata" type="Metadata.Type" minOccurs="1" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="identifier" use="required" type="xs:ID" />
<xs:attribute name="identifierref" use="required" type="xs:IDREF" />
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="variant" type="Variant.Type" />
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,237 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p3"
targetNamespace="http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p3"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS CC AUTHZ 1.3"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Colin Smythe
Date: 31st March, 2013
Version: 1.3
Status: Final
Description: This is the IMS Global Authorization Data Model for the Common Cartridge.
History: Version 1.0 - the first release of this data model;
Version 1.1 - updates made to the namespace;
Version 1.2 - updates made to the namespace;
Version 1.3 - updates made to the namespace.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS Common Cartridge (CC) Authorization Version 1.3
found at http://www.imsglobal.org/cc and the original IMS Global schema binding or code base
http://www.imsglobal.org/cc.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st January, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-04-14
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<xs:attribute name="protected" type="xs:boolean" />
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded" />
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="Authorization.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The authorization detail for the cartridge in terms of the web service.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="cartridgeId" type="xs:normalizedString" minOccurs="1" maxOccurs="1" />
<xs:element name="webservice" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Authorizations.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The set of authorizations for the associated object.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="authorization" type="Authorization.Type" minOccurs="1" maxOccurs="1" />
<xs:group ref="grpStrict.any" />
</xs:sequence>
<xs:attribute name="access" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="cartridge" />
<xs:enumeration value="resource" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="import" use="optional" default="false" type="xs:boolean" />
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="authorizations" type="Authorizations.Type" />
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,847 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1"
targetNamespace="http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1"
xmlns:autz="http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p3"
xmlns:lomm="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/manifest"
xmlns:lomr="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/resource"
xmlns:csmd="http://www.imsglobal.org/xsd/imsccv1p3/imscsmd_v1p0"
xmlns:sch="http://purl.oclc.org/dsdl/schematron"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS CC 1.3 CP 1.2"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.imsglobal.org/xsd/w3/2001/xml.xsd" />
<xs:import namespace="http://www.imsglobal.org/xsd/imsccv1p3/imsccauth_v1p3" schemaLocation="http://www.imsglobal.org/profile/cc/ccv1p3/ccv1p3_imsccauth_v1p3.xsd" />
<xs:import namespace="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/manifest" schemaLocation="http://www.imsglobal.org/profile/cc/ccv1p3/LOM/ccv1p3_lommanifest_v1p0.xsd" />
<xs:import namespace="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/resource" schemaLocation="http://www.imsglobal.org/profile/cc/ccv1p3/LOM/ccv1p3_lomresource_v1p0.xsd" />
<xs:import namespace="http://www.imsglobal.org/xsd/imsccv1p3/imscsmd_v1p0" schemaLocation="http://www.imsglobal.org/profile/cc/ccv1p3/ccv1p3_imscsmd_v1p0.xsd" />
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Colin Smythe, IMS Global (UK)
Date: 31st March, 2013
Version: 1.3
Status: Final Release
Description: This model forms a part of the IMS Global Common Cartridge specification. This model is the profile of the
IMS Global Content Package Core specification (v1.2). The changes made to create the profile are:
(a) The 'default' characteristic for the 'Organizations' class has been removed;
(b) The 'isvisible' characteristic for the Item class has been removed;
(c) The 'parameters' characteristic for the Item class has been removed;
(d) The 'structure' characteristic for the Organization class has been fixed to 'rooted-hierarchy';
(e) The 'extension' and 'version' characteristics for the Manifest class have been removed;
(f) The 'extension' attribute and 'extension' characteristic have been removed the Organizations class;
(g) The 'extension' attribute and 'extension' characteristic have been removed the Organization class;
(h) The 'extension' attribute and 'extension' characteristic have been removed from the Resources class;
(i) The 'extension' attribute and the 'extension' characteristic have been removed from the Resource class;
(j) The 'extension' attribute and 'extension' characteristic have been removed from the Item class;
(k) The 'extension' attribute and the 'extension' characteristic have been removed from the File class;
(l) The 'extension' attribute and 'extension' characteristic have been removed from the Dependency class;
(m) The 'type' characteristic of the Resource class has a new enumerated list of 'PredfinedContentTypes';
(n) The 'title' attribute for the Item class has its multiplicity changed to '1' except for the top-level item
attribute in the Orgaization class where it must not occur;
(o) Manifests are NO longer allowed to contain sub-manifests;
(p) The multiplicity of the Organization class in the Organizations class has been made '0..1';
(q) Only the metadata in the Manifest class is permitted to have the 'schema' and 'schemaversion' attributes;
(r) The 'schema', 'schemaversion' and 'title' attributes are redefined directly as 'String' primitiveTypes;
(s) The multiplicity of the 'item' attribute in the Organization class has been made '1';
(t) The value for the 'schema' attribute has been set as 'IMS Common Cartridge';
(u) The value for the 'schemaversion' attribute has been set to '1.3.0';
(v) The authorizations attribute has been added as an imported extension to the manifest;
(w) The protect attribute has been added as an imported extension to the resource;
(x) The IEEE LOM attribute has been added as an imported extension to the manifest metadata;
(y) The ResourceMetadata class has been added with an import relationship to the curriculum standards
metadata schema. The metadata attribute in the Resource class now uses this new metadata class;
(z) The 'intendeduse' attribute has been added to the ResourceType complexType.
History: This profile is taken from the formal representation in UML of the IMS CP v1.2 core specification.
This is the first version of the profile for the CCv1.3. The changes are the removal of the enumeration of the resource
type from the XSD, the use of an external VDEX file for the resource type, support for the APIPv1.0, IWBv1.0 and EPUBv3.0
resource types is added, support for embedded XML resources is added, multiple question banks are permitted, and the
schema and schemaversion elements are permitted for resource-level metadata.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS Common Cartridge (Content Packaging) Version 1.3
found at http://www.imsglobal.org/cc and the original IMS Global schema binding or code base
http://www.imsglobal.org/cc.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st January, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-04-12
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
Schematron Validation Rules Information
---------------------------------------
Author: Colin Smythe
Date: 9th July, 2011
Version: 1.2
Status: Final Release
Description: This set of schematron rules have been created to increase the validation capability of the CPv1.2 XSD for CCv1.2.
A total of 10 rule sets have been created to ensure that:
[1] The set of rules to ensure that resources for Discussion Topics are correctly provided;
[2] The set of rules to ensure that resources for Web Links are correctly provided;
[3] The set of rules to ensure that resources for Assessments are correctly provided;
[4] The set of rules to ensure that resources for Question Banks are correctly provided;
[5] The set of rules to ensure that resources for Web Content are correctly provided;
[6] The set of rules to ensure that resources for Associated Content are correctly provided;
[7] The set of general rules to ensure that Dependencies are used correctly;
[8] The set of general rules to ensure that Items are defined correctly;
[9] The set of general rules to ensure that Files are used correctly;
[10] The set of general rules to ensure that Resources are used correctly;
[11] The set of rules to ensure that resources for BasicLTI are correctly provided.
History: In CCv1.3 The original Rule 4a has been removed (Ensure that no more than one Question Bank is defined as a resource).
Rule Set: [1] The set of rules to ensure that resources for Discussion Topics are correctly provided.
The rules are:
(a) Detect for the Discussion Topic Resource when the required 'file' element is missing;
(b) Detect for the Discussion Topic Resource when too many 'file' elements are declared;
(c) Ensure for the Discussion Topic Resource that the 'href' attribute is not used on the 'resource' element;
(d) Detect for the Discussion Topic Resource when it has a prohibited dependency on a Discussion Topic;
(e) Detect for the Discussion Topic Resource when it has a prohibited dependency on a Web Link;
(f) Detect for the Discussion Topic Resource when it has a prohibited dependency on an Assessment;
(g) Detect for the Discussion Topic Resource when it has a prohibited dependency on a Question Bank;
(h) Detect for the Discussion Topic Resource when it has a prohibited dependency on a BasicLTI link;
[2] The set of rules to ensure that resources for Web Links are correctly provided.
The rules are:
(a) Detect for the Web Links Resource when the required 'file' element is missing;
(b) Detect for the Web Links Resource when too many 'file' elements are declared;
(c) Ensure for the Web Links Resource that the 'href' attribute is not used on the 'resource' element;
(d) Ensure for the Web Links Resource that the 'dependency' element is not used;
[3] The set of rules to ensure that resources for Assessments are correctly provided.
The rules are:
(a) Detect for the Assessment Resource when the required 'file' element is missing;
(b) Detect for the Assessment Resource when too many 'file' elements are declared;
(c) Ensure for the Assessment Resource that the 'href' attribute is not used on the 'resource' element;
(d) Detect for the Assessment Resource when it has a prohibited dependency on a Discussion Topic;
(e) Detect for the Assessment Resource when it has a prohibited dependency on a Web Link;
(f) Detect for the Assessment Resource when it has a prohibited dependency on an Assessment;
(g) Detect for the Assessment Resource when it has a prohibited dependency on a Question Bank;
(h) Detect for the Assessment Resource when it has a prohibited dependency on a BasicLTI link;
[4] The set of rules to ensure that resources for Question Banks are correctly provided.
The rules are:
(a) Detect for the Question Bank Resource when the required 'file' element is missing;
(b) Detect for the Question Bank Resource when too many 'file' elements are declared - [REMOVED IN CCv1.3 RELEASE];
(c) Ensure for the Question Bank Resource that the 'href' attribute is not used on the 'resource' element;
(d) Detect for the Question Bank Resource when it has a prohibited dependency on a Discussion Topic;
(e) Detect for the Question Bank Resource when it has a prohibited dependency on a Web Link;
(f) Detect for the Question Bank Resource when it has a prohibited dependency on an Assessment;
(g) Detect for the Question Bank Resource when it has a prohibited dependency on a Question Bank;
(h) Detect for the Question Bank Resource when it has a prohibited dependency on a BasicLTI link;
[5] The set of rules to ensure that resources for Web Content are correctly provided.
The rules are:
(a) Detect for the Web Content Resource when it has a prohibited dependency on a Discussion Topic;
(b) Detect for the Web Content Resource when it has a prohibited dependency on a Web Link;
(c) Detect for the Web Content Resource when it has a prohibited dependency on an Assessment;
(d) Detect for the Web Content Resource when it has a prohibited dependency on a Question Bank;
(e) Detect for the Web Content Resource when it has a prohibited dependency on a Associated Content;
(f) Detect for the Web Content Resource when it has a prohibited dependency on a BasicLTI link;
(g) A Web Content Resource has a missing 'href' attribute (required because the resource is directly referenced by an Item). [TO BE VERIFIED]
[6] The set of rules to ensure that resources for Associated Content are correctly provided.
The rules are:
(a) Detect for the Associated Content Resource when it has a prohibited dependency on a Discussion Topic;
(b) Detect for the Associated Content Resource when it has a prohibited dependency on a Web Link;
(c) Detect for the Associated Content Resource when it has a prohibited dependency on an Assessment;
(d) Detect for the Associated Content Resource when it has a prohibited dependency on a Question Bank;
(e) Detect for the Associated Content Resource when it has a prohibited dependency on a Associated Content;
(f) Detect for the Associated Content Resource when it has a prohibited dependency on a BasicLTI link;
(g) An Associated Content Resource has a missing 'href' attribute (required because the resource is directly referenced by an Item). [TO BE VERIFIED]
[7] The set of general rules to ensure that Dependencies are used correctly.
The rules are:
(a) A 'dependency' element has a circular reference to its host 'resource' element with identifier;
(b) In a 'resource' element at least two 'dependency' elements reference the same 'resource' element.
[8] The set of general rules to ensure that Items are defined correctly.
The rules are:
(a) An Item has a prohibited reference(s) to a Question Bank Resource;
(b) A Learning Object Item contains prohibited child Item(s).
[9] The set of general rules to ensure that Files are used correctly.
The rules are:
(a) In a 'resource' element at least two 'file' elements have the same 'href' attribute;
[10] The set of general rules to ensure that Resources are used correctly.
The rules are:
(a) For a 'resource' element with the 'href' attribute the 'file' element is missing;
(b) For a 'resource' element with the 'href' attribute there is no 'file' element with the correct 'href' attribute.
[11] The set of rules to ensure that resources for BasicLTI are correctly provided.
The rules are:
(a) Detect for the BasicLTI Resource when it has a prohibited dependency on a Discussion Topic;
(b) Detect for the BasicLTI Resource when it has a prohibited dependency on a Web Link;
(c) Detect for the BasicLTI Resource when it has a prohibited dependency on an Assessment;
(d) Detect for the BasicLTI Resource when it has a prohibited dependency on a Question Bank;
(e) Detect for the BasicLTI Resource when it has a prohibited dependency on a Web Content;
(f) Detect for the BasicLTI Resource when it has a prohibited dependency on a BasicLTI link.
</xs:documentation>
<xs:appinfo>
<sch:ns uri="http://www.imsglobal.org/xsd/imsccv1p1/imscp_v1p1" prefix="cp"/>
<sch:title>Schematron validation rules for the Common Cartridge v1p1 profile of CP v1.1.4/1.2</sch:title>
<!-- RULE 1: Discussion Topic Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 1">
<sch:title>RULE SET 1: The set of rules to ensure that resources for Discussion Topics are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='imsdt_xmlv1p0']">
<sch:assert test="count(cp:file) &gt; 0">
[RULE 1a] For the Discussion Topic Resource the required 'file' element is missing.
</sch:assert>
<sch:assert test="count(cp:file) &lt; 2">
[RULE 1b] For the Discussion Topic Resource there are too many 'file' element references: <sch:value-of select="count(cp:file)"/>.
</sch:assert>
<sch:assert test="count(@href) = 0">
[RULE 1c] For the Discussion Topic Resource the 'href' attribute must not be used on the 'resource' element.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsdt_xmlv1p0']/@identifier]) = 0">
[RULE 1d] The Discussion Topic Resource has a prohibited dependency on a Discussion Topic: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imswl_xmlv1p0']/@identifier]) = 0">
[RULE 1e] The Discussion Topic Resource has a prohibited dependency on a Web Link: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']/@identifier]) = 0">
[RULE 1f] The Discussion Topic Resource has a prohibited dependency on an Assessment: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier]) = 0">
[RULE 1g] The Discussion Topic Resource has a prohibited dependency on a Question Bank: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsbasiclti_xmlv1p0']/@identifier]) = 0">
[RULE 1h] The Discussion Topic Resource has a prohibited dependency on a BasicLTI: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 2: Web Links Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 2">
<sch:title>RULE SET 2: The set of rules to ensure that resources for Web Links are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='imswl_xmlv1p0']">
<sch:assert test="count(cp:file) &gt; 0">
[RULE 2a] For the Web Link Resource the required 'file' element is missing.
</sch:assert>
<sch:assert test="count(cp:file) &lt; 2">
[RULE 2b] For the Web Link Resource there are too many 'file' element references: <sch:value-of select="count(cp:file)"/>.
</sch:assert>
<sch:assert test="count(@href) = 0">
[RULE 2c] For the Web Link Resource the 'href' attribute must not be used on the 'resource' element.
</sch:assert>
<sch:assert test="count(cp:dependency) = 0">
[RULE 2d] For the Web Link Resource the prohibited 'dependency' element is used: <sch:value-of select="count(cp:dependency)"/>.
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 3: Assessment Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 3">
<sch:title>RULE SET 3: The set of rules to ensure that resources for Assessments are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']">
<sch:assert test="count(cp:file) &gt; 0">
[RULE 3a] For the Assessments Resource the required 'file' element is missing.
</sch:assert>
<sch:assert test="count(cp:file) &lt; 2">
[RULE 3b] For the Assessments Resource there are too many 'file' element references: <sch:value-of select="count(cp:file)"/>.
</sch:assert>
<sch:assert test="count(@href) = 0">
[RULE 3c] For the Assessments Resource the 'href' attribute must not be used on the 'resource' element.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsdt_xmlv1p0']/@identifier]) = 0">
[RULE 3d] The Assessment Resource has a prohibited dependency on a Discussion Topic: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imswl_xmlv1p0']/@identifier]) = 0">
[RULE 3e] The Assessment Resource has a prohibited dependency on a Web Link: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']/@identifier]) = 0">
[RULE 3f] The Assessment Resource has a prohibited dependency on an Assessment: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier]) = 0">
[RULE 3g] The Assessment Resource has a prohibited dependency on a Question Bank: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsbasiclti_xmlv1p0']/@identifier]) = 0">
[RULE 3h] The Assessment Resource has a prohibited dependency on a BasicLTI: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 4: Question Bank Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 4">
<sch:title>RULE SET 4: The set of rules to ensure that resources for Question Banks are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']">
<sch:assert test="count(cp:file) &gt; 0">
[RULE 4a] For the Question Bank Resource the required 'file' element is missing.
</sch:assert>
<!-- REMOVED IN CCv1.3 RELEASE
<sch:assert test="count(cp:file) &lt; 2">
[RULE 4b] For the Question Bank Resource there are too many 'file' element references: <sch:value-of select="count(cp:file)"/>.
</sch:assert>
-->
<sch:assert test="count(@href) = 0">
[RULE 4c] For the Question Bank Resource the 'href' attribute must not be used on the 'resource' element.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsdt_xmlv1p0']/@identifier]) = 0">
[RULE 4d] The Question Bank Resource has a prohibited dependency on a Discussion Topic: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imswl_xmlv1p0']/@identifier]) = 0">
[RULE 4e] The Question Bank Resource has a prohibited dependency on a Web Link: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']/@identifier]) = 0">
[RULE 4f] The Question Bank Resource has a prohibited dependency on an Assessment: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier]) = 0">
[RULE 4g] The Question Bank Resource has a prohibited dependency on a Question Bank: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsbasiclti_xmlv1p0']/@identifier]) = 0">
[RULE 4h] The Question Bank Resource has a prohibited dependency on a BasicLTI: <sch:value-of select="cp:dependency/@identifierref"/>
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 5: Web Content Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 5">
<sch:title>RULE SET 5: The set of rules to ensure that resources for Web Content are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='webcontent']">
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsdt_xmlv1p0']/@identifier]) = 0">
[RULE 5a] The Web Content has a prohibited dependency on a Discussion Topic: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imswl_xmlv1p0']/@identifier]) = 0">
[RULE 5b] The Web Content has a prohibited dependency on a Web Link: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']/@identifier]) = 0">
[RULE 5c] The Web Content has a prohibited dependency on an Assessment: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier]) = 0">
[RULE 5d] The Web Content has a prohibited dependency on a Question Bank: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier]) = 0">
[RULE 5e] The Web Content has a prohibited dependency on an Associated Content: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsbasiclti_xmlv1p0']/@identifier]) = 0">
[RULE 5f] The Web Content has a prohibited dependency on a BasicLTI: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
</sch:rule>
<!-- THIS RULE TO BE VERIFIED ***
<sch:rule abstract="false" context="cp:resources">
<sch:assert test="cp:resource[@type='webcontent'][@identifier=//cp:item/@identifierref][@href]">
[RULE 5g] A Web Content resource has a missing 'href' attribute (required because the resource is directly referenced by an Item). Check the following resources: <sch:value-of select="cp:resource[@type='webcontent']/@identifier"/>.
</sch:assert>
</sch:rule>
-->
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 6: Associated Content Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 6">
<sch:title>RULE SET 6: The set of rules to ensure that resources for Associated Content are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']">
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsdt_xmlv1p0']/@identifier]) = 0">
[RULE 6a] The Associated Content Resource has a prohibited dependency on a Discussion Topic: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imswl_xmlv1p0']/@identifier]) = 0">
[RULE 6b] The Associated Content Resource has a prohibited dependency on a Web Link: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']/@identifier]) = 0">
[RULE 6c] The Associated Content Resource has a prohibited dependency on an Assessment: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier]) = 0">
[RULE 6d] The Associated Content Resource has a prohibited dependency on a Question Bank: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier]) = 0">
[RULE 6e] The Associated Content Resource has a prohibited dependency on an Associated Content: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsbasiclti_xmlv1p0']/@identifier]) = 0">
[RULE 6f] The Associated Content Resource has a prohibited dependency on a BasicLTI: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
</sch:rule>
<!-- THIS RULE TO BE CORRECTED ***
<sch:rule abstract="false" context="cp:resources">
<sch:assert test="cp:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource'][@identifier=//cp:item/@identifierref][@href]">
[RULE 6g] An Associated Content resource has a missing 'href' attribute (required because the resource is directly referenced by an Item). Check the following resources: <sch:value-of select="cp:resource[@type='associatedcontent/imscc_xmlv1p0/learning-application-resource']/@identifier"/>.
</sch:assert>
</sch:rule>
-->
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 7: General Dependency Validation -->
<sch:pattern abstract="false" name="RULE SET 7">
<sch:title>RULE SET 7: The set of rules to ensure that Dependencies are used correctly.</sch:title>
<sch:rule abstract="false" context="cp:dependency">
<sch:assert test="@identifierref != parent::cp:resource/@identifier">
[RULE 7a] A 'dependency' element has a circular reference to its host 'resource' element with identifier: <sch:value-of select="@identifierref"/>.
</sch:assert>
</sch:rule>
<sch:rule abstract="false" context="cp:resource">
<sch:assert test="not(cp:dependency[@identifierref = preceding-sibling::cp:dependency/@identifierref])">
[RULE 7b] In a 'resource' element at least two 'dependency' elements reference the same 'resource' element. <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 8: General Item Validation -->
<sch:pattern abstract="false" name="RULE SET 8">
<sch:title>RULE SET 8: The set of rules to ensure that Items are defined correctly.</sch:title>
<sch:rule abstract="false" context="cp:resources">
<sch:assert test="count(cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank'][@identifier=//cp:item/@identifierref]) = 0">
[RULE 8a] An Item has a prohibited reference(s) to a Question Bank Resource: <sch:value-of select="cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier"/>.
</sch:assert>
</sch:rule>
<sch:rule abstract="false" context="cp:item/cp:item[@identifierref]">
<sch:assert test="count(cp:item) = 0">
[RULE 8b] A Learning Object Item contains prohibited child Item(s): <sch:value-of select="cp:item/@identifier"/>.
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 9: General File Validation -->
<sch:pattern abstract="false" name="RULE SET 9">
<sch:title>RULE SET 9: The set of rules to ensure that Files are used correctly.</sch:title>
<sch:rule abstract="false" context="cp:resource">
<sch:assert test="not(cp:file[@href = preceding-sibling::cp:file/@href])">
[RULE 9a] In a 'resource' element at least two 'file' elements have the same 'href' attribute: <sch:value-of select="cp:file/@href"/>.
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 10: General Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 10">
<sch:title>RULE SET 10: The set of general rules to ensure that Resources are used correctly.</sch:title>
<sch:rule abstract="false" context="cp:resource[@href]">
<sch:assert test="count(cp:file) &gt; 0">
[RULE 10a] For a 'resource' element with the 'href' attribute the 'file' element is missing: <sch:value-of select="@identifier"/>.
</sch:assert>
<sch:assert test="@href=cp:file/@href">
[RULE 10b] For a 'resource' element with the 'href' attribute there is no 'file' element with the correct 'href' attribute: <sch:value-of select="@identifier"/>.
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
<!-- RULE 11: BasicLTI Resource Validation -->
<sch:pattern abstract="false" name="RULE SET 11">
<sch:title>RULE SET 11: The set of rules to ensure that resources for BasicLTI are correctly provided</sch:title>
<sch:rule abstract="false" context="cp:resource[@type='imsbasiclti_xmlv1p0']">
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsdt_xmlv1p0']/@identifier]) = 0">
[RULE 11a] The BasicLTI has a prohibited dependency on a Discussion Topic: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imswl_xmlv1p0']/@identifier]) = 0">
[RULE 11b] The BasicLTI has a prohibited dependency on a Web Link: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/assessment']/@identifier]) = 0">
[RULE 11c] The Web Content has a prohibited dependency on an Assessment: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsqti_xmlv1p2/imscc_xmlv1p0/question-bank']/@identifier]) = 0">
[RULE 11d] The Web Content has a prohibited dependency on a Question Bank: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='webcontent']/@identifier]) = 0">
[RULE 11e] The Web Content has a prohibited dependency on an Associated Content: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
<sch:assert test="count(cp:dependency[@identifierref=//cp:resource[@type='imsbasiclti_xmlv1p0']/@identifier]) = 0">
[RULE 11f] The Web Content has a prohibited dependency on a BasicLTI: <sch:value-of select="cp:dependency/@identifierref"/>.
</sch:assert>
</sch:rule>
</sch:pattern>
<!-- **************************************************************************** -->
</xs:appinfo>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<xs:attributeGroup name="protected.Resource.Attr">
<xs:attribute ref="autz:protected" use="optional" default="false" />
</xs:attributeGroup>
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded" />
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="Dependency.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
This identifies a resource whose files this resource depends upon. The reference to an identifier in the resources section is contained in the Identifierref attribute.
</xs:documentation>
</xs:annotation>
<xs:sequence>
</xs:sequence>
<xs:attribute name="identifierref" use="required" type="xs:string" />
</xs:complexType>
<xs:complexType name="File.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
A listing of file that this resource is dependent on. The href attribute identifies the location of the file. This may have some meta-data.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="href" use="required" type="xs:anyURI" />
</xs:complexType>
<xs:complexType name="Item.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
This is the structure that describes the shape of the organization. It is used in a hierarchical organizational scheme by ordering and nesting. Each Item has an identifier that is unique within the Manifest file. Identifierref acts as a reference to an identifier in the resources section. An Item has a title and may have meta-data. The parameters and isvisible attributes have been removed for this profile.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="item" type="Item.Type" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="identifier" use="required" type="xs:ID" />
<xs:attribute name="identifierref" use="optional" type="xs:string" />
</xs:complexType>
<xs:complexType name="ItemOrg.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
This is the structure that describes the top-level shape of the organization and so only a single Item is permitted. The top-level has an identifier that is unique within the Manifest file. It may have meta-data but it has not title. It can contain any number of Items. The parameters and isvisible attributes have been removed for this profile
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="item" type="Item.Type" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="identifier" use="required" type="xs:ID" />
</xs:complexType>
<xs:complexType name="Manifest.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
A reusable unit of instruction. It encapsulates meta-data, organizations, resource references and authorization. It must have an identifier that is unique within the Manifest. The version and reference base is optional. The base provides the relative path offset for the content file(s).
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="metadata" type="ManifestMetadata.Type" minOccurs="1" maxOccurs="1" />
<xs:element name="organizations" type="Organizations.Type" minOccurs="1" maxOccurs="1" />
<xs:element name="resources" type="Resources.Type" minOccurs="1" maxOccurs="1" />
<xs:element ref="autz:authorizations" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="identifier" use="required" type="xs:ID" />
<xs:attribute ref="xml:base" use="optional" />
</xs:complexType>
<xs:complexType name="ManifestMetadata.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
This is the meta-data describing the Manifest. The schema describes the schema that defines and controls the Manifest. Schemaversion describes the version of the above schema (e.g. 1.0, 1.1, etc.). In Common Cartridge all of the meta-data is described using the IEEE LOM standard format. CC manifest metadata is required. In CCv1.2 support for manifest-level curriculum standards metadata was added.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="schema" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="IMS Common Cartridge" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="schemaversion" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="1.3.0" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element ref="lomm:lom" minOccurs="1" maxOccurs="1" />
<xs:element ref="csmd:curriculumStandardsMetadataSet" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Metadata.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
This is the meta-data describing the associated class (but not the manifest which has its own meta-data structure). In Common Cartridge all of the meta-data is described using the IEEE LOM standard format.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="grpStrict.any" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Organization.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
Describes a particular hierarchical organization in this profile; this is the only type of oranization that is permitted. The identifier, for the organization, that is unique within the Manifest file. The organization may have meta-data.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="item" type="ItemOrg.Type" minOccurs="1" maxOccurs="1" />
<xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="identifier" use="required" type="xs:ID" />
<xs:attribute name="structure" use="required" fixed="rooted-hierarchy" type="xs:string" />
</xs:complexType>
<xs:complexType name="Organizations.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
Describes zero or one structures or organizations for the Cartridge. Only one organization is permitted so the default attribute has been removed for this Profile.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="organization" type="Organization.Type" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Resource.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
A reference to a resource which consists of one or more physical files. The Identifer of the resource is unique within the scope of its containing Manifest file. The Type attribute indicates the type of resource - for the Cartridge this is an enumerated set. The resource may have meta-data, zero or more files references, and zero or more dependencies.
CCV1.1 PROFILE: The authorizations 'protected' attribute and the 'intendedUse' attribute are added.
CCV1.3 PROFLE: The resource type enumeration has been removed to make use of an external VDEX approach. Embedded XML is now permitted for a resource.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="metadata" type="ResourceMetadata.Type" minOccurs="0" maxOccurs="1" />
<xs:element name="file" type="File.Type" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="dependency" type="Dependency.Type" minOccurs="0" maxOccurs="unbounded" />
<xs:group ref="grpStrict.any" />
</xs:sequence>
<xs:attribute name="identifier" use="required" type="xs:ID" />
<xs:attribute name="type" use="required" type="xs:normalizedString" />
<xs:attribute name="href" use="optional" type="xs:anyURI" />
<xs:attribute ref="xml:base" use="optional" />
<xs:attribute name="intendeduse" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="assignment" />
<xs:enumeration value="lessonplan" />
<xs:enumeration value="syllabus" />
<xs:enumeration value="unspecified" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attributeGroup ref="protected.Resource.Attr" />
</xs:complexType>
<xs:complexType name="ResourceMetadata.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
This is the container for resource specific metadata. It may contain GUIDs that identify the curriculum standards which are associated with the resource.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="schema" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
<xs:element name="schemaversion" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
<xs:element ref="lomr:lom" minOccurs="0" maxOccurs="1" />
<xs:element ref="csmd:curriculumStandardsMetadataSet" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Resources.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
A collection of references to resources. There is no assumption of order or hierarchy. The base attribute provides the relative path offset for the content file(s).
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="resource" type="Resource.Type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute ref="xml:base" use="optional" />
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="manifest" type="Manifest.Type" />
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,237 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p3/imscsmd_v1p0"
targetNamespace="http://www.imsglobal.org/xsd/imsccv1p3/imscsmd_v1p0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS CSM 1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Colin Smythe
Date: 31st March, 2013
Version: 1.0
Status: Final
Description: The data model for metadata used to annotate resources with
curriculum standards GUIDs.
History: Version 1.0: The first formal release of this PSM binding.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS Curriculum Standards Metadata (CSM) Version 1.0
found at http://www.imsglobal.org/csm and the original IMS Global schema binding or code base
http://www.imsglobal.org/csm.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st January, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-04-12
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="CurriculumStandardsMetadata.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The CurriculumStandardsMetadata data-type is the container for the specicial metadata for curriculum standards for a particular domain of GUID provider. The 'providerId' attribute is used to denote the originator of the GUID scheme.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="setOfGUIDs" type="SetOfGUIDs.Type" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="providerId" use="optional" type="xs:normalizedString" />
</xs:complexType>
<xs:complexType name="CurriculumStandardsMetadataSet.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The CurriculumStandardsMetadataSet data-type is the container for the set of curriculum standards metadata. Each member of the set contains the curriculum standards metadata for a specific source of the GUIDs. The 'resourceLabel' attribute is a human readable label used to identify the type of resource, or part of resource, to which the enclosed metadata refers. The 'resourcePartId' is used to contain the appropriate identifier that is used to identify the resource part e.g. a QTI-Item within a QTI-Assessment.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="curriculumStandardsMetadata" type="CurriculumStandardsMetadata.Type" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="resourceLabel" use="optional" type="xs:normalizedString" />
<xs:attribute name="resourcePartId" use="optional" type="xs:normalizedString" />
</xs:complexType>
<xs:complexType name="LabelledGUID.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The labelled curriculum standard GUID. The optional label provides a human readable string to provide a clue about the nature of the curriculum standard.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="label" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
<xs:element name="GUID" type="xs:normalizedString" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="SetOfGUIDs.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The SetofGUIDs data-type is the container for the set of GUIDs that are to annotate a resource for a particular geographical/socio-political/etc. region. The region is denote using the 'region' attribute. The 'version' attribute is used to denote any relevant versioning information.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="labelledGUID" type="LabelledGUID.Type" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="region" use="optional" type="xs:normalizedString" />
<xs:attribute name="version" use="optional" type="xs:normalizedString" />
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="curriculumStandardsMetadataSet" type="CurriculumStandardsMetadataSet.Type" />
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,257 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p3/imsdt_v1p3"
targetNamespace="http://www.imsglobal.org/xsd/imsccv1p3/imsdt_v1p3"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS CC DTPC 1.3"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Colin Smythe
Date: 31st March, 2013
Version: 1.3
Status: Final
Description: This is the IMS Global Discussion Topics Data Model for the Common Cartridge.
This is one of the permitted types of resource in a CC.
History: Version 1.0 - the first release of this data model;
Version 1.1 - updates made to the namespace;
Version 1.2 - updates made to the namespace;
Version 1.3 - updates made to the namespace.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS Common Cartridge (CC) Version 1.3
found at http://www.imsglobal.org/cc and the original IMS Global schema binding or code base
http://www.imsglobal.org/cc.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st January, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-04-12
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded" />
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<xs:complexType name="EmptyPrimitiveType.Type">
<xs:complexContent>
<xs:restriction base="xs:anyType" />
</xs:complexContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="Attachments.Type" abstract="false" mixed="false">
<xs:sequence>
<xs:element name="attachment" type="Attachment.Type" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Topic.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The Topic complexType for the discussion topic object.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="title" type="xs:normalizedString" minOccurs="1" maxOccurs="1" />
<xs:element name="text" type="Text.Type" minOccurs="1" maxOccurs="1" />
<xs:element name="attachments" type="Attachments.Type" minOccurs="0" maxOccurs="1" />
<xs:group ref="grpStrict.any" />
</xs:sequence>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<xs:complexType name="Attachment.Type">
<xs:complexContent>
<xs:extension base="EmptyPrimitiveType.Type">
<xs:attribute name="href" use="required" type="xs:normalizedString" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Text.Type">
<xs:annotation>
<xs:documentation source="documentation">
The Text for the discussion topic.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="texttype" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="text/plain" />
<xs:enumeration value="text/html" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="topic" type="Topic.Type" />
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,237 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsccv1p3/imswl_v1p3"
targetNamespace="http://www.imsglobal.org/xsd/imsccv1p3/imswl_v1p3"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS CC WBLNK 1.3"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Colin Smythe
Date: 31st March, 2013
Version: 1.3
Status: Final
Description: This is the IMS Global Web Links Data Model for the Common Cartridge.
This is one of the resource types permitted in CC.
History: Version 1.0 - the first release of this data model;
Version 1.1 - updates made to the namespace;
Version 1.2 - updates made to the namespace;
Version 1.3 - updates made to the namespace..
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS Common Cartridge (CC) Version 1.3
found at http://www.imsglobal.org/cc and the original IMS Global schema binding or code base
http://www.imsglobal.org/cc.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st January, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-04-12
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded" />
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<xs:complexType name="EmptyPrimitiveType.Type">
<xs:complexContent>
<xs:restriction base="xs:anyType" />
</xs:complexContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="WebLink.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The WebLink complexType for the associated object.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="title" type="xs:normalizedString" minOccurs="1" maxOccurs="1" />
<xs:element name="url" type="URL.Type" minOccurs="1" maxOccurs="1" />
<xs:group ref="grpStrict.any" />
</xs:sequence>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<xs:complexType name="URL.Type">
<xs:annotation>
<xs:documentation source="documentation">
The URL for the web link.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="EmptyPrimitiveType.Type">
<xs:attribute name="href" use="required" type="xs:normalizedString" />
<xs:attribute name="target" use="optional" type="xs:normalizedString" />
<xs:attribute name="windowFeatures" use="optional" type="xs:normalizedString" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="webLink" type="WebLink.Type" />
<!-- ================================================================================================== -->
</xs:schema>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,194 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
targetNamespace="http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
xmlns:lticm="http://www.imsglobal.org/xsd/imslticm_v1p0"
xmlns:lticp="http://www.imsglobal.org/xsd/imslticp_v1p0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS BLTI 1.0.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="http://www.imsglobal.org/xsd/imslticm_v1p0" schemaLocation="http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd"/>
<xs:import namespace="http://www.imsglobal.org/xsd/imslticp_v1p0" schemaLocation="http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd"/>
<xs:annotation>
<xs:documentation>
XSD Data File Information
-------------------------
Author: Chuck Severance (IMS GLC) and Colin Smythe (IMS GLC)
Date: 9th June, 2010
Version: 1.0.1
Status: Final Release
Description: This is the description of the basicLTI link description.
History: V1.0 - the first final release.
V1.0.1 - the multiplicity for the extensions attribute has been changed from 0..1 to 0..*.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global Learning Consortium (GLC) specification IMS LTI Version 1.0
found at http://www.imsglobal.org/lti and the original IMS GLC schema binding or code base
http://www.imsglobal.org/lti.
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.
IMS GLC 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 GLCs
procedures with respect to rights in IMS GLC specifications can be found at the IMS GLC Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 GLC community on the IMS GLC website as described in the following two
paragraphs:-
* 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;
* 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 GLC and receive an email from IMS GLC granting the license. To register, follow
the instructions on the IMS GLC 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.
The limited permissions granted above are perpetual and will not be revoked by IMS GLC or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
---------------------------
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon v6 (and later)
Source XSLT File Information
----------------------------
XSL Generator: UMLtoXSDTransformv0p9.xsl
XSLT Processor: Xalan
Release: 1.0 Beta 3
Date: 31st May, 2009
IMS GLC Auto-generation Binding Tool-kit (I-BAT)
------------------------------------------------
This file was auto-generated using the IMS GLC Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS GLC makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS GLC "I-BAT" Documentation available at the IMS GLC web-site.
Tool Copyright: 2005-2010 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based IMS data-types ******************************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the data-type ComplexTypes ************************************************************** -->
<xs:complexType name="BasicLTILink.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The BasicLTILink class is the container for information required to use the BasicLTI mechanism.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="title" type="xs:normalizedString" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="description" type="xs:string" minOccurs = "0" maxOccurs = "1"/>
<xs:element name="custom" type="lticm:PropertySet.Type" minOccurs = "0" maxOccurs = "1"/>
<xs:element name="extensions" type="lticm:PlatformPropertySet.Type" minOccurs = "0" maxOccurs = "unbounded"/>
<xs:element name="launch_url" minOccurs = "0" maxOccurs = "1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value = "4096"/>
<xs:minLength value = "1"/>
<xs:whiteSpace value = "preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="secure_launch_url" minOccurs = "0" maxOccurs = "1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value = "4096"/>
<xs:minLength value = "1"/>
<xs:whiteSpace value = "preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="icon" type="lticp:Icon.Type" minOccurs = "0" maxOccurs = "1"/>
<xs:element name="secure_icon" type="lticp:Icon.Type" minOccurs = "0" maxOccurs = "1"/>
<xs:element name="vendor" type="lticp:Vendor.Type" minOccurs = "1" maxOccurs = "1"/>
</xs:sequence>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Declaration of the elements ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="basic_lti_link" type="BasicLTILink.Type"/>
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,275 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imslticc_v1p3"
targetNamespace="http://www.imsglobal.org/xsd/imslticc_v1p3"
xmlns:blti="http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
xmlns:lomc="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/imscclti"
xmlns:csmd="http://www.imsglobal.org/xsd/imsccv1p3/imscsmd_v1p0"
xmlns:lticp="http://www.imsglobal.org/xsd/imslticp_v1p0"
xmlns:lticm="http://www.imsglobal.org/xsd/imslticm_v1p0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS LTICC 1.3"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="http://www.imsglobal.org/xsd/imsbasiclti_v1p0" schemaLocation="http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0p1.xsd" />
<xs:import namespace="http://ltsc.ieee.org/xsd/imsccv1p3/LOM/imscclti" schemaLocation="http://www.imsglobal.org/profile/cc/ccv1p3/LOM/ccv1p3_lomccltilink_v1p0.xsd" />
<xs:import namespace="http://www.imsglobal.org/xsd/imsccv1p3/imscsmd_v1p0" schemaLocation="http://www.imsglobal.org/profile/cc/ccv1p3/ccv1p3_imscsmd_v1p0.xsd" />
<xs:import namespace="http://www.imsglobal.org/xsd/imslticp_v1p0" schemaLocation="http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd" />
<xs:import namespace="http://www.imsglobal.org/xsd/imslticm_v1p0" schemaLocation="http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd" />
<xs:annotation>
<xs:documentation>
XSD Data File Information
=========================
Author: Chuck Severance (IMS Global) and Colin Smythe (IMS Global)
Date: 31st March, 2013
Version: 1.3
Status: Final Release
Description: This is the description of the resource linkfile that is to be placed inside a Common Cartridge.
History: V1.0 - the first Final Release.
V1.0.1 - changed to use the imsbasiclti_v1p0p1.xsd;
V1.3 - introduction of the metadata and litversion in the CC link
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global specification IMS LTI (Common Cartridge) Version 1.3
found at http://www.imsglobal.org/lti and the original IMS Global schema binding or code base
http://www.imsglobal.org/lti.
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.
IMS Global 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 Global
procedures with respect to rights in IMS Global specifications can be found at the IMS Global Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 Global community on the IMS Global website as described in the following two
paragraphs:-
* 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;
* 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 Global and receive an email from IMS Global granting the license. To register, follow
the instructions on the IMS Global 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.
The limited permissions granted above are perpetual and will not be revoked by IMS Global or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
===========================
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon - v6 (and later)
Source XSLT File Information
============================
XSL Generator: Specificationv1p0_GenerationToolv1.xsl
XSLT Processor: Saxon-HE-9.4.0.4
Release: 1.0
Date: 31st January, 2013
Autogen Engineer: Colin Smythe (IMS Global, UK)
Autogen Date: 2013-04-14
IMS Global Auto-generation Binding Tool-kit (I-BAT)
===================================================
This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS Global makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
http://www.imsglobal.org.
Tool Copyright: 2012-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes (non-assigned) ******************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Global Attributes *********************************************************************** -->
<xs:attributeGroup name="extension.ResourceRef.Attr">
<xs:anyAttribute namespace = "##other" processContents = "strict" />
</xs:attributeGroup>
<!-- ================================================================================================== -->
<!-- Generate Global List Types *********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded" />
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<xs:simpleType name="Name.Type">
<xs:restriction base="xs:Name" />
</xs:simpleType>
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the ComplexTypes ************************************************************************ -->
<xs:complexType name="CartridgeBasicLTILink.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The CartridgeBasicLTILink class is the container for the information about the use of BasicLTI with a Common Cartridge.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="blti:BasicLTILink.Type">
<xs:sequence>
<xs:element name="cartridge_bundle" type="ResourceRef.Type" minOccurs="0" maxOccurs="1" />
<xs:element name="cartridge_icon" type="ResourceRef.Type" minOccurs="0" maxOccurs="1" />
<xs:element name="metadata" type="Metadata.Type" minOccurs="0" maxOccurs="1" />
<xs:group ref="grpStrict.any" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="CartridgeToolLocator.Type" abstract="false" mixed="false">
<xs:annotation>
<xs:documentation source="documentation">
The ToolLocator complexType is the container for the tool locator information for the cartridge BasicLTI resource.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="lticp:ToolLocator.Type">
<xs:sequence>
<xs:element name="tool_settings" type="lticm:PropertySet.Type" minOccurs="0" maxOccurs="1" />
<xs:group ref="grpStrict.any" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Metadata.Type" abstract="false" mixed="false">
<xs:sequence>
<xs:element ref="lomc:lom" minOccurs="0" maxOccurs="1" />
<xs:element ref="csmd:curriculumStandardsMetadataSet" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Generate the derived ComplexTypes **************************************************************** -->
<xs:complexType name="ResourceRef.Type">
<xs:annotation>
<xs:documentation source="documentation">
The ResourceRef complexType is the container for the resource reference.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:normalizedString">
<xs:attribute name="identifierref" use="required" type="Name.Type" />
<xs:attributeGroup ref="extension.ResourceRef.Attr" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Complex) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the elements (Derived) ************************************************************ -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<xs:element name="cartridge_basiclti_link" type="CartridgeBasicLTILink.Type" />
<xs:element name="lti_tool_locator" type="CartridgeToolLocator.Type" />
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,205 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imslticm_v1p0"
targetNamespace="http://www.imsglobal.org/xsd/imslticm_v1p0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS LTICM 1.0.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
XSD Data File Information
-------------------------
Author: Chuck Severance (IMS GLC) and Colin Smythe (IMS GLC)
Date: 30th April, 2010
Version: 1.0
Status: Final Release
Description: This is the description of the Common Messaging objects in LTI.
This version was created for the BasicLTI Final release.
History: V1.0 - First final release.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global Learning Consortium (GLC) specification IMS Common Cartridge Version 1.3 found at http://www.imsglobal.org/cc and the original IMS GLC schema binding or code base http://www.imsglobal.org/cc.
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.
IMS GLC 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 GLCs
procedures with respect to rights in IMS GLC specifications can be found at the IMS GLC Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 GLC community on the IMS GLC website as described in the following two
paragraphs:-
* 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;
* 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 GLC and receive an email from IMS GLC granting the license. To register, follow
the instructions on the IMS GLC 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.
The limited permissions granted above are perpetual and will not be revoked by IMS GLC or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
---------------------------
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon v6 (and later)
Source XSLT File Information
----------------------------
XSL Generator: UMLtoXSDTransformv0p9.xsl
XSLT Processor: Xalan
Release: 1.0 Beta 3
Date: 31st May, 2009
IMS GLC Auto-generation Binding Tool-kit (I-BAT)
------------------------------------------------
This file was auto-generated using the IMS GLC Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS GLC makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS GLC "I-BAT" Documentation available at the IMS GLC web-site.
Tool Copyright: 2005-2010 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes *********************************************************************** -->
<xs:attributeGroup name="extension.Property.Attr">
<xs:anyAttribute namespace = "##other" processContents = "strict"/>
</xs:attributeGroup>
<xs:attributeGroup name="extensions.PlatformPropertySet.Attr">
<xs:anyAttribute namespace = "##other" processContents = "strict"/>
</xs:attributeGroup>
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based IMS data-types ******************************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<xs:simpleType name="Name.Type">
<xs:restriction base="xs:Name"/>
</xs:simpleType>
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the data-type ComplexTypes ************************************************************** -->
<xs:complexType name="PropertySet.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The PropertySet complexType is the container for the set of properties.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="property" type="Property.Type" minOccurs = "0" maxOccurs = "unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PlatformPropertySet.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The Platform complexType is the container for the set of properties for the platform.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="PropertySet.Type">
<xs:sequence>
</xs:sequence>
<xs:attribute name="platform" use="required" type="Name.Type"/>
<xs:attributeGroup ref="extensions.PlatformPropertySet.Attr"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Property.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The Property complexType is the container for each property.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" use="required" type="Name.Type"/>
<xs:attributeGroup ref="extension.Property.Attr"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Declaration of the elements ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<!-- ================================================================================================== -->
</xs:schema>

View File

@@ -0,0 +1,286 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imslticp_v1p0"
targetNamespace="http://www.imsglobal.org/xsd/imslticp_v1p0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="IMS LTICP 1.0.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
XSD Data File Information
-------------------------
Author: Chuck Severance (IMS GLC) and Colin Smythe (IMS GLC)
Date: 30th April, 2010
Version: 1.0
Status: Final Release
Description: This is the set of Common Profile objects used in LTI.
This XSD was created as part of the BasicLTI Final Release.
History: V1.0 - the first Final Release.
License: IPR, License and Distribution Notices
This machine readable file is derived from IMS Global Learning Consortium (GLC) specification IMS Common Cartridge Version 1.3 found at http://www.imsglobal.org/cc and the original IMS GLC schema binding or code base http://www.imsglobal.org/cc.
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.
IMS GLC 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 GLCs
procedures with respect to rights in IMS GLC specifications can be found at the IMS GLC Intellectual Property
Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright (c) IMS Global Learning Consortium 1999-2013. All Rights Reserved.
License Notice for Users
Users of products or services that include this document are hereby granted a worldwide, royalty-free,
non-exclusive license to use this document.
Distribution Notice for Developers
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.
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 GLC community on the IMS GLC website as described in the following two
paragraphs:-
* 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;
* 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 GLC and receive an email from IMS GLC granting the license. To register, follow
the instructions on the IMS GLC 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.
The limited permissions granted above are perpetual and will not be revoked by IMS GLC or its
successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS
EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND NEITHER THE CONSORTIUM
NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF
ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Source UML File Information
---------------------------
The source file information must be supplied as an XMI file (without diagram layout information).
The supported UML authoring tools are:
(a) Poseidon v6 (and later)
Source XSLT File Information
----------------------------
XSL Generator: UMLtoXSDTransformv0p9.xsl
XSLT Processor: Xalan
Release: 1.0 Beta 3
Date: 31st May, 2009
IMS GLC Auto-generation Binding Tool-kit (I-BAT)
------------------------------------------------
This file was auto-generated using the IMS GLC Binding Auto-generation Tool-kit (I-BAT). While every
attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
that this is an experimental tool. Permission is given to make use of this tool. IMS GLC makes no
claim on the materials created by third party users of this tool. Details on how to use this tool
are contained in the IMS GLC "I-BAT" Documentation available at the IMS GLC web-site.
Tool Copyright: 2005-2010 (c) IMS Global Learning Consortium Inc. All Rights Reserved.
</xs:documentation>
</xs:annotation>
<!-- Generate Global Attributes *********************************************************************** -->
<xs:attributeGroup name="extension.Icon.Attr">
<xs:anyAttribute namespace = "##other" processContents = "strict"/>
</xs:attributeGroup>
<xs:attributeGroup name="extension.LocalizedString.Attr">
<xs:anyAttribute namespace = "##other" processContents = "strict"/>
</xs:attributeGroup>
<!-- ================================================================================================== -->
<!-- Generate Namespaced extension Group ************************************************************* -->
<xs:group name="grpStrict.any">
<xs:annotation>
<xs:documentation>
Any namespaced element from any namespace may be included within an "any" element.
The namespace for the imported element must be defined in the instance, and the schema must be imported.
The extension has a definition of "strict" i.e. they must have their own namespace.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace = "##other" processContents = "strict" minOccurs = "0" maxOccurs = "unbounded"/>
</xs:sequence>
</xs:group>
<!-- ================================================================================================== -->
<!-- Generate Special DataTypes ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the enumerated simpleType declarations ************************************************** -->
<!-- ================================================================================================== -->
<!-- Generate the simpleType elements based IMS data-types ******************************************* -->
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon simpleType ************************************ -->
<xs:simpleType name="Name.Type">
<xs:restriction base="xs:Name"/>
</xs:simpleType>
<!-- ================================================================================================== -->
<!-- Generate the derived data-type elements based upon derived simpleType **************************** -->
<!-- ================================================================================================== -->
<!-- Generate the data-type ComplexTypes ************************************************************** -->
<xs:complexType name="Vendor.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The Vendor complexType is the container for the information about the vendor of the tool to be launched/used using BasicLTI.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="code" type="Name.Type" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="name" type="LocalizedString.Type" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="description" type="LocalizedString.Type" minOccurs = "0" maxOccurs = "1"/>
<xs:element name="url" minOccurs = "0" maxOccurs = "1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value = "4096"/>
<xs:minLength value = "1"/>
<xs:whiteSpace value = "preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="contact" type="Contact.Type" minOccurs = "0" maxOccurs = "1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Contact.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The Contact class is the container for the vendor contact information.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="email" minOccurs = "1" maxOccurs = "1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value = "4096"/>
<xs:minLength value = "1"/>
<xs:whiteSpace value = "preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:group ref="grpStrict.any"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProductInfo.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The productInfo complexType is the container for the information about the tool itself.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="code" type="Name.Type" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="name" type="LocalizedString.Type" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="version" type="xs:normalizedString" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="description" type="LocalizedString.Type" minOccurs = "0" maxOccurs = "1"/>
<xs:element name="technical_description" type="LocalizedString.Type" minOccurs = "0" maxOccurs = "1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ToolLocator.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The ToolLocator complexType is the container for information about the electronic location of the tool.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="vendor" type="Vendor.Type" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="tool_info" type="ProductInfo.Type" minOccurs = "1" maxOccurs = "1"/>
<xs:element name="deployment_url" minOccurs = "1" maxOccurs = "1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value = "4096"/>
<xs:minLength value = "1"/>
<xs:whiteSpace value = "preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LocalizedString.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The Localized complexType is the container for localized string entries.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="key" use="optional" type="Name.Type"/>
<xs:attributeGroup ref="extension.LocalizedString.Attr"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Icon.Type">
<xs:annotation>
<xs:documentation source="umldocumentation">
The Icon complexType is the container for information about an icon to be used with the tool.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="key" use="optional" type="Name.Type"/>
<xs:attribute name="platform" use="optional" type="Name.Type"/>
<xs:attribute name="style" use="optional" type="Name.Type"/>
<xs:attributeGroup ref="extension.Icon.Attr"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- ================================================================================================== -->
<!-- Declaration of the elements ********************************************************************** -->
<!-- ================================================================================================== -->
<!-- Declaration of the root element(s) *************************************************************** -->
<!-- ================================================================================================== -->
</xs:schema>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Turbo XML 2.3.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
<xs:schema targetNamespace="http://www.imsglobal.org/xsd/imsvdex_v1p0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.imsglobal.org/xsd/imsvdex_v1p0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:element name="vdex" type="vdexType" block="#all"/>
<xs:element name="metadata" type="metadataType" block="#all"/>
<xs:element name="langstring" type="langstringType" block="#all"/>
<xs:element name="caption" type="langstringBag" block="#all"/>
<xs:element name="description" type="descriptionType" block="#all"/>
<xs:element name="term" type="termType" block="#all"/>
<xs:element name="relationship" type="relationshipType" block="#all"/>
<xs:element name="mediaDescriptor" type="mediaDescriptorType" block="#all"/>
<xs:element name="mediaLocator" type="mediaLocatorType" block="#all"/>
<xs:element name="targetTerm" type="termRefType" block="#all"/>
<xs:element name="sourceTerm" type="termRefType" block="#all"/>
<xs:complexType name="identifierType">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="mediaLocatorType">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="mediaDescriptorType">
<xs:sequence>
<xs:element ref="mediaLocator"/>
<xs:element name="interpretationNote" type="descriptionType" block="#all" minOccurs="0"/>
<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="relationshipType">
<xs:sequence>
<xs:element name="relationshipIdentifier" type="identifierType" block="#all" minOccurs="0"/>
<xs:element ref="sourceTerm"/>
<xs:element ref="targetTerm"/>
<xs:element name="relationshipType" type="vocabType" block="#all" minOccurs="0"/>
<xs:element ref="metadata" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="termType">
<xs:sequence>
<xs:element name="termIdentifier" type="identifierType" block="#all"/>
<xs:element ref="caption" minOccurs="0"/>
<xs:element ref="description" minOccurs="0"/>
<xs:element ref="mediaDescriptor" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="metadata" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="term" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="orderSignificant" type="xs:boolean" default="false"/>
<xs:attribute name="validIndex" type="xs:boolean" default="true"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="metadataType">
<xs:sequence>
<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="vdexType">
<xs:sequence>
<xs:element name="vocabName" type="langstringBag" block="#all" minOccurs="0"/>
<xs:element name="vocabIdentifier" type="vocabIdentifierType" block="#all" minOccurs="0"/>
<xs:element ref="term" maxOccurs="unbounded"/>
<xs:element ref="relationship" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="metadata" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="orderSignificant" type="xs:boolean" default="false"/>
<xs:attribute name="profileType" type="vdexProfilesType" default="lax"/>
<xs:attribute name="language" type="xs:language"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="langstringType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="language" type="xs:language"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="langstringBag">
<xs:sequence>
<xs:element ref="langstring" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="vocabType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="source" type="xs:anyURI" use="required"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="descriptionType">
<xs:complexContent>
<xs:extension base="langstringBag"/>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="vocabIdentifierType">
<xs:simpleContent>
<xs:extension base="identifierType">
<xs:attribute name="isRegistered" type="xs:boolean" default="false"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="termRefType">
<xs:simpleContent>
<xs:extension base="identifierType">
<xs:attribute name="vocabularyIdentifier" type="xs:anyURI"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="vdexProfilesType">
<xs:restriction base="xs:string">
<xs:enumeration value="lax"/>
<xs:enumeration value="hierarchicalTokenTerms"/>
<xs:enumeration value="flatTokenTerms"/>
<xs:enumeration value="glossaryOrDictionary"/>
<xs:enumeration value="thesaurus"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

View File

@@ -0,0 +1,318 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- ********************************************************************************************** -->
<!-- -->
<!-- Author: Colin Smythe, IMS Global (UK) -->
<!-- Date: 2013-03-31 -->
<!-- Version: Final 1.3 -->
<!-- Status: Final Release -->
<!-- -->
<!-- Description: The vocabulary for the permitted resource types in the CCv1.3. -->
<!-- -->
<!-- History: Version 1.1: The first release in which the vocabularies were defined as an e- -->
<!-- xternal VDEX instance. A new resource type to identify Basic LTI v1.0 resourc- -->
<!-- es has been added in this version. Version 1.2: Just date and version numberi- -->
<!-- ng changes. Version 1.3: Addition of the new resource types APIPv1.0, IWBv1.0 -->
<!-- and EPUBv3.0. Support for extension resource types. -->
<!-- -->
<!-- Licenses: IPR, License and Distribution Notices -->
<!-- -->
<!-- This machine readable vocabulary is derived from the IMS Global specification -->
<!-- IMS Global Common Cartridge (Content Packaging) Version 1.3 found at http://w- -->
<!-- ww.imsglobal.org/cc and the original IMS Global schema binding or code base h- -->
<!-- ttp://www.imsglobal.org/cc. -->
<!-- -->
<!-- Recipients of this document are requested to submit, with their comments, not- -->
<!-- ification of any relevant patent claims or other intellectual property rights -->
<!-- of which they may be aware that might be infringed by the schema binding cont- -->
<!-- ained in this document. -->
<!-- -->
<!-- IMS Global takes no position regarding the validity or scope of any intellect- -->
<!-- ual property or other rights that might be claimed to pertain to the implemen- -->
<!-- tation or use of the technology described in this document or the extent to w- -->
<!-- hich any license under such rights might or might not be available; neither d- -->
<!-- oes it represent that it has made any effort to identify any such rights. Inf- -->
<!-- ormation on IMS Global procedures with respect to rights in IMS Global specif- -->
<!-- ications can be found at the IMS Global Intellectual Property Rights web page: -->
<!-- http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf. -->
<!-- -->
<!-- Copyright © IMS Global Learning Consortium 1999-2013. All Rights Reserved. -->
<!-- -->
<!-- License Notice for Users -->
<!-- -->
<!-- Users of products or services that include this document are hereby granted a -->
<!-- worldwide, royalty-free, non-exclusive license to use this document. -->
<!-- -->
<!-- Distribution Notice for Developers -->
<!-- -->
<!-- Developers of products or services that are not original incorporators of this -->
<!-- document and have not changed this document, that is, are distributing a soft- -->
<!-- ware product that incorporates this document as is from a third-party source -->
<!-- other than IMS Global, are hereby granted permission to copy, display and dis- -->
<!-- tribute the contents of this document in any medium for any purpose without f- -->
<!-- ee or royalty provided that you include this IPR, License and Distribution no- -->
<!-- tice in its entirety on ALL copies, or portions thereof. -->
<!-- -->
<!-- Developers of products or services that are original incorporators of this do- -->
<!-- cument and wish to provide distribution of this document as is or with modifi- -->
<!-- cations and developers of products and services that are not original incorpo- -->
<!-- rators of this document and have changed this document, are required to regis- -->
<!-- ter with the IMS Global community on the IMS Global website as described in t- -->
<!-- he following two paragraphs: -->
<!-- -->
<!-- * 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 t- -->
<!-- hat 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 licen- -->
<!-- se registration with IMS Global and receive an email from a valid license reg- -->
<!-- istration with IMS and receive an email from IMS Global granting the license. -->
<!-- To register, follow the instructions on the IMS Global website: http://www.im- -->
<!-- sglobal.org/specificationdownload.cfm. Once registered you are granted permis- -->
<!-- sion to transfer unlimited distribution rights of this document for the purpo- -->
<!-- ses of third-party or other distribution of your product or service that inco- -->
<!-- rporates this document as long as this IPR, License and Distribution notice r- -->
<!-- emains in place in its entirety; -->
<!-- -->
<!-- * 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 profi- -->
<!-- le registration with IMS and receive an email from IMS Global granting the li- -->
<!-- cense. To register, follow the instructions on the IMS Global website: http:/- -->
<!-- /www.imsglobal.org/profile/. Once registered you are granted permission to tr- -->
<!-- ansfer 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. -->
<!-- -->
<!-- The limited permissions granted above are perpetual and will not be revoked by -->
<!-- IMS Global or its successors or assigns. -->
<!-- -->
<!-- THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN P- -->
<!-- ARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF -->
<!-- THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND N- -->
<!-- EITHER THE CONSORTIUM, NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY L- -->
<!-- IABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY -->
<!-- NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECI- -->
<!-- FICATION. -->
<!-- -->
<!-- Source XSLT File Information -->
<!-- ============================ -->
<!-- XSL Generator: Specificationv1p0_GenerationToolv1.xsl -->
<!-- XSLT Processor: Saxon-HE-9.4.0.4 -->
<!-- Release: 1.0 -->
<!-- Date: 31st March, 2013 -->
<!-- Autogen Eng: Colin Smythe (IMS Global, UK) -->
<!-- Autogen Date: 2013-04-26 -->
<!-- -->
<!-- Webster Auto-generation Toolkit -->
<!-- =============================== -->
<!-- This VDEX was auto-generated using the IMS Global Binding Auto-generation Toolkit (I-BAT). Wh- -->
<!-- ile every attempt has been made to ensure that this tool auto-generates the VDEXs correctly, -->
<!-- users should be aware that this is an experimental tool. Permission is given to make use of t- -->
<!-- his tool. IMS Global makes no claim on the materials created by third party users of this too- -->
<!-- l. Details on how to use this auto-generation toolkit are available at the IMS Global web-sit- -->
<!-- e: www.imsglobal.org.' -->
<!-- -->
<!-- Tool Copyright: 2005-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved. -->
<!-- -->
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>IMS Global CPv1.2 CCv1.3 Profile ResourceType Vocabulary</title>
<meta name="language" content="en-US" />
<meta name="author" content="Colin Smythe, IMS Global (UK)" />
<meta name="date" content="2013-03-31" />
<meta name="status" content="Final Release" />
<meta name="version" content="Final 1.3" />
<meta name="publisher" content="IMS Global Learning Consortium Inc." />
<meta name="keywords" content="Common Cartridge, Resource Types" />
<meta name="description" content="The vocabulary for the permitted resource types in the CCv1.3." />
<meta name="history" content="Version 1.1: The first release in which the vocabularies were defined as an external VDEX instance.
A new resource type to identify Basic LTI v1.0 resources has been added in this version.
Version 1.2: Just date and version numbering changes.
Version 1.3: Addition of the new resource types APIPv1.0, IWBv1.0 and EPUBv3.0. Support for
extension resource types." />
<meta name="copyright" content="2013 (c) IMS Global Learning Consortium Inc." />
<link rel="icon" href="http://www.imsglobal.org/favicon.ico" type="image/x-icon" />
</head>
<body>
<a href="http://www.imsglobal.org"><img src="http://www.imsglobal.org/images/header1.png" alt="IMS Global Logo" border="0" /></a>
<h1>IMS Global CPv1.2 CCv1.3 Profile ResourceType Vocabulary</h1>
<h2>Vocabulary Details</h2>
<p>This document provides a human readable description of the vocabulary terms defined in the IMS Global Vocabulary Definition and Exchange (VDEX) file "ccresourcetypevocabularyv1p3.xml". The details of the vocabulary are:</p>
<table>
<tbody>
<tr>
<td width="20%" bgcolor="#99ffff">Vocabulary Identifier:</td>
<td>http://www.imsglobal.org/xsd/cc/ccv1p3/ccresourcetypevocabularyv1p3</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Vocabulary Type:</td>
<td>flatTokenTerms</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Registered Status:</td>
<td>true</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Vocabulary Language:</td>
<td>en-US</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Author:</td>
<td>Colin Smythe, IMS Global (UK)</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Issue Date:</td>
<td>2013-03-31</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Version:</td>
<td>Final 1.3</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Status:</td>
<td>Final Release</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Base Specification:</td>
<td>Common Cartridge (Content Packaging) Version 1.3</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Keywords:</td>
<td>Common Cartridge, Resource Types</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Publisher:</td>
<td>IMS Global Learning Consortium Inc.</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Copyright:</td>
<td>2013 (c) IMS Global Learning Consortium Inc.</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">Description:</td>
<td>The vocabulary for the permitted resource types in the CCv1.3.</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">History:</td>
<td>Version 1.1: The first release in which the vocabularies were defined as an external VDEX instance.
A new resource type to identify Basic LTI v1.0 resources has been added in this version.
Version 1.2: Just date and version numbering changes.
Version 1.3: Addition of the new resource types APIPv1.0, IWBv1.0 and EPUBv3.0. Support for
extension resource types.</td>
</tr>
<tr>
<td width="20%" bgcolor="#99ffff">License:</td>
<td>Users of products or services that include this document are hereby granted a worldwide, royalty-free, non-exclusive license to use this document.</td>
</tr>
</tbody>
</table>
<h2>Vocabulary Terms</h2>
<p>The set of terms for the vocabulary are described in the table below.</p>
<table width="100%" title="IMS Global CPv1.2 CCv1.3 Profile ResourceType Vocabulary" summary="The set of vocabulary terms.">
<thead>
<tr>
<th width="25%" bgcolor="#ffd700">Identifier</th>
<th width="25%" bgcolor="#ffd700">Caption</th>
<th width="10%" bgcolor="#ffd700">Status</th>
<th width="40%" bgcolor="#ffd700">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td bgcolor="#dcdcdc">assignment_xmlv1p0</td>
<td bgcolor="#dcdcdc">Assignment</td>
<td bgcolor="#dcdcdc">Provisional</td>
<td bgcolor="#dcdcdc">This is used when a resource is an Assignment.
The schema and schema version elements in the resource
metadata will provide further validation information.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">associatedcontent/imscc_xmlv1p3/learning-application-resource</td>
<td bgcolor="#dcdcdc">Associated Content Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of Associated Content. Typically used
assets such as images, video, voice files, etc.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">idpfepub_epubv3p0</td>
<td bgcolor="#dcdcdc">IDPF EPUB v3.0 Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of EPUBv3.0 This allows an
EPUB file to be a resource in the cartridge.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imsapip_zipv1p0</td>
<td bgcolor="#dcdcdc">Accessible Portable Item Protocol (APIP) v1.0 Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of APIPv1.0 This allows an
APIP zip file to be a resource in the cartridge.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imsbasiclti_xmlv1p3</td>
<td bgcolor="#dcdcdc">Basic LTI v1.0 Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of Basic LTI. This allows LTI
links to be embedded in a cartridge.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imsdt_xmlv1p3</td>
<td bgcolor="#dcdcdc">Discussion Topic Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of Discussion Topic. This enables the
package to include discussion topics.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imsiwb_iwbv1p0</td>
<td bgcolor="#dcdcdc">Interactive White Board (IWB) v1.0 Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of IWBv1.0 This allows an IWBv1.0
zip file to be a resource in the cartridge.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imsqti_xmlv1p2/imscc_xmlv1p3/assessment</td>
<td bgcolor="#dcdcdc">QTI Assessment Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of QTI Assessment. This must be
used for tests and quizzes based upon QTIv1.2.1.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imsqti_xmlv1p2/imscc_xmlv1p3/question-bank</td>
<td bgcolor="#dcdcdc">QTI Question Bank Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of QTI Question Bank. This must be
used for Question Banks and these must be based upon QTIv1.2.1.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">imswl_xmlv1p3</td>
<td bgcolor="#dcdcdc">Web Links Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of Web Links. This enables the
package to include external web links.</td>
</tr>
<tr>
<td bgcolor="#dcdcdc">webcontent</td>
<td bgcolor="#dcdcdc">Web Content Resource</td>
<td bgcolor="#dcdcdc">Core</td>
<td bgcolor="#dcdcdc">This is the resource type of Web Content. Typically used
for HTML and PDF files.</td>
</tr>
</tbody>
</table>
<p>In the above Table, the possible values and interpretation for the status field are:</p>
<ul type="disc">
<li>"Final" - an IMS Global term that has been approved by the corresponding IMS APMG;</li>
<li>"Draft" - an IMS Global term that has not yet been approved by the corresponding IMS APMG;</li>
<li>"Core" - an IMS Global term that has been approved by the corresponding IMS APMG (used to differentiate from vocabs containing extension terms);</li>
<li>"Provisional" - an extension term that has not yet been approved by the corresponding IMS APMG but which is available on a provisional basis;</li>
<li>"Approved" - an extension term that has been approved by the corresponding IMS APMG.</li>
</ul>
<p />
<hr />
</body>
</html>

View File

@@ -0,0 +1,629 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<!-- ********************************************************************************************** -->
<!-- -->
<!-- Author: Colin Smythe, IMS Global (UK) -->
<!-- Date: 2013-03-31 -->
<!-- Version: Final 1.3 -->
<!-- Status: Final Release -->
<!-- -->
<!-- Description: The vocabulary for the permitted resource types in the CCv1.3. -->
<!-- -->
<!-- History: Version 1.1: The first release in which the vocabularies were defined as an e- -->
<!-- xternal VDEX instance. A new resource type to identify Basic LTI v1.0 resourc- -->
<!-- es has been added in this version. Version 1.2: Just date and version numberi- -->
<!-- ng changes. Version 1.3: Addition of the new resource types APIPv1.0, IWBv1.0 -->
<!-- and EPUBv3.0. Support for extension resource types. -->
<!-- -->
<!-- Licenses: IPR, License and Distribution Notices -->
<!-- -->
<!-- This machine readable vocabulary is derived from the IMS Global specification -->
<!-- IMS Global Common Cartridge (Content Packaging) Version 1.3 found at http://w- -->
<!-- ww.imsglobal.org/cc and the original IMS Global schema binding or code base h- -->
<!-- ttp://www.imsglobal.org/cc. -->
<!-- -->
<!-- Recipients of this document are requested to submit, with their comments, not- -->
<!-- ification of any relevant patent claims or other intellectual property rights -->
<!-- of which they may be aware that might be infringed by the schema binding cont- -->
<!-- ained in this document. -->
<!-- -->
<!-- IMS Global takes no position regarding the validity or scope of any intellect- -->
<!-- ual property or other rights that might be claimed to pertain to the implemen- -->
<!-- tation or use of the technology described in this document or the extent to w- -->
<!-- hich any license under such rights might or might not be available; neither d- -->
<!-- oes it represent that it has made any effort to identify any such rights. Inf- -->
<!-- ormation on IMS Global procedures with respect to rights in IMS Global specif- -->
<!-- ications can be found at the IMS Global Intellectual Property Rights web page: -->
<!-- http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf. -->
<!-- -->
<!-- Copyright © IMS Global Learning Consortium 1999-2013. All Rights Reserved. -->
<!-- -->
<!-- License Notice for Users -->
<!-- -->
<!-- Users of products or services that include this document are hereby granted a -->
<!-- worldwide, royalty-free, non-exclusive license to use this document. -->
<!-- -->
<!-- Distribution Notice for Developers -->
<!-- -->
<!-- Developers of products or services that are not original incorporators of this -->
<!-- document and have not changed this document, that is, are distributing a soft- -->
<!-- ware product that incorporates this document as is from a third-party source -->
<!-- other than IMS Global, are hereby granted permission to copy, display and dis- -->
<!-- tribute the contents of this document in any medium for any purpose without f- -->
<!-- ee or royalty provided that you include this IPR, License and Distribution no- -->
<!-- tice in its entirety on ALL copies, or portions thereof. -->
<!-- -->
<!-- Developers of products or services that are original incorporators of this do- -->
<!-- cument and wish to provide distribution of this document as is or with modifi- -->
<!-- cations and developers of products and services that are not original incorpo- -->
<!-- rators of this document and have changed this document, are required to regis- -->
<!-- ter with the IMS Global community on the IMS Global website as described in t- -->
<!-- he following two paragraphs: -->
<!-- -->
<!-- * 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 t- -->
<!-- hat 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 licen- -->
<!-- se registration with IMS Global and receive an email from a valid license reg- -->
<!-- istration with IMS and receive an email from IMS Global granting the license. -->
<!-- To register, follow the instructions on the IMS Global website: http://www.im- -->
<!-- sglobal.org/specificationdownload.cfm. Once registered you are granted permis- -->
<!-- sion to transfer unlimited distribution rights of this document for the purpo- -->
<!-- ses of third-party or other distribution of your product or service that inco- -->
<!-- rporates this document as long as this IPR, License and Distribution notice r- -->
<!-- emains in place in its entirety; -->
<!-- -->
<!-- * 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 profi- -->
<!-- le registration with IMS and receive an email from IMS Global granting the li- -->
<!-- cense. To register, follow the instructions on the IMS Global website: http:/- -->
<!-- /www.imsglobal.org/profile/. Once registered you are granted permission to tr- -->
<!-- ansfer 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. -->
<!-- -->
<!-- The limited permissions granted above are perpetual and will not be revoked by -->
<!-- IMS Global or its successors or assigns. -->
<!-- -->
<!-- THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN P- -->
<!-- ARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF -->
<!-- THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTERS OWN RISK, AND N- -->
<!-- EITHER THE CONSORTIUM, NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY L- -->
<!-- IABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY -->
<!-- NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECI- -->
<!-- FICATION. -->
<!-- -->
<!-- Source XSLT File Information -->
<!-- ============================ -->
<!-- XSL Generator: Specificationv1p0_GenerationToolv1.xsl -->
<!-- XSLT Processor: Saxon-HE-9.4.0.4 -->
<!-- Release: 1.0 -->
<!-- Date: 31st March, 2013 -->
<!-- Autogen Eng: Colin Smythe (IMS Global, UK) -->
<!-- Autogen Date: 2013-04-26 -->
<!-- -->
<!-- Webster Auto-generation Toolkit -->
<!-- =============================== -->
<!-- This VDEX was auto-generated using the IMS Global Binding Auto-generation Toolkit (I-BAT). Wh- -->
<!-- ile every attempt has been made to ensure that this tool auto-generates the VDEXs correctly, -->
<!-- users should be aware that this is an experimental tool. Permission is given to make use of t- -->
<!-- his tool. IMS Global makes no claim on the materials created by third party users of this too- -->
<!-- l. Details on how to use this auto-generation toolkit are available at the IMS Global web-sit- -->
<!-- e: www.imsglobal.org.' -->
<!-- -->
<!-- Tool Copyright: 2005-2013 (c) IMS Global Learning Consortium Inc. All Rights Reserved. -->
<!-- -->
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<vdex profileType="flatTokenTerms"
xmlns="http://www.imsglobal.org/xsd/imsvdex_v1p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsvdex_v1p0 http://www.imsglobal.org/xsd/imsvdex_v1p0.xsd http://ltsc.ieee.org/xsd/LOM http://www.imsglobal.org/xsd/imsmd_loose_v1p3p2.xsd"
orderSignificant="false"
language="en-US">
<vocabName>
<langstring language="en-US">IMS Global CPv1.2 CCv1.3 Profile ResourceType Vocabulary</langstring>
</vocabName>
<vocabIdentifier isRegistered="true">http://www.imsglobal.org/xsd/cc/ccv1p3/ccresourcetypevocabularyv1p3</vocabIdentifier>
<term>
<termIdentifier>assignment_xmlv1p0</termIdentifier>
<caption>
<langstring language="en-US">Assignment</langstring>
</caption>
<description>
<langstring language="en-US">This is used when a resource is an Assignment.
The schema and schema version elements in the resource
metadata will provide further validation information.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, Assignment</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CC v1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Provisional</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>associatedcontent/imscc_xmlv1p3/learning-application-resource</termIdentifier>
<caption>
<langstring language="en-US">Associated Content Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of Associated Content. Typically used
assets such as images, video, voice files, etc.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, Associated Content</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CCv1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>idpfepub_epubv3p0</termIdentifier>
<caption>
<langstring language="en-US">IDPF EPUB v3.0 Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of EPUBv3.0 This allows an
EPUB file to be a resource in the cartridge.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, EPUB</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IDPF EPUB v3.0</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imsapip_zipv1p0</termIdentifier>
<caption>
<langstring language="en-US">Accessible Portable Item Protocol (APIP) v1.0 Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of APIPv1.0 This allows an
APIP zip file to be a resource in the cartridge.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, APIP</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global APIP v1.0</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imsbasiclti_xmlv1p3</termIdentifier>
<caption>
<langstring language="en-US">Basic LTI v1.0 Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of Basic LTI. This allows LTI
links to be embedded in a cartridge.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, Basic LTI</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global LTI v1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imsdt_xmlv1p3</termIdentifier>
<caption>
<langstring language="en-US">Discussion Topic Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of Discussion Topic. This enables the
package to include discussion topics.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, Discussion Topic</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CCv1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imsiwb_iwbv1p0</termIdentifier>
<caption>
<langstring language="en-US">Interactive White Board (IWB) v1.0 Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of IWBv1.0 This allows an IWBv1.0
zip file to be a resource in the cartridge.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, IWB</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global IWB v1.0</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imsqti_xmlv1p2/imscc_xmlv1p3/assessment</termIdentifier>
<caption>
<langstring language="en-US">QTI Assessment Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of QTI Assessment. This must be
used for tests and quizzes based upon QTIv1.2.1.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, QTI Assessment</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CCv1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imsqti_xmlv1p2/imscc_xmlv1p3/question-bank</termIdentifier>
<caption>
<langstring language="en-US">QTI Question Bank Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of QTI Question Bank. This must be
used for Question Banks and these must be based upon QTIv1.2.1.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, QTI Question Bank</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CCv1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>imswl_xmlv1p3</termIdentifier>
<caption>
<langstring language="en-US">Web Links Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of Web Links. This enables the
package to include external web links.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, Web Links</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CCv1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<term>
<termIdentifier>webcontent</termIdentifier>
<caption>
<langstring language="en-US">Web Content Resource</langstring>
</caption>
<description>
<langstring language="en-US">This is the resource type of Web Content. Typically used
for HTML and PDF files.</langstring>
</description>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<keyword>
<string>Common Cartridge, Resource Type, Web Content</string>
</keyword>
</general>
<relation>
<resource>
<description>
<string>IMS Global CCv1.3</string>
</description>
</resource>
</relation>
<lifeCycle>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
<status>
<value>Core</value>
</status>
</lifeCycle>
</lom>
</metadata>
</term>
<metadata>
<lom xmlns="http://ltsc.ieee.org/xsd/LOM">
<general>
<title>
<string>IMS Global CPv1.2 CCv1.3 Profile ResourceType Vocabulary</string>
</title>
<keyword>
<string>Common Cartridge, Resource Types</string>
</keyword>
<language>en-US</language>
<description>
<string>Description: The vocabulary for the permitted resource types in the CCv1.3.</string>
<string>History: Version 1.1: The first release in which the vocabularies were defined as an external VDEX instance.
A new resource type to identify Basic LTI v1.0 resources has been added in this version.
Version 1.2: Just date and version numbering changes.
Version 1.3: Addition of the new resource types APIPv1.0, IWBv1.0 and EPUBv3.0. Support for
extension resource types.</string>
</description>
</general>
<lifeCycle>
<contribute>
<role>
<value>author</value>
</role>
<entity>Colin Smythe, IMS Global (UK)</entity>
</contribute>
<version>
<string>Final 1.3</string>
</version>
<status>
<value>Final Release</value>
</status>
<contribute>
<role>
<value>publisher</value>
</role>
<entity>IMS Global Learning Consortium Inc.</entity>
<date>
<dateTime>2013-03-31</dateTime>
</date>
</contribute>
</lifeCycle>
<rights>
<copyrightAndOtherRestrictions>
<value>yes</value>
</copyrightAndOtherRestrictions>
<description>
<string>2013 (c) IMS Global Learning Consortium Inc.</string>
</description>
</rights>
<technical>
<format>XML</format>
</technical>
</lom>
</metadata>
</vdex>

View File

@@ -0,0 +1,286 @@
<?xml version='1.0'?>
<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns ="http://www.w3.org/1999/xhtml"
xml:lang="en">
<xs:annotation>
<xs:documentation>
<div>
<h1>About the XML namespace</h1>
<div class="bodytext">
<p>
This schema document describes the XML namespace, in a form
suitable for import by other schema documents.
</p>
<p>
See <a href="http://www.w3.org/XML/1998/namespace.html">
http://www.w3.org/XML/1998/namespace.html</a> and
<a href="http://www.w3.org/TR/REC-xml">
http://www.w3.org/TR/REC-xml</a> for information
about this namespace.
</p>
<p>
Note that local names in this namespace are intended to be
defined only by the World Wide Web Consortium or its subgroups.
The names currently defined in this namespace are listed below.
They should not be used with conflicting semantics by any Working
Group, specification, or document instance.
</p>
<p>
See further below in this document for more information about <a
href="#usage">how to refer to this schema document from your own
XSD schema documents</a> and about <a href="#nsversioning">the
namespace-versioning policy governing this schema document</a>.
</p>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:attribute name="lang">
<xs:annotation>
<xs:documentation>
<div>
<h3>lang (as an attribute name)</h3>
<p>
denotes an attribute whose value
is a language code for the natural language of the content of
any element; its value is inherited. This name is reserved
by virtue of its definition in the XML specification.</p>
</div>
<div>
<h4>Notes</h4>
<p>
Attempting to install the relevant ISO 2- and 3-letter
codes as the enumerated possible values is probably never
going to be a realistic possibility.
</p>
<p>
See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
and the IANA language subtag registry at
<a href="http://www.iana.org/assignments/language-subtag-registry">
http://www.iana.org/assignments/language-subtag-registry</a>
for further information.
</p>
<p>
The union allows for the 'un-declaration' of xml:lang with
the empty string.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:union memberTypes="xs:token">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="space">
<xs:annotation>
<xs:documentation>
<div>
<h3>space (as an attribute name)</h3>
<p>
denotes an attribute whose
value is a keyword indicating what whitespace processing
discipline is intended for the content of the element; its
value is inherited. This name is reserved by virtue of its
definition in the XML specification.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:enumeration value="default"/>
<xs:enumeration value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
<xs:documentation>
<div>
<h3>base (as an attribute name)</h3>
<p>
denotes an attribute whose value
provides a URI to be used as the base for interpreting any
relative URIs in the scope of the element on which it
appears; its value is inherited. This name is reserved
by virtue of its definition in the XML Base specification.</p>
<p>
See <a
href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
for information about this attribute.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:ID">
<xs:annotation>
<xs:documentation>
<div>
<h3>id (as an attribute name)</h3>
<p>
denotes an attribute whose value
should be interpreted as if declared to be of type ID.
This name is reserved by virtue of its definition in the
xml:id specification.</p>
<p>
See <a
href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
for information about this attribute.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup name="specialAttrs">
<xs:attribute ref="xml:base"/>
<xs:attribute ref="xml:lang"/>
<xs:attribute ref="xml:space"/>
<xs:attribute ref="xml:id"/>
</xs:attributeGroup>
<xs:annotation>
<xs:documentation>
<div>
<h3>Father (in any context at all)</h3>
<div class="bodytext">
<p>
denotes Jon Bosak, the chair of
the original XML Working Group. This name is reserved by
the following decision of the W3C XML Plenary and
XML Coordination groups:
</p>
<blockquote>
<p>
In appreciation for his vision, leadership and
dedication the W3C XML Plenary on this 10th day of
February, 2000, reserves for Jon Bosak in perpetuity
the XML name "xml:Father".
</p>
</blockquote>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
<div xml:id="usage" id="usage">
<h2><a name="usage">About this schema document</a></h2>
<div class="bodytext">
<p>
This schema defines attributes and an attribute group suitable
for use by schemas wishing to allow <code>xml:base</code>,
<code>xml:lang</code>, <code>xml:space</code> or
<code>xml:id</code> attributes on elements they define.
</p>
<p>
To enable this, such a schema must import this schema for
the XML namespace, e.g. as follows:
</p>
<pre>
&lt;schema . . .>
. . .
&lt;import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
</pre>
<p>
or
</p>
<pre>
&lt;import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
</pre>
<p>
Subsequently, qualified reference to any of the attributes or the
group defined below will have the desired effect, e.g.
</p>
<pre>
&lt;type . . .>
. . .
&lt;attributeGroup ref="xml:specialAttrs"/>
</pre>
<p>
will define a type which will schema-validate an instance element
with any of those attributes.
</p>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
<div id="nsversioning" xml:id="nsversioning">
<h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
<div class="bodytext">
<p>
In keeping with the XML Schema WG's standard versioning
policy, this schema document will persist at
<a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd</a>.
</p>
<p>
At the date of issue it can also be found at
<a href="http://www.w3.org/2001/xml.xsd">
http://www.w3.org/2001/xml.xsd</a>.
</p>
<p>
The schema document at that URI may however change in the future,
in order to remain compatible with the latest version of XML
Schema itself, or with the XML namespace itself. In other words,
if the XML Schema or XML namespaces change, the version of this
document at <a href="http://www.w3.org/2001/xml.xsd">
http://www.w3.org/2001/xml.xsd
</a>
will change accordingly; the version at
<a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd
</a>
will not change.
</p>
<p>
Previous dated (and unchanging) versions of this schema
document are at:
</p>
<ul>
<li><a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd</a></li>
<li><a href="http://www.w3.org/2007/08/xml.xsd">
http://www.w3.org/2007/08/xml.xsd</a></li>
<li><a href="http://www.w3.org/2004/10/xml.xsd">
http://www.w3.org/2004/10/xml.xsd</a></li>
<li><a href="http://www.w3.org/2001/03/xml.xsd">
http://www.w3.org/2001/03/xml.xsd</a></li>
</ul>
</div>
</div>
</xs:documentation>
</xs:annotation>
</xs:schema>

View File

@@ -0,0 +1,379 @@
<?php
/* For licensing terms, see /license.txt */
class CcBase
{
public const CC_TYPE_FORUM = 'imsdt_xmlv1p3';
public const CC_TYPE_QUIZ = 'imsqti_xmlv1p3/imscc_xmlv1p3/assessment';
public const CC_TYPE_QUESTION_BANK = 'imsqti_xmlv1p3/imscc_xmlv1p3/question-bank';
public const CC_TYPE_WEBLINK = 'imswl_xmlv1p3';
public const CC_TYPE_WEBCONTENT = 'webcontent';
public const CC_TYPE_ASSOCIATED_CONTENT = 'associatedcontent/imscc_xmlv1p3/learning-application-resource';
public const CC_TYPE_EMPTY = '';
public static $restypes = ['associatedcontent/imscc_xmlv1p0/learning-application-resource', 'webcontent'];
public static $forumns = ['dt' => 'http://www.imsglobal.org/xsd/imsdt_v1p0'];
public static $quizns = ['xmlns' => 'http://www.imsglobal.org/xsd/ims_qtiasiv1p2'];
public static $resourcens = ['wl' => 'http://www.imsglobal.org/xsd/imswl_v1p0'];
public static $instances = [];
public static $manifest;
public static $pathToManifestFolder;
public static $namespaces = ['imscc' => 'http://www.imsglobal.org/xsd/imscc/imscp_v1p1',
'lomimscc' => 'http://ltsc.ieee.org/xsd/imscc/LOM',
'lom' => 'http://ltsc.ieee.org/xsd/LOM',
'voc' => 'http://ltsc.ieee.org/xsd/LOM/vocab',
'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'cc' => 'http://www.imsglobal.org/xsd/imsccauth_v1p0', ];
public function __construct($path_to_manifest)
{
static::$manifest = new DOMDocument();
static::$manifest->validateOnParse = false;
static::$pathToManifestFolder = dirname($path_to_manifest);
static::logAction('Proccess start');
static::logAction('Load the manifest file: '.$path_to_manifest);
if (!static::$manifest->load($path_to_manifest, LIBXML_NONET)) {
static::logAction('Cannot load the manifest file: '.$path_to_manifest, true);
}
}
/**
* @return array
*/
public static function getquizns()
{
return static::$quizns;
}
/**
* @return array
*/
public static function getforumns()
{
return static::$forumns;
}
/**
* @return array
*/
public static function getresourcens()
{
return static::$resourcens;
}
/**
* Find the imsmanifest.xml file inside the given folder and return its path.
*
* @param string $folder Full path name of the folder in which we expect to find imsmanifest.xml
*
* @return false|string
*/
public static function getManifest(string $folder)
{
if (!is_dir($folder)) {
return false;
}
// Before iterate over directories, try to find one manifest at top level
if (file_exists($folder.'/imsmanifest.xml')) {
return $folder.'/imsmanifest.xml';
}
$result = false;
try {
$dirIter = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::KEY_AS_PATHNAME);
$recIter = new RecursiveIteratorIterator($dirIter, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($recIter as $info) {
if ($info->isFile() && ($info->getFilename() == 'imsmanifest.xml')) {
$result = $info->getPathname();
break;
}
}
} catch (Exception $e) {
}
return $result;
}
public function isAuth()
{
$xpath = static::newxPath(static::$manifest, static::$namespaces);
$count_auth = $xpath->evaluate('count(/imscc:manifest/cc:authorizations)');
if ($count_auth > 0) {
$response = true;
} else {
$response = false;
}
return $response;
}
public function getNodesByCriteria($key, $value)
{
$response = [];
if (array_key_exists('index', static::$instances)) {
foreach (static::$instances['index'] as $item) {
if ($item[$key] == $value) {
$response[] = $item;
}
}
}
return $response;
}
public function countInstances($type)
{
$quantity = 0;
if (array_key_exists('index', static::$instances)) {
if (static::$instances['index'] && $type) {
foreach (static::$instances['index'] as $instance) {
if (!empty($instance['tool_type'])) {
$types[] = $instance['tool_type'];
}
}
$quantityInstances = array_count_values($types);
$quantity = array_key_exists($type, $quantityInstances) ? $quantityInstances[$type] : 0;
}
}
return $quantity;
}
public function getItemCcType($identifier)
{
$xpath = static::newxPath(static::$manifest, static::$namespaces);
$nodes = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@identifier="'.$identifier.'"]/@type');
if ($nodes && !empty($nodes->item(0)->nodeValue)) {
return $nodes->item(0)->nodeValue;
} else {
return '';
}
}
public function getItemHref($identifier)
{
$xpath = static::newxPath(static::$manifest, static::$namespaces);
$nodes = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@identifier="'.$identifier.'"]/imscc:file/@href');
if ($nodes && !empty($nodes->item(0)->nodeValue)) {
return $nodes->item(0)->nodeValue;
} else {
return '';
}
}
public static function newxPath(DOMDocument $manifest, $namespaces = '')
{
$xpath = new DOMXPath($manifest);
if (!empty($namespaces)) {
foreach ($namespaces as $prefix => $ns) {
if (!$xpath->registerNamespace($prefix, $ns)) {
static::logAction('Cannot register the namespace: '.$prefix.':'.$ns, true);
}
}
}
return $xpath;
}
public static function logFile()
{
return static::$pathToManifestFolder.DIRECTORY_SEPARATOR.'cc_import.log';
}
public static function logAction($text, $criticalError = false)
{
$full_message = strtoupper(date("j/n/Y g:i:s a"))." - ".$text."\r";
file_put_contents(static::logFile(), $full_message, FILE_APPEND);
if ($criticalError) {
static::criticalError($text);
}
}
public function convertToToolType($ccType)
{
$type = TYPE_UNKNOWN;
if ($ccType == static::CC_TYPE_FORUM) {
$type = TOOL_TYPE_FORUM;
}
if ($ccType == static::CC_TYPE_QUIZ) {
$type = TOOL_TYPE_QUIZ;
}
if ($ccType == static::CC_TYPE_WEBLINK) {
$type = TOOL_TYPE_WEBLINK;
}
if ($ccType == static::CC_TYPE_WEBCONTENT) {
$type = TOOL_TYPE_DOCUMENT;
}
return $type;
}
protected function getMetadata($section, $key)
{
$xpath = static::newxPath(static::$manifest, static::$namespaces);
$metadata = $xpath->query('/imscc:manifest/imscc:metadata/lomimscc:lom/lomimscc:'.$section.'/lomimscc:'.$key.'/lomimscc:string');
$value = !empty($metadata->item(0)->nodeValue) ? $metadata->item(0)->nodeValue : '';
return $value;
}
/**
* Is activity visible or not.
*
* @param string $identifier
*
* @return number
*/
protected function getModuleVisible($identifier)
{
//Should item be hidden or not
$mod_visible = 1;
if (!empty($identifier)) {
$xpath = static::newxPath(static::$manifest, static::$namespaces);
$query = '/imscc:manifest/imscc:resources/imscc:resource[@identifier="'.$identifier.'"]';
$query .= '//lom:intendedEndUserRole/voc:vocabulary/lom:value';
$intendeduserrole = $xpath->query($query);
if (!empty($intendeduserrole) && ($intendeduserrole->length > 0)) {
$role = trim($intendeduserrole->item(0)->nodeValue);
if (strcasecmp('Instructor', $role) == 0) {
$mod_visible = 0;
}
}
}
return $mod_visible;
}
protected function createInstances($items, $level = 0, &$array_index = 0, $index_root = 0)
{
$level++;
$i = 1;
if ($items) {
$xpath = self::newxPath(static::$manifest, static::$namespaces);
foreach ($items as $item) {
$array_index++;
$title = $path = $tool_type = $identifierref = '';
if ($item->nodeName == 'item') {
if ($item->hasAttribute('identifierref')) {
$identifierref = $item->getAttribute('identifierref');
}
$titles = $xpath->query('imscc:title', $item);
if ($titles->length > 0) {
$title = $titles->item(0)->nodeValue;
}
$ccType = $this->getItemCcType($identifierref);
$tool_type = $this->convertToToolType($ccType);
//Fix the label issue - MDL-33523
if (empty($identifierref) && empty($title)) {
$tool_type = TYPE_UNKNOWN;
}
} elseif ($item->nodeName == 'resource') {
$identifierref = $xpath->query('@identifier', $item);
$identifierref = !empty($identifierref->item(0)->nodeValue) ? $identifierref->item(0)->nodeValue : '';
$ccType = $this->getItemCcType($identifierref);
$tool_type = $this->convertToToolType($ccType);
if (self::CC_TYPE_WEBCONTENT == $ccType) {
$path = $this->getItemHref($identifierref);
$title = basename($path);
} else { // A resource but not a file... we assume it's a quiz bank and its assigned identifier is irrelevant to its name
$title = 'Quiz Bank '.($this->countInstances($tool_type) + 1);
}
}
if ($level == ROOT_DEEP) {
$index_root = $array_index;
}
static::$instances['index'][$array_index] = [
'common_cartridge_type' => $ccType,
'tool_type' => $tool_type,
'title' => $title ? $title : '',
'root_parent' => $index_root,
'index' => $array_index,
'deep' => $level,
'instance' => $this->countInstances($tool_type),
'resource_identifier' => $identifierref,
];
static::$instances['instances'][$tool_type][] = [
'title' => $title,
'instance' => static::$instances['index'][$array_index]['instance'],
'common_cartridge_type' => $ccType,
'resource_identifier' => $identifierref,
'deep' => $level,
'src' => $path,
];
$more_items = $xpath->query('imscc:item', $item);
if ($more_items->length > 0) {
$this->createInstances($more_items, $level, $array_index, $index_root);
}
$i++;
}
}
}
protected static function criticalError($text)
{
$path_to_log = static::logFile();
echo '
<p>
<hr />A critical error has been found!
<p>'.$text.'</p>
<p>
The process has been stopped. Please see the <a href="'.$path_to_log.'">log file</a> for more information.</p>
<p>Log: '.$path_to_log.'</p>
<hr />
</p>
';
exit();
}
protected function createCourseCode($title)
{
//Making sure that text of the short name does not go over the DB limit.
//and leaving the space to add additional characters by the platform
$code = substr(strtoupper(str_replace(' ', '', trim($title))), 0, 94);
return $code;
}
}

View File

@@ -0,0 +1,10 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class AssesmentValidator extends CcValidateType
{
public function __construct($location)
{
parent::__construct(self::ASSESMENT_VALIDATOR13, $location);
}
}

View File

@@ -0,0 +1,10 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class BltiValidator extends CcValidateType
{
public function __construct($location)
{
parent::__construct(self::BLTI_VALIDATOR13, $location);
}
}

View File

@@ -0,0 +1,62 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class CcValidateType
{
public const MANIFEST_VALIDATOR1 = 'cclibxml2validator.xsd';
public const ASSESMENT_VALIDATOR1 = '/domainProfile_4/ims_qtiasiv1p2_localised.xsd';
public const DISCUSSION_VALIDATOR1 = '/domainProfile_6/imsdt_v1p0_localised.xsd';
public const WEBLINK_VALIDATOR1 = '/domainProfile_5/imswl_v1p0_localised.xsd';
public const MANIFEST_VALIDATOR11 = 'cc11libxml2validator.xsd';
public const BLTI_VALIDATOR11 = 'imslticc_v1p0p1.xsd';
public const ASSESMENT_VALIDATOR11 = 'ccv1p1_qtiasiv1p2p1_v1p0.xsd';
public const DISCUSSION_VALIDATOR11 = 'ccv1p1_imsdt_v1p1.xsd';
public const WEBLINK_VALIDATOR11 = 'ccv1p1_imswl_v1p1.xsd';
public const MANIFEST_VALIDATOR13 = 'cc13libxml2validator.xsd';
public const BLTI_VALIDATOR13 = 'imslticc_v1p3.xsd';
public const ASSESMENT_VALIDATOR13 = 'ccv1p3_qtiasiv1p2p1_v1p0.xsd';
public const DISCUSSION_VALIDATOR13 = 'ccv1p3_imsdt_v1p3.xsd';
public const WEBLINK_VALIDATOR13 = 'ccv1p3_imswl_v1p3.xsd';
/**
* @var string
*/
protected $type = null;
/**
* @var string
*/
protected $location = null;
public function __construct($type, $location)
{
$this->type = $type;
$this->location = $location;
}
/**
* Validates the item.
*
* @param string $element - File path for the xml
*
* @return bool
*/
public function validate($element)
{
$this->last_error = null;
$celement = realpath($element);
$cvalidator = realpath($this->location.DIRECTORY_SEPARATOR.$this->type);
$result = (empty($celement) || empty($cvalidator));
if (!$result) {
$xml_error = new LibxmlErrorsMgr();
$doc = new DOMDocument();
$doc->validateOnParse = false;
$result = $doc->load($celement, LIBXML_NONET) &&
$doc->schemaValidate($cvalidator);
}
return $result;
}
}

View File

@@ -0,0 +1,10 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class DiscussionValidator extends CcValidateType
{
public function __construct($location)
{
parent::__construct(self::DISCUSSION_VALIDATOR13, $location);
}
}

View File

@@ -0,0 +1,101 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
final class ErrorMessages
{
/**
* @static ErrorMessages
*/
private static $instance = null;
/**
* @var array
*/
private $items = [];
private function __construct()
{
}
private function __clone()
{
}
/**
* Casting to string method.
*
* @return string
*/
public function __toString()
{
return $this->toString(false);
}
/**
* @return ErrorMessages
*/
public static function instance()
{
if (empty(self::$instance)) {
$c = __CLASS__;
self::$instance = new $c();
}
return self::$instance;
}
/**
* @param string $msg
*/
public function add($msg)
{
if (!empty($msg)) {
$this->items[] = $msg;
}
}
/**
* @return array
*/
public function errors()
{
$this->items;
}
/**
* Empties the error content.
*/
public function reset()
{
$this->items = [];
}
/**
* @param bool $web
*
* @return string
*/
public function toString($web = false)
{
$result = '';
if ($web) {
$result .= '<ol>'.PHP_EOL;
}
foreach ($this->items as $error) {
if ($web) {
$result .= '<li>';
}
$result .= $error.PHP_EOL;
if ($web) {
$result .= '</li>'.PHP_EOL;
}
}
if ($web) {
$result .= '</ol>'.PHP_EOL;
}
return $result;
}
}

View File

@@ -0,0 +1,61 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
final class LibxmlErrorsMgr
{
/**
* @var bool
*/
private $previous = false;
/**
* @param bool $reset
*/
public function __construct($reset = false)
{
if ($reset) {
ErrorMessages::instance()->reset();
}
$this->previous = libxml_use_internal_errors(true);
libxml_clear_errors();
}
public function __destruct()
{
$this->collectErrors();
if (!$this->previous) {
libxml_use_internal_errors($this->previous);
}
}
public function collect()
{
$this->collectErrors();
}
private function collectErrors($filename = '')
{
$errors = libxml_get_errors();
static $error_types = [
LIBXML_ERR_ERROR => 'Error', LIBXML_ERR_FATAL => 'Fatal Error', LIBXML_ERR_WARNING => 'Warning',
];
$result = [];
foreach ($errors as $error) {
$add = '';
if (!empty($filename)) {
$add = " in {$filename}";
} elseif (!empty($error->file)) {
$add = " in {$error->file}";
}
$line = '';
if (!empty($error->line)) {
$line = " at line {$error->line}";
}
$err = "{$error_types[$error->level]}{$add}: {$error->message}{$line}";
ErrorMessages::instance()->add($err);
}
libxml_clear_errors();
return $result;
}
}

View File

@@ -0,0 +1,10 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class Manifest10Validator extends CcValidateType
{
public function __construct($location)
{
parent::__construct(self::MANIFEST_VALIDATOR1, $location);
}
}

View File

@@ -0,0 +1,10 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class ManifestValidator extends CcValidateType
{
public function __construct($location)
{
parent::__construct(self::MANIFEST_VALIDATOR13, $location);
}
}

View File

@@ -0,0 +1,10 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/backup/cc/validator.php under GNU/GPL license */
class WeblinkValidator extends CcValidateType
{
public function __construct($location)
{
parent::__construct(self::WEBLINK_VALIDATOR13, $location);
}
}

View File

@@ -0,0 +1,57 @@
<?php
/* For licensing terms, see /license.txt */
class Cc13Entities extends CcEntities
{
public function getExternalXml($identifier)
{
$xpath = Cc1p3Convert::newxPath(Cc1p3Convert::$manifest, Cc1p3Convert::$namespaces);
$files = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@identifier="'.
$identifier.'"]/imscc:file/@href');
$response = empty($files) || ($files->length == 0) ? '' : $files->item(0)->nodeValue;
return $response;
}
protected function getAllFiles()
{
$permDirs = api_get_permissions_for_new_directories();
$allFiles = [];
$xpath = Cc1p3Convert::newxPath(Cc1p3Convert::$manifest, Cc1p3Convert::$namespaces);
foreach (Cc1p3Convert::$restypes as $type) {
$files = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@type="'.
$type.'"]/imscc:file/@href');
if (empty($files) || ($files->length == 0)) {
continue;
}
foreach ($files as $file) {
//omit html files
//this is a bit too simplistic
$ext = strtolower(pathinfo($file->nodeValue, PATHINFO_EXTENSION));
if (in_array($ext, ['html', 'htm', 'xhtml'])) {
continue;
}
$allFiles[] = $file->nodeValue;
}
unset($files);
}
//are there any labels?
$xquery = "//imscc:item/imscc:item/imscc:item[imscc:title][not(@identifierref)]";
$labels = $xpath->query($xquery);
if (!empty($labels) && ($labels->length > 0)) {
$tname = 'course_files';
$dpath = Cc1p3Convert::$pathToManifestFolder.DIRECTORY_SEPARATOR.$tname;
$rfpath = 'files.gif';
$fpath = $dpath.DIRECTORY_SEPARATOR.'files.gif';
if (!file_exists($dpath)) {
mkdir($dpath, $permDirs, true);
}
$allFiles[] = $rfpath;
}
$allFiles = empty($allFiles) ? '' : $allFiles;
return $allFiles;
}
}

View File

@@ -0,0 +1,166 @@
<?php
/* For licensing terms, see /license.txt */
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
class Cc13Forum extends Cc13Entities
{
public function fullPath($path, $dir_sep = DIRECTORY_SEPARATOR)
{
$token = '/\$(?:IMS|1EdTech)[-_]CC[-_]FILEBASE\$/';
$path = preg_replace($token, '', $path);
if (is_string($path) && ($path != '')) {
$dot_dir = '.';
$up_dir = '..';
$length = strlen($path);
$rtemp = trim($path);
$start = strrpos($path, $dir_sep);
$can_continue = ($start !== false);
$result = $can_continue ? '' : $path;
$rcount = 0;
while ($can_continue) {
$dir_part = ($start !== false) ? substr($rtemp, $start + 1, $length - $start) : $rtemp;
$can_continue = ($dir_part !== false);
if ($can_continue) {
if ($dir_part != $dot_dir) {
if ($dir_part == $up_dir) {
$rcount++;
} else {
if ($rcount > 0) {
$rcount--;
} else {
$result = ($result == '') ? $dir_part : $dir_part.$dir_sep.$result;
}
}
}
$rtemp = substr($path, 0, $start);
$start = strrpos($rtemp, $dir_sep);
$can_continue = (($start !== false) || (strlen($rtemp) > 0));
}
}
}
return $result;
}
public function generateData()
{
$data = [];
if (!empty(Cc1p3Convert::$instances['instances']['forum'])) {
foreach (Cc1p3Convert::$instances['instances']['forum'] as $instance) {
$data[] = $this->getForumData($instance);
}
}
return $data;
}
public function getForumData($instance)
{
$topic_data = $this->getTopicData($instance);
$values = [];
if (!empty($topic_data)) {
$values = [
'instance' => $instance['instance'],
'title' => self::safexml($topic_data['title']),
'description' => self::safexml($topic_data['description']),
];
}
return $values;
}
public function storeForums($forums)
{
// Create a Forum category for the import CC 1.3.
$courseInfo = api_get_course_info();
$catForumValues['forum_category_title'] = 'CC1p3';
$catForumValues['forum_category_comment'] = '';
$catId = store_forumcategory(
$catForumValues,
$courseInfo,
false
);
foreach ($forums as $forum) {
$forumValues = [];
$forumValues['forum_title'] = $forum['title'];
$forumValues['forum_image'] = '';
$forumValues['forum_comment'] = strip_tags($forum['description']);
$forumValues['forum_category'] = $catId;
$forumValues['moderated'] = 0;
store_forum($forumValues, $courseInfo);
}
return true;
}
public function getTopicData($instance)
{
$topic_data = [];
$topic_file = $this->getExternalXml($instance['resource_identifier']);
if (!empty($topic_file)) {
$topic_file_path = Cc1p3Convert::$pathToManifestFolder.DIRECTORY_SEPARATOR.$topic_file;
$topic_file_dir = dirname($topic_file_path);
$topic = $this->loadXmlResource($topic_file_path);
if (!empty($topic)) {
$xpath = Cc1p3Convert::newxPath($topic, Cc1p3Convert::$forumns);
$topic_title = $xpath->query('/dt:topic/dt:title');
if ($topic_title->length > 0 && !empty($topic_title->item(0)->nodeValue)) {
$topic_title = $topic_title->item(0)->nodeValue;
} else {
$topic_title = 'Untitled Topic';
}
$topic_text = $xpath->query('/dt:topic/dt:text');
$topic_text = !empty($topic_text->item(0)->nodeValue) ? $this->updateSources($topic_text->item(0)->nodeValue, dirname($topic_file)) : '';
$topic_text = !empty($topic_text) ? str_replace("%24", "\$", $this->includeTitles($topic_text)) : '';
if (!empty($topic_title)) {
$topic_data['title'] = $topic_title;
$topic_data['description'] = $topic_text;
}
}
$topic_attachments = $xpath->query('/dt:topic/dt:attachments/dt:attachment/@href');
if ($topic_attachments->length > 0) {
$attachment_html = '';
foreach ($topic_attachments as $file) {
$attachment_html .= $this->generateAttachmentHtml($this->fullPath($file->nodeValue, '/'));
}
$topic_data['description'] = !empty($attachment_html) ? $topic_text.'<p>Attachments:</p>'.$attachment_html : $topic_text;
}
}
return $topic_data;
}
private function generateAttachmentHtml(string $filename, ?string $rootPath)
{
$images_extensions = ['gif', 'jpeg', 'jpg', 'jif', 'jfif', 'png', 'bmp', 'webp'];
$fileinfo = pathinfo($filename);
if (empty($rootPath)) {
$rootPath = '';
}
if (in_array($fileinfo['extension'], $images_extensions)) {
return '<img src="'.$rootPath.$filename.'" title="'.$fileinfo['basename'].'" alt="'.$fileinfo['basename'].'" /><br />';
} else {
return '<a href="'.$rootPath.$filename.'" title="'.$fileinfo['basename'].'" alt="'.$fileinfo['basename'].'">'.$fileinfo['basename'].'</a><br />';
}
return '';
}
}

View File

@@ -0,0 +1,763 @@
<?php
/* For licensing terms, see /license.txt */
class Cc13Quiz extends Cc13Entities
{
/**
* Get all data from the object instance (coming from the xml file) into a clean array.
*
* @return array
*/
public function generateData()
{
$data = [];
$instances = $this->generateInstances();
if (!empty($instances)) {
foreach ($instances as $instance) {
if ($instance['is_question_bank'] == 0) {
$data[] = $this->getQuizData($instance);
}
}
}
return $data;
}
/**
* Create a quiz based on the information available in the assessment structure.
*
* @param $quiz
*
* @return void
*/
public function storeQuiz($quiz)
{
$token = '/\$(?:IMS|1EdTech)[-_]CC[-_]FILEBASE\$\.\.\//';
$courseInfo = api_get_course_info();
// Replace by the path in documents in which we place all relevant CC files
$replacementPath = '/courses/'.$courseInfo['directory'].'/document/commoncartridge/';
$exercise = new Exercise($courseInfo['real_id']);
$title = Exercise::format_title_variable($quiz['title']);
$exercise->updateTitle($title);
$description = preg_replace($token, $replacementPath, $quiz['description']);
$exercise->updateDescription($description);
$exercise->updateAttempts($quiz['max_attempts']);
$exercise->updateFeedbackType(0);
$exercise->setRandom(0);
$exercise->updateRandomAnswers(!empty($moduleValues['shuffleanswers']));
$exercise->updateExpiredTime((int) $quiz['timelimit']);
$exercise->updateType(1);
// Create the new Quiz
$exercise->save();
if (!empty($quiz['questions'])) {
foreach ($quiz['questions'] as $question) {
$qtype = $question['type'];
$types = [
'unique_answer' => UNIQUE_ANSWER,
'multiple_answer' => MULTIPLE_ANSWER,
'fib' => FILL_IN_BLANKS,
'essay' => FREE_ANSWER,
];
$questionType = $types[$qtype];
$questionInstance = Question::getInstance($questionType);
if (empty($questionInstance)) {
continue;
}
$questionInstance->updateTitle(substr(Security::remove_XSS(strip_tags_blacklist($question['title'], ['br', 'p'])), 0, 20));
$questionText = Security::remove_XSS(strip_tags_blacklist($question['title'], ['br', 'p']));
// Replace the path from $1EdTech-CC-FILEBASE$ to a correct chamilo path
$questionText = preg_replace($token, $replacementPath, $questionText);
$questionInstance->updateDescription($questionText);
$questionInstance->updateLevel(1);
$questionInstance->updateCategory(0);
//Save normal question if NOT media
if ($questionInstance->type != MEDIA_QUESTION) {
$questionInstance->save($exercise);
// modify the exercise
$exercise->addToList($questionInstance->iid);
$exercise->update_question_positions();
}
if ($qtype == 'unique_answer') {
$objAnswer = new Answer($questionInstance->iid);
$questionWeighting = 0;
foreach ($question['answers'] as $slot => $answerValues) {
$correct = $answerValues['score'] ? (int) $answerValues['score'] : 0;
$answer = Security::remove_XSS(preg_replace($token, $replacementPath, $answerValues['title']));
$comment = Security::remove_XSS(preg_replace($token, $replacementPath, $answerValues['feedback']));
$weighting = $answerValues['score'];
$weighting = abs($weighting);
if ($weighting > 0) {
$questionWeighting += $weighting;
}
$goodAnswer = $correct ? true : false;
$objAnswer->createAnswer(
$answer,
$goodAnswer,
$comment,
$weighting,
$slot + 1,
null,
null,
''
);
}
// saves the answers into the database
$objAnswer->save();
// sets the total weighting of the question
$questionInstance->updateWeighting($questionWeighting);
$questionInstance->save($exercise);
} else {
$objAnswer = new Answer($questionInstance->iid);
$questionWeighting = 0;
if (is_array($question['answers'])) {
foreach ($question['answers'] as $slot => $answerValues) {
$answer = Security::remove_XSS(preg_replace($token, $replacementPath, $answerValues['title']));
$comment = Security::remove_XSS(preg_replace($token, $replacementPath, $answerValues['feedback']));
$weighting = $answerValues['score'];
if ($weighting > 0) {
$questionWeighting += $weighting;
}
$goodAnswer = $weighting > 0;
$objAnswer->createAnswer(
$answer,
$goodAnswer,
$comment,
$weighting,
$slot + 1,
null,
null,
''
);
}
} elseif ($qtype == 'essay') {
$questionWeighting = $question['ponderation'];
}
// saves the answers into the database
$objAnswer->save();
// sets the total weighting of the question
$questionInstance->updateWeighting($questionWeighting);
$questionInstance->save($exercise);
}
}
}
}
public function storeQuizzes($quizzes)
{
if (!empty($quizzes)) {
foreach ($quizzes as $quiz) {
$this->storeQuiz($quiz);
}
}
}
public function getQuizData($instance)
{
$values = [];
if (!empty($instance)) {
$questions = [];
if (!empty($instance['questions'])) {
foreach ($instance['questions'] as $question) {
$questions[$question['id']] = [
'title' => $question['title'],
'type' => $question['qtype'],
'ponderation' => $question['defaultgrade'],
'answers' => $question['answers'],
];
}
}
$values = [
'id' => $instance['id'],
'title' => $instance['title'],
'description' => $instance['description'],
'timelimit' => $instance['options']['timelimit'],
'max_attempts' => $instance['options']['max_attempts'],
'questions' => $questions,
];
}
return $values;
}
private function generateInstances()
{
$lastInstanceId = 0;
$lastQuestionId = 0;
$lastAnswerId = 0;
$instances = [];
$types = [TOOL_TYPE_QUIZ];
foreach ($types as $type) {
if (!empty(Cc1p3Convert::$instances['instances'][$type])) {
foreach (Cc1p3Convert::$instances['instances'][$type] as $instance) {
if ($type == TOOL_TYPE_QUIZ) {
$is_question_bank = 0;
} else {
$is_question_bank = 1;
}
// Get the path of the assessment.xml file
$assessmentFile = $this->getExternalXml($instance['resource_identifier']);
if (!empty($assessmentFile)) {
$assessment = $this->loadXmlResource(Cc1p3Convert::$pathToManifestFolder.DIRECTORY_SEPARATOR.$assessmentFile);
if (!empty($assessment)) {
$replaceValues = ['unlimited' => 0];
$questions = $this->getQuestions($assessment, $lastQuestionId, $lastAnswerId, dirname($assessmentFile), $is_question_bank);
$questionCount = count($questions);
if (!empty($questionCount)) {
$lastInstanceId++;
$instances[$instance['resource_identifier']]['questions'] = $questions;
$instances[$instance['resource_identifier']]['id'] = $lastInstanceId;
$instances[$instance['resource_identifier']]['title'] = $instance['title'];
$instances[$instance['resource_identifier']]['description'] = $this->getQuizDescription($assessment);
$instances[$instance['resource_identifier']]['is_question_bank'] = $is_question_bank;
$instances[$instance['resource_identifier']]['options']['timelimit'] = $this->getGlobalConfig($assessment, 'qmd_timelimit', 0);
$instances[$instance['resource_identifier']]['options']['max_attempts'] = $this->getGlobalConfig($assessment, 'cc_maxattempts', 0, $replaceValues);
}
}
}
}
}
}
return $instances;
}
private function getGlobalConfig($assessment, $option, $defaultValue, $replaceValues = '')
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$metadata = $xpath->query('/xmlns:questestinterop/xmlns:assessment/xmlns:qtimetadata/xmlns:qtimetadatafield');
foreach ($metadata as $field) {
$fieldLabel = $xpath->query('xmlns:fieldlabel', $field);
$fieldLabel = !empty($fieldLabel->item(0)->nodeValue) ? $fieldLabel->item(0)->nodeValue : '';
if (strtolower($fieldLabel) == strtolower($option)) {
$fieldEntry = $xpath->query('xmlns:fieldentry', $field);
$response = !empty($fieldEntry->item(0)->nodeValue) ? $fieldEntry->item(0)->nodeValue : '';
}
}
$response = !empty($response) ? trim($response) : '';
if (!empty($replaceValues)) {
foreach ($replaceValues as $key => $value) {
$response = ($key == $response) ? $value : $response;
}
}
$response = empty($response) ? $defaultValue : $response;
return $response;
}
private function getQuizDescription(DOMDocument $assessment): string
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$fieldEntry = $xpath->query('/xmlns:questestinterop/xmlns:assessment/xmlns:rubric/xmlns:material/xmlns:mattext');
$response = !empty($fieldEntry->item(0)->nodeValue) ? $fieldEntry->item(0)->nodeValue : '';
return $response;
}
private function getQuestions($assessment, &$lastQuestionId, &$last_answer_id, $rootPath, $is_question_bank)
{
$questions = [];
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
if (!$is_question_bank) {
$questionsItems = $xpath->query('/xmlns:questestinterop/xmlns:assessment/xmlns:section/xmlns:item');
} else {
$questionsItems = $xpath->query('/xmlns:questestinterop/xmlns:objectbank/xmlns:item');
}
foreach ($questionsItems as $question_item) {
$countQuestions = $xpath->evaluate('count(xmlns:presentation/xmlns:flow/xmlns:material/xmlns:mattext)', $question_item);
if ($countQuestions == 0) {
$questionTitle = $xpath->query('xmlns:presentation/xmlns:material/xmlns:mattext', $question_item);
} else {
$questionTitle = $xpath->query('xmlns:presentation/xmlns:flow/xmlns:material/xmlns:mattext', $question_item);
}
$questionTitle = !empty($questionTitle->item(0)->nodeValue) ? $questionTitle->item(0)->nodeValue : '';
$questionIdentifier = $xpath->query('@ident', $question_item);
$questionIdentifier = !empty($questionIdentifier->item(0)->nodeValue) ? $questionIdentifier->item(0)->nodeValue : '';
if (!empty($questionIdentifier)) {
$questionType = $this->getQuestionType($questionIdentifier, $assessment);
if (!empty($questionType['qtype'])) {
$lastQuestionId++;
$questions[$questionIdentifier]['id'] = $lastQuestionId;
$questionTitle = $this->updateSources($questionTitle, $rootPath);
$questionTitle = !empty($questionTitle) ? str_replace("%24", "\$", $this->includeTitles($questionTitle)) : '';
$questionname = $xpath->query('@title', $question_item);
$questionname = !empty($questionname->item(0)->nodeValue) ? $questionname->item(0)->nodeValue : '';
$questions[$questionIdentifier]['title'] = $questionTitle;
$questions[$questionIdentifier]['name'] = $questionname;
$questions[$questionIdentifier]['identifier'] = $questionIdentifier;
$questions[$questionIdentifier]['qtype'] = $questionType['qtype'];
$questions[$questionIdentifier]['cc_type'] = $questionType['cc'];
$questions[$questionIdentifier]['feedback'] = $this->getGeneralFeedback($assessment, $questionIdentifier);
$questions[$questionIdentifier]['defaultgrade'] = $this->getDefaultgrade($assessment, $questionIdentifier);
$questions[$questionIdentifier]['answers'] = $this->getAnswers($questionIdentifier, $assessment, $lastAnswerId);
}
}
}
$questions = !empty($questions) ? $questions : '';
return $questions;
}
private function getDefaultgrade($assessment, $questionIdentifier)
{
$result = 1;
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$query = '//xmlns:item[@ident="'.$questionIdentifier.'"]';
$query .= '//xmlns:qtimetadatafield[xmlns:fieldlabel="cc_weighting"]/xmlns:fieldentry';
$defgrade = $xpath->query($query);
if (!empty($defgrade) && ($defgrade->length > 0)) {
$resp = (int) $defgrade->item(0)->nodeValue;
if ($resp >= 0 && $resp <= 99) {
$result = $resp;
}
}
return $result;
}
private function getGeneralFeedback($assessment, $questionIdentifier)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$respconditions = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:resprocessing/xmlns:respcondition');
if (!empty($respconditions)) {
foreach ($respconditions as $respcondition) {
$continue = $respcondition->getAttributeNode('continue');
$continue = !empty($continue->nodeValue) ? strtolower($continue->nodeValue) : '';
if ($continue == 'yes') {
$displayFeedback = $xpath->query('xmlns:displayfeedback', $respcondition);
if (!empty($displayFeedback)) {
foreach ($displayFeedback as $feedback) {
$feedbackIdentifier = $feedback->getAttributeNode('linkrefid');
$feedbackIdentifier = !empty($feedbackIdentifier->nodeValue) ? $feedbackIdentifier->nodeValue : '';
if (!empty($feedbackIdentifier)) {
$feedbackIdentifiers[] = $feedbackIdentifier;
}
}
}
}
}
}
$feedback = '';
$feedbackIdentifiers = empty($feedbackIdentifiers) ? '' : $feedbackIdentifiers;
if (!empty($feedbackIdentifiers)) {
foreach ($feedbackIdentifiers as $feedbackIdentifier) {
$feedbacks = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:itemfeedback[@ident="'.$feedbackIdentifier.'"]/xmlns:flow_mat/xmlns:material/xmlns:mattext');
$feedback .= !empty($feedbacks->item(0)->nodeValue) ? $feedbacks->item(0)->nodeValue.' ' : '';
}
}
return $feedback;
}
private function getFeedback($assessment, $identifier, $itemIdentifier, $questionType)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$resourceProcessing = $xpath->query('//xmlns:item[@ident="'.$itemIdentifier.'"]/xmlns:resprocessing/xmlns:respcondition');
if (!empty($resourceProcessing)) {
foreach ($resourceProcessing as $response) {
$varequal = $xpath->query('xmlns:conditionvar/xmlns:varequal', $response);
$varequal = !empty($varequal->item(0)->nodeValue) ? $varequal->item(0)->nodeValue : '';
if (strtolower($varequal) == strtolower($identifier) || ($questionType == CC_QUIZ_ESSAY)) {
$displayFeedback = $xpath->query('xmlns:displayfeedback', $response);
if (!empty($displayFeedback)) {
foreach ($displayFeedback as $feedback) {
$feedbackIdentifier = $feedback->getAttributeNode('linkrefid');
$feedbackIdentifier = !empty($feedbackIdentifier->nodeValue) ? $feedbackIdentifier->nodeValue : '';
if (!empty($feedbackIdentifier)) {
$feedbackIdentifiers[] = $feedbackIdentifier;
}
}
}
}
}
}
$feedback = '';
$feedbackIdentifiers = empty($feedbackIdentifiers) ? '' : $feedbackIdentifiers;
if (!empty($feedbackIdentifiers)) {
foreach ($feedbackIdentifiers as $feedbackIdentifier) {
$feedbacks = $xpath->query('//xmlns:item[@ident="'.$itemIdentifier.'"]/xmlns:itemfeedback[@ident="'.$feedbackIdentifier.'"]/xmlns:flow_mat/xmlns:material/xmlns:mattext');
$feedback .= !empty($feedbacks->item(0)->nodeValue) ? $feedbacks->item(0)->nodeValue.' ' : '';
}
}
return $feedback;
}
private function getAnswersFib($questionIdentifier, $identifier, $assessment, &$lastAnswerId)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$correctanswersfib = [];
$incorrectanswersfib = [];
$responseItems = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:resprocessing/xmlns:respcondition');
$correctrespcond = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:resprocessing/xmlns:respcondition/xmlns:setvar[text()="100"]/..');
$correctanswers = $xpath->query('xmlns:conditionvar/xmlns:varequal', $correctrespcond->item(0));
// Correct answers.
foreach ($correctanswers as $correctans) {
$answertitle = !empty($correctans->nodeValue) ? $correctans->nodeValue : '';
if (empty($answertitle)) {
continue;
}
$lastAnswerId++;
$correctanswersfib[$answertitle] = [
'id' => $lastAnswerId,
'title' => $answertitle,
'score' => 1,
'feedback' => '',
'case' => 0, ];
}
// Handle incorrect answers and feedback for all items.
foreach ($responseItems as $response_item) {
$setvar = $xpath->query('xmlns:setvar', $response_item);
if (!empty($setvar->length) && $setvar->item(0)->nodeValue == '100') {
// Skip the correct answer responsecondition.
continue;
}
$varequal = $xpath->query('xmlns:conditionvar/xmlns:varequal', $response_item);
if (empty($varequal->length)) {
// Skip respcondition elements that don't have varequal containing an answer
continue;
}
$answerTitle = !empty($varequal->item(0)->nodeValue) ? $varequal->item(0)->nodeValue : '';
$displayFeedback = $xpath->query('xmlns:displayfeedback', $response_item);
unset($feedbackIdentifiers);
if (!empty($displayFeedback)) {
foreach ($displayFeedback as $feedback) {
$feedbackIdentifier = $feedback->getAttributeNode('linkrefid');
$feedbackIdentifier = !empty($feedbackIdentifier->nodeValue) ? $feedbackIdentifier->nodeValue : '';
if (!empty($feedbackIdentifier)) {
$feedbackIdentifiers[] = $feedbackIdentifier;
}
}
}
$feedback = '';
$feedbackIdentifiers = empty($feedbackIdentifiers) ? '' : $feedbackIdentifiers;
if (!empty($feedbackIdentifiers)) {
foreach ($feedbackIdentifiers as $feedbackIdentifier) {
$feedbacks = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:itemfeedback[@ident="'.$feedbackIdentifier.'"]/xmlns:flow_mat/xmlns:material/xmlns:mattext');
$feedback .= !empty($feedbacks->item(0)->nodeValue) ? $feedbacks->item(0)->nodeValue.' ' : '';
}
}
if (array_key_exists($answerTitle, $correctanswersfib)) {
// Already a correct answer, just need the feedback for the correct answer.
$correctanswerfib[$answerTitle]['feedback'] = $feedback;
} else {
// Need to add an incorrect answer.
$lastAnswerId++;
$incorrectanswersfib[] = [
'id' => $lastAnswerId,
'title' => $answerTitle,
'score' => 0,
'feedback' => $feedback,
'case' => 0, ];
}
}
$answersFib = array_merge($correctanswersfib, $incorrectanswersfib);
$answersFib = empty($answersFib) ? '' : $answersFib;
return $answersFib;
}
private function getAnswersPatternMatch($questionIdentifier, $identifier, $assessment, &$lastAnswerId)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$answersFib = [];
$responseItems = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:resprocessing/xmlns:respcondition');
foreach ($responseItems as $response_item) {
$setvar = $xpath->query('xmlns:setvar', $response_item);
$setvar = is_object($setvar->item(0)) ? $setvar->item(0)->nodeValue : '';
if ($setvar != '') {
$lastAnswerId++;
$answerTitle = $xpath->query('xmlns:conditionvar/xmlns:varequal[@respident="'.$identifier.'"]', $response_item);
$answerTitle = !empty($answerTitle->item(0)->nodeValue) ? $answerTitle->item(0)->nodeValue : '';
if (empty($answerTitle)) {
$answerTitle = $xpath->query('xmlns:conditionvar/xmlns:varsubstring[@respident="'.$identifier.'"]', $response_item);
$answerTitle = !empty($answerTitle->item(0)->nodeValue) ? '*'.$answerTitle->item(0)->nodeValue.'*' : '';
}
if (empty($answerTitle)) {
$answerTitle = '*';
}
$case = $xpath->query('xmlns:conditionvar/xmlns:varequal/@case', $response_item);
$case = is_object($case->item(0)) ? $case->item(0)->nodeValue : 'no'
;
$case = strtolower($case) == 'yes' ? 1 :
0;
$displayFeedback = $xpath->query('xmlns:displayfeedback', $response_item);
unset($feedbackIdentifiers);
if (!empty($displayFeedback)) {
foreach ($displayFeedback as $feedback) {
$feedbackIdentifier = $feedback->getAttributeNode('linkrefid');
$feedbackIdentifier = !empty($feedbackIdentifier->nodeValue) ? $feedbackIdentifier->nodeValue : '';
if (!empty($feedbackIdentifier)) {
$feedbackIdentifiers[] = $feedbackIdentifier;
}
}
}
$feedback = '';
$feedbackIdentifiers = empty($feedbackIdentifiers) ? '' : $feedbackIdentifiers;
if (!empty($feedbackIdentifiers)) {
foreach ($feedbackIdentifiers as $feedbackIdentifier) {
$feedbacks = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:itemfeedback[@ident="'.$feedbackIdentifier.'"]/xmlns:flow_mat/xmlns:material/xmlns:mattext');
$feedback .= !empty($feedbacks->item(0)->nodeValue) ? $feedbacks->item(0)->nodeValue.' ' : '';
}
}
$answersFib[] = ['id' => $lastAnswerId,
'title' => $answerTitle,
'score' => $setvar,
'feedback' => $feedback,
'case' => $case, ];
}
}
$answersFib = empty($answersFib) ? '' : $answersFib;
return $answersFib;
}
private function getAnswers($identifier, $assessment, &$lastAnswerId)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$answers = [];
$questionCcType = $this->getQuestionType($identifier, $assessment);
$questionCcType = $questionCcType['cc'];
$isMultiresponse = ($questionCcType == CC_QUIZ_MULTIPLE_RESPONSE);
if ($questionCcType == CC_QUIZ_MULTIPLE_CHOICE || $isMultiresponse || $questionCcType == CC_QUIZ_TRUE_FALSE) {
$queryAnswers = '//xmlns:item[@ident="'.$identifier.'"]/xmlns:presentation/xmlns:response_lid/xmlns:render_choice/xmlns:response_label';
$queryAnswersWithFlow = '//xmlns:item[@ident="'.$identifier.'"]/xmlns:presentation/xmlns:flow/xmlns:response_lid/xmlns:render_choice/xmlns:response_label';
$queryIndentifer = '@ident';
$queryTitle = 'xmlns:material/xmlns:mattext';
}
if ($questionCcType == CC_QUIZ_ESSAY) {
$queryAnswers = '//xmlns:item[@ident="'.$identifier.'"]/xmlns:presentation/xmlns:response_str';
$queryAnswersWithFlow = '//xmlns:item[@ident="'.$identifier.'"]/xmlns:presentation/xmlns:flow/xmlns:response_str';
$queryIndentifer = '@ident';
$queryTitle = 'xmlns:render_fib';
}
if ($questionCcType == CC_QUIZ_FIB || $questionCcType == CC_QUIZ_PATTERN_MACHT) {
$xpathQuery = '//xmlns:item[@ident="'.$identifier.'"]/xmlns:presentation/xmlns:response_str/@ident';
$xpathQueryWithFlow = '//xmlns:item[@ident="'.$identifier.'"]/xmlns:presentation/xmlns:flow/xmlns:response_str/@ident';
$countResponse = $xpath->evaluate('count('.$xpathQueryWithFlow.')');
if ($countResponse == 0) {
$answerIdentifier = $xpath->query($xpathQuery);
} else {
$answerIdentifier = $xpath->query($xpathQueryWithFlow);
}
$answerIdentifier = !empty($answerIdentifier->item(0)->nodeValue) ? $answerIdentifier->item(0)->nodeValue : '';
if ($questionCcType == CC_QUIZ_FIB) {
$answers = $this->getAnswersFib($identifier, $answerIdentifier, $assessment, $lastAnswerId);
} else {
$answers = $this->getAnswersPatternMatch($identifier, $answerIdentifier, $assessment, $lastAnswerId);
}
} else {
$countResponse = $xpath->evaluate('count('.$queryAnswersWithFlow.')');
if ($countResponse == 0) {
$responseItems = $xpath->query($queryAnswers);
} else {
$responseItems = $xpath->query($queryAnswersWithFlow);
}
if (!empty($responseItems)) {
if ($isMultiresponse) {
$correctAnswerScore = 0;
//get the correct answers count
$canswers_query = "//xmlns:item[@ident='{$identifier}']//xmlns:setvar[@varname='SCORE'][.=100]/../xmlns:conditionvar//xmlns:varequal[@case='Yes'][not(parent::xmlns:not)]";
$canswers = $xpath->query($canswers_query);
if ($canswers->length > 0) {
$correctAnswerScore = round(1.0 / (float) $canswers->length, 7); //weird
$correctAanswersIdent = [];
foreach ($canswers as $cnode) {
$correctAanswersIdent[$cnode->nodeValue] = true;
}
}
}
foreach ($responseItems as $response_item) {
$lastAnswerId++;
$answerIdentifier = $xpath->query($queryIndentifer, $response_item);
$answerIdentifier = !empty($answerIdentifier->item(0)->nodeValue) ? $answerIdentifier->item(0)->nodeValue : '';
$answerTitle = $xpath->query($queryTitle, $response_item);
$answerTitle = !empty($answerTitle->item(0)->nodeValue) ? $answerTitle->item(0)->nodeValue : '';
$answerFeedback = $this->getFeedback($assessment, $answerIdentifier, $identifier, $questionCcType);
$answer_score = $this->getScore($assessment, $answerIdentifier, $identifier);
if ($isMultiresponse && isset($correctAanswersIdent[$answerIdentifier])) {
$answer_score = $correctAnswerScore;
}
$answers[] = ['id' => $lastAnswerId,
'title' => $answerTitle,
'score' => $answer_score,
'identifier' => $answerIdentifier,
'feedback' => $answerFeedback, ];
}
}
}
$answers = empty($answers) ? '' : $answers;
return $answers;
}
private function getScore($assessment, $identifier, $questionIdentifier)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$resourceProcessing = $xpath->query('//xmlns:item[@ident="'.$questionIdentifier.'"]/xmlns:resprocessing/xmlns:respcondition');
if (!empty($resourceProcessing)) {
foreach ($resourceProcessing as $response) {
$questionCcType = $this->getQuestionType($questionIdentifier, $assessment);
$questionCcType = $questionCcType['cc'];
$varequal = $xpath->query('xmlns:conditionvar/xmlns:varequal', $response);
$varequal = !empty($varequal->item(0)->nodeValue) ? $varequal->item(0)->nodeValue : '';
if (strtolower($varequal) == strtolower($identifier)) {
$score = $xpath->query('xmlns:setvar', $response);
$score = !empty($score->item(0)->nodeValue) ? $score->item(0)->nodeValue : '';
}
}
}
$score = empty($score) ? "0.0000000" : '1.0000000';
return $score;
}
private function getQuestionType($identifier, $assessment)
{
$xpath = Cc1p3Convert::newxPath($assessment, Cc1p3Convert::getquizns());
$metadata = $xpath->query('//xmlns:item[@ident="'.$identifier.'"]/xmlns:itemmetadata/xmlns:qtimetadata/xmlns:qtimetadatafield');
foreach ($metadata as $field) {
$fieldLabel = $xpath->query('xmlns:fieldlabel', $field);
$fieldLabel = !empty($fieldLabel->item(0)->nodeValue) ? $fieldLabel->item(0)->nodeValue : '';
if ($fieldLabel == 'cc_profile') {
$fieldEntry = $xpath->query('xmlns:fieldentry', $field);
$type = !empty($fieldEntry->item(0)->nodeValue) ? $fieldEntry->item(0)->nodeValue : '';
}
}
$returnType = [];
$returnType['qtype'] = '';
$returnType['cc'] = $type;
switch ($type) {
case CC_QUIZ_MULTIPLE_CHOICE:
$returnType['qtype'] = 'unique_answer';
break;
case CC_QUIZ_MULTIPLE_RESPONSE:
$returnType['qtype'] = 'multiple_answer';
break;
case CC_QUIZ_FIB:
$returnType['qtype'] = 'fib';
break;
case CC_QUIZ_ESSAY:
$returnType['qtype'] = 'essay';
break;
}
return $returnType;
}
}

View File

@@ -0,0 +1,207 @@
<?php
/* For licensing terms, see /license.txt */
class Cc13Resource extends Cc13Entities
{
public function generateData($resource_type)
{
$data = [];
if (!empty(Cc1p3Convert::$instances['instances'][$resource_type])) {
foreach (Cc1p3Convert::$instances['instances'][$resource_type] as $instance) {
$data[] = $this->getResourceData($instance);
}
}
return $data;
}
public function storeLinks($links)
{
foreach ($links as $link) {
$_POST['title'] = $link[1];
$_POST['url'] = $link[4];
$_POST['description'] = '';
$_POST['category_id'] = 0;
$_POST['target'] = '_blank';
Link::addlinkcategory('link');
}
return true;
}
public function storeDocuments($documents, $path)
{
$courseInfo = api_get_course_info();
$sessionId = api_get_session_id();
$groupId = api_get_group_id();
$documentPath = api_get_path(SYS_COURSE_PATH).$courseInfo['directory'].'/document';
foreach ($documents as $document) {
if ($document[2] == 'file') {
$filepath = $path.DIRECTORY_SEPARATOR.$document[4];
$files = [];
$files['file']['name'] = $document[1];
$files['file']['tmp_name'] = $filepath;
$files['file']['type'] = mime_content_type($filepath);
$files['file']['error'] = 0;
$files['file']['size'] = filesize($filepath);
$files['file']['from_file'] = true;
$files['file']['move_file'] = true;
$_POST['language'] = $courseInfo['language'];
$_POST['cc_import'] = true;
$destDir = dirname($document[4]);
// Create the subdirectory if necessary
create_unexisting_directory(
$courseInfo,
api_get_user_id(),
$sessionId,
$groupId,
null,
$documentPath,
'/commoncartridge/'.$destDir,
$destDir,
1
);
DocumentManager::upload_document(
$files,
'/commoncartridge/'.$destDir,
$document[1],
'',
null,
null,
true,
true
);
}
}
return true;
}
public function getResourceData($instance)
{
//var_dump($instance);
$xpath = Cc1p3Convert::newxPath(Cc1p3Convert::$manifest, Cc1p3Convert::$namespaces);
$link = '';
if ($instance['common_cartridge_type'] == Cc1p3Convert::CC_TYPE_WEBCONTENT || $instance['common_cartridge_type'] == Cc1p3Convert::CC_TYPE_ASSOCIATED_CONTENT) {
$resource = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@identifier="'.$instance['resource_identifier'].'"]/@href');
if ($resource->length > 0) {
$resource = !empty($resource->item(0)->nodeValue) ? $resource->item(0)->nodeValue : '';
} else {
$resource = '';
}
if (empty($resource)) {
unset($resource);
// src has been set in CcBase::createInstances() based on the contents of <file href="...">
$resource = $instance['src'];
}
if (!empty($resource)) {
$link = $resource;
}
}
if ($instance['common_cartridge_type'] == Cc1p3Convert::CC_TYPE_WEBLINK) {
// src has been set in CcBase::createInstances() based on the contents of <file href="...">
$external_resource = $instance['src'];
if ($external_resource) {
$resource = $this->loadXmlResource(Cc1p3Convert::$pathToManifestFolder.DIRECTORY_SEPARATOR.$external_resource);
if (!empty($resource)) {
$xpath = Cc1p3Convert::newxPath($resource, Cc1p3Convert::$resourcens);
$resource = $xpath->query('/wl:webLink/wl:url/@href');
if ($resource->length > 0) {
$rawlink = $resource->item(0)->nodeValue;
if (!validateUrlSyntax($rawlink, 's+')) {
$changed = rawurldecode($rawlink);
if (validateUrlSyntax($changed, 's+')) {
$link = $changed;
} else {
$link = 'http://invalidurldetected/';
}
} else {
$link = htmlspecialchars(trim($rawlink), ENT_COMPAT, 'UTF-8', false);
}
}
}
}
}
$mod_type = 'file';
$mod_options = 'objectframe';
$mod_reference = $link;
$mod_alltext = '';
// detect if we are dealing with html file
if (!empty($link) && ($instance['common_cartridge_type'] == Cc1p3Convert::CC_TYPE_WEBCONTENT)) {
$ext = strtolower(pathinfo($link, PATHINFO_EXTENSION));
if (in_array($ext, ['html', 'htm', 'xhtml'])) {
$mod_type = 'html';
//extract the content of the file and treat it
$rootpath = realpath(Cc1p3Convert::$pathToManifestFolder);
$htmlpath = realpath($rootpath.DIRECTORY_SEPARATOR.$link);
$dirpath = dirname($htmlpath);
if (file_exists($htmlpath)) {
$fcontent = file_get_contents($htmlpath);
$mod_alltext = $this->prepareContent($fcontent);
$mod_reference = '';
$mod_options = '';
/**
* try to handle embedded resources
* images, linked static resources, applets, videos.
*/
$doc = new DOMDocument();
$cdir = getcwd();
chdir($dirpath);
try {
$doc->loadHTML($mod_alltext);
$xpath = new DOMXPath($doc);
$attributes = ['href', 'src', 'background', 'archive', 'code'];
$qtemplate = "//*[@##][not(contains(@##,'://'))]/@##";
$query = '';
foreach ($attributes as $attrname) {
if (!empty($query)) {
$query .= " | ";
}
$query .= str_replace('##', $attrname, $qtemplate);
}
$list = $xpath->query($query);
$searches = [];
$replaces = [];
foreach ($list as $resrc) {
$rpath = $resrc->nodeValue;
$rtp = realpath($rpath);
if (($rtp !== false) && is_file($rtp)) {
//file is there - we are in business
$strip = str_replace("\\", "/", str_ireplace($rootpath, '/', $rtp));
//$encoded_file = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $strip);
$encoded_file = $strip;
$searches[] = $resrc->nodeValue;
$replaces[] = $encoded_file;
}
}
$mod_alltext = str_replace($searches, $replaces, $mod_alltext);
} catch (Exception $e) {
//silence the complaints
}
chdir($cdir);
$mod_alltext = self::safexml($mod_alltext);
}
}
}
$values = [
$instance['instance'],
self::safexml($instance['title']),
$mod_type,
$mod_alltext,
$mod_reference, // src or href
$mod_options,
];
return $values;
}
}

View File

@@ -0,0 +1,248 @@
<?php
/* For licensing terms, see /license.txt */
class CcEntities
{
/**
* Prepares convert for inclusion into XML.
*
* @param string $value
*
* @return string
*/
public static function safexml($value)
{
$result = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'),
ENT_NOQUOTES,
'UTF-8',
false);
return $result;
}
public function loadXmlResource($path_to_file)
{
$resource = new DOMDocument();
Cc1p3Convert::logAction('Load the XML resource file: '.$path_to_file);
if (!$resource->load($path_to_file)) {
Cc1p3Convert::logAction('Cannot load the XML resource file: '.$path_to_file, false);
}
return $resource;
}
public function updateSources($html, $rootPath = '')
{
$document = $this->loadHtml($html);
$tags = ['img' => 'src', 'a' => 'href'];
foreach ($tags as $tag => $attribute) {
$elements = $document->getElementsByTagName($tag);
foreach ($elements as $element) {
$attribute_value = $element->getAttribute($attribute);
$protocol = parse_url($attribute_value, PHP_URL_SCHEME);
if (empty($protocol)) {
// The CC standard changed with the renaming of IMS Global to 1stEdTech, so we don't know what we're going to get
$attribute_value = str_replace("\$1EdTech[-_]CC[-_]FILEBASE\$", "", $attribute_value);
$attribute_value = str_replace("\$IMS[-_]CC[-_]FILEBASE\$", "", $attribute_value);
$attribute_value = $this->fullPath($rootPath."/".$attribute_value, "/");
//$attribute_value = "\$@FILEPHP@\$"."/".$attribute_value;
}
$element->setAttribute($attribute, $attribute_value);
}
}
$html = $this->htmlInsidebody($document);
return $html;
}
public function fullPath($path, $dir_sep = DIRECTORY_SEPARATOR)
{
$token = '/\$(?:IMS|1EdTech)[-_]CC[-_]FILEBASE\$/';
$path = preg_replace($token, '', $path);
if (is_string($path) && ($path != '')) {
$dot_dir = '.';
$up_dir = '..';
$length = strlen($path);
$rtemp = trim($path);
$start = strrpos($path, $dir_sep);
$can_continue = ($start !== false);
$result = $can_continue ? '' : $path;
$rcount = 0;
while ($can_continue) {
$dir_part = ($start !== false) ? substr($rtemp, $start + 1, $length - $start) : $rtemp;
$can_continue = ($dir_part !== false);
if ($can_continue) {
if ($dir_part != $dot_dir) {
if ($dir_part == $up_dir) {
$rcount++;
} else {
if ($rcount > 0) {
$rcount--;
} else {
$result = ($result == '') ? $dir_part : $dir_part.$dir_sep.$result;
}
}
}
$rtemp = substr($path, 0, $start);
$start = strrpos($rtemp, $dir_sep);
$can_continue = (($start !== false) || (strlen($rtemp) > 0));
}
}
}
return $result;
}
public function includeTitles($html)
{
$document = $this->loadHtml($html);
$images = $document->getElementsByTagName('img');
foreach ($images as $image) {
$src = $image->getAttribute('src');
$alt = $image->getAttribute('alt');
$title = $image->getAttribute('title');
$filename = pathinfo($src);
$filename = $filename['filename'];
$alt = empty($alt) ? $filename : $alt;
$title = empty($title) ? $filename : $title;
$image->setAttribute('alt', $alt);
$image->setAttribute('title', $title);
}
$html = $this->htmlInsidebody($document);
return $html;
}
public function getExternalXml($identifier)
{
$xpath = Cc1p3Convert::newxPath(Cc1p3Convert::$manifest, Cc1p3Convert::$namespaces);
$files = $xpath->query('/imscc:manifest/imscc:resources/imscc:resource[@identifier="'.
$identifier.'"]/imscc:file/@href');
if (empty($files)) {
$response = '';
} else {
$response = $files->item(0)->nodeValue;
}
return $response;
}
public function generateRandomString($length = 6)
{
$response = '';
$source = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
if ($length > 0) {
$response = '';
$source = str_split($source, 1);
for ($i = 1; $i <= $length; $i++) {
$num = mt_rand(1, count($source));
$response .= $source[$num - 1];
}
}
return $response;
}
public function truncateText($text, $max, $remove_html)
{
if ($max > 10) {
$text = substr($text, 0, ($max - 6)).' [...]';
} else {
$text = substr($text, 0, $max);
}
$text = $remove_html ? strip_tags($text) : $text;
return $text;
}
protected function prepareContent($content)
{
$result = $content;
if (empty($result)) {
return '';
}
$encoding = null;
$xml_error = new LibxmlErrorsMgr();
$dom = new DOMDocument();
$dom->validateOnParse = false;
$dom->strictErrorChecking = false;
if ($dom->loadHTML($content)) {
$encoding = $dom->xmlEncoding;
}
if (empty($encoding)) {
$encoding = mb_detect_encoding($content, 'auto', true);
}
if (!empty($encoding) && !mb_check_encoding($content, 'UTF-8')) {
$result = mb_convert_encoding($content, 'UTF-8', $encoding);
}
// See if we can strip off body tag and anything outside of it.
foreach (['body', 'html'] as $tagname) {
$regex = str_replace('##', $tagname, "/<##[^>]*>(.+)<\/##>/is");
if (preg_match($regex, $result, $matches)) {
$result = $matches[1];
break;
}
}
return $result;
}
/**
* @param string $html
*
* @return DOMDocument
*/
private function loadHtml($html)
{
// Need to make sure that the html passed has charset meta tag.
$metatag = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
if (strpos($html, $metatag) === false) {
$html = '<html><head>'.$metatag.'</head><body>'.$html.'</body></html>';
}
$document = new DOMDocument();
@$document->loadHTML($html);
return $document;
}
/**
* @param DOMDocument $domdocument
*
* @return string
*/
private function htmlInsidebody($domdocument)
{
$html = '';
$bodyitems = $domdocument->getElementsByTagName('body');
if ($bodyitems->length > 0) {
$body = $bodyitems->item(0);
$html = str_ireplace(['<body>', '</body>'], '', $body->C14N());
}
return $html;
}
}

View File

@@ -0,0 +1,46 @@
<?php
/* For licensing terms, see /license.txt */
// GENERAL PARAMETERS ************************************************************************************************* //
define('ROOT_DEEP', 2);
// PACKAGES FORMATS *************************************************************************************************** //
define('FORMAT_UNKNOWN', 'NA');
define('FORMAT_COMMON_CARTRIDGE', 'CC');
define('FORMAT_BLACK_BOARD', 'BB');
// FORMATS NAMESPACES ************************************************************************************************* //
define('NS_COMMON_CARTRIDGE', 'http://www.imsglobal.org/xsd/imsccv1p3/imscp_v1p1');
define('NS_BLACK_BOARD', 'http://www.blackboard.com/content-packaging');
// CC RESOURCES TYPE ************************************************************************************************** //
define('CC_TYPE_FORUM', 'imsdt_xmlv1p3');
define('CC_TYPE_QUIZ', 'imsqti_xmlv1p3/imscc_xmlv1p3/assessment');
define('CC_TYPE_QUESTION_BANK', 'imsqti_xmlv1p3/imscc_xmlv1p3/question-bank');
define('CC_TYPE_WEBLINK', 'imswl_xmlv1p3');
define('CC_TYPE_WEBCONTENT', 'webcontent');
define('CC_TYPE_ASSOCIATED_CONTENT', 'associatedcontent/imscc_xmlv1p3/learning-application-resource');
define('CC_TYPE_BASICLTI', 'imsbasiclti_xmlv1p3');
define('CC_TYPE_EMPTY', '');
// COURSE RESOURCES TYPE ********************************************************************************************** //
define('TOOL_TYPE_FORUM', 'forum');
define('TOOL_TYPE_QUIZ', 'quiz');
define('TOOL_TYPE_DOCUMENT', 'document');
define('TOOL_TYPE_WEBLINK', 'link');
// UNKNOWN TYPE ******************************************************************************************************* //
define('TYPE_UNKNOWN', '[UNKNOWN]');
// CC QUESTIONS TYPES ************************************************************************************************* //
define('CC_QUIZ_MULTIPLE_CHOICE', 'cc.multiple_choice.v0p1');
define('CC_QUIZ_TRUE_FALSE', 'cc.true_false.v0p1');
define('CC_QUIZ_FIB', 'cc.fib.v0p1');
define('CC_QUIZ_MULTIPLE_RESPONSE', 'cc.multiple_response.v0p1');
define('CC_QUIZ_PATTERN_MACHT', 'cc.pattern_match.v0p1');
define('CC_QUIZ_ESSAY', 'cc.essay.v0p1');
//COURSE QUESTIONS TYPES ********************************************************************************************** //
define('TOOL_QUIZ_MULTIPLE_CHOICE', 'multichoice');
define('TOOL_QUIZ_MULTIANSWER', 'multianswer');
define('TOOL_QUIZ_MULTIPLE_RESPONSE', 'multichoice');

View File

@@ -0,0 +1,447 @@
<?php
/* Source: https://github.com/moodle/moodle/blob/MOODLE_310_STABLE/lib/validateurlsyntax.php under GNU/GPL license */
/**
* BEGINNING OF validateUrlSyntax() function.
*/
function validateUrlSyntax($urladdr, $options = "")
{
// Force Options parameter to be lower case
// DISABLED PERMAMENTLY - OK to remove from code
// $options = strtolower($options);
// Check Options Parameter
if (!preg_match('/^([sHSEFRuPaIpfqr][+?-])*$/', $options)) {
trigger_error("Options attribute malformed", E_USER_ERROR);
}
// Set Options Array, set defaults if options are not specified
// Scheme
if (strpos($options, 's') === false) {
$aOptions['s'] = '?';
} else {
$aOptions['s'] = substr($options, strpos($options, 's') + 1, 1);
}
// http://
if (strpos($options, 'H') === false) {
$aOptions['H'] = '?';
} else {
$aOptions['H'] = substr($options, strpos($options, 'H') + 1, 1);
}
// https:// (SSL)
if (strpos($options, 'S') === false) {
$aOptions['S'] = '?';
} else {
$aOptions['S'] = substr($options, strpos($options, 'S') + 1, 1);
}
// mailto: (email)
if (strpos($options, 'E') === false) {
$aOptions['E'] = '-';
} else {
$aOptions['E'] = substr($options, strpos($options, 'E') + 1, 1);
}
// ftp://
if (strpos($options, 'F') === false) {
$aOptions['F'] = '-';
} else {
$aOptions['F'] = substr($options, strpos($options, 'F') + 1, 1);
}
// rtmp://
if (strpos($options, 'R') === false) {
$aOptions['R'] = '-';
} else {
$aOptions['R'] = substr($options, strpos($options, 'R') + 1, 1);
}
// User section
if (strpos($options, 'u') === false) {
$aOptions['u'] = '?';
} else {
$aOptions['u'] = substr($options, strpos($options, 'u') + 1, 1);
}
// Password in user section
if (strpos($options, 'P') === false) {
$aOptions['P'] = '?';
} else {
$aOptions['P'] = substr($options, strpos($options, 'P') + 1, 1);
}
// Address Section
if (strpos($options, 'a') === false) {
$aOptions['a'] = '+';
} else {
$aOptions['a'] = substr($options, strpos($options, 'a') + 1, 1);
}
// IP Address in address section
if (strpos($options, 'I') === false) {
$aOptions['I'] = '?';
} else {
$aOptions['I'] = substr($options, strpos($options, 'I') + 1, 1);
}
// Port number
if (strpos($options, 'p') === false) {
$aOptions['p'] = '?';
} else {
$aOptions['p'] = substr($options, strpos($options, 'p') + 1, 1);
}
// File Path
if (strpos($options, 'f') === false) {
$aOptions['f'] = '?';
} else {
$aOptions['f'] = substr($options, strpos($options, 'f') + 1, 1);
}
// Query Section
if (strpos($options, 'q') === false) {
$aOptions['q'] = '?';
} else {
$aOptions['q'] = substr($options, strpos($options, 'q') + 1, 1);
}
// Fragment (Anchor)
if (strpos($options, 'r') === false) {
$aOptions['r'] = '?';
} else {
$aOptions['r'] = substr($options, strpos($options, 'r') + 1, 1);
}
// Loop through options array, to search for and replace "-" to "{0}" and "+" to ""
foreach ($aOptions as $key => $value) {
if ($value == '-') {
$aOptions[$key] = '{0}';
}
if ($value == '+') {
$aOptions[$key] = '';
}
}
// DEBUGGING - Unescape following line to display to screen current option values
// echo '<pre>'; print_r($aOptions); echo '</pre>';
// Preset Allowed Characters
$alphanum = '[a-zA-Z0-9]'; // Alpha Numeric
$unreserved = '[a-zA-Z0-9_.!~*'.'\''.'()-]';
$escaped = '(%[0-9a-fA-F]{2})'; // Escape sequence - In Hex - %6d would be a 'm'
$reserved = '[;/?:@&=+$,]'; // Special characters in the URI
// Beginning Regular Expression
// Scheme - Allows for 'http://', 'https://', 'mailto:', 'ftp://' or 'rtmp://'
$scheme = '(';
if ($aOptions['H'] === '') {
$scheme .= 'http://';
} elseif ($aOptions['S'] === '') {
$scheme .= 'https://';
} elseif ($aOptions['E'] === '') {
$scheme .= 'mailto:';
} elseif ($aOptions['F'] === '') {
$scheme .= 'ftp://';
} elseif ($aOptions['R'] === '') {
$scheme .= 'rtmp://';
} else {
if ($aOptions['H'] === '?') {
$scheme .= '|(http://)';
}
if ($aOptions['S'] === '?') {
$scheme .= '|(https://)';
}
if ($aOptions['E'] === '?') {
$scheme .= '|(mailto:)';
}
if ($aOptions['F'] === '?') {
$scheme .= '|(ftp://)';
}
if ($aOptions['R'] === '?') {
$scheme .= '|(rtmp://)';
}
$scheme = str_replace('(|', '(', $scheme); // fix first pipe
}
$scheme .= ')'.$aOptions['s'];
// End setting scheme
// User Info - Allows for 'username@' or 'username:password@'. Note: contrary to rfc, I removed ':' from username section, allowing it only in password.
// /---------------- Username -----------------------\ /-------------------------------- Password ------------------------------\
$userinfo = '(('.$unreserved.'|'.$escaped.'|[;&=+$,]'.')+(:('.$unreserved.'|'.$escaped.'|[;:&=+$,]'.')+)'.$aOptions['P'].'@)'.$aOptions['u'];
// IP ADDRESS - Allows 0.0.0.0 to 255.255.255.255
$ipaddress = '((((2(([0-4][0-9])|(5[0-5])))|([01]?[0-9]?[0-9]))\.){3}((2(([0-4][0-9])|(5[0-5])))|([01]?[0-9]?[0-9])))';
// Tertiary Domain(s) - Optional - Multi - Although some sites may use other characters, the RFC says tertiary domains have the same naming restrictions as second level domains
$domain_tertiary = '('.$alphanum.'(([a-zA-Z0-9-]{0,62})'.$alphanum.')?\.)*';
$domain_toplevel = '([a-zA-Z](([a-zA-Z0-9-]*)[a-zA-Z0-9])?)';
if ($aOptions['I'] === '{0}') { // IP Address Not Allowed
$address = '('.$domain_tertiary. /* MDL-9295 $domain_secondary . */ $domain_toplevel.')';
} elseif ($aOptions['I'] === '') { // IP Address Required
$address = '('.$ipaddress.')';
} else { // IP Address Optional
$address = '(('.$ipaddress.')|('.$domain_tertiary. /* MDL-9295 $domain_secondary . */ $domain_toplevel.'))';
}
$address = $address.$aOptions['a'];
// Port Number - :80 or :8080 or :65534 Allows range of :0 to :65535
// (0-59999) |(60000-64999) |(65000-65499) |(65500-65529) |(65530-65535)
$port_number = '(:(([0-5]?[0-9]{1,4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5])))'.$aOptions['p'];
// Path - Can be as simple as '/' or have multiple folders and filenames
$path = '(/((;)?('.$unreserved.'|'.$escaped.'|'.'[:@&=+$,]'.')+(/)?)*)'.$aOptions['f'];
// Query Section - Accepts ?var1=value1&var2=value2 or ?2393,1221 and much more
$querystring = '(\?('.$reserved.'|'.$unreserved.'|'.$escaped.')*)'.$aOptions['q'];
// Fragment Section - Accepts anchors such as #top
$fragment = '(\#('.$reserved.'|'.$unreserved.'|'.$escaped.')*)'.$aOptions['r'];
// Building Regular Expression
$regexp = '#^'.$scheme.$userinfo.$address.$port_number.$path.$querystring.$fragment.'$#i';
// DEBUGGING - Uncomment Line Below To Display The Regular Expression Built
// echo '<pre>' . htmlentities(wordwrap($regexp,70,"\n",1)) . '</pre>';
// Running the regular expression
if (preg_match($regexp, $urladdr)) {
return true; // The domain passed
} else {
return false; // The domain didn't pass the expression
}
} // END Function validateUrlSyntax()
/**
* About ValidateEmailSyntax():
* This function uses the ValidateUrlSyntax() function to easily check the
* syntax of an email address. It accepts the same options as ValidateURLSyntax
* but defaults them for email addresses.
*
* Released under same license as validateUrlSyntax()
*/
function validateEmailSyntax($emailaddr, $options = "")
{
// Check Options Parameter
if (!preg_match('/^([sHSEFuPaIpfqr][+?-])*$/', $options)) {
trigger_error("Options attribute malformed", E_USER_ERROR);
}
// Set Options Array, set defaults if options are not specified
// Scheme
if (strpos($options, 's') === false) {
$aOptions['s'] = '-';
} else {
$aOptions['s'] = substr($options, strpos($options, 's') + 1, 1);
}
// http://
if (strpos($options, 'H') === false) {
$aOptions['H'] = '-';
} else {
$aOptions['H'] = substr($options, strpos($options, 'H') + 1, 1);
}
// https:// (SSL)
if (strpos($options, 'S') === false) {
$aOptions['S'] = '-';
} else {
$aOptions['S'] = substr($options, strpos($options, 'S') + 1, 1);
}
// mailto: (email)
if (strpos($options, 'E') === false) {
$aOptions['E'] = '?';
} else {
$aOptions['E'] = substr($options, strpos($options, 'E') + 1, 1);
}
// ftp://
if (strpos($options, 'F') === false) {
$aOptions['F'] = '-';
} else {
$aOptions['F'] = substr($options, strpos($options, 'F') + 1, 1);
}
// User section
if (strpos($options, 'u') === false) {
$aOptions['u'] = '+';
} else {
$aOptions['u'] = substr($options, strpos($options, 'u') + 1, 1);
}
// Password in user section
if (strpos($options, 'P') === false) {
$aOptions['P'] = '-';
} else {
$aOptions['P'] = substr($options, strpos($options, 'P') + 1, 1);
}
// Address Section
if (strpos($options, 'a') === false) {
$aOptions['a'] = '+';
} else {
$aOptions['a'] = substr($options, strpos($options, 'a') + 1, 1);
}
// IP Address in address section
if (strpos($options, 'I') === false) {
$aOptions['I'] = '-';
} else {
$aOptions['I'] = substr($options, strpos($options, 'I') + 1, 1);
}
// Port number
if (strpos($options, 'p') === false) {
$aOptions['p'] = '-';
} else {
$aOptions['p'] = substr($options, strpos($options, 'p') + 1, 1);
}
// File Path
if (strpos($options, 'f') === false) {
$aOptions['f'] = '-';
} else {
$aOptions['f'] = substr($options, strpos($options, 'f') + 1, 1);
}
// Query Section
if (strpos($options, 'q') === false) {
$aOptions['q'] = '-';
} else {
$aOptions['q'] = substr($options, strpos($options, 'q') + 1, 1);
}
// Fragment (Anchor)
if (strpos($options, 'r') === false) {
$aOptions['r'] = '-';
} else {
$aOptions['r'] = substr($options, strpos($options, 'r') + 1, 1);
}
// Generate options
$newoptions = '';
foreach ($aOptions as $key => $value) {
$newoptions .= $key.$value;
}
// DEBUGGING - Uncomment line below to display generated options
// echo '<pre>' . $newoptions . '</pre>';
// Send to validateUrlSyntax() and return result
return validateUrlSyntax($emailaddr, $newoptions);
} // END Function validateEmailSyntax()
/**
* About ValidateFtpSyntax():
* This function uses the ValidateUrlSyntax() function to easily check the
* syntax of an FTP address. It accepts the same options as ValidateURLSyntax
* but defaults them for FTP addresses.
*
* Usage:
* <code>
* validateFtpSyntax( url_to_check[, options])
* </code>
* url_to_check - string - The url to check
*
* options - string - A optional string of options to set which parts of
* the url are required, optional, or not allowed. Each option
* must be followed by a "+" for required, "?" for optional, or
* "-" for not allowed. See ValidateUrlSyntax() docs for option list.
*
* The default options are changed to:
* s?H-S-E-F+u?P?a+I?p?f?q-r-
*
* Examples:
* <code>
* validateFtpSyntax('ftp://netscape.com')
* validateFtpSyntax('moz:iesucks@netscape.com')
* validateFtpSyntax('ftp://netscape.com:2121/browsers/ns7/', 'u-')
* </code>
*
* Author(s):
* Rod Apeldoorn - rod(at)canowhoopass(dot)com
*
*
* Homepage:
* http://www.canowhoopass.com/
*
*
* License:
* Copyright 2004 - Rod Apeldoorn
*
* Released under same license as validateUrlSyntax(). For details, contact me.
*/
function validateFtpSyntax($ftpaddr, $options = "")
{
// Check Options Parameter
if (!preg_match('/^([sHSEFuPaIpfqr][+?-])*$/', $options)) {
trigger_error("Options attribute malformed", E_USER_ERROR);
}
// Set Options Array, set defaults if options are not specified
// Scheme
if (strpos($options, 's') === false) {
$aOptions['s'] = '?';
} else {
$aOptions['s'] = substr($options, strpos($options, 's') + 1, 1);
}
// http://
if (strpos($options, 'H') === false) {
$aOptions['H'] = '-';
} else {
$aOptions['H'] = substr($options, strpos($options, 'H') + 1, 1);
}
// https:// (SSL)
if (strpos($options, 'S') === false) {
$aOptions['S'] = '-';
} else {
$aOptions['S'] = substr($options, strpos($options, 'S') + 1, 1);
}
// mailto: (email)
if (strpos($options, 'E') === false) {
$aOptions['E'] = '-';
} else {
$aOptions['E'] = substr($options, strpos($options, 'E') + 1, 1);
}
// ftp://
if (strpos($options, 'F') === false) {
$aOptions['F'] = '+';
} else {
$aOptions['F'] = substr($options, strpos($options, 'F') + 1, 1);
}
// User section
if (strpos($options, 'u') === false) {
$aOptions['u'] = '?';
} else {
$aOptions['u'] = substr($options, strpos($options, 'u') + 1, 1);
}
// Password in user section
if (strpos($options, 'P') === false) {
$aOptions['P'] = '?';
} else {
$aOptions['P'] = substr($options, strpos($options, 'P') + 1, 1);
}
// Address Section
if (strpos($options, 'a') === false) {
$aOptions['a'] = '+';
} else {
$aOptions['a'] = substr($options, strpos($options, 'a') + 1, 1);
}
// IP Address in address section
if (strpos($options, 'I') === false) {
$aOptions['I'] = '?';
} else {
$aOptions['I'] = substr($options, strpos($options, 'I') + 1, 1);
}
// Port number
if (strpos($options, 'p') === false) {
$aOptions['p'] = '?';
} else {
$aOptions['p'] = substr($options, strpos($options, 'p') + 1, 1);
}
// File Path
if (strpos($options, 'f') === false) {
$aOptions['f'] = '?';
} else {
$aOptions['f'] = substr($options, strpos($options, 'f') + 1, 1);
}
// Query Section
if (strpos($options, 'q') === false) {
$aOptions['q'] = '-';
} else {
$aOptions['q'] = substr($options, strpos($options, 'q') + 1, 1);
}
// Fragment (Anchor)
if (strpos($options, 'r') === false) {
$aOptions['r'] = '-';
} else {
$aOptions['r'] = substr($options, strpos($options, 'r') + 1, 1);
}
// Generate options
$newoptions = '';
foreach ($aOptions as $key => $value) {
$newoptions .= $key.$value;
}
// Send to validateUrlSyntax() and return result
return validateUrlSyntax($ftpaddr, $newoptions);
} // END Function validateFtpSyntax()