]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18910 normalised module intro and introformat
authorskodak <skodak>
Mon, 20 Apr 2009 19:57:04 +0000 (19:57 +0000)
committerskodak <skodak>
Mon, 20 Apr 2009 19:57:04 +0000 (19:57 +0000)
19 files changed:
mod/choice/db/install.xml
mod/choice/db/upgrade.php
mod/data/db/install.xml
mod/data/db/upgrade.php
mod/feedback/db/install.xml
mod/feedback/db/upgrade.php
mod/forum/db/install.xml
mod/forum/db/upgrade.php
mod/glossary/db/install.xml
mod/glossary/db/upgrade.php
mod/scorm/backuplib.php
mod/scorm/db/install.xml
mod/scorm/db/upgrade.php
mod/scorm/index.php
mod/scorm/locallib.php
mod/scorm/mod_form.php
mod/scorm/restorelib.php
mod/scorm/version.php
mod/scorm/view.php

index b6f1889f3455523b57b7bf8e452e8e3cad648715..c14ed3bfb92cebe9fbe5827c9b5dbcdbda4faa2d 100644 (file)
@@ -10,7 +10,7 @@
         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
         <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
-        <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="publish"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="publish"/>
         <FIELD NAME="publish" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="showresults"/>
         <FIELD NAME="showresults" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="publish" NEXT="display"/>
         <FIELD NAME="display" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="showresults" NEXT="allowupdate"/>
index 2c7eb5f1ab5eadc80e9c9e26334f0c7ce59b78c1..c636000d188b4bfa554f81719ac31a60b84247ab 100644 (file)
@@ -45,7 +45,7 @@ function xmldb_choice_upgrade($oldversion) {
 
     /// Rename field format on table choice to NEWNAMEGOESHERE
         $table = new xmldb_table('choice');
-        $field = new xmldb_field('format', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+        $field = new xmldb_field('format', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
 
     /// Launch rename field format
         $dbman->rename_field($table, $field, 'introformat');
index 7920a2f46947a75f67815b20800a6f8cc739a72a..cca08c379ebbdedcace305aa7c94d62e1b2ab803 100644 (file)
@@ -10,7 +10,7 @@
         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
         <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
-        <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="comments"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="comments"/>
         <FIELD NAME="comments" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="timeavailablefrom"/>
         <FIELD NAME="timeavailablefrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="comments" NEXT="timeavailableto"/>
         <FIELD NAME="timeavailableto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeavailablefrom" NEXT="timeviewfrom"/>
index 0847570abfd0e65eecb77857585a5999126801f3..e4f911f79ebb773844b6e0d76ddcb0e0dcf7bb42 100644 (file)
@@ -171,7 +171,7 @@ function xmldb_data_upgrade($oldversion) {
 
     /// Define field introformat to be added to data
         $table = new xmldb_table('data');
-        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
 
     /// Launch add field introformat
         $dbman->add_field($table, $field);
index ae6a4e5b7e5622692e660a5a678e346bfa59a8ac..ec3c24a37838fe9908807c9dfd8d4c000991f0c1 100644 (file)
@@ -10,7 +10,7 @@
         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
         <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
-        <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="anonymous"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="anonymous"/>
         <FIELD NAME="anonymous" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="email_notification"/>
         <FIELD NAME="email_notification" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="anonymous" NEXT="multiple_submit"/>
         <FIELD NAME="multiple_submit" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="email_notification" NEXT="autonumbering"/>
index e46d9c8b77018cc7541037c57e5a895669d1f3dc..31d0e9191e93ef80e093bc1e27cdf29cf43b10dc 100644 (file)
@@ -268,12 +268,10 @@ function xmldb_feedback_upgrade($oldversion) {
 
     /// Define field introformat to be added to feedback
         $table = new xmldb_table('feedback');
-        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
 
-    /// Conditionally launch add field introformat
-        if (!$dbman->field_exists($table, $field)) {
-            $dbman->add_field($table, $field);
-        }
+    /// Launch add field introformat
+        $dbman->add_field($table, $field);
 
     /// feedback savepoint reached
         upgrade_mod_savepoint($result, 2009042001, 'feedback');
index d874ed514bfe0eaf6f29c377dcd5805ea19e7609..d07b8e5c2ffb3843e1eabda1df0fd149e9697d0e 100644 (file)
@@ -11,7 +11,7 @@
         <FIELD NAME="type" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="general" SEQUENCE="false" ENUM="true" ENUMVALUES="'single', 'news', 'general', 'social', 'eachuser', 'teacher', 'qanda'" PREVIOUS="course" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="type" NEXT="intro"/>
         <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
-        <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="text format of intro field" PREVIOUS="intro" NEXT="assessed"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="text format of intro field" PREVIOUS="intro" NEXT="assessed"/>
         <FIELD NAME="assessed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="assesstimestart"/>
         <FIELD NAME="assesstimestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assessed" NEXT="assesstimefinish"/>
         <FIELD NAME="assesstimefinish" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="assesstimestart" NEXT="scale"/>
index 2ff19731d6d7d0a0c427159a5ade9f1b3d548e3c..8a1e4a5842e3372bed44c6382f5c5ac4c18c099b 100644 (file)
@@ -224,7 +224,7 @@ function xmldb_forum_upgrade($oldversion) {
 
     /// Define field introformat to be added to forum
         $table = new xmldb_table('forum');
-        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
 
     /// Launch add field introformat
         $dbman->add_field($table, $field);
index ee25a196ba79150c8fd61d51f5a7e01c7e465c3e..33ddc390553730941c4203ba6d78cc77d9dfabe4 100644 (file)
@@ -10,7 +10,7 @@
         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
         <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
-        <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="allowduplicatedentries"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="allowduplicatedentries"/>
         <FIELD NAME="allowduplicatedentries" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="displayformat"/>
         <FIELD NAME="displayformat" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="dictionary" SEQUENCE="false" ENUM="false" PREVIOUS="allowduplicatedentries" NEXT="mainglossary"/>
         <FIELD NAME="mainglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayformat" NEXT="showspecial"/>
index 9f241233896724f87a47bf0c7fcffe0f7134ef62..6322fd8cda945750b229e20af5b786e67539289a 100644 (file)
@@ -194,7 +194,7 @@ function xmldb_glossary_upgrade($oldversion) {
 
     /// Define field introformat to be added to glossary
         $table = new xmldb_table('glossary');
-        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
 
     /// Conditionally launch add field introformat
         if (!$dbman->field_exists($table, $field)) {
index 0b083677abb44bc747c15241e31cec88c1406e70..50921ec337c9e136ca71f2a259dcffe3ee37e949 100755 (executable)
@@ -64,7 +64,7 @@
         fwrite ($bf,full_tag('GRADEMETHOD',4,false,$scorm->grademethod));
         fwrite ($bf,full_tag('LAUNCH',4,false,$scorm->launch));
         fwrite ($bf,full_tag('SKIPVIEW',4,false,$scorm->skipview));
-        fwrite ($bf,full_tag('SUMMARY',4,false,$scorm->summary));
+        fwrite ($bf,full_tag('SUMMARY',4,false,$scorm->intro));
         fwrite ($bf,full_tag('HIDEBROWSE',4,false,$scorm->hidebrowse));
         fwrite ($bf,full_tag('HIDETOC',4,false,$scorm->hidetoc));
         fwrite ($bf,full_tag('HIDENAV',4,false,$scorm->hidenav));
index 91e69572b526a434abb2dfb8a4092b1c71f75347..b2813aaffa6be286889a54e3df39e64a28c9be1f 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/scorm/db" VERSION="20080903" COMMENT="XMLDB file for Moodle mod/scorm"
+<XMLDB PATH="mod/scorm/db" VERSION="20090420" COMMENT="XMLDB file for Moodle mod/scorm"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
 >
         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="scormtype"/>
         <FIELD NAME="scormtype" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="local" SEQUENCE="false" ENUM="false" COMMENT="local, external or repository" PREVIOUS="name" NEXT="reference"/>
-        <FIELD NAME="reference" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="scormtype" NEXT="summary"/>
-        <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="reference" NEXT="version"/>
-        <FIELD NAME="version" TYPE="char" LENGTH="9" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="maxgrade"/>
+        <FIELD NAME="reference" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="scormtype" NEXT="intro"/>
+        <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="reference" NEXT="introformat"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="version"/>
+        <FIELD NAME="version" TYPE="char" LENGTH="9" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="maxgrade"/>
         <FIELD NAME="maxgrade" TYPE="float" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="grademethod"/>
         <FIELD NAME="grademethod" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxgrade" NEXT="whatgrade"/>
         <FIELD NAME="whatgrade" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grademethod" NEXT="maxattempt"/>
       </KEYS>
     </TABLE>
   </TABLES>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
index aa6788f89903ba755662607bf933af83c85bc979..b05b4e31356b1cf9863f0745a6891e0ade345a88 100644 (file)
@@ -400,6 +400,32 @@ function xmldb_scorm_upgrade($oldversion) {
         upgrade_mod_savepoint($result, 2008090310, 'scorm');
     }
 
+    if ($result && $oldversion < 2009042000) {
+
+    /// Rename field summary on table scorm to intro
+        $table = new xmldb_table('scorm');
+        $field = new xmldb_field('summary', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, null, 'reference');
+
+    /// Launch rename field summary
+        $dbman->rename_field($table, $field, 'intro');
+
+    /// scorm savepoint reached
+        upgrade_mod_savepoint($result, 2009042000, 'scorm');
+    }
+
+    if ($result && $oldversion < 2009042001) {
+
+    /// Define field introformat to be added to scorm
+        $table = new xmldb_table('scorm');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+
+    /// Launch add field introformat
+        $dbman->add_field($table, $field);
+
+    /// scorm savepoint reached
+        upgrade_mod_savepoint($result, 2009042001, 'scorm');
+    }
+
     return $result;
 }
 
index 41163d21979084c10c53bac8a3ac7184e553df86..7afbf08557e296195300265aff9ed8ab149eaa5a 100755 (executable)
             $report = scorm_grade_user($scorm, $USER->id);
             $reportshow = get_string('score','scorm').": ".$report;
         }
+        $options = (object)array('noclean'=>true);
         if (!$scorm->visible) {
            //Show dimmed if the mod is hidden
            $table->data[] = array ($tt, "<a class=\"dimmed\" href=\"view.php?id=$scorm->coursemodule\">".format_string($scorm->name)."</a>",
-                                   format_text($scorm->summary), $reportshow);
+                                   format_text($scorm->intro, $scorm->introformat, $options), $reportshow);
         } else {
            //Show normal if the mod is visible
            $table->data[] = array ($tt, "<a href=\"view.php?id=$scorm->coursemodule\">".format_string($scorm->name)."</a>",
-                                   format_text($scorm->summary), $reportshow);
+                                   format_text($scorm->intro, $scorm->introformat, $options), $reportshow);
         }
     }
 
index 0ea34b0752ee19087cd7e283efdc3f6543057656..35ead245d0bbdea3e064916be292ef410ab0044e 100755 (executable)
@@ -700,7 +700,8 @@ function scorm_course_format_display($user,$course) {
             }
             $colspan = ' colspan="2"';
         }
-        $headertext .= '</td></tr><tr><td'.$colspan.'>'.format_text(get_string('summary').':<br />'.$scorm->summary).'</td></tr></table>';
+        $options = (object)array('noclean'=>true);
+        $headertext .= '</td></tr><tr><td'.$colspan.'>'.get_string('summary').':<br />'.format_text($scorm->intro, $scorm->introformat, $options).'</td></tr></table>';
         print_simple_box($headertext,'','100%');
         scorm_view_display($user, $scorm, 'view.php?id='.$course->id, $cm, '100%');
     } else {
index 5dcb8c53424569d4e727458e287105d8b53777ee..33a0f097f887797ac7e82853080759adb67be3d3 100644 (file)
@@ -30,10 +30,10 @@ class mod_scorm_mod_form extends moodleform_mod {
         $mform->addRule('name', null, 'required', null, 'client');
 
 // Summary
-        $mform->addElement('htmleditor', 'summary', get_string('summary'));
-        $mform->setType('summary', PARAM_RAW);
-        $mform->addRule('summary', get_string('required'), 'required', null, 'client');
-        $mform->setHelpButton('summary', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton');
+        $mform->addElement('htmleditor', 'intro', get_string('summary'));
+        $mform->setType('intro', PARAM_RAW);
+        $mform->addRule('intro', get_string('required'), 'required', null, 'client');
+        $mform->setHelpButton('intro', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton');
 
 // Scorm types
         $options = array(SCORM_TYPE_LOCAL => get_string('typelocal', 'scorm'));
index 5f800f7982411c52304a01208d8bb62d6b620033..a9d8362470785ebecf8c0976473e4faad3625beb 100755 (executable)
@@ -75,7 +75,7 @@
             } else {
                 $scorm->skipview = backup_todb($info['MOD']['#']['SKIPVIEW']['0']['#']);
             }
-            $scorm->summary = backup_todb($info['MOD']['#']['SUMMARY']['0']['#']);
+            $scorm->intro = backup_todb($info['MOD']['#']['SUMMARY']['0']['#']);
             $scorm->hidebrowse = backup_todb($info['MOD']['#']['HIDEBROWSE']['0']['#']);
             $scorm->hidetoc = backup_todb($info['MOD']['#']['HIDETOC']['0']['#']);
             $scorm->hidenav = backup_todb($info['MOD']['#']['HIDENAV']['0']['#']);
         global $CFG;
         $status = true;
 
-        if ($scorms = $DB->get_records('scorm', array('course'=>$restore->course_id), '', "id,summary")) {
+        if ($scorms = $DB->get_records('scorm', array('course'=>$restore->course_id), '', "id,intro")) {
 
             $i = 0;   //Counter to send some output to the browser to avoid timeouts
             foreach ($scorms as $scorm) {
                 //Increment counter
                 $i++;
-                $content = $scorm->summary;
+                $content = $scorm->intro;
                 $result = restore_decode_content_links_worker($content,$restore);
 
                 if ($result != $content) {
                     //Update record
-                    $scorm->summary = $result;
+                    $scorm->intro = $result;
                     $status = $DB->update_record("scorm",$scorm);
                     if (debugging()) {
                         if (!defined('RESTORE_SILENTLY')) {
index 21df95ec5c3f2b1b0b2b66f19aa3cce93db38591..b0eb5c3c62a6b3120fa24124f8ef2d5faf7cc8db 100755 (executable)
@@ -10,8 +10,8 @@
 //       catch up now, so until 27th October please only increment in very tiny steps
 //       in HEAD, until we get past that date..
 
-$module->version  = 2008090310;   // The (date) version of this module
-$module->requires = 2008090108;   // The version of Moodle that is required
+$module->version  = 2009042001;   // The (date) version of this module
+$module->requires = 2009041700;   // The version of Moodle that is required
 $module->cron     = 300;            // How often should cron check this module (seconds)?
 
 ?>
\ No newline at end of file
index 25147a867da2c5a8523a3c7a61f6ef65b90a2b89..29011a4055da95ee8886d18b7c2f07e6a5d40f65 100755 (executable)
@@ -75,7 +75,8 @@
     if($scorm->displayattemptstatus == 1) {
         $attemptstatus = scorm_get_attempt_status($USER,$scorm);
     }
-    print_simple_box(format_text($scorm->summary).$attemptstatus, 'center', '70%', '', 5, 'generalbox', 'intro');
+    $options = (object)array('noclean'=>true);
+    print_simple_box(format_text($scorm->intro, $scorm->introformat, $options).$attemptstatus, 'center', '70%', '', 5, 'generalbox', 'intro');
     
     $scormopen = true;
     $timenow = time();