[svn r18074] Changed several qualification variables from Work, Exercise and Forum tables. INT values changed to FLOAT(6,2) It requires test. (see FS#3564)

skala
Julio Montoya 16 years ago
parent 77f27e8d48
commit e50fa191ba
  1. 23
      main/inc/lib/add_course.lib.inc.php
  2. 62
      main/install/dokeos_main.sql
  3. 14
      main/install/migrate-db-1.8.5-1.8.6-pre.sql

@ -310,8 +310,8 @@ function update_Db_course($courseDbName)
$TABLETOOLFORUMMAILCUE = $courseDbName . 'forum_mailcue';
$TABLETOOLFORUMATTACHMENT = $courseDbName . 'forum_attachment';
$TABLETOOLFORUMNOTIFICATION = $courseDbName . 'forum_notification';
$TABLETOOLFORUMQUALIFY = $courseDbName.'forum_thread_qualify';
$TABLETOOLFORUMQUALIFYLOG = $courseDbName.'forum_thread_qualify_log';
$TABLETOOLFORUMQUALIFY = $courseDbName . 'forum_thread_qualify';
$TABLETOOLFORUMQUALIFYLOG = $courseDbName . 'forum_thread_qualify_log';
// Link
$TABLETOOLLINK = $courseDbName . 'link';
@ -519,9 +519,9 @@ function update_Db_course($courseDbName)
locked int NOT NULL default 0,
session_id int unsigned default NULL,
thread_title_qualify varchar(255) default '',
thread_qualify_max int unsigned default 0,
thread_qualify_max float(6,2) UNSIGNED NOT NULL default 0,
thread_close_date datetime default '0000-00-00 00:00:00',
thread_weight smallint default 0,
thread_weight float(6,2) UNSIGNED NOT NULL default 0,
PRIMARY KEY (thread_id)
) TYPE=MyISAM";
@ -593,7 +593,7 @@ function update_Db_course($courseDbName)
id int unsigned PRIMARY KEY AUTO_INCREMENT,
user_id int unsigned NOT NULL,
thread_id int NOT NULL,
qualify int default NULL,
qualify float(6,2) NOT NULL default 0,
qualify_user_id int default NULL,
qualify_time datetime default '0000-00-00 00:00:00',
session_id int default NULL
@ -607,7 +607,7 @@ function update_Db_course($courseDbName)
id int unsigned PRIMARY KEY AUTO_INCREMENT,
user_id int unsigned NOT NULL,
thread_id int NOT NULL,
qualify int default NULL,
qualify float(6,2) NOT NULL default 0,
qualify_user_id int default NULL,
qualify_time datetime default '0000-00-00 00:00:00',
session_id int default NULL
@ -646,7 +646,7 @@ function update_Db_course($courseDbName)
id mediumint unsigned NOT NULL auto_increment,
question varchar(200) NOT NULL,
description text default NULL,
ponderation smallint unsigned default NULL,
ponderation float(6,2) NOT NULL default 0,
position mediumint unsigned NOT NULL default 1,
type tinyint unsigned NOT NULL default 2,
picture varchar(50) default NULL,
@ -665,7 +665,7 @@ function update_Db_course($courseDbName)
answer text NOT NULL,
correct mediumint unsigned default NULL,
comment text default NULL,
ponderation smallint default NULL,
ponderation float(6,2) NOT NULL default 0,
position mediumint unsigned NOT NULL default 1,
hotspot_coordinates text,
hotspot_type enum('square','circle','poly','delineation') default NULL,
@ -806,7 +806,7 @@ function update_Db_course($courseDbName)
filetype set('file','folder') NOT NULL default 'file',
has_properties int UNSIGNED NOT NULL DEFAULT 0,
view_properties tinyint NULL,
qualification INT UNSIGNED NOT NULL DEFAULT 0,
qualification float(6,2) UNSIGNED NOT NULL DEFAULT 0,
date_of_qualification datetime NOT NULL default '0000-00-00 00:00:00',
parent_id INT UNSIGNED NOT NULL DEFAULT 0,
qualificator_id INT UNSIGNED NOT NULL DEFAULT 0,
@ -1568,7 +1568,8 @@ function update_Db_course($courseDbName)
invitation_code varchar(250) NOT NULL,
invitation_date datetime NOT NULL,
reminder_date datetime NOT NULL,
answered int NOT NULL default '0',
answered int NOT NULL default 0,
session_id SMALLINT(5) UNSIGNED NOT NULL default 0,
PRIMARY KEY (survey_invitation_id)
)";
$result = api_sql_query($sql, __FILE__, __LINE__) or die(mysql_error($sql));
@ -2372,7 +2373,7 @@ function register_course($courseSysCode, $courseScreenCode, $courseRepository, $
api_sql_query($sql, __FILE__, __LINE__);
}
}
}
return 0;

@ -1027,29 +1027,6 @@ CREATE TABLE user_field_values(
PRIMARY KEY(id)
);
DROP TABLE IF EXISTS access_url;
CREATE TABLE access_url(
id int unsigned NOT NULL auto_increment,
url varchar(255) NOT NULL,
description text,
active int unsigned not null default 0,
created_by int not null,
tms TIMESTAMP,
PRIMARY KEY (id)
);
INSERT INTO access_url(url, description, active, created_by) VALUES ('http://localhost/',' ',1,1);
DROP TABLE IF EXISTS access_url_rel_user;
CREATE TABLE access_url_rel_user (
access_url_id int unsigned NOT NULL,
user_id int unsigned NOT NULL,
PRIMARY KEY (access_url_id, user_id)
);
ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_user (user_id);
ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_access_url(access_url_id);
ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_access_url_user (user_id,access_url_id);
ALTER TABLE gradebook_category ADD session_id int DEFAULT NULL;
@ -1078,6 +1055,45 @@ CREATE TABLE gradebook_linkeval_log (
PRIMARY KEY (id)
);
--
-- --------------------------------------------------------
--
-- Tables for the access URL feature
--
DROP TABLE IF EXISTS access_url;
CREATE TABLE access_url(
id int unsigned NOT NULL auto_increment,
url varchar(255) NOT NULL,
description text,
active int unsigned not null default 0,
created_by int not null,
tms TIMESTAMP,
PRIMARY KEY (id)
);
INSERT INTO access_url(url, description, active, created_by) VALUES ('http://localhost/',' ',1,1);
DROP TABLE IF EXISTS access_url_rel_user;
CREATE TABLE access_url_rel_user (
access_url_id int unsigned NOT NULL,
user_id int unsigned NOT NULL,
PRIMARY KEY (access_url_id, user_id)
);
ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_user (user_id);
ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_access_url(access_url_id);
ALTER TABLE access_url_rel_user ADD INDEX idx_access_url_rel_user_access_url_user (user_id,access_url_id);
DROP TABLE IF EXISTS access_url_rel_course;
CREATE TABLE access_url_rel_course (
access_url_id int unsigned NOT NULL,
course_code char(40) NOT NULL,
PRIMARY KEY (access_url_id, course_code)
);
-----------------
CREATE TABLE sys_calendar (
id int unsigned NOT NULL auto_increment,
title varchar(200) NOT NULL,

@ -91,6 +91,7 @@ UPDATE settings_current SET access_url_changeable = 1 WHERE variable='show_tabs'
UPDATE settings_current SET access_url_changeable = 1 WHERE variable='show_tabs' AND subkey='my_profile';
UPDATE settings_current SET access_url_changeable = 1 WHERE variable='show_tabs' AND subkey='my_gradebook';
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('advanced_filemanager',NULL,'radio','Platform','false','AdvancedFileManagerTitle','AdvancedFileManagerComment',NULL,NULL);
CREATE TABLE access_url_rel_course (access_url_id int unsigned NOT NULL, course_code char(40) NOT NULL, PRIMARY KEY (access_url_id, course_code));
-- xxSTATSxx
ALTER TABLE track_e_exercices ADD status varchar(20) NOT NULL default '';
@ -158,16 +159,16 @@ ALTER TABLE lp_item ADD audio VARCHAR(250);
CREATE TABLE wiki_conf (id int NOT NULL auto_increment, page_id int NOT NULL default 0, feedback1 text NOT NULL, feedback2 text NOT NULL, feedback3 text NOT NULL, max_size int default NULL, max_text int default NULL, max_version int default NULL, startdate_assig datetime NOT NULL default '0000-00-00 00:00:00', enddate_assig datetime NOT NULL default '0000-00-00 00:00:00', delayedsubmit int NOT NULL default 0, PRIMARY KEY (id) );
CREATE TABLE student_publication_assignment (id int NOT NULL auto_increment, expires_on datetime NOT NULL default '0000-00-00 00:00:00', ends_on datetime NOT NULL default '0000-00-00 00:00:00', add_to_calendar tinyint NOT NULL, enable_qualification tinyint NOT NULL, publication_id int NOT NULL, PRIMARY KEY (id));
ALTER TABLE student_publication ADD has_properties INT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE student_publication ADD qualification INT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE student_publication ADD qualification float(6,2) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE student_publication ADD date_of_qualification datetime NOT NULL default '0000-00-00 00:00:00';
ALTER TABLE student_publication ADD parent_id INT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE student_publication ADD qualificator_id INT UNSIGNED NOT NULL DEFAULT 0;
CREATE TABLE forum_thread_qualify (id int unsigned PRIMARY KEY AUTO_INCREMENT, user_id int unsigned NOT NULL,thread_id int NOT NULL,qualify int default NULL,qualify_user_id int default NULL,qualify_time datetime NOT NULL default '0000-00-00 00:00:00', session_id int default NULL);
CREATE TABLE forum_thread_qualify (id int unsigned PRIMARY KEY AUTO_INCREMENT, user_id int unsigned NOT NULL,thread_id int NOT NULL,qualify float(6,2) NOT NULL default 0,qualify_user_id int default NULL,qualify_time datetime NOT NULL default '0000-00-00 00:00:00', session_id int default NULL);
ALTER TABLE forum_thread_qualify ADD INDEX (user_id, thread_id);
ALTER TABLE forum_thread ADD session_id int unsigned default NULL;
ALTER TABLE forum_thread ADD thread_title_qualify varchar(255) default '';
ALTER TABLE forum_thread ADD thread_qualify_max int unsigned default 0;
CREATE TABLE forum_thread_qualify_log (id int unsigned PRIMARY KEY AUTO_INCREMENT, user_id int unsigned NOT NULL,thread_id int NOT NULL,qualify int default NULL,qualify_user_id int default NULL,qualify_time datetime NOT NULL default '0000-00-00 00:00:00', session_id int default NULL);
ALTER TABLE forum_thread ADD thread_qualify_max float(6,2) UNSIGNED NOT NULL DEFAULT 0;
CREATE TABLE forum_thread_qualify_log (id int unsigned PRIMARY KEY AUTO_INCREMENT, user_id int unsigned NOT NULL,thread_id int NOT NULL,qualify float(6,2) NOT NULL default 0,qualify_user_id int default NULL,qualify_time datetime NOT NULL default '0000-00-00 00:00:00', session_id int default NULL);
ALTER TABLE forum_thread_qualify_log ADD INDEX (user_id, thread_id);
INSERT INTO tool(name,link,image,visibility,admin,address,added_tool,target,category) VALUES ('gradebook','gradebook/index.php','gradebook.gif',1,'0','squaregrey.gif',0,'_self','authoring');
ALTER TABLE forum_thread ADD thread_close_date datetime default '0000-00-00 00:00:00';
@ -178,7 +179,7 @@ UPDATE forum_notification SET thread_id=NULL WHERE thread_id='';
ALTER TABLE forum_notification CHANGE thread_id thread_id INT;
UPDATE forum_notification SET post_id=NULL WHERE post_id='';
ALTER TABLE forum_notification CHANGE post_id post_id INT NULL;
ALTER TABLE forum_thread ADD thread_weight smallint default 0;
ALTER TABLE forum_thread ADD thread_weight float(6,2) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE forum_notification CHANGE post_id post_id INT;
ALTER TABLE quiz_answer CHANGE hotspot_coordinates hotspot_coordinates text;
ALTER TABLE group_info ADD forum_state TINYINT unsigned NOT NULL default 0 AFTER announcements_state;
@ -193,3 +194,6 @@ ALTER TABLE quiz_answer ADD destination text NOT NULL;
CREATE TABLE glossary(glossary_id int unsigned NOT NULL auto_increment, name varchar(255) NOT NULL, description text not null, display_order int, PRIMARY KEY (glossary_id));
ALTER TABLE glossary ADD display_order int;
ALTER TABLE quiz_question ADD level int UNSIGNED NOT NULL default 0;
ALTER TABLE survey_invitation ADD COLUMN session_id SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE quiz_answer CHANGE ponderation ponderation float(6,2) NOT NULL DEFAULT 0;
ALTER TABLE quiz_question CHANGE ponderation ponderation float(6,2) NOT NULL DEFAULT 0;

Loading…
Cancel
Save