CC
class CC extends TsugiDOM
This class allows us to produce an IMS Common Cartridge Version 1.2
Usage to Create a ZIP file:
$zip = new ZipArchive();
if ($zip->open('cc.zip', ZipArchive::CREATE)!==TRUE) {
$cc_dom = new CC();
$cc_dom->set_title('Web Applications for Everybody');
$cc_dom->set_description('Awesome MOOC to learn PHP, MySQL, and JavaScript.');
$module = $cc_dom->add_module('Week 1');
$sub_module = $cc_dom->add_sub_module($module, 'Part 1');
$cc_dom->zip_add_url_to_module($zip, $sub_module, 'WA4E', 'https://www.wa4e.com');
$custom = array('exercise' => 'http_headers.php');
$cc_dom->zip_add_lti_to_module($zip, $sub_module, 'RRC',
'https://www.wa4e.com/tools/autograder/index.php', $custom);
$zip->addFromString('imsmanifest.xml',$cc_dom->saveXML());
$zip->close();
Constants
CC_1_1_CP |
|
WL_NS |
|
BLTI_NS |
|
TOPIC_NS |
|
LTICM_NS |
|
LTICP_NS |
|
LOM_NS |
|
LOMIMSCC_NS |
|
metadata_xpath |
|
item_xpath |
|
resource_xpath |
|
lom_general_xpath |
|
Properties
$currentNamespace | from TsugiDOM | ||
$resource_count | |||
$last_type | |||
$last_file | |||
$last_identifier | |||
$last_identifierref |
Methods
No description
No description
No description
Adds a module to the manifest
Adds a sub module to a module
No description
No description
Add an LTI link resource item
Add a resource to the manifest.
No description
No description
No description
No description
Details
at line 48
__construct()
in TsugiDOM at line 35
set_namespace($new)
in TsugiDOM at line 39
replace_text($tag, $text)
in TsugiDOM at line 43
replace_text_ns($ns, $tag, $text)
in TsugiDOM at line 54
delete_tag($tag)
in TsugiDOM at line 58
delete_tag_ns($ns, $tag)
in TsugiDOM at line 64
delete_children($tag)
in TsugiDOM at line 68
get_element($ns, $tag)
in TsugiDOM at line 82
delete_children_ns($ns, $tag)
in TsugiDOM at line 90
get_tag($tag, $key = null, $value = null)
in TsugiDOM at line 94
get_tag_ns($ns, $tag, $key = null, $value = null)
in TsugiDOM at line 109
add_child($entry, $tag, $text = null, $attr = null)
in TsugiDOM at line 113
add_child_ns($ns, $entry, $tag, $text = null, $attr = null)
in TsugiDOM at line 129
dump_dom_list($node_list)
in TsugiDOM at line 138
dump_dom_node($tag)
in TsugiDOM at line 143
dump_dom_levels($node, $level = 0)
at line 105
set_title($title)
at line 120
set_description($desc)
at line 134
the
add_module($title)
Adds a module to the manifest
at line 159
the
add_sub_module($module, $title)
Adds a sub module to a module
As a note, while some LMS's are happpy with deeply nested sub-module trees, other LMS's prefre a strict two-layer module / submodule structure.
at line 181
add_web_link($module, $title = null)
at line 203
add_topic($module, $title = null)
at line 225
The
add_lti_link($module, $title = null)
Add an LTI link resource item
This adds an LTI link to the manifest, to complete this when making a
zip file, you must generate and place the LTI XML in the returned file
name within the ZIP. The zip_add_lti_to_module()
combines these two steps.
at line 238
add_resource_item($module, $title, $type, $identifier, $file)
Add a resource to the manifest.