MDL-17457 migrated all modules to new db/install.php; added upgrade.txt file for devs converting contrib modules

This commit is contained in:
skodak 2009-01-12 21:13:28 +00:00
parent c20ce8742a
commit 9c82ff2acd
38 changed files with 445 additions and 354 deletions

View File

@ -382,7 +382,7 @@ function get_db_directories() {
* @param string $return The url to prompt the user to continue to
*/
function upgrade_plugins($type, $dir) {
global $CFG, $interactive, $DB;
global $CFG, $DB;
/// special cases
if ($type === 'mod') {
@ -521,20 +521,14 @@ function upgrade_plugins($type, $dir) {
/**
* Find and check all modules and load them up or upgrade them if necessary
*
* @uses $CFG
* @param string $return The url to prompt the user to continue to
* @todo Finish documenting this function
*/
function upgrade_activity_modules() {
global $CFG, $interactive, $DB, $unittest;
global $CFG, $DB;
if (!$mods = get_list_of_plugins('mod') ) {
print_error('nomodules', 'debug');
}
$updated_modules = false;
$strmodulesetup = get_string('modulesetup');
foreach ($mods as $mod) {
@ -547,11 +541,11 @@ function upgrade_activity_modules() {
unset($module);
if ( is_readable($fullmod .'/version.php')) {
include_once($fullmod .'/version.php'); // defines $module with version etc
if (is_readable($fullmod .'/version.php')) {
require($fullmod .'/version.php'); // defines $module with version etc
} else {
notify('Module '. $mod .': '. $fullmod .'/version.php was not readable');
continue;
error('Module '. $mod .': '. $fullmod .'/version.php was not readable'); // TODO: localise
}
$newupgrade = false;
@ -573,7 +567,6 @@ function upgrade_activity_modules() {
$info->requiremoodle = $module->requires;
upgrade_log_start();
notify(get_string('modulerequirementsnotmet', 'error', $info));
$updated_modules = true;
continue;
}
}
@ -627,8 +620,6 @@ function upgrade_activity_modules() {
/// Update message providers
message_update_providers('mod/'.$module->name);
$updated_modules = true;
} else {
print_error('cannotdowngrade', 'debug', '', (object)array('oldversion'=>$currmodule->version, 'newversion'=>$module->version));
}
@ -636,46 +627,31 @@ function upgrade_activity_modules() {
} else { // module not installed yet, so install it
upgrade_log_start();
print_heading($module->name);
$updated_modules = true;
// To avoid unnecessary output from the SQL queries in the CLI version
@set_time_limit(0); // To allow slow databases to complete the long SQL
/// Both old .sql files and new install.xml are supported
/// but we priorize install.xml (XMLDB) if present
if (file_exists($fullmod . '/db/install.xml')) {
$DB->get_manager()->install_from_xmldb_file($fullmod . '/db/install.xml'); //New method
$status = true;
/// Execute install.xml (XMLDB) - must be present
$DB->get_manager()->install_from_xmldb_file($fullmod . '/db/install.xml'); //New method
/// Post installation hook - optional
if (file_exists("$fullmod/db/install.php")) {
require_once("$fullmod/db/install.php");
$post_install_function = 'xmldb_'.$module->name.'_install';;
$post_install_function();
}
/// Continue with the installation, roles and other stuff
if ($status) {
if ($module->id = $DB->insert_record('modules', $module)) {
$module->id = $DB->insert_record('modules', $module);
/// Capabilities
update_capabilities('mod/'.$module->name);
/// Capabilities
update_capabilities('mod/'.$module->name);
/// Events
events_update_definition('mod/'.$module->name);
/// Events
events_update_definition('mod/'.$module->name);
/// Message providers
message_update_providers('mod/'.$module->name);
/// Message providers
message_update_providers('mod/'.$module->name);
/// Run local install function if there is one
$installfunction = $module->name.'_install';
if (function_exists($installfunction)) {
if (! $installfunction() ) {
notify('Encountered a problem running install function for '.$module->name.'!');
}
}
notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');
print_upgrade_separator();
} else {
print_error('cannotaddmodule', '', '', $module->name);
}
} else {
print_error('cannotsetuptable', 'debug', '', $module->name);
}
notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');
print_upgrade_separator();
}
/// Check submodules of this module if necessary
@ -710,8 +686,6 @@ function upgrade_activity_modules() {
}
}
}
return $updated_modules;
}
/**
@ -898,7 +872,6 @@ function upgrade_log_start($preinstall=false) {
build_navigation(array(array('name' => $strupgrade, 'link' => null, 'type' => 'misc'))), '',
upgrade_get_javascript(), false, ' ', ' ');
}
//$DB->set_debug(true); // should be configurable soon
ignore_user_abort(true);
register_shutdown_function('upgrade_finished_handler');

View File

@ -0,0 +1,18 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_assignment_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('assignment', 'view', 'assignment', 'name');
upgrade_log_display_entry('assignment', 'add', 'assignment', 'name');
upgrade_log_display_entry('assignment', 'update', 'assignment', 'name');
upgrade_log_display_entry('assignment', 'view submission', 'assignment', 'name');
upgrade_log_display_entry('assignment', 'upload', 'assignment', 'name');
}

View File

@ -61,15 +61,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('assignment', 'view', 'assignment', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('assignment', 'add', 'assignment', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('assignment', 'update', 'assignment', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('assignment', 'view submission', 'assignment', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('assignment', 'upload', 'assignment', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

View File

@ -1966,13 +1966,6 @@ class mod_assignment_upload_file_form extends moodleform {
/// OTHER STANDARD FUNCTIONS ////////////////////////////////////////////////////////
/**
* Code to be executed when a module is installed
*/
function assignment_install() {
return true;
}
/**
* Deletes an assignment instance
*

17
mod/chat/db/install.php Normal file
View File

@ -0,0 +1,17 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_chat_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('chat', 'view', 'chat', 'name');
upgrade_log_display_entry('chat', 'add', 'chat', 'name');
upgrade_log_display_entry('chat', 'update', 'chat', 'name');
upgrade_log_display_entry('chat', 'report', 'chat', 'name');
upgrade_log_display_entry('chat', 'talk', 'chat', 'name');
}

View File

@ -89,15 +89,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'view', 'chat', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'add', 'chat', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'update', 'chat', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'report', 'chat', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'talk', 'chat', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

19
mod/choice/db/install.php Normal file
View File

@ -0,0 +1,19 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_choice_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('choice', 'view', 'choice', 'name');
upgrade_log_display_entry('choice', 'update', 'choice', 'name');
upgrade_log_display_entry('choice', 'add', 'choice', 'name');
upgrade_log_display_entry('choice', 'report', 'choice', 'name');
upgrade_log_display_entry('choice', 'choose', 'choice', 'name');
upgrade_log_display_entry('choice', 'choose again', 'choice', 'name');
}

View File

@ -56,16 +56,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'view', 'choice', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'update', 'choice', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'add', 'choice', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'report', 'choice', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'choose', 'choice', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('choice', 'choose again', 'choice', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

21
mod/data/db/install.php Normal file
View File

@ -0,0 +1,21 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_data_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('data', 'view', 'data', 'name');
upgrade_log_display_entry('data', 'add', 'data', 'name');
upgrade_log_display_entry('data', 'update', 'data', 'name');
upgrade_log_display_entry('data', 'record delete', 'data', 'name');
upgrade_log_display_entry('data', 'fields add', 'data_fields', 'name');
upgrade_log_display_entry('data', 'fields update', 'data_fields', 'name');
upgrade_log_display_entry('data', 'templates saved', 'data', 'name');
upgrade_log_display_entry('data', 'templates def', 'data', 'name');
}

View File

@ -130,18 +130,4 @@
</KEYS>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'view', 'data', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'add', 'data', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'update', 'data', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'record delete', 'data', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'fields add', 'data_fields', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'fields update', 'data_fields', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'templates saved', 'data', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('data', 'templates def', 'data', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

View File

@ -0,0 +1,18 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_feedback_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('feedback', 'startcomplete', 'feedback', 'name');
upgrade_log_display_entry('feedback', 'submit', 'feedback', 'name');
upgrade_log_display_entry('feedback', 'delete', 'feedback', 'name');
upgrade_log_display_entry('feedback', 'view', 'feedback', 'name');
upgrade_log_display_entry('feedback', 'view all', 'course', 'shortname');
}

View File

@ -158,15 +158,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('feedback', 'startcomplete', 'feedback', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('feedback', 'submit', 'feedback', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('feedback', 'delete', 'feedback', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('feedback', 'view', 'feedback', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('feedback', 'view all', 'course', 'shortname')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

View File

@ -29,13 +29,6 @@ if(!isset($SESSION->feedback) OR !is_object($SESSION->feedback)) {
$SESSION->feedback = new object();
}
/**
* Code to be executed when a module is installed
*/
function feedback_install() {
return true;
}
/**
* @param string $feature FEATURE_xx constant for requested feature
* @return mixed True if module supports feature, null if doesn't know

25
mod/forum/db/install.php Normal file
View File

@ -0,0 +1,25 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_forum_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('forum', 'add', 'forum', 'name');
upgrade_log_display_entry('forum', 'update', 'forum', 'name');
upgrade_log_display_entry('forum', 'add discussion', 'forum_discussions', 'name');
upgrade_log_display_entry('forum', 'add post', 'forum_posts', 'subject');
upgrade_log_display_entry('forum', 'update post', 'forum_posts', 'subject');
upgrade_log_display_entry('forum', 'user report', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)');
upgrade_log_display_entry('forum', 'move discussion', 'forum_discussions', 'name');
upgrade_log_display_entry('forum', 'view subscribers', 'forum', 'name');
upgrade_log_display_entry('forum', 'view discussion', 'forum_discussions', 'name');
upgrade_log_display_entry('forum', 'view forum', 'forum', 'name');
upgrade_log_display_entry('forum', 'subscribe', 'forum', 'name');
upgrade_log_display_entry('forum', 'unsubscribe', 'forum', 'name');
}

View File

@ -166,22 +166,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'add', 'forum', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'update', 'forum', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'add discussion', 'forum_discussions', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'add post', 'forum_posts', 'subject')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'update post', 'forum_posts', 'subject')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'user report', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'move discussion', 'forum_discussions', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'view subscribers', 'forum', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'view discussion', 'forum_discussions', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'view forum', 'forum', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'subscribe', 'forum', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('forum', 'unsubscribe', 'forum', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

View File

@ -30,14 +30,6 @@ define ('FORUM_AGGREGATE_SUM', 5);
/// STANDARD FUNCTIONS ///////////////////////////////////////////////////////////
/**
* Code to be executed when a module is installed
*/
function forum_install() {
return true;
}
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function

View File

@ -0,0 +1,27 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_glossary_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('glossary', 'add', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'update', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'view', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'view all', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'add entry', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'update entry', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'add category', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'update category', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'delete category', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'add comment', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'update comment', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'delete comment', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'approve entry', 'glossary', 'name');
upgrade_log_display_entry('glossary', 'view entry', 'glossary_entries', 'concept');
}

View File

@ -151,24 +151,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'view', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'view all', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add entry', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update entry', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add category', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update category', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'delete category', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'add comment', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'update comment', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'delete comment', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'approve entry', 'glossary', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('glossary', 'view entry', 'glossary_entries', 'concept')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

17
mod/hotpot/db/install.php Normal file
View File

@ -0,0 +1,17 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_hotpot_install() {
global $DB;
/// Disable it by default
$DB->set_field('modules', 'visible', 0, array('name'=>'hotpot'));
/// Install logging support here
}

View File

@ -18,6 +18,13 @@ function xmldb_hotpot_upgrade($oldversion) {
// ensure "hotpot_upgrade_grades" function is available
require_once $CFG->dirroot.'/mod/hotpot/lib.php';
hotpot_upgrade_grades();
upgrade_mod_savepoint(true, 2007101511, 'hotpot');
}
if ($result && $oldversion < 2008011200) {
// remove not used setting
unset_config('hotpot_initialdisable');
upgrade_mod_savepoint(true, 2008011200, 'hotpot');
}
return $result;

View File

@ -1,9 +0,0 @@
<?php // $Id$
if (empty($CFG->hotpot_initialdisable)) {
if (!$DB->count_records('hotpot')) {
$DB->set_field('modules', 'visible', 0, array('name'=>'hotpot')); // Disable it by default
set_config('hotpot_initialdisable', 1);
}
}
?>

View File

@ -3,7 +3,7 @@
/// Code fragment to define the version of hotpot
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2007101511; // release date of this version (see note below)
$module->version = 2008011200; // release date of this version (see note below)
$module->release = 'v2.4.2'; // human-friendly version name (used in mod/hotpot/lib.php)
$module->requires = 2007101509; // Requires this Moodle version
$module->cron = 0; // period for cron to check this module (secs)

15
mod/label/db/install.php Normal file
View File

@ -0,0 +1,15 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_label_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('label', 'add', 'label', 'name');
upgrade_log_display_entry('label', 'update', 'label', 'name');
}

View File

@ -20,12 +20,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('label', 'add', 'label', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('label', 'update', 'label', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

16
mod/lesson/db/install.php Normal file
View File

@ -0,0 +1,16 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_lesson_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('lesson', 'start', 'lesson', 'name');
upgrade_log_display_entry('lesson', 'end', 'lesson', 'name');
upgrade_log_display_entry('lesson', 'view', 'lesson_pages', 'title');
}

View File

@ -225,13 +225,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('lesson', 'start', 'lesson', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('lesson', 'end', 'lesson', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('lesson', 'view', 'lesson_pages', 'title')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

View File

@ -11,14 +11,6 @@ require_once($CFG->libdir.'/eventslib.php');
define("LESSON_MAX_EVENT_LENGTH", "432000"); // 5 days maximum
/**
* Code to be executed when a module is installed
*/
function lesson_install() {
return true;
}
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function

40
mod/quiz/db/install.php Normal file
View File

@ -0,0 +1,40 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_quiz_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('quiz', 'add', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'update', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'view', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'report', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'attempt', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'submit', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'review', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'editquestions', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'preview', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'start attempt', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'close attempt', 'quiz', 'name');
upgrade_log_display_entry('quiz', 'continue attempt', 'quiz', 'name');
$record = new object();
$record->name = 'overview';
$record->displayorder = '10000';
$DB->insert_record('quiz_report', $record);
$record = new object();
$record->name = 'responses';
$record->displayorder = '9000';
$DB->insert_record('quiz_report', $record);
$record = new object();
$record->name = 'grading';
$record->displayorder = '6000';
$DB->insert_record('quiz_report', $record);
}

View File

@ -121,29 +121,4 @@
</KEYS>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display" NEXT="insert quiz_report">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'add', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'update', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'view', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'report', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'attempt', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'submit', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'review', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'editquestions', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'preview', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'start attempt', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'close attempt', 'quiz', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('quiz', 'continue attempt', 'quiz', 'name')" />
</SENTENCES>
</STATEMENT>
<STATEMENT NAME="insert quiz_report" TYPE="insert" TABLE="quiz_report" COMMENT="Initial insert of records on table quiz_report" PREVIOUS="insert log_display">
<SENTENCES>
<SENTENCE TEXT="(name, displayorder) VALUES ('overview', '10000')" />
<SENTENCE TEXT="(name, displayorder) VALUES ('responses', '9000')" />
<SENTENCE TEXT="(name, displayorder) VALUES ('grading', '6000')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

View File

@ -67,13 +67,6 @@ define("QUIZ_MAX_EVENT_LENGTH", 5*24*60*60); // 5 days maximum
/// FUNCTIONS ///////////////////////////////////////////////////////////////////
/**
* Code to be executed when a module is installed
*/
function quiz_install() {
return true;
}
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function

View File

@ -0,0 +1,17 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_resource_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('resource', 'view', 'resource', 'name');
upgrade_log_display_entry('resource', 'update', 'resource', 'name');
upgrade_log_display_entry('resource', 'add', 'resource', 'name');
}

View File

@ -25,13 +25,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('resource', 'view', 'resource', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('resource', 'update', 'resource', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('resource', 'add', 'resource', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

17
mod/scorm/db/install.php Normal file
View File

@ -0,0 +1,17 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_scorm_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('scorm', 'view', 'scorm', 'name');
upgrade_log_display_entry('scorm', 'review', 'scorm', 'name');
upgrade_log_display_entry('scorm', 'update', 'scorm', 'name');
upgrade_log_display_entry('scorm', 'add', 'scorm', 'name');
}

View File

@ -194,14 +194,4 @@
</KEYS>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('scorm', 'view', 'scorm', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('scorm', 'review', 'scorm', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('scorm', 'update', 'scorm', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('scorm', 'add', 'scorm', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

112
mod/survey/db/install.php Normal file
View File

@ -0,0 +1,112 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_survey_install() {
global $DB;
/// Install logging support
upgrade_log_display_entry('survey', 'add', 'survey', 'name');
upgrade_log_display_entry('survey', 'update', 'survey', 'name');
upgrade_log_display_entry('survey', 'download', 'survey', 'name');
upgrade_log_display_entry('survey', 'view form', 'survey', 'name');
upgrade_log_display_entry('survey', 'view graph', 'survey', 'name');
upgrade_log_display_entry('survey', 'view report', 'survey', 'name');
upgrade_log_display_entry('survey', 'submit', 'survey', 'name');
/// insert survey data
$records = array(
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44')),
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44')),
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44')),
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68')),
array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'ciqname', 'ciqintro', '69,70,71,72,73')),
);
foreach ($records as $record) {
$DB->insert_record('survey', $record, false);
}
$records = array(
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles1', 'colles1short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles2', 'colles2short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles3', 'colles3short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles4', 'colles4short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles5', 'colles5short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles6', 'colles6short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles7', 'colles7short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles8', 'colles8short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles9', 'colles9short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles10', 'colles10short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles11', 'colles11short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles12', 'colles12short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles13', 'colles13short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles14', 'colles14short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles15', 'colles15short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles16', 'colles16short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles17', 'colles17short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles18', 'colles18short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles19', 'colles19short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles20', 'colles20short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles21', 'colles21short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles22', 'colles22short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles23', 'colles23short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('colles24', 'colles24short', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5')),
array_combine(array('text', 'type', 'options'), array('howlong', 1, 'howlongoptions')),
array_combine(array('text', 'type'), array('othercomments', 0)),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls1', 'attls1short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls2', 'attls2short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls3', 'attls3short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls4', 'attls4short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls5', 'attls5short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls6', 'attls6short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls7', 'attls7short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls8', 'attls8short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls9', 'attls9short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls10', 'attls10short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls11', 'attls11short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls12', 'attls12short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls13', 'attls13short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls14', 'attls14short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls15', 'attls15short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls16', 'attls16short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls17', 'attls17short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls18', 'attls18short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls19', 'attls19short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type', 'options'), array('attls20', 'attls20short', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('-', '-', '-', '-', 0, '-')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'multi', 'intro', 'type', 'options'), array('attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5')),
array_combine(array('text', 'shorttext', 'type'), array('ciq1', 'ciq1short', 0)),
array_combine(array('text', 'shorttext', 'type'), array('ciq2', 'ciq2short', 0)),
array_combine(array('text', 'shorttext', 'type'), array('ciq3', 'ciq3short', 0)),
array_combine(array('text', 'shorttext', 'type'), array('ciq4', 'ciq4short', 0)),
array_combine(array('text', 'shorttext', 'type'), array('ciq5', 'ciq5short', 0)),
);
foreach ($records as $record) {
$DB->insert_record('survey_questions', $record, false);
}
}

View File

@ -69,103 +69,4 @@
</INDEXES>
</TABLE>
</TABLES>
<STATEMENTS>
<STATEMENT NAME="insert survey" TYPE="insert" TABLE="survey" COMMENT="Initial insert of records on table survey" NEXT="insert survey_questions">
<SENTENCES>
<SENTENCE TEXT="(course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44')" />
<SENTENCE TEXT="(course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collespname', 'collespintro', '31,32,33,34,35,36,43,44')" />
<SENTENCE TEXT="(course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'collesapname', 'collesapintro', '37,38,39,40,41,42,43,44')" />
<SENTENCE TEXT="(course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'attlsname', 'attlsintro', '65,67,68')" />
<SENTENCE TEXT="(course, template, days, timecreated, timemodified, name, intro, questions) VALUES (0, 0, 0, 985017600, 985017600, 'ciqname', 'ciqintro', '69,70,71,72,73')" />
</SENTENCES>
</STATEMENT>
<STATEMENT NAME="insert survey_questions" TYPE="insert" TABLE="survey_questions" COMMENT="Initial insert of records on table survey_questions" PREVIOUS="insert survey" NEXT="insert log_display">
<SENTENCES>
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles1', 'colles1short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles2', 'colles2short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles3', 'colles3short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles4', 'colles4short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles5', 'colles5short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles6', 'colles6short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles7', 'colles7short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles8', 'colles8short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles9', 'colles9short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles10', 'colles10short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles11', 'colles11short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles12', 'colles12short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles13', 'colles13short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles14', 'colles14short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles15', 'colles15short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles16', 'colles16short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles17', 'colles17short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles18', 'colles18short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles19', 'colles19short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles20', 'colles20short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles21', 'colles21short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles22', 'colles22short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles23', 'colles23short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('colles24', 'colles24short', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 1, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 2, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 2, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 2, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 2, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 2, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 2, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm1', 'collesm1short', '1,2,3,4', 'collesmintro', 3, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm2', 'collesm2short', '5,6,7,8', 'collesmintro', 3, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm3', 'collesm3short', '9,10,11,12', 'collesmintro', 3, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm4', 'collesm4short', '13,14,15,16', 'collesmintro', 3, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm5', 'collesm5short', '17,18,19,20', 'collesmintro', 3, 'scaletimes5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('collesm6', 'collesm6short', '21,22,23,24', 'collesmintro', 3, 'scaletimes5')" />
<SENTENCE TEXT="(text, type, options) VALUES ('howlong', 1, 'howlongoptions')" />
<SENTENCE TEXT="(text, type) VALUES ('othercomments', 0)" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls1', 'attls1short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls2', 'attls2short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls3', 'attls3short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls4', 'attls4short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls5', 'attls5short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls6', 'attls6short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls7', 'attls7short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls8', 'attls8short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls9', 'attls9short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls10', 'attls10short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls11', 'attls11short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls12', 'attls12short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls13', 'attls13short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls14', 'attls14short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls15', 'attls15short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls16', 'attls16short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls17', 'attls17short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls18', 'attls18short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls19', 'attls19short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type, options) VALUES ('attls20', 'attls20short', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('attlsm1', 'attlsm1', '45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64', 'attlsmintro', 1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('-', '-', '-', '-', 0, '-')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('attlsm2', 'attlsm2', '63,62,59,57,55,49,52,50,48,47', 'attlsmintro', -1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, multi, intro, type, options) VALUES ('attlsm3', 'attlsm3', '46,54,45,51,60,53,56,58,61,64', 'attlsmintro', -1, 'scaleagree5')" />
<SENTENCE TEXT="(text, shorttext, type) VALUES ('ciq1', 'ciq1short', 0)" />
<SENTENCE TEXT="(text, shorttext, type) VALUES ('ciq2', 'ciq2short', 0)" />
<SENTENCE TEXT="(text, shorttext, type) VALUES ('ciq3', 'ciq3short', 0)" />
<SENTENCE TEXT="(text, shorttext, type) VALUES ('ciq4', 'ciq4short', 0)" />
<SENTENCE TEXT="(text, shorttext, type) VALUES ('ciq5', 'ciq5short', 0)" />
</SENTENCES>
</STATEMENT>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display" PREVIOUS="insert survey_questions">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'add', 'survey', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'update', 'survey', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'download', 'survey', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'view form', 'survey', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'view graph', 'survey', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'view report', 'survey', 'name')" />
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('survey', 'submit', 'survey', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>

22
mod/upgrade.txt Normal file
View File

@ -0,0 +1,22 @@
This files describes API changes in /mod/* - activity modules,
information provided here is intended especially for developers.
=== 2.0 ===
required changes in code:
* use new DML syntax everywhere
* use new DDL syntax in db/upgrade.php
* replace defaults.php by settings.php and db/install.php
* replace STATEMENTS section in db/install.xml by db/install.php
* move post instalation code from lib.php into db/install.php
* completely rewrite file handling
* rewrite backup/restore
optional - no changes needed in older code:
* portfolio support
* course completion tracking support
* lib.php/xxx_supports() may describe module features and capabilities
TODO: add links to docs

13
mod/wiki/db/install.php Normal file
View File

@ -0,0 +1,13 @@
<?php //$Id$
// This file replaces:
// * STATEMENTS section in db/install.xml
// * lib.php/modulename_install() post installation hook
// * partially defaults.php
function xmldb_wiki_install() {
global $DB;
/// Install logging support here
}