|
|
(2 intermediate revisions by one other user not shown) |
Line 12: |
Line 12: |
| === Implementation === | | === Implementation === |
|
| |
|
| Since Moodle 2.0 is still not ready for integration of any third-party format we will start development on experimental import extension for Moodle 1.9. In Moodle 1.9 the only supported third-party format (other than native moodle) is [http://www.blackboard.com/ Blackboard] 5.5&6. Blackboard package support is implemented through use of XSL transformation. That means that if we try to upload directly blacboard package moodle will detect that and transform package manifest using XSL transformation, reorder it's resources thus creating a moodle package and import that transformed package. This is a prefferd way of implementing support for importing any third-party format. The main reason for this is that there is no currently any API for managing restore of course content and that would mean that any third-party format developer would have to develop all that code again from scratch.
| | Based on initial discussions with Moodle developers general plan for implementing CC support is following: |
| | | * MDL-20591: Implement CC import in Moodle 1.9 - this is first step because Moodle 2.0 is still not ready for this kind of development. It will be done as experimental feature. |
| As we can see in restorelib.php blackboard conversion is initiated in function restore_precheck. That would be appropriate place for adding precheck for any other third-party format.
| | *Implement CC library in PHP for generating and manipulating CC packages. |
| | | *Implement CC export for Moodle 2.0 once CC library is done and new Backup system is finished |
| <code php>
| | *Implement CC import for Moodle 2.0 once changes to the restore system are finished. |
| <?php
| | *Implement basic support for CC authorization. |
| | |
| ...
| |
| | |
| function restore_precheck($id,$file,&$errorstr,$noredirect=false) {
| |
| | |
| ...
| |
| //Check for IMS Common Cartridge backups and convert
| |
| //Note that CC check goes before blackboard which is
| |
| //important based on how current detection of blackboard package is
| |
| //implemented
| |
| if ($status){
| |
| require_once("$CFG->dirroot/backup/cc/restore_cc.php");
| |
| if (!defined('RESTORE_SILENTLY')) {
| |
| echo "<li>".get_string("checkingforccexport").'</li>';
| |
| }
| |
| $status = ims_cc_convert($CFG->dataroot."/temp/backup/".$backup_unique_code);
| |
| }
| |
| | |
| ...
| |
| | |
| //Check for Blackboard backups and convert
| |
| if ($status){
| |
| require_once("$CFG->dirroot/backup/bb/restore_bb.php");
| |
| if (!defined('RESTORE_SILENTLY')) {
| |
| echo "<li>".get_string("checkingforbbexport").'</li>';
| |
| }
| |
| $status = blackboard_convert($CFG->dataroot."/temp/backup/".$backup_unique_code);
| |
| }
| |
| | |
| }
| |
| </code>
| |
| | |
| === Additional notes regarding package type detection ===
| |
| | |
| Current third-party format checking in Moodle 1.9 is far from being adequate. In case of blackboard type detection system only checks for existence of imsmanifest.xml. Almost all IMS based content packages use this file name for their manifest (blackboard, SCORM, Common Cartridge etc.). Therefore a better file type detection is needed, not only for the presence of the manifest file but also regarding it's content.
| |
| | |
| Every manifest has a specific xml namespaces that define organization of the file. By checking for specific item described in particular standard for a content type in question we can detect what type of package we are working with.
| |
| | |
| For example Common Cartridge manifest looks like this:
| |
| | |
| <code xml>
| |
| <?xml version="1.0" encoding="UTF-8" ?>
| |
| <manifest identifier="M102815" xmlns="http://www.imsglobal.org/xsd/imscc/imscp_v1p1"
| |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| |
| | |
| ...
| |
| | |
| </manifest>
| |
| </code>
| |
| | |
| By checking for existence and value of xmlns attribute we can reliably detect the type in question. As additional check a validation can be performed using XSD files from common cartridge definition.
| |
| | |
| This would be basic example of format detection function:
| |
| | |
| <code php>
| |
| function detect_backup_format(DOMDocument $xml_dom) {
| |
| | |
| $format = FORMAT_UNKNOWN;
| |
|
| |
| $rootNode = $xml_dom->documentElement;
| |
|
| |
| //Is it IMS manifest at all?
| |
| if ( is_object($rootNode)
| |
| && ($rootNode->tagName == 'manifest')
| |
| ) {
| |
| | |
| //Is it common cartridge
| |
| if ( $rootNode->hasAttribute('xmlns') ) {
| |
| $xmlns = $rootNode->getAttribute('xmlns');
| |
| if ($xmlns == <common cartridge namespace uri>) {
| |
| $format = FORMAT_COMMON_CARTRIDGE;
| |
| }
| |
| }
| |
| | |
| //Is it Blackboard
| |
| if ( ($format == FORMAT_UNKNOWN) && $rootNode->hasAttribute('xmlns:bb') ) {
| |
| $xmlns = $rootNode->getAttribute('xmlns:bb');
| |
| if ($xmlns == <blackboard 5.5 & 6 namespace uri>) {
| |
| $format = FORMAT_BLACK_BOARD;
| |
| }
| |
| }
| |
| | |
| }
| |
|
| |
| return $format;
| |
| }
| |
| </code>
| |
| | |
| === Mapping specific content type inside common cartridge into appropriate Moodle type ===
| |
| | |
| Based on the common cartridge profile document supported content types in common cartridge are these:
| |
| | |
| *folder
| |
| *web content
| |
| *web link
| |
| *discussion topic
| |
| *assesment (QTI assesment - quiz)
| |
| *associated content
| |
| *intra-package reference
| |
| *metadata
| |
| *question bank (in qti 1.2 format)
| |
| | |
| Investigation is required to determine exactly what maps to what, how long will it take to implement appropriate transformation etc.
| |
| | |
| For now we can say that following mappings apply:
| |
| | |
| {| class="nicetable"
| |
| |-
| |
| ! Moodle
| |
| ! Common Cartridge
| |
| |-
| |
| | Forum
| |
| | Discussion topic
| |
| |-
| |
| | Quiz
| |
| | QTI assesment
| |
| |-
| |
| | Link to static web page
| |
| | Web link or web content
| |
| |-
| |
| | Text page
| |
| | Web content
| |
| |-
| |
| | Web page
| |
| | Web content
| |
| |}
| |
| | |
| ====CC Discussion topic transformation to Moodle Forum====
| |
| | |
| An example of forum discussion topic:
| |
| | |
| <code xml>
| |
| | |
| <?xml version="1.0" encoding="UTF-8"?>
| |
| <dt:topic xmlns:dt="http://www.imsglobal.org/xsd/imsdt_v1p0"
| |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| |
| <title>Discussion Topic</title>
| |
| <text texttype="text/html"><h3>Hello World!</h3></text>
| |
| <attachments>
| |
| <attachment href="media/info.jpg"/>
| |
| </attachments>
| |
| </dt:topic>
| |
| | |
| </code>
| |
| | |
| Common Cartridge supports storing only forum topics. Forum topic contains only topic title, message text and optional attachments.
| |
| | |
| ====CC QTI assesment transformation to Moodle Quiz====
| |
| {Description to be added...}
| |
| | |
| ====CC web link/web content - web content transformation to Moodle web link/text page/web page====
| |
| | |
| Example of web link xml:
| |
| | |
| <code xml>
| |
| | |
| <?xml version="1.0" encoding="UTF-8"?>
| |
| <wl:webLink xmlns:wl="http://www.imsglobal.org/xsd/imswl_v1p0"
| |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
| |
| <title>WebLink Example</title>
| |
| <url href="http://www.uvcms.com" target="_parent" windowFeatures=""/>
| |
| </wl:webLink>
| |
| | |
| </code>
| |
|
| |
|
| === Additional Information === | | === Additional Information === |
| | *[[Backup 2.0 multiple formats|Backup 2.0 multiple formats]] |
| *[http://www.imsglobal.org/cc/index.html IMS Common Cartridge Specification] | | *[http://www.imsglobal.org/cc/index.html IMS Common Cartridge Specification] |
| *[http://www.imsglobal.org/cc/ccfaqs.html IMS Common Cartridge FAQ] | | *[http://www.imsglobal.org/cc/ccfaqs.html IMS Common Cartridge FAQ] |
| | *[http://www.imsglobal.org/cc/authv1p0/imscc_authv1p0.html IMS Common Cartridge Authorization Web Service] |