-/* check if the glossary terms exist */
-/* Commented by Cindy Li on Jan 7, 2010. Transformable does not include glossary
-$glossary_path = '';
-if ($content_type == 'IMS Common Cartridge'){
- $glossary_path = 'resources/GlossaryItem/';
-// $package_base_path = '';
-}
-if (file_exists($import_path . $glossary_path . 'glossary.xml')){
- $glossary_xml = @file_get_contents($import_path.$glossary_path.'glossary.xml');
- $element_path = array();
- $xml_parser = xml_parser_create();
-
- // insert the glossary terms into the database (if they're not in there already)
- // parse the glossary.xml file and insert the terms
- xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); // conform to W3C specs
- xml_set_element_handler($xml_parser, 'glossaryStartElement', 'glossaryEndElement');
- xml_set_character_data_handler($xml_parser, 'glossaryCharacterData');
-
- if (!xml_parse($xml_parser, $glossary_xml, true)) {
- die(sprintf("XML error: %s at line %d",
- xml_error_string(xml_get_error_code($xml_parser)),
- xml_get_current_line_number($xml_parser)));
- }
- xml_parser_free($xml_parser);
- $contains_glossary_terms = true;
- foreach ($imported_glossary as $term => $defn) {
- if (!$glossary[$term]) {
- $sql = "INSERT INTO ".TABLE_PREFIX."glossary VALUES (NULL, $_SESSION[course_id], '$term', '$defn', 0)";
- mysql_query($sql, $db);
- }
- }
-}
-*/