Index: lams_tool_vote/build.properties =================================================================== diff -u -rd56929f06ad90a63082d514e6521adc175f3de27 -rbb9636f8038c20ea45b41680f3d822a0bc8561a5 --- lams_tool_vote/build.properties (.../build.properties) (revision d56929f06ad90a63082d514e6521adc175f3de27) +++ lams_tool_vote/build.properties (.../build.properties) (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -1,7 +1,7 @@ # Minimum compatible version of server -min.server.version.number=2.0.3 +min.server.version.number=3.0 signature=lavote11 -tool.version=20110509 +tool.version=20170101 tool.hide=false tool.short.name=vote \ No newline at end of file Index: lams_tool_vote/db/sql/activity_insert.sql =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -rbb9636f8038c20ea45b41680f3d822a0bc8561a5 --- lams_tool_vote/db/sql/activity_insert.sql (.../activity_insert.sql) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_vote/db/sql/activity_insert.sql (.../activity_insert.sql) (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -1,97 +1,30 @@ --- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) --- ============================================================= --- License Information: http://lamsfoundation.org/licensing/lams/2.0/ --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License version 2.0 as --- published by the Free Software Foundation. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 --- USA --- --- http://www.gnu.org/licenses/gpl.txt --- **************************************************************** --- - - INSERT INTO lams_learning_activity ( -activity_ui_id -, description + description , title , help_text -, xcoord -, ycoord -, parent_activity_id -, parent_ui_id , learning_activity_type_id , grouping_support_type_id , apply_grouping_flag -, grouping_id -, grouping_ui_id -, order_id -, define_later_flag -, learning_design_id , learning_library_id , create_date_time -, run_offline_flag -, max_number_of_options -, min_number_of_options -, options_instructions , tool_id -, tool_content_id , activity_category_id -, gate_activity_level_id -, gate_open_flag -, gate_start_time_offset -, gate_end_time_offset , library_activity_ui_image -, create_grouping_id -, create_grouping_ui_id -, library_activity_id , language_file ) VALUES ( -NULL -, 'Allows creation and use of voting format' + 'Allows creation and use of voting format' , 'Voting' , 'Help text' -, NULL -, NULL -, NULL -, NULL , 1 , 2 , 0 -, NULL -, NULL -, NULL -, 0 -, NULL , ${learning_library_id} , NOW() -, 0 -, NULL -, NULL -, NULL , ${tool_id} -, NULL , 6 -, NULL -, NULL -, NULL -, NULL , 'tool/lavote11/images/icon_ranking.svg' -, NULL -, NULL -, NULL ,'org.lamsfoundation.lams.tool.vote.ApplicationResources' -) +) \ No newline at end of file Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql =================================================================== diff -u -rf6a03ee21a18654d54498cd94d9f68fbea3b996a -rbb9636f8038c20ea45b41680f3d822a0bc8561a5 --- lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision f6a03ee21a18654d54498cd94d9f68fbea3b996a) +++ lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -5,26 +5,23 @@ , instructions TEXT , creation_date DATETIME , update_date DATETIME - , maxNominationCount VARCHAR(20) NOT NULL DEFAULT '1' - , minNominationCount VARCHAR(20) NOT NULL DEFAULT '1' + , maxNominationCount VARCHAR(20) NOT NULL DEFAULT 1 + , minNominationCount VARCHAR(20) NOT NULL DEFAULT 1 , allowText TINYINT(1) NOT NULL DEFAULT 0 , reflect TINYINT(1) NOT NULL DEFAULT 0 , created_by BIGINT(20) NOT NULL DEFAULT 0 - , run_offline TINYINT(1) NOT NULL DEFAULT 0 , define_later TINYINT(1) NOT NULL DEFAULT 0 - , offline_instructions TEXT - , online_instructions TEXT - , content_in_use TINYINT(1) NOT NULL DEFAULT 0 , lock_on_finish TINYINT(1) NOT NULL DEFAULT 1 , retries TINYINT(1) NOT NULL DEFAULT 0 , reflectionSubject TEXT , show_results TINYINT(1) NOT NULL DEFAULT 1 , assigned_data_flow_object TINYINT(1) , external_inputs_added SMALLINT DEFAULT 0 , max_external_inputs SMALLINT - , submission_deadline datetime DEFAULT NULL + , submission_deadline datetime + , use_select_leader_tool_ouput tinyint(1) NOT NULL DEFAULT 0 , PRIMARY KEY (uid) -)ENGINE=InnoDB; +); CREATE TABLE tl_lavote11_session ( uid BIGINT(20) NOT NULL AUTO_INCREMENT @@ -34,12 +31,13 @@ , session_name VARCHAR(100) , session_status VARCHAR(100) , vote_content_id BIGINT(20) NOT NULL - , UNIQUE UQ_tl_lamc11_session_1 (vote_session_id) + , group_leader_uid bigint(20) , PRIMARY KEY (uid) - , INDEX (vote_content_id) + , UNIQUE KEY UQ_tl_lamc11_session_1 (vote_session_id) + , KEY vote_content_id (vote_content_id) , CONSTRAINT FK_tl_lavote11_session_1 FOREIGN KEY (vote_content_id) - REFERENCES tl_lavote11_content (uid) -)ENGINE=InnoDB; + REFERENCES tl_lavote11_content (uid) ON DELETE CASCADE ON UPDATE CASCADE +); CREATE TABLE tl_lavote11_usr ( uid BIGINT(20) NOT NULL AUTO_INCREMENT @@ -50,10 +48,11 @@ , responseFinalised TINYINT(1) NOT NULL DEFAULT 0 , finalScreenRequested TINYINT(1) NOT NULL DEFAULT 0 , PRIMARY KEY (uid) - , INDEX (vote_session_id) + , UNIQUE KEY user_id (user_id,vote_session_id) + , KEY vote_session_id (vote_session_id) , CONSTRAINT FK_tl_lavote11_usr_1 FOREIGN KEY (vote_session_id) - REFERENCES tl_lavote11_session (uid) -)ENGINE=InnoDB; + REFERENCES tl_lavote11_session (uid) ON DELETE CASCADE ON UPDATE CASCADE +); CREATE TABLE tl_lavote11_nomination_content ( uid BIGINT(20) NOT NULL AUTO_INCREMENT @@ -63,13 +62,13 @@ , PRIMARY KEY (uid) , INDEX (vote_content_id) , CONSTRAINT FK_tl_lavote11_nomination_content_1 FOREIGN KEY (vote_content_id) - REFERENCES tl_lavote11_content (uid) -)ENGINE=InnoDB; + REFERENCES tl_lavote11_content (uid) ON DELETE CASCADE ON UPDATE CASCADE +); CREATE TABLE tl_lavote11_usr_attempt ( uid BIGINT(20) NOT NULL AUTO_INCREMENT , que_usr_id BIGINT(20) NOT NULL - , vote_nomination_content_id BIGINT(20) NOT NULL + , vote_nomination_content_id BIGINT(20) , attempt_time DATETIME , time_zone VARCHAR(255) , userEntry VARCHAR(255) @@ -78,27 +77,18 @@ , PRIMARY KEY (uid) , INDEX (que_usr_id) , CONSTRAINT FK_tl_lavote11_usr_attempt_2 FOREIGN KEY (que_usr_id) - REFERENCES tl_lavote11_usr (uid) + REFERENCES tl_lavote11_usr (uid) ON DELETE CASCADE ON UPDATE CASCADE , INDEX (vote_nomination_content_id) , CONSTRAINT FK_tl_lavote11_usr_attempt_3 FOREIGN KEY (vote_nomination_content_id) - REFERENCES tl_lavote11_nomination_content (uid) -)ENGINE=InnoDB; + REFERENCES tl_lavote11_nomination_content (uid) ON DELETE CASCADE ON UPDATE CASCADE +); -CREATE TABLE tl_lavote11_uploadedfile ( - submissionId BIGINT(20) NOT NULL AUTO_INCREMENT - , uuid VARCHAR(255) NOT NULL - , isOnline_File TINYINT(1) NOT NULL - , filename VARCHAR(255) NOT NULL - , vote_content_id BIGINT(20) NOT NULL - , PRIMARY KEY (submissionId) - , INDEX (vote_content_id) - , CONSTRAINT FK_tablex_111 FOREIGN KEY (vote_content_id) - REFERENCES tl_lavote11_content (uid) -)ENGINE=InnoDB; +ALTER TABLE tl_lavote11_session ADD CONSTRAINT tl_lavote11_session FOREIGN KEY (group_leader_uid) + REFERENCES tl_lavote11_usr (uid) ON DELETE CASCADE ON UPDATE CASCADE; + + +INSERT INTO tl_lavote11_content(uid, content_id , title , instructions , creation_date , created_by , define_later, retries, lock_on_finish) VALUES (1, ${default_content_id} ,'Voting','Instructions', NOW(), 1, 0, 0, 0); -INSERT INTO tl_lavote11_content(uid, content_id , title , instructions , creation_date , created_by , run_offline , define_later, offline_instructions, online_instructions, content_in_use, retries, lock_on_finish) VALUES (1, ${default_content_id} ,'Voting','Instructions', NOW(), 1,0, 0, '','', 0, 0, 0); - INSERT INTO tl_lavote11_nomination_content (uid,nomination, display_order, vote_content_id) VALUES (1, 'Sample Nomination 1', 1, 1); -INSERT INTO tl_lavote11_nomination_content (uid,nomination, display_order, vote_content_id) VALUES (2, 'Sample Nomination 2', 2, 1); - +INSERT INTO tl_lavote11_nomination_content (uid,nomination, display_order, vote_content_id) VALUES (2, 'Sample Nomination 2', 2, 1); \ No newline at end of file Index: lams_tool_vote/db/sql/drop_lams_tool_vote.sql =================================================================== diff -u -r076f681daa99d0471dea9b1f166e5e68e44413ca -rbb9636f8038c20ea45b41680f3d822a0bc8561a5 --- lams_tool_vote/db/sql/drop_lams_tool_vote.sql (.../drop_lams_tool_vote.sql) (revision 076f681daa99d0471dea9b1f166e5e68e44413ca) +++ lams_tool_vote/db/sql/drop_lams_tool_vote.sql (.../drop_lams_tool_vote.sql) (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -1,14 +1,5 @@ - -DROP TABLE tl_lavote11_uploadedfile; DROP TABLE tl_lavote11_usr_attempt; DROP TABLE tl_lavote11_nomination_content; DROP TABLE tl_lavote11_usr; DROP TABLE tl_lavote11_session; -DROP TABLE tl_lavote11_content; - - - - - - - +DROP TABLE tl_lavote11_content; \ No newline at end of file Index: lams_tool_vote/db/sql/library_insert.sql =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -rbb9636f8038c20ea45b41680f3d822a0bc8561a5 --- lams_tool_vote/db/sql/library_insert.sql (.../library_insert.sql) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_vote/db/sql/library_insert.sql (.../library_insert.sql) (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -1,26 +1,3 @@ --- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) --- ============================================================= --- License Information: http://lamsfoundation.org/licensing/lams/2.0/ --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License version 2.0 as --- published by the Free Software Foundation. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 --- USA --- --- http://www.gnu.org/licenses/gpl.txt --- **************************************************************** --- - - INSERT INTO lams_learning_library ( description, @@ -34,4 +11,4 @@ 'Voting', 0, NOW() -) +) \ No newline at end of file Index: lams_tool_vote/db/sql/tool_insert.sql =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -rbb9636f8038c20ea45b41680f3d822a0bc8561a5 --- lams_tool_vote/db/sql/tool_insert.sql (.../tool_insert.sql) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_vote/db/sql/tool_insert.sql (.../tool_insert.sql) (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -1,26 +1,3 @@ --- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) --- ============================================================= --- License Information: http://lamsfoundation.org/licensing/lams/2.0/ --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License version 2.0 as --- published by the Free Software Foundation. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 --- USA --- --- http://www.gnu.org/licenses/gpl.txt --- **************************************************************** --- - - INSERT INTO lams_tool ( tool_signature, @@ -29,8 +6,6 @@ description, tool_identifier, tool_version, -learning_library_id, -default_tool_content_id, valid_flag, grouping_support_type_id, supports_run_offline_flag, @@ -55,22 +30,19 @@ 'Voting', 'vote', '@tool_version@', -NULL, -NULL, 0, 2, 1, -'tool/lavote11/learningStarter.do?mode=learner', -'tool/lavote11/learningStarter.do?mode=author', -'tool/lavote11/learningStarter.do?mode=teacher', -'tool/lavote11/authoringStarter.do', -'tool/lavote11/monitoringStarter.do', +'tool/lavote11/learning.do?dispatch=start&mode=learner', +'tool/lavote11/learning.do?dispatch=start&mode=author', +'tool/lavote11/learning.do?dispatch=start&mode=teacher', +'tool/lavote11/authoring.do?dispatch=start', +'tool/lavote11/monitoring.do?dispatch=start', 'tool/lavote11/defineLaterStarter.do', 'tool/lavote11/pedagogicalPlanner.do', 'http://wiki.lamsfoundation.org/display/lamsdocs/lavote11', 'org.lamsfoundation.lams.tool.vote.ApplicationResources', NOW(), NOW(), 1 -) - +) \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dbupdates/patch20170101.sql =================================================================== diff -u --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dbupdates/patch20170101.sql (revision 0) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dbupdates/patch20170101.sql (revision bb9636f8038c20ea45b41680f3d822a0bc8561a5) @@ -0,0 +1,14 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-4180 +UPDATE lams_tool SET tool_version='20170101' WHERE tool_signature='lavote11'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file