diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php index 0396271ac02..c57b1540b58 100644 --- a/blocks/admin/block_admin.php +++ b/blocks/admin/block_admin.php @@ -124,7 +124,7 @@ class block_admin extends block_list { $this->content->icons[]=''; } - $this->content->items[]=''.get_string('grades').'...'; + $this->content->items[]=''.get_string('grades').'...'; $this->content->icons[]=''; $this->content->items[]=''.get_string('logs').'...'; @@ -146,7 +146,7 @@ class block_admin extends block_list { } else if (!isguest()) { // Students menu if ($course->showgrades) { - $this->content->items[]=''.get_string('grades').'...'; + $this->content->items[]=''.get_string('grades').'...'; $this->content->icons[]=''; } if ($course->showreports) { diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 6cbec46e0eb..18509b333e9 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -1253,6 +1253,65 @@ function main_upgrade($oldversion=0) { ) TYPE=MyISAM COMMENT='Rules for calculating local wall clock time for users';"); } + if ($oldversion < 2005032800) { + execute_sql("CREATE TABLE `{$CFG->prefix}grade_category` ( + `id` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) default NULL, + `courseid` int(10) unsigned NOT NULL default '0', + `drop_x_lowest` int(10) unsigned NOT NULL default '0', + `bonus_points` int(10) unsigned NOT NULL default '0', + `hidden` int(10) unsigned NOT NULL default '0', + `weight` decimal(4,2) default '0.00', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) + ) TYPE=MyISAM ;"); + + execute_sql("CREATE TABLE `{$CFG->prefix}grade_exceptions` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned NOT NULL default '0', + `grade_itemid` int(10) unsigned NOT NULL default '0', + `userid` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) + ) TYPE=MyISAM ;"); + + + execute_sql("CREATE TABLE `{$CFG->prefix}grade_item` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned default NULL, + `category` int(10) unsigned default NULL, + `modid` int(10) unsigned default NULL, + `cminstance` int(10) unsigned default NULL, + `scale_grade` float(11,10) default '1.0000000000', + `extra_credit` int(10) unsigned NOT NULL default '0', + `sort_order` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) + ) TYPE=MyISAM ;"); + + + execute_sql("CREATE TABLE `{$CFG->prefix}grade_letter` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned NOT NULL default '0', + `letter` varchar(8) NOT NULL default 'NA', + `grade_high` decimal(4,2) NOT NULL default '100.00', + `grade_low` decimal(4,2) NOT NULL default '0.00', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) + ) TYPE=MyISAM ;"); + + + execute_sql("CREATE TABLE `{$CFG->prefix}grade_preferences` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned default NULL, + `preference` int(10) NOT NULL default '0', + `value` int(10) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `courseidpreference` (`courseid`,`preference`) + ) TYPE=MyISAM ;"); + + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index fda0471bc04..beb0c09a038 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -220,6 +220,88 @@ CREATE TABLE `prefix_cache_text` ( # -------------------------------------------------------- +# +# Table structure for table `grade_category` +# + +CREATE TABLE `prefix_grade_category` ( + `id` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) default NULL, + `courseid` int(10) unsigned NOT NULL default '0', + `drop_x_lowest` int(10) unsigned NOT NULL default '0', + `bonus_points` int(10) unsigned NOT NULL default '0', + `hidden` int(10) unsigned NOT NULL default '0', + `weight` decimal(4,2) default '0.00', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) +) TYPE=MyISAM ; + +# -------------------------------------------------------- + +# +# Table structure for table `grade_exceptions` +# + +CREATE TABLE `prefix_grade_exceptions` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned NOT NULL default '0', + `grade_itemid` int(10) unsigned NOT NULL default '0', + `userid` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) +) TYPE=MyISAM ; + +# -------------------------------------------------------- + +# +# Table structure for table `grade_item` +# + +CREATE TABLE `prefix_grade_item` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned default NULL, + `category` int(10) unsigned default NULL, + `modid` int(10) unsigned default NULL, + `cminstance` int(10) unsigned default NULL, + `scale_grade` float(11,10) default '1.0000000000', + `extra_credit` int(10) unsigned NOT NULL default '0', + `sort_order` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) +) TYPE=MyISAM ; + +# -------------------------------------------------------- + +# +# Table structure for table `grade_letter` +# + +CREATE TABLE `prefix_grade_letter` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned NOT NULL default '0', + `letter` varchar(8) NOT NULL default 'NA', + `grade_high` decimal(4,2) NOT NULL default '100.00', + `grade_low` decimal(4,2) NOT NULL default '0.00', + PRIMARY KEY (`id`), + KEY `courseid` (`courseid`) +) TYPE=MyISAM ; + +# -------------------------------------------------------- + +# +# Table structure for table `grade_preferences` +# + +CREATE TABLE `prefix_grade_preferences` ( + `id` int(10) unsigned NOT NULL auto_increment, + `courseid` int(10) unsigned default NULL, + `preference` int(10) NOT NULL default '0', + `value` int(10) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `courseidpreference` (`courseid`,`preference`) +) TYPE=MyISAM; + +# -------------------------------------------------------- # # Table structure for table `group` diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 9adbaf65282..5d39505a98b 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -949,6 +949,7 @@ function main_upgrade($oldversion=0) { execute_sql('UPDATE `'.$CFG->prefix.'user` SET timezonename = \'\''); } + if ($oldversion < 2005032600) { execute_sql('DROP TABLE '.$CFG->prefix.'dst_preset', false); modify_database('',"CREATE TABLE prefix_timezone ( @@ -971,6 +972,10 @@ function main_upgrade($oldversion=0) { );"); } + if ($oldversion < 2005032800) { + /// Need GRADE TABLES HERE! + } + return $result; } diff --git a/version.php b/version.php index 9f5f5595e00..c902a6a6859 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2005032600; // YYYYMMDD = date + $version = 2005032800; // YYYYMMDD = date // XY = increments within a single day $release = '1.5 UNSTABLE DEVELOPMENT'; // Human-friendly version name