Index: lams_tool_vote/build.properties =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/build.properties (.../build.properties) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/build.properties (.../build.properties) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -1,7 +1,7 @@ # properties for building the Lams voting Tool #name of this project -signature=vote11 +signature=lavote11 #submit files package definition vote.package=org.lamsfoundation.lams.tool.vote Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml =================================================================== diff -u -r261d9a36d11a99322125fa55faaddffc16a041b3 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision 261d9a36d11a99322125fa55faaddffc16a041b3) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -7,7 +7,7 @@ Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (.../VoteQueUsr.hbm.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (.../VoteQueUsr.hbm.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -7,7 +7,7 @@ Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (.../VoteSession.hbm.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (.../VoteSession.hbm.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -6,7 +6,7 @@ - - - - The following is your nominations. -label.learning.forceFinishMessage =You have reached the maximum number of votes limit. Please finish. +label.learning.reportMessage =The following are your votes. +label.learning.reportMessage.past =The following were your votes. +error.maxNominationCount.reached =You have reached the maximum number of nominations you can select.
Please vote again. +label.learning.forceFinishMessage =Voting is no more allowed. Please finish. count.total.user =Total Users Count: count.finished.user =Finished User Count: count.max.attempt =Maximum Attempt Count: @@ -65,6 +67,7 @@ label.view.answers =View Answers label.view.answers =View Nominations label.nominated =Nominated +label.submit.vote =Submit Vote label.view =View label.download =Download label.delete =Delete Index: lams_tool_vote/conf/war/META-INF/MANIFEST.MF =================================================================== diff -u -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/conf/war/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) +++ lams_tool_vote/conf/war/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -1,6 +1,6 @@ Manifest-Version: 1.0 Ant-Version: Apache Ant 1.5.3 Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.) -Class-Path: ./lams.jar ./lams-tool-vote11.jar ./lams-contentrepository.jar ./lams-learning.jar +Class-Path: ./lams.jar ./lams-tool-lavote11.jar ./lams-contentrepository.jar ./lams-learning.jar Index: lams_tool_vote/db/model/lams_tool_vote.clay =================================================================== diff -u -r52a1e39117be580c8b8992c55da0411a49151ff8 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/db/model/lams_tool_vote.clay (.../lams_tool_vote.clay) (revision 52a1e39117be580c8b8992c55da0411a49151ff8) +++ lams_tool_vote/db/model/lams_tool_vote.clay (.../lams_tool_vote.clay) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -7,9 +7,9 @@ - +
- + @@ -24,7 +24,7 @@ - + @@ -37,77 +37,85 @@ - + - - - - - - - - - - - - - + - + - + - - - - - - - - - + + + - + - - - - - - - - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + +
+ + + + + - - - - - - - - - + + + + + + + + + - + @@ -120,45 +128,40 @@ - + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - + + - + - - + + + - + - - + + + - + @@ -171,49 +174,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + + + + + + + + + + + + + + + + +
- +
- + @@ -228,27 +215,15 @@ - + - - + + + - + - - - - - - - - - - - - - @@ -260,14 +235,34 @@ + + + + + + + + + + + + + + + + + + + + - + - + @@ -277,9 +272,9 @@
- +
- + @@ -294,7 +289,7 @@ - + @@ -327,26 +322,21 @@ - + - + - - - - - - + - + @@ -356,9 +346,9 @@
- +
- + @@ -373,45 +363,25 @@ - + - - - - - - - - - + + - + - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - @@ -426,18 +396,13 @@ - + - - - - - - + - + @@ -447,9 +412,9 @@
- +
- + @@ -464,7 +429,7 @@ - + @@ -477,53 +442,38 @@ - + - - - - - - - - - + + - + - - + + - + - - - + + - + - - - - - - - - - + + - + - + @@ -536,36 +486,21 @@ - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - + + + + + + + + + + + + + + @@ -577,28 +512,46 @@ - + - - - + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - + + + + + + + + + + + + + @@ -610,28 +563,39 @@ - + - - - + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - +
Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql =================================================================== diff -u -r52a1e39117be580c8b8992c55da0411a49151ff8 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision 52a1e39117be580c8b8992c55da0411a49151ff8) +++ lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -1,12 +1,11 @@ -CREATE TABLE tl_vote11_content ( +CREATE TABLE tl_lavote11_content ( uid BIGINT(20) NOT NULL AUTO_INCREMENT , content_id BIGINT(20) NOT NULL , title TEXT NOT NULL , instructions TEXT NOT NULL , creation_date DATETIME , update_date DATETIME - , maxNominationCount VARCHAR(20) NOT NULL DEFAULT '0' - , questions_sequenced TINYINT(1) NOT NULL DEFAULT 0 + , maxNominationCount VARCHAR(20) NOT NULL DEFAULT '1' , allowText TINYINT(1) NOT NULL DEFAULT 0 , voteChangable TINYINT(1) NOT NULL DEFAULT 0 , created_by BIGINT(20) NOT NULL DEFAULT 0 @@ -15,25 +14,13 @@ , offline_instructions TEXT , online_instructions TEXT , content_in_use TINYINT(1) NOT NULL DEFAULT 0 - , lock_on_finish TINYINT NOT NULL DEFAULT 0 + , lock_on_finish TINYINT(1) NOT NULL DEFAULT 0 , retries TINYINT(1) NOT NULL DEFAULT 0 - , UNIQUE UQ_tl_lamc11_content_1 (content_id) , PRIMARY KEY (uid) )TYPE=InnoDB; -CREATE TABLE tl_vote11_que_content ( +CREATE TABLE tl_lavote11_session ( uid BIGINT(20) NOT NULL AUTO_INCREMENT - , question TEXT - , display_order INT(5) - , vote_content_id BIGINT(20) NOT NULL - , PRIMARY KEY (uid) - , INDEX (vote_content_id) - , CONSTRAINT FK_tl_vote_que_content_1 FOREIGN KEY (vote_content_id) - REFERENCES tl_vote11_content (uid) -)TYPE=InnoDB; - -CREATE TABLE tl_vote11_session ( - uid BIGINT(20) NOT NULL AUTO_INCREMENT , vote_session_id BIGINT(20) NOT NULL , session_start_date DATETIME , session_end_date DATETIME @@ -43,53 +30,62 @@ , UNIQUE UQ_tl_lamc11_session_1 (vote_session_id) , PRIMARY KEY (uid) , INDEX (vote_content_id) - , CONSTRAINT FK_tl_vote_session_1 FOREIGN KEY (vote_content_id) - REFERENCES tl_vote11_content (uid) + , CONSTRAINT FK_tl_lavote11_session_1 FOREIGN KEY (vote_content_id) + REFERENCES tl_lavote11_content (uid) )TYPE=InnoDB; -CREATE TABLE tl_vote11_que_usr ( +CREATE TABLE tl_lavote11_usr ( uid BIGINT(20) NOT NULL AUTO_INCREMENT - , que_usr_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL , vote_session_id BIGINT(20) NOT NULL , username VARCHAR(100) - , fullname VARCHAR(100) - , UNIQUE UQ_tl_lamc11_que_usr_1 (que_usr_id) + , fullname VARCHAR(20) , PRIMARY KEY (uid) , INDEX (vote_session_id) - , CONSTRAINT FK_tl_vote_que_usr_1 FOREIGN KEY (vote_session_id) - REFERENCES tl_vote11_session (uid) + , CONSTRAINT FK_tl_lavote11_usr_1 FOREIGN KEY (vote_session_id) + REFERENCES tl_lavote11_session (uid) )TYPE=InnoDB; -CREATE TABLE tl_vote11_usr_attempt ( +CREATE TABLE tl_lavote11_nomination_content ( uid BIGINT(20) NOT NULL AUTO_INCREMENT + , nomination TEXT + , display_order INT(5) + , vote_content_id BIGINT(20) NOT NULL + , PRIMARY KEY (uid) + , INDEX (vote_content_id) + , CONSTRAINT FK_tl_lavote11_nomination_content_1 FOREIGN KEY (vote_content_id) + REFERENCES tl_lavote11_content (uid) +)TYPE=InnoDB; + +CREATE TABLE tl_lavote11_usr_attempt ( + uid BIGINT(20) NOT NULL AUTO_INCREMENT , que_usr_id BIGINT(20) NOT NULL , vote_que_content_id BIGINT(20) NOT NULL , attempt_time DATETIME , time_zone VARCHAR(255) - , nominationCount INT(5) NOT NULL DEFAULT 0 , userEntry VARCHAR(255) , singleUserEntry TINYINT(1) NOT NULL DEFAULT 0 , PRIMARY KEY (uid) , INDEX (que_usr_id) - , CONSTRAINT FK_tl_vote_usr_attempt_1 FOREIGN KEY (que_usr_id) - REFERENCES tl_vote11_que_usr (uid) + , CONSTRAINT FK_tl_lavote11_usr_attempt_2 FOREIGN KEY (que_usr_id) + REFERENCES tl_lavote11_usr (uid) , INDEX (vote_que_content_id) - , CONSTRAINT FK_tl_vote_usr_attempt_4 FOREIGN KEY (vote_que_content_id) - REFERENCES tl_vote11_que_content (uid) + , CONSTRAINT FK_tl_lavote11_usr_attempt_3 FOREIGN KEY (vote_que_content_id) + REFERENCES tl_lavote11_nomination_content (uid) )TYPE=InnoDB; -CREATE TABLE tl_vote11_uploadedfile ( +CREATE TABLE tl_lavote11_uploadedfile ( uid BIGINT(20) NOT NULL AUTO_INCREMENT , uuid VARCHAR(255) NOT NULL , vote_content_id BIGINT(20) NOT NULL , isOnline_File TINYINT(1) NOT NULL , filename VARCHAR(255) NOT NULL , PRIMARY KEY (uid) , INDEX (vote_content_id) - , CONSTRAINT FK_tl_vote_uploadedfile_1 FOREIGN KEY (vote_content_id) - REFERENCES tl_vote11_content (uid) + , CONSTRAINT FK_tl_lavote11_uploadedfile_1 FOREIGN KEY (vote_content_id) + REFERENCES tl_lavote11_content (uid) )TYPE=InnoDB; -INSERT INTO tl_vote11_content(uid, content_id , title , instructions , creation_date , questions_sequenced , created_by , run_offline , define_later, offline_instructions, online_instructions, content_in_use, retries) VALUES (1, ${default_content_id} ,'Voting Title','Voting Instructions', NOW(), 0, 1,0, 0, 'offline instructions','online instructions', 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) VALUES (1, ${default_content_id} ,'Voting Title','Voting Instructions', NOW(), 1,0, 0, 'offline instructions','online instructions', 0, 0); -INSERT INTO tl_vote11_que_content (uid,question, display_order, vote_content_id) VALUES (1, 'sample nomination', 1, 1); \ No newline at end of file +INSERT INTO tl_lavote11_nomination_content (uid,nomination, display_order, vote_content_id) VALUES (1, 'sample nomination', 1, 1); \ No newline at end of file Index: lams_tool_vote/db/sql/drop_lams_tool_vote.sql =================================================================== diff -u -rb9472d342c6b0edd1c3e0df5ff2b7179051bb389 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/db/sql/drop_lams_tool_vote.sql (.../drop_lams_tool_vote.sql) (revision b9472d342c6b0edd1c3e0df5ff2b7179051bb389) +++ lams_tool_vote/db/sql/drop_lams_tool_vote.sql (.../drop_lams_tool_vote.sql) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -1,37 +1,14 @@ --- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 --- USA --- --- http://www.gnu.org/licenses/gpl.txt --- **************************************************************** --- --- $Id$ -SET FOREIGN_KEY_CHECKS=0; -DROP TABLE tl_vote11_uploadedfile; -DROP TABLE tl_vote11_usr_attempt; -DROP TABLE tl_vote11_que_usr; -DROP TABLE tl_vote11_session; -DROP TABLE tl_vote11_que_content; -DROP TABLE tl_vote11_content; -SET FOREIGN_KEY_CHECKS=1; +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; + Index: lams_tool_vote/db/sql/tool_insert.sql =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/db/sql/tool_insert.sql (.../tool_insert.sql) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/db/sql/tool_insert.sql (.../tool_insert.sql) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -49,7 +49,7 @@ ) VALUES ( -'vote11', +'lavote11', 'voteService', 'Voting', 'Voting', @@ -60,16 +60,16 @@ 0, 2, 1, -'tool/vote11/learningStarter.do?mode=learner', -'tool/vote11/learningStarter.do?mode=author', -'tool/vote11/learningStarter.do?mode=teacher', -'tool/vote11/authoringStarter.do', -'tool/vote11/monitoringStarter.do', -'tool/vote11/defineLaterStarter.do', -'tool/vote11/portfolioExport?mode=learner', -'tool/vote11/portfolioExport?mode=teacher', -'tool/vote11/monitoringStarter.do', -'tool/vote11/monitoringStarter.do', +'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/defineLaterStarter.do', +'tool/lavote11/portfolioExport?mode=learner', +'tool/lavote11/portfolioExport?mode=teacher', +'tool/lavote11/monitoringStarter.do', +'tool/lavote11/monitoringStarter.do', 'org.lamsfoundation.lams.tool.vote.VoteResources', NOW() ) Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== diff -u -r277d8412bc03b9c73992a0e6f3ad845cd0a4eba6 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 277d8412bc03b9c73992a0e6f3ad845cd0a4eba6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -28,7 +28,7 @@ */ public interface VoteAppConstants { - public static final String MY_SIGNATURE ="vote11"; + public static final String MY_SIGNATURE ="lavote11"; public static final String DEFAULT_CONTENT_ID ="defaultContentId"; public static final String TOOL_SERVICE ="tool_service"; public static final String ERROR_VOTEAPPLICATION = "error.exception.VoteApplication"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -re6d4c9ba0ba0e2b42b4ff2f997618bfedc28dd7c -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision e6d4c9ba0ba0e2b42b4ff2f997618bfedc28dd7c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -133,16 +133,6 @@ public int getLastNominationCount(Long userId) { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER) - .setLong("queUsrId", userId.longValue()) - .list(); - - - if(list != null && list.size() > 0){ - VoteUsrAttempt vote = (VoteUsrAttempt) list.get(0); - return vote.getNominationCount(); - } return 0; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java =================================================================== diff -u -r261d9a36d11a99322125fa55faaddffc16a041b3 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 261d9a36d11a99322125fa55faaddffc16a041b3) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -37,7 +37,7 @@ /** *

Persistent object/bean that defines the content for the Voting tool. * Provides accessors and mutators to get/set attributes - * It maps to database table: tl_vote11_content + * It maps to database table: tl_lavote11_content *

* * @author Ozgur Demirtas Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java =================================================================== diff -u -r261d9a36d11a99322125fa55faaddffc16a041b3 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (.../VoteQueContent.java) (revision 261d9a36d11a99322125fa55faaddffc16a041b3) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (.../VoteQueContent.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -35,7 +35,7 @@ /** *

Persistent object/bean that defines the question content for the Voting tool. * Provides accessors and mutators to get/set attributes - * It maps to database table: tl_vote11_que_content + * It maps to database table: tl_lavote11_que_content *

* * @author Ozgur Demirtas Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java (.../VoteQueUsr.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java (.../VoteQueUsr.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -32,7 +32,7 @@ /** *

Persistent object/bean that defines the user for the Voting tool. * Provides accessors and mutators to get/set attributes - * It maps to database table: tl_vote11_que_usr + * It maps to database table: tl_lavote11_que_usr *

* * @author Ozgur Demirtas Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteSession.java =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteSession.java (.../VoteSession.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteSession.java (.../VoteSession.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -32,7 +32,7 @@ /** *

Persistent object/bean that defines the content for the Voting tool. * Provides accessors and mutators to get/set attributes - * It maps to database table: tl_vote11_session + * It maps to database table: tl_lavote11_session *

* * @author Ozgur Demirtas Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (.../VoteUploadedFile.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (.../VoteUploadedFile.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -34,7 +34,7 @@ /** *

Persistent object/bean that defines the uploaded file for the MCQ tool. * Provides accessors and mutators to get/set attributes - * It maps to database table: tl_vote11_uploadedfile + * It maps to database table: tl_lavote11_uploadedfile *

* * @author Ozgur Demirtas Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java =================================================================== diff -u -r261d9a36d11a99322125fa55faaddffc16a041b3 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java (.../VoteUsrAttempt.java) (revision 261d9a36d11a99322125fa55faaddffc16a041b3) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java (.../VoteUsrAttempt.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -31,7 +31,7 @@ /** *

Persistent object/bean that defines the user attempt for the MCQ tool. * Provides accessors and mutators to get/set attributes - * It maps to database table: tl_vote11_usr_attempt + * It maps to database table: tl_lavote11_usr_attempt *

* * @author Ozgur Demirtas @@ -52,8 +52,6 @@ private String userEntry; - private int nominationCount; - private Long queUsrId; private boolean singleUserEntry; @@ -94,30 +92,18 @@ this.userEntry=userEntry; } - public VoteUsrAttempt(Date attemptTime, String timeZone, org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, - org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr, String userEntry, int nominationCount) { - this.attemptTime = attemptTime; - this.timeZone = timeZone; - this.voteQueContent = voteQueContent; - this.voteQueUsr = voteQueUsr; - this.userEntry=userEntry; - this.nominationCount=nominationCount; - } public VoteUsrAttempt(Date attemptTime, String timeZone, org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, - org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr, String userEntry, int nominationCount, boolean singleUserEntry) { + org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr, String userEntry, boolean singleUserEntry) { this.attemptTime = attemptTime; this.timeZone = timeZone; this.voteQueContent = voteQueContent; this.voteQueUsr = voteQueUsr; this.userEntry=userEntry; - this.nominationCount=nominationCount; this.singleUserEntry=singleUserEntry; } - - public VoteUsrAttempt(String userEntry, Date attemptTime, String timeZone, org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr) { this.userEntry=userEntry; @@ -244,19 +230,6 @@ } /** - * @return Returns the nominationCount. - */ - public int getNominationCount() { - return nominationCount; - } - /** - * @param nominationCount The nominationCount to set. - */ - public void setNominationCount(int nominationCount) { - this.nominationCount = nominationCount; - } - - /** * @return Returns the singleUserEntry. */ public boolean isSingleUserEntry() { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java =================================================================== diff -u -re8bdd364f7372b39f60efbd8cdbb114e7955e9a2 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java (.../LearningUtil.java) (revision e8bdd364f7372b39f60efbd8cdbb114e7955e9a2) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java (.../LearningUtil.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -113,10 +113,9 @@ } - public static void createAttempt(HttpServletRequest request, VoteQueUsr voteQueUsr, Map mapGeneralCheckedOptionsContent, String userEntry, int nominationCount, boolean singleUserEntry) + public static void createAttempt(HttpServletRequest request, VoteQueUsr voteQueUsr, Map mapGeneralCheckedOptionsContent, String userEntry, boolean singleUserEntry) { logger.debug("doing createAttempt: " + mapGeneralCheckedOptionsContent); - logger.debug("nominationCount: " + nominationCount); logger.debug("userEntry: " + userEntry); logger.debug("singleUserEntry: " + singleUserEntry); @@ -142,30 +141,29 @@ logger.debug("voteQueContent: " + voteQueContent); if (voteQueContent != null) { - createIndividualOptions(request, voteQueContent, voteQueUsr, attempTime, timeZone, userEntry, nominationCount, false); + createIndividualOptions(request, voteQueContent, voteQueUsr, attempTime, timeZone, userEntry, false); } else if ((voteQueContent == null) && (questionDisplayOrder.toString().equals("101"))) { logger.debug("creating user entry record, 101"); VoteQueContent localVoteQueContent=voteService.getToolDefaultQuestionContent(1); logger.debug("localVoteQueContent: " + localVoteQueContent); - createIndividualOptions(request, localVoteQueContent, voteQueUsr, attempTime, timeZone, userEntry, nominationCount, true); + createIndividualOptions(request, localVoteQueContent, voteQueUsr, attempTime, timeZone, userEntry, true); } else if ((voteQueContent == null) && (questionDisplayOrder.toString().equals("102"))) { logger.debug("creating user entry record, 102"); VoteQueContent localVoteQueContent=voteService.getToolDefaultQuestionContent(1); logger.debug("localVoteQueContent: " + localVoteQueContent); - createIndividualOptions(request, localVoteQueContent, voteQueUsr, attempTime, timeZone, userEntry, nominationCount, false); + createIndividualOptions(request, localVoteQueContent, voteQueUsr, attempTime, timeZone, userEntry, false); } } } } - public static void createIndividualOptions(HttpServletRequest request, VoteQueContent voteQueContent, VoteQueUsr voteQueUsr, Date attempTime, String timeZone, String userEntry, int nominationCount, boolean singleUserEntry) + public static void createIndividualOptions(HttpServletRequest request, VoteQueContent voteQueContent, VoteQueUsr voteQueUsr, Date attempTime, String timeZone, String userEntry, boolean singleUserEntry) { logger.debug("doing createIndividualOptions"); - logger.debug("nominationCount: " + nominationCount); logger.debug("userEntry: " + userEntry); logger.debug("singleUserEntry: " + singleUserEntry); @@ -183,7 +181,6 @@ if (existingVoteUsrAttempt != null) { logger.debug("update existingVoteUsrAttempt: " + existingVoteUsrAttempt); - existingVoteUsrAttempt.setNominationCount(nominationCount); existingVoteUsrAttempt.setUserEntry(userEntry); existingVoteUsrAttempt.setAttemptTime(attempTime); existingVoteUsrAttempt.setTimeZone(timeZone); @@ -193,7 +190,7 @@ else { logger.debug("create new attempt"); - VoteUsrAttempt voteUsrAttempt=new VoteUsrAttempt(attempTime, timeZone, voteQueContent, voteQueUsr, userEntry, nominationCount , singleUserEntry); + VoteUsrAttempt voteUsrAttempt=new VoteUsrAttempt(attempTime, timeZone, voteQueContent, voteQueUsr, userEntry, singleUserEntry); logger.debug("voteUsrAttempt: " + voteUsrAttempt); voteService.createVoteUsrAttempt(voteUsrAttempt); logger.debug("created voteUsrAttempt in the db :" + voteUsrAttempt); @@ -245,17 +242,17 @@ } - public static void selectOptionsCheckBox(HttpServletRequest request,VoteLearningForm voteLearningForm, String questionIndex) + public static Map selectOptionsCheckBox(HttpServletRequest request,VoteLearningForm voteLearningForm, String questionIndex, + Map mapGeneralCheckedOptionsContent) { logger.debug("requested optionCheckBoxSelected..."); logger.debug("questionIndex: " + voteLearningForm.getQuestionIndex()); logger.debug("optionIndex: " + voteLearningForm.getOptionIndex()); logger.debug("optionValue: " + voteLearningForm.getOptionValue()); logger.debug("checked: " + voteLearningForm.getChecked()); + + Map mapFinal= new TreeMap(new VoteComparator()); - Map mapGeneralCheckedOptionsContent=(Map) request.getSession().getAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT); - logger.debug("mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); - if (mapGeneralCheckedOptionsContent.size() == 0) { logger.debug("mapGeneralCheckedOptionsContent size is 0"); @@ -266,7 +263,8 @@ else mapLeanerCheckedOptionsContent.remove(voteLearningForm.getQuestionIndex()); - request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapLeanerCheckedOptionsContent); + + mapFinal=mapLeanerCheckedOptionsContent; } else { @@ -282,7 +280,8 @@ logger.debug("updated mapCurrentOptions: " + mapCurrentOptions); - request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapCurrentOptions); + mapFinal=mapCurrentOptions; + //request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapCurrentOptions); } else { @@ -292,14 +291,17 @@ if (voteLearningForm.getChecked().equals("true")) mapLeanerCheckedOptionsContent.put(voteLearningForm.getQuestionIndex(), voteLearningForm.getOptionValue()); else - mapLeanerCheckedOptionsContent.remove(voteLearningForm.getOptionIndex()); + mapLeanerCheckedOptionsContent.remove(voteLearningForm.getOptionIndex()); - request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapLeanerCheckedOptionsContent); + mapFinal=mapLeanerCheckedOptionsContent; + //request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapLeanerCheckedOptionsContent); } } - mapGeneralCheckedOptionsContent=(Map) request.getSession().getAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT); - logger.debug("final mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); + //mapGeneralCheckedOptionsContent=(Map) request.getSession().getAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT); + //logger.debug("final mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); + logger.debug("mapFinal: " + mapFinal); + return mapFinal; } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -re8bdd364f7372b39f60efbd8cdbb114e7955e9a2 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision e8bdd364f7372b39f60efbd8cdbb114e7955e9a2) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -48,6 +48,7 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr; +import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.web.action.LamsDispatchAction; @@ -117,6 +118,7 @@ VoteUtils.cleanUpUserExceptions(request); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); IVoteService voteService =VoteUtils.getToolService(request); VoteUtils.persistRichText(request); @@ -136,6 +138,7 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); setContentInUse(request); IVoteService voteService =VoteUtils.getToolService(request); @@ -157,6 +160,8 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + IVoteService voteService =VoteUtils.getToolService(request); setContentInUse(request); @@ -215,9 +220,8 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); - IVoteService voteService =VoteUtils.getToolService(request); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); - setContentInUse(request); logger.debug("requested redoQuestionsOk, user is sure to redo the questions."); voteLearningForm.resetCommands(); @@ -237,14 +241,26 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); - IVoteService voteService =VoteUtils.getToolService(request); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + IVoteService voteService =VoteUtils.getToolService(request); + Long toolSessionId = (Long) request.getSession().getAttribute(TOOL_SESSION_ID); String userID=(String) request.getSession().getAttribute(USER_ID); logger.debug("attempting to leave/complete session with toolSessionId:" + toolSessionId + " and userID:"+userID); VoteUtils.cleanUpSessionAbsolute(request); + + /* REMOVE THIS this is temp code from here **/ + VoteSession voteSession=null; + voteSession=voteService.retrieveVoteSession(toolSessionId); + logger.debug("retrieved voteSession: " + voteSession); + voteSession.setSessionStatus(VoteAppConstants.COMPLETED); + voteService.updateVoteSession(voteSession); + logger.debug("updated voteSession to COMPLETED" + voteSession); + /* till here*/ + String nextUrl=null; try @@ -285,19 +301,55 @@ } - public ActionForward nominateVotes(ActionMapping mapping, + public ActionForward castVotes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VoteUtils.cleanUpUserExceptions(request); - logger.debug("dispatching nominateVotes..."); + logger.debug("dispatching castVotes..."); VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); - IVoteService voteService =VoteUtils.getToolService(request); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + + Map mapGeneralCheckedOptionsContent=(Map) request.getSession().getAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT); + logger.debug("mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); + + int castVoteCount=mapGeneralCheckedOptionsContent.size(); + logger.debug("castVoteCount pre user entry count: " + castVoteCount); + + String userEntry=voteLearningForm.getUserEntry(); + logger.debug("userEntry: " + userEntry); + + if ((userEntry != null) && (userEntry.length() > 0)) + { + logger.debug("userEntry available: " + userEntry); + ++castVoteCount; + } + logger.debug("castVoteCount post user entry count: " + castVoteCount); + + + String maxNominationCount=voteLearningForm.getMaxNominationCount(); + logger.debug("maxNominationCount: " + maxNominationCount); + + int intMaxNominationCount=0; + if (maxNominationCount != null) + intMaxNominationCount=new Integer(maxNominationCount).intValue(); + logger.debug("intMaxNominationCount: " + intMaxNominationCount); + logger.debug("intMaxNominationCount versus current voting count: " + intMaxNominationCount + " versus " + castVoteCount ); + + if (castVoteCount > intMaxNominationCount ) + { + voteLearningForm.setMaxNominationCountReached(new Boolean(true).toString()); + persistError(request, "error.maxNominationCount.reached"); + logger.debug("give warning, max nom count reached..."); + logger.debug("fwd'ing to: " + LOAD_LEARNER); + return (mapping.findForward(LOAD_LEARNER)); + } + return (mapping.findForward(INDIVIDUAL_REPORT)); } @@ -314,9 +366,10 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + IVoteService voteService =VoteUtils.getToolService(request); - - setContentInUse(request); + setContentInUse(request); Map mapGeneralCheckedOptionsContent=(Map) request.getSession().getAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT); logger.debug("final mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); @@ -345,62 +398,28 @@ VoteQueUsr voteQueUsr=LearningUtil.getUser(request); logger.debug("voteQueUsr: " + voteQueUsr); - String maxNominationCount=voteLearningForm.getMaxNominationCount(); - logger.debug("current maxNominationCount: " + maxNominationCount); - - int intMaxNominationCount=0; - if (maxNominationCount != null) - intMaxNominationCount=new Integer(maxNominationCount).intValue(); - logger.debug("intMaxNominationCount: " + intMaxNominationCount); - - int nominationCount=0; - if (intMaxNominationCount != 0) - { - nominationCount=voteService.getLastNominationCount(voteQueUsr.getUid()); - logger.debug("current nominationCount: " + nominationCount); - - Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug("current toolSessionId: " + toolSessionId); - logger.debug("current user's voteSession: " + voteQueUsr.getVoteSession()); - logger.debug("current user's toolSessionId: " + voteQueUsr.getVoteSession().getVoteSessionId()); - - if (voteQueUsr.getVoteSession().getVoteSessionId().toString().equals(toolSessionId.toString())) - { - if (nominationCount >= intMaxNominationCount) - { - logger.debug("this is a the same user."); - logger.debug("max nom count reached..."); - logger.debug("fwd'ing to: " + EXIT_PAGE); - return (mapping.findForward(EXIT_PAGE)); - } - } - } - - int newNominationCount=nominationCount+1; - logger.debug("newNominationCount: " + newNominationCount); logger.debug("creating attemps with mapGeneralCheckedOptionsContent " + mapGeneralCheckedOptionsContent); voteService.removeAttemptsForUser(voteQueUsr.getUid()); logger.debug("nominations deleted for user: " + voteQueUsr.getUid()); logger.debug("mapGeneralCheckedOptionsContent size: " + mapGeneralCheckedOptionsContent.size()); if (mapGeneralCheckedOptionsContent.size() > 0) { - LearningUtil.createAttempt(request, voteQueUsr, mapGeneralCheckedOptionsContent, userEntry, newNominationCount, false); + LearningUtil.createAttempt(request, voteQueUsr, mapGeneralCheckedOptionsContent, userEntry, false); } - logger.debug("using nominationCount: " + newNominationCount); + if ((mapGeneralCheckedOptionsContent.size() == 0 && (userEntryAvailable == true))) { logger.debug("mapGeneralCheckedOptionsContent size is 0"); Map mapLeanerCheckedOptionsContent= new TreeMap(new VoteComparator()); mapLeanerCheckedOptionsContent.put("101", userEntry); logger.debug("after mapsize check mapLeanerCheckedOptionsContent " + mapLeanerCheckedOptionsContent); - logger.debug("using nominationCount: " + nominationCount); if (userEntry.length() > 0) { logger.debug("creating entry for: " + userEntry); - LearningUtil.createAttempt(request, voteQueUsr, mapLeanerCheckedOptionsContent, userEntry, newNominationCount, true); + LearningUtil.createAttempt(request, voteQueUsr, mapLeanerCheckedOptionsContent, userEntry, true); } } if ((mapGeneralCheckedOptionsContent.size() > 0) && (userEntryAvailable == true)) @@ -410,11 +429,10 @@ mapLeanerCheckedOptionsContent.put("102", userEntry); logger.debug("after mapsize check mapLeanerCheckedOptionsContent " + mapLeanerCheckedOptionsContent); - logger.debug("using nominationCount: " + nominationCount); if (userEntry.length() > 0) { logger.debug("creating entry for: " + userEntry); - LearningUtil.createAttempt(request, voteQueUsr, mapLeanerCheckedOptionsContent, userEntry, newNominationCount, false); + LearningUtil.createAttempt(request, voteQueUsr, mapLeanerCheckedOptionsContent, userEntry, false); } } @@ -441,6 +459,8 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + IVoteService voteService =VoteUtils.getToolService(request); Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); @@ -488,16 +508,25 @@ VoteLearningForm voteLearningForm = (VoteLearningForm) form; voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + IVoteService voteService =VoteUtils.getToolService(request); - - voteLearningForm.resetParameters(); + voteLearningForm.resetParameters(); LearningUtil.readParameters(request, voteLearningForm); logger.debug("doing getOptionCheckBoxSelected"); setContentInUse(request); voteLearningForm.resetCommands(); - LearningUtil.selectOptionsCheckBox(request,voteLearningForm, voteLearningForm.getQuestionIndex()); + + Map mapGeneralCheckedOptionsContent=(Map) request.getSession().getAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT); + logger.debug("mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); + + Map mapLeanerCheckedOptionsContent=LearningUtil.selectOptionsCheckBox(request,voteLearningForm, voteLearningForm.getQuestionIndex(), mapGeneralCheckedOptionsContent); + logger.debug("post select mapLeanerCheckedOptionsContent: " + mapLeanerCheckedOptionsContent); + + request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapLeanerCheckedOptionsContent); + voteLearningForm.resetCommands(); return (mapping.findForward(LOAD_LEARNER)); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java =================================================================== diff -u -r865d01f017c6e40ee98ae2e61d5bbbe49b2a5851 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision 865d01f017c6e40ee98ae2e61d5bbbe49b2a5851) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -52,7 +52,7 @@ protected String continueOptions; protected String nextOptions; - protected String nominateVotes; + protected String castVotes; protected String continueOptionsCombined; protected String redoQuestions; @@ -76,6 +76,8 @@ protected String nominationsSubmited; protected String revisitingUser; protected String revisitingPageActive; + protected String maxNominationCountReached; + protected int castVoteCount; protected void resetUserActions() { @@ -540,21 +542,8 @@ public void setMaxNominationCount(String maxNominationCount) { this.maxNominationCount = maxNominationCount; } + /** - * @return Returns the nominateVotes. - */ - public String getNominateVotes() { - return nominateVotes; - } - /** - * @param nominateVotes The nominateVotes to set. - */ - public void setNominateVotes(String nominateVotes) { - this.nominateVotes = nominateVotes; - } - - - /** * @return Returns the nominationsSubmited. */ public String getNominationsSubmited() { @@ -592,4 +581,41 @@ this.revisitingPageActive = revisitingPageActive; } + /** + * @return Returns the castVoteCount. + */ + public int getCastVoteCount() { + return castVoteCount; + } + /** + * @param castVoteCount The castVoteCount to set. + */ + public void setCastVoteCount(int castVoteCount) { + this.castVoteCount = castVoteCount; + } + + /** + * @return Returns the castVotes. + */ + public String getCastVotes() { + return castVotes; + } + /** + * @param castVotes The castVotes to set. + */ + public void setCastVotes(String castVotes) { + this.castVotes = castVotes; + } + /** + * @return Returns the maxNominationCountReached. + */ + public String getMaxNominationCountReached() { + return maxNominationCountReached; + } + /** + * @param maxNominationCountReached The maxNominationCountReached to set. + */ + public void setMaxNominationCountReached(String maxNominationCountReached) { + this.maxNominationCountReached = maxNominationCountReached; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r277d8412bc03b9c73992a0e6f3ad845cd0a4eba6 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 277d8412bc03b9c73992a0e6f3ad845cd0a4eba6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -133,6 +133,9 @@ voteLearningForm.setRevisitingUser(new Boolean(false).toString()); voteLearningForm.setRevisitingPageActive(new Boolean(false).toString()); voteLearningForm.setUserEntry(""); + voteLearningForm.setCastVoteCount(0); + voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); + /* * persist time zone information to session scope. */ @@ -370,15 +373,11 @@ logger.debug("userSessionId: " + userSessionId); Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); logger.debug("current toolSessionId: " + toolSessionId); + if (toolSessionId.toString().equals(userSessionId)) { - logger.debug("the user's session id AND user id exists in the tool tables go to redo questions. " + toolSessionId + " voteQueUsr: " + - voteQueUsr + " user id: " + voteQueUsr.getQueUsrId()); - logger.debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); - - voteLearningForm.setRevisitingUser(new Boolean(true).toString()); - voteLearningForm.setRevisitingPageActive(new Boolean(true).toString()); - + logger.debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); + logger.debug("start building MAP_GENERAL_CHECKED_OPTIONS_CONTENT"); Long toolContentId=(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentId: " + toolContentId); @@ -417,6 +416,27 @@ } request.getSession().setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, localMapQuestionsContent); logger.debug("end building MAP_GENERAL_CHECKED_OPTIONS_CONTENT: " + localMapQuestionsContent); + + + + boolean isSessionCompleted=isSessionCompleted(userSessionId, voteService); + logger.debug("isSessionCompleted: " + isSessionCompleted); + + String isContentLockOnFinish=voteLearningForm.getLockOnFinish(); + logger.debug("isContentLockOnFinish: " + isContentLockOnFinish); + if ((isContentLockOnFinish.equals(new Boolean(true).toString()) && (isSessionCompleted == true))) + { + logger.debug("user with session id: " + userSessionId + " should not redo votes. session is locked."); + logger.debug("fwd'ing to: " + EXIT_PAGE); + return (mapping.findForward(EXIT_PAGE)); + } + + + logger.debug("the user's session id AND user id exists in the tool tables go to redo questions. " + toolSessionId + " voteQueUsr: " + + voteQueUsr + " user id: " + voteQueUsr.getQueUsrId()); + voteLearningForm.setRevisitingUser(new Boolean(true).toString()); + voteLearningForm.setRevisitingPageActive(new Boolean(true).toString()); + return (mapping.findForward(ALL_NOMINATIONS)); } } @@ -431,28 +451,28 @@ } -/** - * sets up question and candidate answers maps - * commonContentSetup(HttpServletRequest request, VoteContent voteContent) - * - * @param request - * @param voteContent - */ -protected void commonContentSetup(HttpServletRequest request, VoteContent voteContent) -{ - Map mapQuestionsContent= new TreeMap(new VoteComparator()); - mapQuestionsContent=LearningUtil.buildQuestionContentMap(request,voteContent); - logger.debug("mapQuestionsContent: " + mapQuestionsContent); - - request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); - logger.debug("MAP_QUESTION_CONTENT_LEARNER: " + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER)); - logger.debug("voteContent has : " + mapQuestionsContent.size() + " entries."); - request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestionsContent.size()).toString()); - - request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); - logger.debug("CURRENT_QUESTION_INDEX: " + request.getSession().getAttribute(CURRENT_QUESTION_INDEX)); - -} + /** + * sets up question and candidate answers maps + * commonContentSetup(HttpServletRequest request, VoteContent voteContent) + * + * @param request + * @param voteContent + */ + protected void commonContentSetup(HttpServletRequest request, VoteContent voteContent) + { + Map mapQuestionsContent= new TreeMap(new VoteComparator()); + mapQuestionsContent=LearningUtil.buildQuestionContentMap(request,voteContent); + logger.debug("mapQuestionsContent: " + mapQuestionsContent); + + request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); + logger.debug("MAP_QUESTION_CONTENT_LEARNER: " + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER)); + logger.debug("voteContent has : " + mapQuestionsContent.size() + " entries."); + request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestionsContent.size()).toString()); + + request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1"); + logger.debug("CURRENT_QUESTION_INDEX: " + request.getSession().getAttribute(CURRENT_QUESTION_INDEX)); + + } /** @@ -571,6 +591,20 @@ } + boolean isSessionCompleted(String userSessionId, IVoteService voteService) + { + logger.debug("userSessionId:" + userSessionId); + VoteSession voteSession=voteService.retrieveVoteSession(new Long(userSessionId)); + logger.debug("retrieving voteSession: " + voteSession); + logger.debug("voteSession status : " + voteSession.getSessionStatus()); + if ((voteSession.getSessionStatus() != null) && (voteSession.getSessionStatus().equals(VoteAppConstants.COMPLETED))) + { + logger.debug("this session is COMPLETED voteSession status : " + userSessionId + "->" + voteSession.getSessionStatus()); + return true; + } + return false; + } + /** * persists error messages to request scope * @param request Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -7,7 +7,7 @@ - + - - - + access="property" + column="allowText" + length="1" + /> + - - - - - - - - - - - - + + + - - - - - - - - Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (.../VoteSession.hbm.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (.../VoteSession.hbm.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -6,7 +6,7 @@ - + access="property" + column="singleUserEntry" + length="1" + /> + - - - - - -
Index: lams_tool_vote/web/META-INF/MANIFEST.MF =================================================================== diff -u -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/web/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) +++ lams_tool_vote/web/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -1,5 +1,5 @@ Manifest-Version: 1.0 Ant-Version: Apache Ant 1.5.3 Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.) -Class-Path: ./lams.jar ./lams-tool-vote11.jar ./lams-contentrepository.jar ./lams-learning.jar +Class-Path: ./lams.jar ./lams-tool-lavote11.jar ./lams-contentrepository.jar ./lams-learning.jar Index: lams_tool_vote/web/WEB-INF/struts-config.xml =================================================================== diff -u -r277d8412bc03b9c73992a0e6f3ad845cd0a4eba6 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 277d8412bc03b9c73992a0e6f3ad845cd0a4eba6) +++ lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -236,7 +236,14 @@ redirect="false" /> + + + + - - - - - -       - - - - - - -       - - Index: lams_tool_vote/web/learning/AnswersContent.jsp =================================================================== diff -u -r865d01f017c6e40ee98ae2e61d5bbbe49b2a5851 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/web/learning/AnswersContent.jsp (.../AnswersContent.jsp) (revision 865d01f017c6e40ee98ae2e61d5bbbe49b2a5851) +++ lams_tool_vote/web/learning/AnswersContent.jsp (.../AnswersContent.jsp) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -47,14 +47,15 @@ + + + + + + + - - - - - - @@ -164,10 +165,10 @@ - - + onclick="submitMethod('castVotes');"> + Index: lams_tool_vote/web/learning/ExitLearning.jsp =================================================================== diff -u -r261d9a36d11a99322125fa55faaddffc16a041b3 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/web/learning/ExitLearning.jsp (.../ExitLearning.jsp) (revision 261d9a36d11a99322125fa55faaddffc16a041b3) +++ lams_tool_vote/web/learning/ExitLearning.jsp (.../ExitLearning.jsp) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -28,7 +28,27 @@ - + + +
+ + + + + + + + + + + + + + + + + + Index: lams_tool_vote/web/learning/IndividualLearnerResults.jsp =================================================================== diff -u -r9656fbcdd18cc51826a0a61a1bf93bdba249fdc7 -rae28185f07883077586773f760d1bde953e2d9bf --- lams_tool_vote/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision 9656fbcdd18cc51826a0a61a1bf93bdba249fdc7) +++ lams_tool_vote/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision ae28185f07883077586773f760d1bde953e2d9bf) @@ -65,6 +65,25 @@ onclick="submitMethod('redoQuestions');">
+ + + + + +       + + + + + + +       + +