Index: lams_tool_vote/build.xml =================================================================== diff -u -rad683fcaeabe83c702b599c5c866bb7d30cd7191 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/build.xml (.../build.xml) (revision ad683fcaeabe83c702b599c5c866bb7d30cd7191) +++ lams_tool_vote/build.xml (.../build.xml) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -388,6 +388,7 @@ toolLibraryInsertScriptPath="${db.scripts}/library_insert.sql" toolInsertScriptPath="${db.scripts}/tool_insert.sql" toolApplicationContextPath="/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml" + lamsEarPath="${jboss.deploy}" toolContext="${toolContext}" toolWebUri="${product}.war" Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml =================================================================== diff -u -rb9472d342c6b0edd1c3e0df5ff2b7179051bb389 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision b9472d342c6b0edd1c3e0df5ff2b7179051bb389) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -42,16 +42,7 @@ length="65535" /> - - - + + + + - - - - - - - - + - - - - - + @@ -43,12 +43,6 @@ - - - - - - @@ -67,6 +61,13 @@ + + + + + + + @@ -80,10 +81,23 @@ - + + + + + + + + + + + + + + @@ -106,18 +120,6 @@ - - - - - - - - - - - - @@ -156,12 +158,6 @@ - - - - - - @@ -201,19 +197,6 @@ - - - - - - - - - - - - - @@ -255,8 +238,8 @@ - + Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql =================================================================== diff -u -ra135b38b088c2fe771f10b3d87705efc5b877412 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision a135b38b088c2fe771f10b3d87705efc5b877412) +++ lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -2,24 +2,21 @@ uid BIGINT(20) NOT NULL AUTO_INCREMENT , content_id BIGINT(20) NOT NULL , title TEXT NOT NULL - , posting TEXT , 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 - , username_visible TINYINT(1) NOT NULL DEFAULT 0 + , allowText TINYINT(1) NOT NULL DEFAULT 0 + , voteChangable TINYINT(1) NOT NULL DEFAULT 0 , created_by BIGINT(20) NOT NULL DEFAULT 0 - , monitoring_report_title TEXT NOT NULL - , report_title TEXT NOT NULL , run_offline TINYINT(1) NOT NULL DEFAULT 0 , define_later TINYINT(1) NOT NULL DEFAULT 0 , offline_instructions TEXT , online_instructions TEXT - , end_learning_message TEXT NOT NULL , content_in_use TINYINT(1) NOT NULL DEFAULT 0 , lock_on_finish TINYINT NOT NULL DEFAULT 0 , retries TINYINT(1) NOT NULL DEFAULT 0 - , show_report TINYINT(1) NOT NULL DEFAULT 0 , UNIQUE UQ_tl_lamc11_content_1 (content_id) , PRIMARY KEY (uid) )TYPE=InnoDB; @@ -93,6 +90,7 @@ REFERENCES tl_vote11_content (uid) )TYPE=InnoDB; -INSERT INTO tl_vote11_content(uid, content_id , title , instructions , posting, creation_date , questions_sequenced , username_visible , created_by , monitoring_report_title , report_title , run_offline , define_later, offline_instructions, online_instructions, end_learning_message, content_in_use, retries, show_report) VALUES (1, ${default_content_id} ,'Voting Title','Voting Instructions', 'sample posting', NOW(), 0, 0,1,'Voting Report','Report', 0, 0, 'offline instructions','online instructions','Finished Activity...', 0, 0, 0); +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_vote11_que_content (uid,question, display_order, vote_content_id) VALUES (1, 'sample nomination', 1, 1); \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -219,16 +219,24 @@ logger.debug("ACTIVITY_INSTRUCTIONS: " + defaultVoteContent.getInstructions()); - voteAuthoringForm.setReportTitle(defaultVoteContent.getReportTitle()); - voteAuthoringForm.setMonitoringReportTitle(defaultVoteContent.getMonitoringReportTitle()); - voteAuthoringForm.setEndLearningMessage(defaultVoteContent.getEndLearningMessage()); + //voteAuthoringForm.setReportTitle(defaultVoteContent.getReportTitle()); + //voteAuthoringForm.setMonitoringReportTitle(defaultVoteContent.getMonitoringReportTitle()); + //voteAuthoringForm.setEndLearningMessage(defaultVoteContent.getEndLearningMessage()); voteAuthoringForm.setOnlineInstructions(defaultVoteContent.getOnlineInstructions()); voteAuthoringForm.setOfflineInstructions(defaultVoteContent.getOfflineInstructions()); - voteAuthoringForm.setMonitoringReportTitle(defaultVoteContent.getMonitoringReportTitle()); + //voteAuthoringForm.setMonitoringReportTitle(defaultVoteContent.getMonitoringReportTitle()); //determine the status of radio boxes - voteAuthoringForm.setUsernameVisible(defaultVoteContent.isUsernameVisible()?ON:OFF); - voteAuthoringForm.setQuestionsSequenced(defaultVoteContent.isQuestionsSequenced()?ON:OFF); + //voteAuthoringForm.setUsernameVisible(defaultVoteContent.isUsernameVisible()?ON:OFF); + //voteAuthoringForm.setQuestionsSequenced(defaultVoteContent.isQuestionsSequenced()?ON:OFF); + voteAuthoringForm.setAllowText(defaultVoteContent.isAllowText()?ON:OFF); + voteAuthoringForm.setVoteChangable(defaultVoteContent.isVoteChangable()?ON:OFF); + voteAuthoringForm.setLockOnFinish(defaultVoteContent.isLockOnFinish()?ON:OFF); + voteAuthoringForm.setRetries(defaultVoteContent.isRetries()?ON:OFF); + + String maxNomcount= defaultVoteContent.getMaxNominationCount(); + logger.debug("maxNomcount: " + maxNomcount); + voteAuthoringForm.setMaxNominationCount(maxNomcount); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -88,6 +88,12 @@ /** nullable persistent field */ private long createdBy; + + private boolean voteChangable; + + private boolean allowText; + + private String maxNominationCount; /** nullable persistent field */ private boolean lockOnFinish; @@ -121,7 +127,7 @@ /** full constructor */ public VoteContent(Long voteContentId, String content, String title, String instructions, String posting, boolean defineLater, boolean runOffline, - Date creationDate, Date updateDate, boolean questionsSequenced, boolean usernameVisible, String reportTitle, + Date creationDate, Date updateDate, boolean questionsSequenced, boolean voteChangable, boolean allowText, String maxNominationCount, boolean usernameVisible, String reportTitle, String monitoringReportTitle, long createdBy, boolean lockOnFinish, boolean contentInUse, String offlineInstructions, String onlineInstructions, String endLearningMessage, boolean showReport, boolean retries, Set voteQueContents, Set voteSessions, Set voteAttachments) { @@ -135,6 +141,9 @@ this.creationDate = creationDate; this.updateDate = updateDate; this.questionsSequenced = questionsSequenced; + this.voteChangable=voteChangable; + this.maxNominationCount=maxNominationCount; + this.allowText=allowText; this.usernameVisible = usernameVisible; this.reportTitle = reportTitle; this.monitoringReportTitle = monitoringReportTitle; @@ -188,6 +197,9 @@ vote.getCreationDate(), vote.getUpdateDate(), vote.isQuestionsSequenced(), + vote.isVoteChangable(), + vote.isAllowText(), + vote.getMaxNominationCount(), vote.isUsernameVisible(), vote.getReportTitle(), vote.getMonitoringReportTitle(), @@ -520,4 +532,42 @@ public void setPosting(String posting) { this.posting = posting; } + + /** + * @return Returns the voteChangable. + */ + public boolean isVoteChangable() { + return voteChangable; + } + /** + * @param voteChangable The voteChangable to set. + */ + public void setVoteChangable(boolean voteChangable) { + this.voteChangable = voteChangable; + } + + /** + * @return Returns the allowText. + */ + public boolean isAllowText() { + return allowText; + } + /** + * @param allowText The allowText to set. + */ + public void setAllowText(boolean allowText) { + this.allowText = allowText; + } + /** + * @return Returns the maxNominationCount. + */ + public String getMaxNominationCount() { + return maxNominationCount; + } + /** + * @param maxNominationCount The maxNominationCount to set. + */ + public void setMaxNominationCount(String maxNominationCount) { + this.maxNominationCount = maxNominationCount; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== diff -u -ra135b38b088c2fe771f10b3d87705efc5b877412 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision a135b38b088c2fe771f10b3d87705efc5b877412) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -1061,55 +1061,33 @@ { UserDTO toolUser = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); - boolean isQuestionsSequenced=false; - boolean isUsernameVisible=false; - //String reportTitle = voteAuthoringForm.getReportTitle(); - String richTextTitle = request.getParameter("title"); String richTextInstructions = request.getParameter("instructions"); logger.debug("richTextTitle: " + richTextTitle); logger.debug("richTextInstructions: " + richTextInstructions); - String richTextPosting = request.getParameter("posting"); - logger.debug("richTextPosting: " + richTextPosting); + String voteChangable = voteAuthoringForm.getVoteChangable(); + logger.debug("voteChangable: " + voteChangable); - String monitoringReportTitle = voteAuthoringForm.getMonitoringReportTitle(); - logger.debug("monitoringReportTitle: " + monitoringReportTitle); + String lockedOnFinish=voteAuthoringForm.getLockOnFinish(); + logger.debug("lockedOnFinish: " + lockedOnFinish); - //String richTextOnlineInstructions = voteAuthoringForm.getOnlineInstructions(); - //logger.debug("richTextOnlineInstructions: " + richTextOnlineInstructions); - - //String richTextInstructions = voteAuthoringForm.getInstructions(); - //String richTextOfflineInstructions = voteAuthoringForm.getOfflineInstructions(); - //logger.debug("richTextOfflineInstructions: " + richTextOfflineInstructions); - - //String endLearningMessage = voteAuthoringForm.getEndLearningMessage(); - //logger.debug("endLearningMessage: " + endLearningMessage); - - String questionsSequenced = voteAuthoringForm.getQuestionsSequenced(); - logger.debug("questionsSequenced: " + questionsSequenced); - - String usernameVisible = voteAuthoringForm.getUsernameVisible(); - logger.debug("usernameVisible: " + usernameVisible); - + String allowText=voteAuthoringForm.getAllowText(); + logger.debug("allowText: " + allowText); + String retries = voteAuthoringForm.getRetries(); logger.debug("retries: " + retries); - String richTextReportTitle= (String)request.getSession().getAttribute(RICHTEXT_REPORT_TITLE); - String richTextEndLearningMessage=(String)request.getSession().getAttribute(RICHTEXT_END_LEARNING_MSG); - logger.debug("richTextReportTitle: " + richTextReportTitle); - logger.debug("richTextEndLearningMessage: " + richTextEndLearningMessage); - - + String maxNomcount= voteAuthoringForm.getMaxNominationCount(); + logger.debug("maxNomcount: " + maxNomcount); + String richTextOfflineInstructions=(String)request.getSession().getAttribute(RICHTEXT_OFFLINEINSTRUCTIONS); logger.debug("richTextOfflineInstructions: " + richTextOfflineInstructions); String richTextOnlineInstructions=(String)request.getSession().getAttribute(RICHTEXT_ONLINEINSTRUCTIONS); logger.debug("richTextOnlineInstructions: " + richTextOnlineInstructions); - - boolean setCommonContent=true; - if ((questionsSequenced == null) || (usernameVisible == null)) + if ((lockedOnFinish == null) || (voteChangable == null)) { setCommonContent=false; } @@ -1121,14 +1099,20 @@ boolean questionsSequencedBoolean=false; boolean synchInMonitorBoolean=false; boolean retriesBoolean=false; - boolean usernameVisibleBoolean=false; + boolean voteChangableBoolean=false; + boolean lockedOnFinishBoolean=false; + boolean allowTextBoolean=false; + if (setCommonContent) { - if (questionsSequenced.equalsIgnoreCase(ON)) - questionsSequencedBoolean=true; + if (voteChangable.equalsIgnoreCase(ON)) + voteChangableBoolean=true; - if (usernameVisible.equalsIgnoreCase(ON)) - usernameVisibleBoolean=true; + if (lockedOnFinish.equalsIgnoreCase(ON)) + lockedOnFinishBoolean=true; + + if (allowText.equalsIgnoreCase(ON)) + allowTextBoolean=true; if (retries.equalsIgnoreCase(ON)) retriesBoolean=true; @@ -1162,7 +1146,6 @@ Long toolContentIdLong =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentIdLong: " + toolContentIdLong); - //String toolContentId=voteAuthoringForm.getToolContentId(); String toolContentId=toolContentIdLong.toString(); logger.debug("toolContentId: " + toolContentId); @@ -1181,7 +1164,6 @@ voteContent.setVoteContentId(new Long(toolContentId)); voteContent.setTitle(richTextTitle); voteContent.setInstructions(richTextInstructions); - voteContent.setPosting(richTextPosting); voteContent.setUpdateDate(new Date(System.currentTimeMillis())); /**keep updating this one*/ logger.debug("userId: " + userId); voteContent.setCreatedBy(userId); /**make sure we are setting the userId from the User object above*/ @@ -1191,14 +1173,13 @@ if ((!activeModule.equals(DEFINE_LATER)) && (setCommonContent)) { logger.debug("setting other content values..."); - voteContent.setUsernameVisible(usernameVisibleBoolean); + voteContent.setVoteChangable(voteChangableBoolean); + voteContent.setLockOnFinish(lockedOnFinishBoolean); + voteContent.setAllowText(allowTextBoolean); + voteContent.setMaxNominationCount(maxNomcount); voteContent.setRetries(retriesBoolean); - voteContent.setQuestionsSequenced(questionsSequencedBoolean); /**the default question listing in learner mode will be all in the same page*/ voteContent.setOnlineInstructions(richTextOnlineInstructions); voteContent.setOfflineInstructions(richTextOfflineInstructions); - voteContent.setEndLearningMessage(richTextEndLearningMessage); - voteContent.setReportTitle(richTextReportTitle); - voteContent.setMonitoringReportTitle(monitoringReportTitle); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -44,6 +44,12 @@ protected String editDefaultQuestion; protected String removeOptionContent; + protected String voteChangable; + protected String lockOnFinish; + protected String allowText; + + protected String maxNominationCount; + protected String fileItem; protected String uuid; @@ -186,6 +192,10 @@ this.retries=null; this.sln=null; this.passmark=null; + this.voteChangable=null; + this.lockOnFinish=null; + this.allowText=null; + this.maxNominationCount=null; this.summaryMonitoring=null; this.instructionsMonitoring=null; @@ -203,6 +213,9 @@ this.sln =OPTION_OFF; this.showFeedback =OPTION_OFF; this.usernameVisible =OPTION_OFF; + this.voteChangable =OPTION_OFF; + this.lockOnFinish =OPTION_OFF; + this.allowText =OPTION_OFF; } @@ -835,4 +848,54 @@ public void setOptIndex(String optIndex) { this.optIndex = optIndex; } + + /** + * @return Returns the voteChangable. + */ + public String getVoteChangable() { + return voteChangable; + } + /** + * @param voteChangable The voteChangable to set. + */ + public void setVoteChangable(String voteChangable) { + this.voteChangable = voteChangable; + } + + /** + * @return Returns the lockOnFinish. + */ + public String getLockOnFinish() { + return lockOnFinish; + } + /** + * @param lockOnFinish The lockOnFinish to set. + */ + public void setLockOnFinish(String lockOnFinish) { + this.lockOnFinish = lockOnFinish; + } + /** + * @return Returns the allowText. + */ + public String getAllowText() { + return allowText; + } + /** + * @param allowText The allowText to set. + */ + public void setAllowText(String allowText) { + this.allowText = allowText; + } + /** + * @return Returns the maxNominationCount. + */ + public String getMaxNominationCount() { + return maxNominationCount; + } + /** + * @param maxNominationCount The maxNominationCount to set. + */ + public void setMaxNominationCount(String maxNominationCount) { + this.maxNominationCount = maxNominationCount; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -ra135b38b088c2fe771f10b3d87705efc5b877412 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision a135b38b088c2fe771f10b3d87705efc5b877412) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -441,8 +441,10 @@ { logger.debug("retrieve uid of the content based on default content id determined above: " + defaultContentID); VoteContent voteContent=voteService.retrieveVote(new Long(defaultContentID)); + logger.debug("voteContent: " + voteContent); if (voteContent == null) { + logger.debug("voteContent is null: " + voteContent); VoteUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default content"); persistError(request,"error.defaultContent.notSetup"); @@ -456,6 +458,7 @@ } catch(Exception e) { + logger.debug("other problems: " + e); VoteUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default question content"); persistError(request,"error.defaultContent.notSetup"); Index: lams_tool_vote/web/authoring/AdvancedContent.jsp =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/web/authoring/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/web/authoring/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -35,41 +35,62 @@ - + - + + + + + + + + - - - - - - - + - + + - - - - - +
- : + : - + - +
- : + : - - + + - + - +
+ + : + + + + + + + + + + + +
@@ -87,41 +108,20 @@
- - : - - - - - -
- - : - + + + : + + + - - - -
-    -
- \ No newline at end of file Index: lams_tool_vote/web/authoring/BasicContent.jsp =================================================================== diff -u -ra135b38b088c2fe771f10b3d87705efc5b877412 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision a135b38b088c2fe771f10b3d87705efc5b877412) +++ lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -60,14 +60,6 @@ - - : - - - - - - Index: lams_tool_vote/web/authoring/InstructionsContent.jsp =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rc5172424555b18ee103dd5609fd36e2d886d035a --- lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision c5172424555b18ee103dd5609fd36e2d886d035a) @@ -40,41 +40,42 @@ - - - + + + + - - - + + - +
+ - : + - +
- - + + - - + +
- - - + + + - +
@@ -84,7 +85,7 @@ - + @@ -96,51 +97,51 @@ - images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOfflineFile');"> + images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOnlineFile');">
+ - + : - +
- - + + - - + +
- - - + + + - +
@@ -150,7 +151,7 @@ - + @@ -162,14 +163,15 @@ - images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOnlineFile');"> + images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOfflineFile');">