Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -179,7 +179,6 @@ - - - +error.default.content.notSetup =The tool initialization error: The tool default content has not been set up properly. +error.questions.submitted.none =Please correct this: No questions have been submitted. Please also note that the questions with no candidate answers are being automatically removed. +error.question.empty =Please correct this: The question text can not be empty. +error.weights.empty =Please correct this: The question weights can not be empty. +error.checkBoxes.empty =Please correct this: No candidate answer has been selected. +error.weights.zero =Please correct this: The question weights can not be 0. +error.weights.notInteger =Please correct this: The question weights must be an integer. +error.question.weight.total =Please correct this: The total question weight:100 has been reached. +error.answers.duplicate =Please correct this: The candidate answers must be unique. +error.emptyQuestion =Please enter the question text. The chosen question can not be empty. +error.singleOption =Please correct this: There must be at least 2 candidate answers. +error.emptyWeight =Sorry, the question can not be added without a weight. +error.title =Please correct this: The field "Title" is mandatory.
+error.instructions =Please correct this: The field "Instructions" is mandatory.
+error.reportTitle =Please correct this: The field "Report Title (Advanced)" is mandatory.
+error.defaultquestion.empty =Please correct this: The first question can not be empty.
+error.passMark.empty =Please correct this: Pass Mark can not be empty. +options.count.zero =Please correct this: There must be at least one candidate answer. +error.passmark.notInteger =Please correct this: Pass Mark can only be an integer. +error.weights.total.invalid =Please correct this: The total weight must equal 100. Please also note that the questions with no candidate answers are being automatically removed. +error.learner.userId.required =Tool Activity Error! Can't continue. Tool Activity expects learner's user id. +error.learner.user.doesNoExist =Tool Activity Error! Learner is not ready in the tool's database yet. +error.file.notPersisted =An error occurred: The file is not viewable yet. Please save all the content first and check back. +error.learningUser.notAvailable =Tool Activity Error! Can't continue. Tool Activity expects a user id. +error.toolSession.notAvailable =Tool Activity Error! Can't continue. Tool session is not ready in the tool's database yet.
Please verify the API method: public void createToolSession(Long toolSessionId, Long toolContentId) has already been executed. +error.toolSession.doesNoExist =Tool Activity Error! Can't continue. Tool session is not ready in the tool's database yet. +error.toolContent.notAvailable =Tool Activity Error! Can't continue. Tool content is not ready in the tool's database yet.
Please verify the API method: public void createToolSession(Long toolSessionId, Long toolContentId) has run properly. +error.learner.required =Tool Activity Error! Can't continue. The Learner records are not ready in the tool's database yet. +error.fileName.empty =Please correct this: Under "Instructions", the file(name) to upload can not be empty. +error.questions.withNoOptions =Please note: The questions with no candidate answers have been automatically removed for you. Please check total question weight. +error.answers.empty =Please correct this: Candidate answers can not be empty. +error.passMark.greater100 =Please correct this: The passmark can not be greater than 100% +error.question.addNotAllowed.thisScreen = The question text can not be modified in this screen since it has options attached . Please use the "Options" button to edit the question text. +error.question.removeNotAllowed.thisScreen = The question can not be removed since one or more of the question texts has been modified. Please try again without any text modifications. +error.selectedIndex.empty =Can not continue. Please select the correct answer and click "Done". +error.content.locked =The content has been locked since it is being used by one mor more learners.
The modification of the content is not allowed. +error.content.doesNotExist =Tool Activity Error! Can't continue. Tool content is not ready in the tool's database yet. +error.content.inUse =The modification of the content is not allowed since one or more students has attempted the activity. +error.content.beingModified =The content can not be presented since it is being modified. Please check back later. +error.content.unstableState =The content is in an unstable state since it has been left editable while monitored.
Please use this screen to redefine the content. +error.defaultContent.notAvailable =Tool Activity Error! Can't continue
The the default content for the Tool Activity has not been set up. +error.defaultQuestionContent.notAvailable =Tool Activity Error! Can't continue
The the default question content for the Tool Activity has not been set up. +error.defaultOptionsContent.notAvailable =Tool Activity Error! Can't continue
The the default options content for the Tool Activity has not been set up. +error.noLearnerActivity =Summary report is not available since no users attempted the activity yet. + +#Learning mode resources +label.question =Question +label.answers =Answers: +button.endLearning =Finish +label.learning.user =User +label.learning.attemptTime =Attempt Date/Time +label.learning.timezone =Time-Zone +label.learning.response =Response +label.user =User +label.attemptTime =Attempt Date/Time +label.timezone =Time-Zone +label.response =Response +label.learning.forceOfflineMessage =This is setup to be carried out offline. Plase see your instructor for details. +label.learning.runOffline =This activity is not being done on the computer. Please see your instructor for details. +error.defineLater =Sorry, the activity's content is not ready yet. Please wait for the teacher to define this part. +error.toolSessionId.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a toolSession id. +error.contentId.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a content id. +error.authoringUser.notAvailable =Tool Activity Error! Can't continue. Tool Activity expects a user id. +error.userId.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a user id. +error.userId.notNumeric =Tool Activity Error! Can't continue. The user id passed to the Tool Activity must be numerical. +error.userId.existing =Tool Activity Error! Can't continue. The user id passed to the Tool Activity refers to a student that has already used the activity.
Each learner activity should be associated with a unique userId. +error.defaultContent.notSetup =Tool Activity Error! Can't continue. The default content for the tool has not been setup properly. +error.mode.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a mode. +error.mode.invalid =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a valid mode: learner or teacher +error.learner.sessionId.inconsistent =Tool Activity Error! Can't continue
The session id passed is inconsistent for learner progress report. + +#Monitoring mode resources +button.startLesson =Start Lesson +button.deleteLesson =Delete Lesson +button.contributeLesson =Contribute -> Report +button.forceComplete =Force Complete +error.synchInMonitor =The report is available only after all the students finish their activities.
+ Some of the students has not completed the activity yet. However, those students may be forced to complete. +error.monitorReportTitle =The field "Monitor Report Title (Advanced)" is mandatory.
+error.noStudentActivity =Sorry, the report can not be generated.
No student has attempted the activity yet. +error.contentAndToolSession.notCompatible =Tool Activity Error! Can't continue. The content id and tool session(s) passed to the tool activity are not compatible with each other.
The Tool Activity expects that each of the passed tool sessions refer to the same passed content id. +error.toolSessions.wrongFormat =Tool Activity Error! Can't continue. No valid tool sessions has been passed to the Tool Activity.
The expected format is: TOOLURL?toolContentId=A&toolSessionId1=B&toolSessionId2=C&toolSessionId3=D&... +error.numberFormatException =Tool Activity Error! Can't continue. The content id and tool session id(s) passed to the Tool Activity must be numerical. +error.ids.numberFormatException =Tool Activity Error! Can't continue. The content id and tool session id(s) passed to the Tool Activity must be numerical. +error.contentId.numberFormatException =Tool Activity Error! Can't continue. The content id passed to the Tool Activity must be numerical. +error.sessionId.numberFormatException =Tool Activity Error! Can't continue. The toolSession id passed to the Tool Activity must be numerical. +error.toolSessions.doesNotExist =Tool Activity Error! Can't continue. One of the toolsession ids passed to the Tool Activity does not refer to an existing tool session. +error.toolSession.doesNotExist =Tool Activity Error! Can't continue. The toolsession id passed to the Tool Activity does not refer to an existing tool session. +error.content.onlyContentAndNoSessions =A report can not be generated since no tool sessions has been passed to the Tool Activity. +error.content.noToolSessions =A report can not be generated since there has not been any student activity on this content. +error.user.doesNotExist =Tool Activity Error! Can't continue. The user id passed to the Tool Activity does not refer to an existing user. +error.tab.contentId.required =Sorry, the screen is not available. The Tool Activity requires a content id. +monitoring.feedback.instructionUpdate =The content has been updated successfully. + +group.label =Group +button.summary =Summary +button.editActivity =Edit Activity +button.stats =Stats +label.edit =Edit +label.update =Update +label.selectGroup =Select Group: +label.learner.progress =Learner Progress Report +label.stats.totalLearners =Total count of learners: +label.stats.allGroups =All Groups: +label.stats.totalAllGroups =Total count of all learners: + +#=========================Error Messages===========================# +error.system.vote=A system exception has occured. Please contact Lams International technical support at 95806666. The error to report is\:
{0}
+ + Fisheye: Tag 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d refers to a dead (removed) revision in file `lams_tool_vote/conf/language/VoteResources.properties'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/conf/war/META-INF/MANIFEST.MF =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/conf/war/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/conf/war/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -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-lamc11.jar ./lams-contentrepository.jar ./lams-learning.jar +Class-Path: ./lams.jar ./lams-tool-vote11.jar ./lams-contentrepository.jar ./lams-learning.jar Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/db/sql/create_lams_tool_vote.sql (.../create_lams_tool_vote.sql) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -130,7 +130,7 @@ )TYPE=InnoDB; -INSERT INTO tl_vote11_content(uid, content_id , title , instructions , 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_feedback, show_report) VALUES (1, 1 ,'Voting Title','Voting Instructions', NOW(), 0, 0,1,'Voting Report','Report', 0, 0, 'offline instructions','online instructions','Finished Activity...', 0, 0, 0, 0); +INSERT INTO tl_vote11_content(uid, content_id , title , instructions , 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_feedback, show_report) VALUES (1, ${default_content_id} ,'Voting Title','Voting Instructions', NOW(), 0, 0,1,'Voting Report','Report', 0, 0, 'offline instructions','online instructions','Finished Activity...', 0, 0, 0, 0); INSERT INTO tl_vote11_que_content (uid,question, disabled, vote_content_id) VALUES (1, 'sample posting', 0, 1); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -57,7 +57,7 @@ public static final String LEARNER_PROGRESS_USERID ="learnerProgressUserId"; public static final String AUTHORING ="authoring"; - public static final String SOURCE_MC_STARTER ="sourceMcStarter"; + public static final String SOURCE_VOTE_STARTER ="sourceVoteStarter"; public static final String AUTHORING_CANCELLED ="authoringCancelled"; public static final String DEFINE_LATER_EDIT_ACTIVITY ="defineLaterEditActivity"; public static final String ACTIVE_MODULE ="activeModule"; @@ -94,7 +94,11 @@ /* * authoring mode constants */ + public static final String IS_DEFINE_LATER ="isDefineLater"; + public static final String DEFAULT_CONTENT_ID_STR ="defaultContentIdStr"; + public static final String DEFAULT_QUESTION_CONTENT ="defaultQuestionContent"; public static final String MAP_QUESTIONS_CONTENT ="mapQuestionsContent"; + public static final String MAP_QUESTION_CONTENT ="mapQuestionContent"; public static final String MAP_OPTIONS_CONTENT ="mapOptionsContent"; public static final String MAP_DEFAULTOPTIONS_CONTENT ="mapDefaultOptionsContent"; public static final String MAP_DISABLED_QUESTIONS ="mapDisabledQuestions"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -40,6 +40,7 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.service.IVoteService; +import org.lamsfoundation.lams.tool.vote.web.VoteAuthoringForm; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.web.session.SessionManager; @@ -56,7 +57,7 @@ /** * returns the service object from the session cache - * IMcService getToolService(HttpServletRequest request) + * IVoteService getToolService(HttpServletRequest request) * * @param request * @return @@ -152,7 +153,7 @@ { IVoteService mcService =VoteUtils.getToolService(request); /* - VoteContent mcContent=mcService.retrieveMc(toolContentId); + VoteContent mcContent=mcService.retrieveVote(toolContentId); logger.debug("retrieving mcContent: " + mcContent); if (mcContent == null) return false; @@ -171,7 +172,7 @@ { logger.debug("existsSession"); IVoteService mcService =VoteUtils.getToolService(request); - VoteSession mcSession=mcService.retrieveMcSession(toolSessionId); + VoteSession mcSession=mcService.retrieveVoteSession(toolSessionId); logger.debug("mcSession:" + mcSession); if (mcSession == null) @@ -183,17 +184,17 @@ /** * returns a Map of options - * generateOptionsMap(List listMcOptions) + * generateOptionsMap(List listVoteOptions) * - * @param listMcOptions + * @param listVoteOptions * @return Map */ - public static Map generateOptionsMap(List listMcOptions) + public static Map generateOptionsMap(List listVoteOptions) { - logger.debug("incoming listMcOptions" + listMcOptions); + logger.debug("incoming listVoteOptions" + listVoteOptions); Map mapOptionsContent= new TreeMap(new VoteStringComparator()); - Iterator listIterator=listMcOptions.iterator(); + Iterator listIterator=listVoteOptions.iterator(); Long mapIndex=new Long(1); while (listIterator.hasNext()) { @@ -206,6 +207,32 @@ return mapOptionsContent; } + + public static void setDefaultSessionAttributes(HttpServletRequest request, VoteContent defaultVoteContent, VoteAuthoringForm voteAuthoringForm) + { + /*should never be null anyway as default content MUST exist in the db*/ + if(defaultVoteContent == null) + throw new NullPointerException("Default VoteContent cannot be null"); + + voteAuthoringForm.setTitle(defaultVoteContent.getTitle()); + voteAuthoringForm.setInstructions(defaultVoteContent.getInstructions()); + request.getSession().setAttribute(ACTIVITY_TITLE, defaultVoteContent.getTitle()); + request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, defaultVoteContent.getInstructions()); + + logger.debug("ACTIVITY_INSTRUCTIONS: " + defaultVoteContent.getInstructions()); + + voteAuthoringForm.setReportTitle(defaultVoteContent.getReportTitle()); + voteAuthoringForm.setMonitoringReportTitle(defaultVoteContent.getMonitoringReportTitle()); + voteAuthoringForm.setEndLearningMessage(defaultVoteContent.getEndLearningMessage()); + voteAuthoringForm.setOnlineInstructions(defaultVoteContent.getOnlineInstructions()); + voteAuthoringForm.setOfflineInstructions(defaultVoteContent.getOfflineInstructions()); + voteAuthoringForm.setMonitoringReportTitle(defaultVoteContent.getMonitoringReportTitle()); + + //determine the status of radio boxes + voteAuthoringForm.setUsernameVisible(defaultVoteContent.isUsernameVisible()?ON:OFF); + voteAuthoringForm.setQuestionsSequenced(defaultVoteContent.isQuestionsSequenced()?ON:OFF); + } + public static void persistRichText(HttpServletRequest request) { @@ -288,23 +315,23 @@ /** * retrieves existing updated file information - * populateUploadedFilesData(HttpServletRequest request, McContent defaultMcContent) + * populateUploadedFilesData(HttpServletRequest request, VoteContent defaultVoteContent) * * @param request - * @param defaultMcContent + * @param defaultVoteContent */ - public static void populateUploadedFilesData(HttpServletRequest request, VoteContent defaultMcContent) + public static void populateUploadedFilesData(HttpServletRequest request, VoteContent defaultVoteContent) { - logger.debug("attempt populateUploadedFilesData for: " + defaultMcContent); + logger.debug("attempt populateUploadedFilesData for: " + defaultVoteContent); IVoteService mcService =VoteUtils.getToolService(request); logger.debug("mcService: " + mcService); /** read the uploaded offline uuid + file name pair */ - List listOffFilesName=mcService.retrieveMcUploadedOfflineFilesName(defaultMcContent.getUid()); + List listOffFilesName=mcService.retrieveVoteUploadedOfflineFilesName(defaultVoteContent.getUid()); logger.debug("initial listOfflineFilesName: " + listOffFilesName); /** read the uploaded online uuid + file name pair */ - List listOnFilesName=mcService.retrieveMcUploadedOnlineFilesName(defaultMcContent.getUid()); + List listOnFilesName=mcService.retrieveVoteUploadedOnlineFilesName(defaultVoteContent.getUid()); logger.debug("initial listOnlineFilesName: " + listOnFilesName); request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES, listOffFilesName); @@ -446,7 +473,7 @@ * The idea of content being in use is, once any one learner starts using a particular content * that content should become unmodifiable. * - * isContentInUse(McContent mcContent) + * isContentInUse(VoteContent mcContent) * @param mcContent * @return boolean */ @@ -460,7 +487,7 @@ /** * find out if the content is being edited in monitoring interface or not. If it is, the author can not modify it. * - * isDefineLater(McContent mcContent) + * isDefineLater(VoteContent mcContent) * @param mcContent * @return boolean */ @@ -473,7 +500,7 @@ /** * find out if the content is set to run offline or online. If it is set to run offline , the learners are informed about that.. - * isRubnOffline(McContent mcContent) + * isRubnOffline(VoteContent mcContent) * * @param mcContent * @return boolean @@ -499,27 +526,27 @@ logger.debug("toolContentId:" + toolContentId); logger.debug("value:" + value); - VoteContent mcContent=mcService.retrieveMc(toolContentId); + VoteContent mcContent=mcService.retrieveVote(toolContentId); logger.debug("mcContent:" + mcContent); if (mcContent != null) { mcContent.setDefineLater(value); logger.debug("defineLater has been set to true"); - mcService.saveMcContent(mcContent); + mcService.saveVoteContent(mcContent); } } - public static String getDestination(String sourceMcStarter) + public static String getDestination(String sourceVoteStarter) { - logger.debug("sourceMcStarter: " + sourceMcStarter); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); - if ((sourceMcStarter != null) && !sourceMcStarter.equals("monitoring")) + if ((sourceVoteStarter != null) && !sourceVoteStarter.equals("monitoring")) { logger.debug("request is from authoring or define Later url. return to: " + LOAD_QUESTIONS); return LOAD_QUESTIONS; } - else if (sourceMcStarter == null) + else if (sourceVoteStarter == null) { logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS); return LOAD_QUESTIONS; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteContentDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteContentDAO.java (.../IVoteContentDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteContentDAO.java (.../IVoteContentDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -28,23 +28,23 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; public interface IVoteContentDAO { - public VoteContent getMcContentByUID(Long uid); + public VoteContent getVoteContentByUID(Long uid); - public VoteContent findMcContentById(Long mcContentId); + public VoteContent findVoteContentById(Long mcContentId); - public VoteContent getMcContentBySession(Long mcSessionId); + public VoteContent getVoteContentBySession(Long mcSessionId); - public void saveMcContent(VoteContent mcContent); + public void saveVoteContent(VoteContent mcContent); - public void updateMcContent(VoteContent mcContent); + public void updateVoteContent(VoteContent mcContent); - public void removeMc(VoteContent mcContent); + public void removeVote(VoteContent mcContent); - public void removeMcById(Long mcContentId); + public void removeVoteById(Long mcContentId); - public void removeMcSessions(VoteContent mcContent); + public void removeVoteSessions(VoteContent mcContent); - public void addMcSession(Long mcContentId, VoteSession mcSession); + public void addVoteSession(Long mcContentId, VoteSession mcSession); public List findAll(Class objClass); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteOptionsContentDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteOptionsContentDAO.java (.../IVoteOptionsContentDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteOptionsContentDAO.java (.../IVoteOptionsContentDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -33,27 +33,25 @@ */ public interface IVoteOptionsContentDAO { - public VoteOptsContent getMcOptionsContentByUID(Long uid); + public VoteOptsContent getVoteOptionsContentByUID(Long uid); + + public List findVoteOptionsContentByQueId(Long voteQueContentId); - public List findMcOptionsContentByQueId(Long mcQueContentId); - - public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid); + public List findVoteOptionNamesByQueId(Long voteQueContentId); + + public VoteOptsContent getOptionContentByOptionText(final String option, final Long voteQueContentUid); + + public void saveVoteOptionsContent(VoteOptsContent voteOptsContent); + + public void updateVoteOptionsContent(VoteOptsContent voteOptsContent); - public List getPersistedSelectedOptions(Long mcQueContentId); + public void removeVoteOptionsContentByUID(Long uid); - public List getCorrectOption(Long mcQueContentId); + public void removeVoteOptionsContentByQueId(Long voteQueContentId); + + public void removeVoteOptionsContent(VoteOptsContent voteOptsContent); - public void saveMcOptionsContent(VoteOptsContent mcOptionsContent); - - public void updateMcOptionsContent(VoteOptsContent mcOptionsContent); - - public void removeMcOptionsContentByUID(Long uid); - - public void removeMcOptionsContentByQueId(Long mcQueContentId); - - public void removeMcOptionsContent(VoteOptsContent mcOptsContent); - - public List findMcOptionNamesByQueId(Long mcQueContentId); + public void flush(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteQueContentDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteQueContentDAO.java (.../IVoteQueContentDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteQueContentDAO.java (.../IVoteQueContentDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -35,35 +35,31 @@ */ public interface IVoteQueContentDAO { - public VoteQueContent getMcQueContentByUID(Long uid); + public VoteQueContent getVoteQueContentByUID(Long uid); - public VoteQueContent getToolDefaultQuestionContent(final long mcContentId); - - public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid); + public VoteQueContent getToolDefaultQuestionContent(final long voteContentId); - public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid); - - public List getAllQuestionEntries(final long mcContentId); + public List getAllQuestionEntries(final long voteContentId); + + public VoteQueContent getQuestionContentByQuestionText(final String question, final Long voteContentUid); + + public void removeQuestionContentByVoteUid(final Long voteContentUid); + + public void resetAllQuestions(final Long voteContentUid); - public List refreshQuestionContent(final Long mcContentId); - - public void cleanAllQuestions(final Long mcContentUid); - - public void cleanAllQuestionsSimple(final Long mcContentUid); - - public void resetAllQuestions(final Long mcContentUid); - - public void removeQuestionContentByMcUid(final Long mcContentUid); - - public void saveMcQueContent(VoteQueContent mcQueContent); + public void cleanAllQuestions(final Long voteContentUid); + + public void cleanAllQuestionsSimple(final Long voteContentUid); + + public void saveVoteQueContent(VoteQueContent voteQueContent); - public void updateMcQueContent(VoteQueContent mcQueContent); - - public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent); + public void updateVoteQueContent(VoteQueContent voteQueContent); - public void removeMcQueContentByUID(Long uid); - - public void removeMcQueContent(VoteQueContent mcQueContent); + public void saveOrUpdateVoteQueContent(VoteQueContent voteQueContent); - public List getNextAvailableDisplayOrder(final long mcContentId); + public void removeVoteQueContentByUID(Long uid); + + public void removeVoteQueContent(VoteQueContent voteQueContent); + + public void flush(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java (.../IVoteSessionDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java (.../IVoteSessionDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -24,8 +24,8 @@ import java.util.List; -import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; +import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr; import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; /** @@ -34,29 +34,32 @@ * */ public interface IVoteSessionDAO { - public VoteSession getMcSessionByUID(Long uid); - - public VoteSession findMcSessionById(Long mcSessionId); + public VoteSession getVoteSessionByUID(Long uid); - public void saveMcSession(VoteSession mcSession); + public VoteSession findVoteSessionById(Long voteSessionId); - public void updateMcSession(VoteSession mcSession); + public int countSessionComplete(); - public void removeMcSessionByUID(Long uid); + public int countSessionIncomplete(); - public void removeMcSessionById(Long mcSessionId); - - public void removeMcSession(VoteSession mcSession); + public void saveVoteSession(VoteSession voteSession); - public VoteSession getMcSessionByUser(Long userId); + public void updateVoteSession(VoteSession voteSession); + + public void removeVoteSessionByUID(Long uid); - public void addMcUsers(Long mcSessionId, VoteQueUsr user); - - public List getSessionsFromContent(VoteContent mcContent); - - public List getSessionNamesFromContent(VoteContent mcContent); - - public int countSessionComplete(); + public void removeVoteSessionById(Long voteSessionId); - public int countSessionIncomplete(); + public void removeVoteSession(VoteSession voteSession); + + public VoteSession getVoteSessionByUser(final Long userId); + + public void removeVoteUsers(VoteSession voteSession); + + public void addVoteUsers(Long voteSessionId, VoteQueUsr user); + + public List getSessionsFromContent(VoteContent voteContent); + + public List getSessionNamesFromContent(VoteContent voteContent); + } \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUploadedFileDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUploadedFileDAO.java (.../IVoteUploadedFileDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUploadedFileDAO.java (.../IVoteUploadedFileDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -20,9 +20,12 @@ */ package org.lamsfoundation.lams.tool.vote.dao; +import java.util.Iterator; import java.util.List; +import org.hibernate.FlushMode; import org.lamsfoundation.lams.tool.vote.pojos.VoteUploadedFile; +import org.springframework.orm.hibernate3.HibernateTemplate; /** * @@ -32,49 +35,51 @@ */ public interface IVoteUploadedFileDAO { - public VoteUploadedFile loadUploadedFileById(long submissionId); + public VoteUploadedFile getUploadedFileById(long submissionId); + ; + public VoteUploadedFile loadUploadedFileById(long uid); + + public void updateUploadFile(VoteUploadedFile voteUploadedFile); + + public void saveUploadFile(VoteUploadedFile voteUploadedFile); + + public void createUploadFile(VoteUploadedFile voteUploadedFile); + + public void UpdateUploadFile(VoteUploadedFile voteUploadedFile); - public void updateUploadFile(VoteUploadedFile mcUploadedFile); + public void removeOffLineFile(String filename, Long voteContentId); - public void saveUploadFile(VoteUploadedFile mcUploadedFile); + public void removeOnLineFile(String filename, Long voteContentId); + + public boolean isOffLineFilePersisted(String filename); - public void createUploadFile(VoteUploadedFile mcUploadedFile); + public boolean isOnLineFilePersisted(String filename); + + public List getOnlineFilesMetaData(Long voteContentId); - public void UpdateUploadFile(VoteUploadedFile mcUploadedFile); + public List getOfflineFilesMetaData(Long voteContentId); + + public boolean isUuidPersisted(String uuid); + + public void cleanUploadedFilesMetaData(); + + public String getFileUuid(String filename); + + public void removeUploadFile(Long uid); + + public List retrieveVoteUploadedFiles(Long voteContentId, boolean fileOnline); - public void removeUploadFile(Long submissionId); + public List retrieveVoteUploadedOfflineFilesUuid(Long voteContentId); + + public List retrieveVoteUploadedOnlineFilesUuid(Long voteContentId); + + public List retrieveVoteUploadedOfflineFilesUuidPlusFilename(Long voteContentId); + + public List retrieveVoteUploadedOfflineFilesName(Long voteContentId); - public void deleteUploadFile(VoteUploadedFile mcUploadedFile); - - public String getFileUuid(String filename); - - public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline); - - public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId); - - public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId); - - public List retrieveMcUploadedOfflineFilesName(Long mcContentId); - - public List retrieveMcUploadedOnlineFilesName(Long mcContentId); - - public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId); - - public void removeOffLineFile(String filename, Long mcContentId); - - public void removeOnLineFile(String filename, Long mcContentId); - - public boolean isOffLineFilePersisted(String filename); - - public boolean isOnLineFilePersisted(String filename); - - public boolean isUuidPersisted(String uuid); - - public List getOnlineFilesMetaData(Long mcContentId); - - public List getOfflineFilesMetaData(Long mcContentId); - - public void cleanUploadedFilesMetaData(); - - public void flush(); + public List retrieveVoteUploadedOnlineFilesName(Long voteContentId); + + public void deleteUploadFile(VoteUploadedFile voteUploadedFile); + + public void flush(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java (.../IVoteUserDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java (.../IVoteUserDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -33,24 +33,23 @@ *

*/ public interface IVoteUserDAO { - - public VoteQueUsr getMcUserByUID(Long uid); + public VoteQueUsr getVoteUserByUID(Long uid); + + public VoteQueUsr findVoteUserById(Long userId); + + public List getVoteUserBySessionOnly(final VoteSession voteSession); + + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId); + + public void saveVoteUser(VoteQueUsr voteUser); + + public void updateVoteUser(VoteQueUsr voteUser); - public VoteQueUsr findMcUserById(Long userId); + public void removeVoteUserById(Long userId); + + public void removeVoteUser(VoteQueUsr voteUser); - public VoteQueUsr getMcUserBySession(Long userId, Long sessionId); + public int getNumberOfUsers(VoteSession voteSession); - public void saveMcUser(VoteQueUsr mcUser); - - public void updateMcUser(VoteQueUsr mcUser); - - public void removeMcUser(VoteQueUsr mcUser); - - public void removeMcUserById(Long userId); - - public int getNumberOfUsers(VoteSession mcSession); - - public List getMcUserBySessionOnly(final VoteSession mcSession); - - public int getTotalNumberOfUsers(); + public int getTotalNumberOfUsers(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (.../IVoteUsrAttemptDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (.../IVoteUsrAttemptDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -35,21 +35,21 @@ */ public interface IVoteUsrAttemptDAO { - public VoteUsrAttempt getMcUserAttemptByUID(Long uid); - - public void saveMcUsrAttempt(VoteUsrAttempt mcUsrAttempt); - - public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt); - - public void removeMcUsrAttemptByUID(Long uid); - - public void removeMcUsrAttempt(VoteUsrAttempt mcUsrAttempt); + public VoteUsrAttempt getVoteUserAttemptByUID(Long uid); - public List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId); + public void saveVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt); public List getAttemptsForUser(final Long queUsrId); - public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId); + public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId); + + public List getAttemptForQueContent(final Long queUsrId, final Long voteQueContentId); + + public void updateVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt); + + public void removeVoteUsrAttemptByUID(Long uid); + + public void removeVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (.../VoteContentDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (.../VoteContentDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -43,33 +43,33 @@ public class VoteContentDAO extends HibernateDaoSupport implements IVoteContentDAO { static Logger logger = Logger.getLogger(VoteContentDAO.class.getName()); - private static final String FIND_VOTE_CONTENT = "from " + VoteContent.class.getName() + " as mc where content_id=?"; + private static final String FIND_VOTE_CONTENT = "from " + VoteContent.class.getName() + " as vote where content_id=?"; - private static final String LOAD_VOTE_BY_SESSION = "select mc from VoteContent mc left join fetch " - + "mc.mcSessions session where session.mcSessionId=:sessionId"; + private static final String LOAD_VOTE_BY_SESSION = "select vote from VoteContent vote left join fetch " + + "vote.voteSessions session where session.voteSessionId=:sessionId"; - public VoteContent getMcContentByUID(Long uid) + public VoteContent getVoteContentByUID(Long uid) { return (VoteContent) this.getHibernateTemplate().get(VoteContent.class, uid); } - public VoteContent findMcContentById(Long mcContentId) + public VoteContent findVoteContentById(Long voteContentId) { - String query = "from VoteContent as mc where mc.mcContentId = ?"; + String query = "from VoteContent as vote where vote.voteContentId = ?"; HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query) - .setLong(0,mcContentId.longValue()) + .setLong(0,voteContentId.longValue()) .list(); if(list != null && list.size() > 0){ - VoteContent mc = (VoteContent) list.get(0); - return mc; + VoteContent vote = (VoteContent) list.get(0); + return vote; } return null; } - public VoteContent getMcContentBySession(final Long mcSessionId) + public VoteContent getVoteContentBySession(final Long voteSessionId) { return (VoteContent) getHibernateTemplate().execute(new HibernateCallback() { @@ -78,65 +78,64 @@ { return session.createQuery(LOAD_VOTE_BY_SESSION) .setLong("sessionId", - mcSessionId.longValue()) + voteSessionId.longValue()) .uniqueResult(); } }); } - public void saveMcContent(VoteContent mcContent) + public void saveVoteContent(VoteContent voteContent) { this.getSession().setFlushMode(FlushMode.AUTO); logger.debug("before saveOrUpdate"); - this.getHibernateTemplate().saveOrUpdate(mcContent); + this.getHibernateTemplate().saveOrUpdate(voteContent); logger.debug("after saveOrUpdate"); } - public void updateMcContent(VoteContent mcContent) + public void updateVoteContent(VoteContent voteContent) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().update(mcContent); + this.getHibernateTemplate().update(voteContent); } - public void removeMcById(Long mcContentId) + public void removeVoteById(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); - if ( mcContentId != null) { + if ( voteContentId != null) { List list = getSession().createQuery(FIND_VOTE_CONTENT) - .setLong(0,mcContentId.longValue()) + .setLong(0,voteContentId.longValue()) .list(); if(list != null && list.size() > 0){ - VoteContent mc = (VoteContent) list.get(0); + VoteContent vote = (VoteContent) list.get(0); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mc); + templ.delete(vote); templ.flush(); } } } - public void removeMc(VoteContent mcContent) + public void removeVote(VoteContent voteContent) { - this.getHibernateTemplate().delete(mcContent); + this.getHibernateTemplate().delete(voteContent); } - public void removeMcSessions(VoteContent mcContent) + public void removeVoteSessions(VoteContent voteContent) { - this.getHibernateTemplate().deleteAll(mcContent.getVoteSessions()); + this.getHibernateTemplate().deleteAll(voteContent.getVoteSessions()); } - public void addMcSession(Long mcContentId, VoteSession mcSession) + public void addVoteSession(Long voteContentId, VoteSession voteSession) { - /* - VoteContent content = findMcContentById(mcContentId); - mcSession.setMcContent(content); - content.getMcSessions().add(mcSession); - this.getHibernateTemplate().saveOrUpdate(mcSession); + VoteContent content = findVoteContentById(voteContentId); + voteSession.setVoteContent(content); + content.getVoteSessions().add(voteSession); + this.getHibernateTemplate().saveOrUpdate(voteSession); this.getHibernateTemplate().saveOrUpdate(content); - */ + } public List findAll(Class objClass) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteOptionsContentDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteOptionsContentDAO.java (.../VoteOptionsContentDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteOptionsContentDAO.java (.../VoteOptionsContentDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -40,133 +40,109 @@ public class VoteOptionsContentDAO extends HibernateDaoSupport implements IVoteOptionsContentDAO { static Logger logger = Logger.getLogger(VoteOptionsContentDAO.class.getName()); - private static final String FIND_VOTE_OPTIONS_CONTENT = "from " + VoteOptsContent.class.getName() + " as mco where mc_que_content_id=?"; + private static final String FIND_VOTE_OPTIONS_CONTENT = "from " + VoteOptsContent.class.getName() + " as voteo where vote_que_content_id=?"; - private static final String LOAD_VOTE_CONTENT_BY_OPTION_TEXT = "from mcOptsContent in class VoteOptsContent where mcOptsContent.mcQueOptionText=:option and mcOptsContent.mcQueContentId=:mcQueContentUid"; + private static final String LOAD_VOTE_CONTENT_BY_OPTION_TEXT = "from voteOptsContent in class VoteOptsContent where voteOptsContent.voteQueOptionText=:option and voteOptsContent.voteQueContentId=:voteQueContentUid"; - private static final String LOAD_PERSISTED_SELECTED_OPTIONS = "from mcOptsContent in class VoteOptsContent where mcOptsContent.mcQueContentId=:mcQueContentUid and mcOptsContent.correctOption = 1"; - - private static final String LOAD_CORRECT_OPTION = "from mcOptsContent in class VoteOptsContent where mcOptsContent.mcQueContentId=:mcQueContentUid and mcOptsContent.correctOption = 1"; - - public VoteOptsContent getMcOptionsContentByUID(Long uid) + public VoteOptsContent getVoteOptionsContentByUID(Long uid) { return (VoteOptsContent) this.getHibernateTemplate() .get(VoteOptsContent.class, uid); } - public List findMcOptionsContentByQueId(Long mcQueContentId) + public List findVoteOptionsContentByQueId(Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); - if ( mcQueContentId != null) { + if ( voteQueContentId != null) { List list = getSession().createQuery(FIND_VOTE_OPTIONS_CONTENT) - .setLong(0,mcQueContentId.longValue()) + .setLong(0,voteQueContentId.longValue()) .list(); return list; } return null; } - public List findMcOptionNamesByQueId(Long mcQueContentId) + public List findVoteOptionNamesByQueId(Long voteQueContentId) { List listOptionNames= new LinkedList(); HibernateTemplate templ = this.getHibernateTemplate(); - if ( mcQueContentId != null) { + if ( voteQueContentId != null) { List list = getSession().createQuery(FIND_VOTE_OPTIONS_CONTENT) - .setLong(0,mcQueContentId.longValue()) + .setLong(0,voteQueContentId.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteOptsContent mcOptsContent=(VoteOptsContent)listIterator.next(); - listOptionNames.add(mcOptsContent.getVoteQueOptionText()); + VoteOptsContent voteOptsContent=(VoteOptsContent)listIterator.next(); + listOptionNames.add(voteOptsContent.getVoteQueOptionText()); } } } return listOptionNames; } - public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid) + public VoteOptsContent getOptionContentByOptionText(final String option, final Long voteQueContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_VOTE_CONTENT_BY_OPTION_TEXT) .setString("option", option) - .setLong("mcQueContentUid", mcQueContentUid.longValue()) + .setLong("voteQueContentUid", voteQueContentUid.longValue()) .list(); if(list != null && list.size() > 0){ - VoteOptsContent mcq = (VoteOptsContent) list.get(0); - return mcq; + VoteOptsContent voteq = (VoteOptsContent) list.get(0); + return voteq; } return null; } - - public List getPersistedSelectedOptions(Long mcQueContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_PERSISTED_SELECTED_OPTIONS) - .setLong("mcQueContentUid", mcQueContentId.longValue()) - .list(); - - return list; - } - - public List getCorrectOption(Long mcQueContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_CORRECT_OPTION) - .setLong("mcQueContentUid", mcQueContentId.longValue()) - .list(); - - return list; - } - - public void saveMcOptionsContent(VoteOptsContent mcOptsContent) + + public void saveVoteOptionsContent(VoteOptsContent voteOptsContent) { - this.getHibernateTemplate().save(mcOptsContent); + this.getHibernateTemplate().save(voteOptsContent); } - public void updateMcOptionsContent(VoteOptsContent mcOptsContent) + public void updateVoteOptionsContent(VoteOptsContent voteOptsContent) { - this.getHibernateTemplate().update(mcOptsContent); + this.getHibernateTemplate().update(voteOptsContent); } - public void removeMcOptionsContentByUID(Long uid) + public void removeVoteOptionsContentByUID(Long uid) { - VoteOptsContent mco = (VoteOptsContent)getHibernateTemplate().get(VoteOptsContent.class, uid); - this.getHibernateTemplate().delete(mco); + VoteOptsContent voteo = (VoteOptsContent)getHibernateTemplate().get(VoteOptsContent.class, uid); + this.getHibernateTemplate().delete(voteo); } - public void removeMcOptionsContentByQueId(Long mcQueContentId) + public void removeVoteOptionsContentByQueId(Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(FIND_VOTE_OPTIONS_CONTENT) - .setLong(0,mcQueContentId.longValue()) + .setLong(0,voteQueContentId.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteOptsContent mcOptsContent=(VoteOptsContent)listIterator.next(); + VoteOptsContent voteOptsContent=(VoteOptsContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcOptsContent); + templ.delete(voteOptsContent); } } } - public void removeMcOptionsContent(VoteOptsContent mcOptsContent) + public void removeVoteOptionsContent(VoteOptsContent voteOptsContent) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcOptsContent); + this.getHibernateTemplate().delete(voteOptsContent); } public void flush() Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -40,213 +40,168 @@ public class VoteQueContentDAO extends HibernateDaoSupport implements IVoteQueContentDAO { static Logger logger = Logger.getLogger(VoteQueContentDAO.class.getName()); - private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class VoteQueContent where mcQueContent.mcContentId=:mcContentId order by mcQueContent.displayOrder"; + private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; - private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from mcQueContent in class VoteQueContent where mcQueContent.mcContentId=:mcContentId"; + private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; - private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class VoteQueContent where mcQueContent.mcContentId=:mcContentId and mcQueContent.disabled=true"; + private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from voteQueContent in class VoteQueContent where voteQueContent.question=:question and voteQueContent.voteContentId=:voteContentUid"; - private static final String REFRESH_QUESTION_CONTENT = "from mcQueContent in class VoteQueContent where mcQueContent.mcContentId=:mcContentId and mcQueContent.disabled=false order by mcQueContent.displayOrder"; - private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from mcQueContent in class VoteQueContent where mcQueContent.question=:question and mcQueContent.mcContentId=:mcContentUid"; - - private static final String LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER = "from mcQueContent in class VoteQueContent where mcQueContent.displayOrder=:displayOrder and mcQueContent.mcContentId=:mcContentUid"; - - private static final String GET_NEXT_AVAILABLE_DISPLAY_ORDER = "from mcQueContent in class VoteQueContent where mcQueContent.mcContentId=:mcContentId"; - - - public VoteQueContent getMcQueContentByUID(Long uid) + public VoteQueContent getVoteQueContentByUID(Long uid) { return (VoteQueContent) this.getHibernateTemplate() .get(VoteQueContent.class, uid); } - public VoteQueContent getToolDefaultQuestionContent(final long mcContentId) + public VoteQueContent getToolDefaultQuestionContent(final long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) - .setLong("mcContentId", mcContentId) + .setLong("voteContentId", voteContentId) .list(); if(list != null && list.size() > 0){ - VoteQueContent mcq = (VoteQueContent) list.get(0); - return mcq; + VoteQueContent voteq = (VoteQueContent) list.get(0); + return voteq; } return null; } - public List getAllQuestionEntries(final long mcContentId) + public List getAllQuestionEntries(final long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) - .setLong("mcContentId", mcContentId) + .setLong("voteContentId", voteContentId) .list(); return list; } - public List refreshQuestionContent(final Long mcContentId) - { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(REFRESH_QUESTION_CONTENT) - .setLong("mcContentId", mcContentId.longValue()) - .list(); - - return list; - } - - public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid) + public VoteQueContent getQuestionContentByQuestionText(final String question, final Long voteContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT) .setString("question", question) - .setLong("mcContentUid", mcContentUid.longValue()) + .setLong("voteContentUid", voteContentUid.longValue()) .list(); if(list != null && list.size() > 0){ - VoteQueContent mcq = (VoteQueContent) list.get(0); - return mcq; + VoteQueContent voteq = (VoteQueContent) list.get(0); + return voteq; } return null; } - public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid) + public void removeQuestionContentByVoteUid(final Long voteContentUid) { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER) - .setLong("displayOrder", displayOrder.longValue()) - .setLong("mcContentUid", mcContentUid.longValue()) - .list(); - - if(list != null && list.size() > 0){ - VoteQueContent mcq = (VoteQueContent) list.get(0); - return mcq; - } - return null; - } - - - public void removeQuestionContentByMcUid(final Long mcContentUid) - { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) - .setLong("mcContentId", mcContentUid.longValue()) + .setLong("voteContentId", voteContentUid.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteQueContent mcQueContent=(VoteQueContent)listIterator.next(); + VoteQueContent voteQueContent=(VoteQueContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcQueContent); + templ.delete(voteQueContent); templ.flush(); } } } - public void resetAllQuestions(final Long mcContentUid) + public void resetAllQuestions(final Long voteContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) - .setLong("mcContentId", mcContentUid.longValue()) + .setLong("voteContentId", voteContentUid.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteQueContent mcQueContent=(VoteQueContent)listIterator.next(); + VoteQueContent voteQueContent=(VoteQueContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - templ.update(mcQueContent); + templ.update(voteQueContent); } } } - public void cleanAllQuestions(final Long mcContentUid) + public void cleanAllQuestions(final Long voteContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(CLEAN_QUESTION_CONTENT_BY_CONTENT_ID) - .setLong("mcContentId", mcContentUid.longValue()) + List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) + .setLong("voteContentId", voteContentUid.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteQueContent mcQueContent=(VoteQueContent)listIterator.next(); + VoteQueContent voteQueContent=(VoteQueContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - logger.debug("deleting mcQueContent: " + mcQueContent); - templ.delete(mcQueContent); + logger.debug("deleting voteQueContent: " + voteQueContent); + templ.delete(voteQueContent); } } } - public void cleanAllQuestionsSimple(final Long mcContentUid) + public void cleanAllQuestionsSimple(final Long voteContentUid) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE) - .setLong("mcContentId", mcContentUid.longValue()) + .setLong("voteContentId", voteContentUid.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteQueContent mcQueContent=(VoteQueContent)listIterator.next(); + VoteQueContent voteQueContent=(VoteQueContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - logger.debug("deleting mcQueContent: " + mcQueContent); - templ.delete(mcQueContent); + logger.debug("deleting voteQueContent: " + voteQueContent); + templ.delete(voteQueContent); } } } - public List getNextAvailableDisplayOrder(final long mcContentId) + public void saveVoteQueContent(VoteQueContent voteQueContent) { - HibernateTemplate templ = this.getHibernateTemplate(); - List list = getSession().createQuery(GET_NEXT_AVAILABLE_DISPLAY_ORDER) - .setLong("mcContentId", mcContentId) - .list(); - - return list; + this.getHibernateTemplate().save(voteQueContent); } - - - public void saveMcQueContent(VoteQueContent mcQueContent) - { - this.getHibernateTemplate().save(mcQueContent); - } - public void updateMcQueContent(VoteQueContent mcQueContent) + public void updateVoteQueContent(VoteQueContent voteQueContent) { - this.getHibernateTemplate().update(mcQueContent); + this.getHibernateTemplate().update(voteQueContent); } - public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent) + public void saveOrUpdateVoteQueContent(VoteQueContent voteQueContent) { - this.getHibernateTemplate().saveOrUpdate(mcQueContent); + this.getHibernateTemplate().saveOrUpdate(voteQueContent); } - public void removeMcQueContentByUID(Long uid) + public void removeVoteQueContentByUID(Long uid) { - VoteQueContent mcq = (VoteQueContent)getHibernateTemplate().get(VoteQueContent.class, uid); + VoteQueContent voteq = (VoteQueContent)getHibernateTemplate().get(VoteQueContent.class, uid); this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcq); + this.getHibernateTemplate().delete(voteq); } - public void removeMcQueContent(VoteQueContent mcQueContent) + public void removeVoteQueContent(VoteQueContent voteQueContent) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcQueContent); + this.getHibernateTemplate().delete(voteQueContent); } public void flush() Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -37,42 +37,41 @@ /** * @author ozgurd - *

Hibernate implementation for database access to Mc sessions for the mc tool.

+ *

Hibernate implementation for database access to Vote sessions for the voting tool.

*/ public class VoteSessionDAO extends HibernateDaoSupport implements IVoteSessionDAO { - private static final String FIND_VOTE_SESSION_CONTENT = "from " + VoteSession.class.getName() + " as mcs where mc_session_id=?"; + private static final String FIND_VOTE_SESSION_CONTENT = "from " + VoteSession.class.getName() + " as votes where vote_session_id=?"; - private static final String LOAD_MCSESSION_BY_USER = "select ms from VoteSession ms left join fetch " - + "ms.mcQueUsers user where user.queUsrId=:userId"; + private static final String LOAD_VOTESESSION_BY_USER = "select votes from VoteSession votes left join fetch " + + "votes.voteQueUsers user where user.queUsrId=:userId"; - private static final String GET_SESSIONS_FROM_CONTENT = "select ms.mcSessionId from McSession ms where ms.mcContent=:mcContent"; + private static final String GET_SESSIONS_FROM_CONTENT = "select votes.voteSessionId from VoteSession vote where vote.voteContent=:voteContent"; - private static final String COUNT_SESSION_COMPLETE = "from mcSession in class where mcSession.sessionStatus='COMPLETE'"; + private static final String COUNT_SESSION_COMPLETE = "from voteSession in class where voteSession.sessionStatus='COMPLETE'"; - private static final String COUNT_SESSION_INCOMPLETE = "from mcSession in class where mcSession.sessionStatus='INCOMPLETE'"; + private static final String COUNT_SESSION_INCOMPLETE = "from voteSession in class where voteSession.sessionStatus='INCOMPLETE'"; - private static final String GET_SESSIONNAMES_FROM_CONTENT = "select mcs.session_name from VoteSession mcs where mcs.mcContent=:mcContent order by mcs.mcSessionId"; + private static final String GET_SESSIONNAMES_FROM_CONTENT = "select votes.session_name from VoteSession votes where votes.voteContent=:voteContent order by votes.voteSessionId"; - public VoteSession getMcSessionByUID(Long uid) + public VoteSession getVoteSessionByUID(Long uid) { - return (VoteSession) this.getHibernateTemplate() - .get(VoteSession.class, uid); + return (VoteSession) this.getHibernateTemplate().get(VoteSession.class, uid); } - public VoteSession findMcSessionById(Long mcSessionId) + public VoteSession findVoteSessionById(Long voteSessionId) { - String query = "from VoteSession mcs where mcs.mcSessionId=?"; + String query = "from VoteSession votes where votes.voteSessionId=?"; HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query) - .setLong(0,mcSessionId.longValue()) + .setLong(0,voteSessionId.longValue()) .list(); if(list != null && list.size() > 0){ - VoteSession mcs = (VoteSession) list.get(0); - return mcs; + VoteSession votes = (VoteSession) list.get(0); + return votes; } return null; } @@ -102,62 +101,62 @@ } - public void saveMcSession(VoteSession mcSession) + public void saveVoteSession(VoteSession voteSession) { - this.getHibernateTemplate().save(mcSession); + this.getHibernateTemplate().save(voteSession); } - public void updateMcSession(VoteSession mcSession) + public void updateVoteSession(VoteSession voteSession) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().update(mcSession); + this.getHibernateTemplate().update(voteSession); } - public void removeMcSessionByUID(Long uid) + public void removeVoteSessionByUID(Long uid) { - VoteSession ms = (VoteSession)getHibernateTemplate().get(VoteSession.class, uid); - this.getHibernateTemplate().delete(ms); + VoteSession votes = (VoteSession)getHibernateTemplate().get(VoteSession.class, uid); + this.getHibernateTemplate().delete(votes); } - public void removeMcSessionById(Long mcSessionId) + public void removeVoteSessionById(Long voteSessionId) { - String query = "from VoteSession as mcs where mcs.mcSessionId ="; + String query = "from VoteSession as votes where votes.voteSessionId ="; HibernateTemplate templ = this.getHibernateTemplate(); - if ( mcSessionId != null) { + if ( voteSessionId != null) { List list = getSession().createQuery(FIND_VOTE_SESSION_CONTENT) - .setLong(0,mcSessionId.longValue()) + .setLong(0,voteSessionId.longValue()) .list(); if(list != null && list.size() > 0){ - VoteSession mcs = (VoteSession) list.get(0); + VoteSession vote = (VoteSession) list.get(0); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcs); + templ.delete(vote); templ.flush(); } } } - public void removeMcSession(VoteSession mcSession) + public void removeVoteSession(VoteSession voteSession) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcSession); + this.getHibernateTemplate().delete(voteSession); } - public VoteSession getMcSessionByUser(final Long userId) + public VoteSession getVoteSessionByUser(final Long userId) { return (VoteSession) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { - return session.createQuery(LOAD_MCSESSION_BY_USER) + return session.createQuery(LOAD_VOTESESSION_BY_USER) .setLong("userId", userId.longValue()) .uniqueResult(); @@ -166,15 +165,15 @@ } - public void removeMcUsers(VoteSession mcSession) + public void removeVoteUsers(VoteSession voteSession) { - this.getHibernateTemplate().deleteAll(mcSession.getVoteQueUsers()); + this.getHibernateTemplate().deleteAll(voteSession.getVoteQueUsers()); } - public void addMcUsers(Long mcSessionId, VoteQueUsr user) + public void addVoteUsers(Long voteSessionId, VoteQueUsr user) { - VoteSession session = findMcSessionById(mcSessionId); + VoteSession session = findVoteSessionById(voteSessionId); user.setVoteSession(session); session.getVoteQueUsers().add(user); this.getHibernateTemplate().saveOrUpdate(user); @@ -183,18 +182,17 @@ } - public List getSessionsFromContent(VoteContent mcContent) + public List getSessionsFromContent(VoteContent voteContent) { return (getHibernateTemplate().findByNamedParam(GET_SESSIONS_FROM_CONTENT, - "mcContent", - mcContent)); + "voteContent", + voteContent)); } - public List getSessionNamesFromContent(VoteContent mcContent) + public List getSessionNamesFromContent(VoteContent voteContent) { return (getHibernateTemplate().findByNamedParam(GET_SESSIONNAMES_FROM_CONTENT, - "mcContent", - mcContent)); + "voteContent", + voteContent)); } - } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java (.../VoteUploadedFileDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java (.../VoteUploadedFileDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -35,35 +35,35 @@ /** * @author ozgurd - *

Hibernate implementation for database access to McUploadedFile for the mc tool.

+ *

Hibernate implementation for database access to VoteUploadedFile for the voting tool.

*/ public class VoteUploadedFileDAO extends HibernateDaoSupport implements IVoteUploadedFileDAO { static Logger logger = Logger.getLogger(VoteUploadedFileDAO.class.getName()); - private static final String GET_ONLINE_FILENAMES_FOR_CONTENT = "select mcUploadedFile.filename from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1"; - private static final String GET_OFFLINE_FILENAMES_FOR_CONTENT = "select mcUploadedFile.filename from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; + private static final String GET_ONLINE_FILENAMES_FOR_CONTENT = "select voteUploadedFile.filename from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=1"; + private static final String GET_OFFLINE_FILENAMES_FOR_CONTENT = "select voteUploadedFile.filename from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=0"; - private static final String GET_ONLINE_FILES_UUID = "select mcUploadedFile.uuid from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1"; - private static final String GET_ONLINE_FILES_NAME ="select mcUploadedFile.filename from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1 order by mcUploadedFile.uuid"; + private static final String GET_ONLINE_FILES_UUID = "select voteUploadedFile.uuid from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=1"; + private static final String GET_ONLINE_FILES_NAME ="select voteUploadedFile.filename from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=1 order by voteUploadedFile.uuid"; - private static final String GET_OFFLINE_FILES_UUID = "select mcUploadedFile.uuid from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; - private static final String GET_OFFLINE_FILES_NAME ="select mcUploadedFile.filename from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0 order by mcUploadedFile.uuid"; + private static final String GET_OFFLINE_FILES_UUID = "select voteUploadedFile.uuid from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=0"; + private static final String GET_OFFLINE_FILES_NAME ="select voteUploadedFile.filename from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=0 order by voteUploadedFile.uuid"; - private static final String GET_FILES_UUID ="select mcUploadedFile.uuid from VoteUploadedFile mcUploadedFile where mcUploadedFile.filename=:filename"; + private static final String GET_FILES_UUID ="select voteUploadedFile.uuid from VoteUploadedFile voteUploadedFile where voteUploadedFile.filename=:filename"; - private static final String GET_OFFLINE_FILES_UUIDPLUSFILENAME = "select (mcUploadedFile.uuid + '~' + mcUploadedFile.filename) from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; + private static final String GET_OFFLINE_FILES_UUIDPLUSFILENAME = "select (voteUploadedFile.uuid + '~' + voteUploadedFile.filename) from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=0"; - private static final String FIND_ALL_UPLOADED_FILE_DATA = "from mcUploadedFile in class VoteUploadedFile"; + private static final String FIND_ALL_UPLOADED_FILE_DATA = "from voteUploadedFile in class VoteUploadedFile"; - private static final String IS_UUID_PERSISTED ="select mcUploadedFile.uuid from VoteUploadedFile mcUploadedFile where mcUploadedFile.uuid=:uuid"; + private static final String IS_UUID_PERSISTED ="select voteUploadedFile.uuid from VoteUploadedFile voteUploadedFile where voteUploadedFile.uuid=:uuid"; - private static final String GET_ONLINE_FILES_METADATA = "from mcUploadedFile in class VoteUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=1"; + private static final String GET_ONLINE_FILES_METADATA = "from voteUploadedFile in class VoteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=1"; - private static final String GET_OFFLINE_FILES_METADATA = "from mcUploadedFile in class VoteUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.fileOnline=0"; + private static final String GET_OFFLINE_FILES_METADATA = "from voteUploadedFile in class VoteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.fileOnline=0"; - private static final String IS_OFFLINE_FILENAME_PERSISTED ="select mcUploadedFile from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.filename=:filename and mcUploadedFile.fileOnline=0"; + private static final String IS_OFFLINE_FILENAME_PERSISTED ="select voteUploadedFile from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.filename=:filename and voteUploadedFile.fileOnline=0"; - private static final String IS_ONLINE_FILENAME_PERSISTED ="select mcUploadedFile from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.filename=:filename and mcUploadedFile.fileOnline=1"; + private static final String IS_ONLINE_FILENAME_PERSISTED ="select voteUploadedFile from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContentId = :voteContentId and voteUploadedFile.filename=:filename and voteUploadedFile.fileOnline=1"; public VoteUploadedFile getUploadedFileById(long submissionId) @@ -83,69 +83,69 @@ - public void updateUploadFile(VoteUploadedFile mcUploadedFile) + public void updateUploadFile(VoteUploadedFile voteUploadedFile) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().update(mcUploadedFile); + this.getHibernateTemplate().update(voteUploadedFile); this.getSession().setFlushMode(FlushMode.AUTO); } - public void saveUploadFile(VoteUploadedFile mcUploadedFile) + public void saveUploadFile(VoteUploadedFile voteUploadedFile) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().save(mcUploadedFile); + this.getHibernateTemplate().save(voteUploadedFile); this.getSession().setFlushMode(FlushMode.AUTO); } - public void createUploadFile(VoteUploadedFile mcUploadedFile) + public void createUploadFile(VoteUploadedFile voteUploadedFile) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().save(mcUploadedFile); + this.getHibernateTemplate().save(voteUploadedFile); } - public void UpdateUploadFile(VoteUploadedFile mcUploadedFile) + public void UpdateUploadFile(VoteUploadedFile voteUploadedFile) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().update(mcUploadedFile); + this.getHibernateTemplate().update(voteUploadedFile); } - public void removeOffLineFile(String filename, Long mcContentId) + public void removeOffLineFile(String filename, Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(IS_OFFLINE_FILENAME_PERSISTED) .setString("filename", filename) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); - if(list != null && list.size() > 0){ + if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteUploadedFile mcFile=(VoteUploadedFile)listIterator.next(); + VoteUploadedFile voteFile=(VoteUploadedFile)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); + templ.delete(voteFile); templ.flush(); } } } - public void removeOnLineFile(String filename, Long mcContentId) + public void removeOnLineFile(String filename, Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(IS_ONLINE_FILENAME_PERSISTED) .setString("filename", filename) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); if(list != null && list.size() > 0){ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteUploadedFile mcFile=(VoteUploadedFile)listIterator.next(); + VoteUploadedFile voteFile=(VoteUploadedFile)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); + templ.delete(voteFile); templ.flush(); } } @@ -181,22 +181,22 @@ } - public List getOnlineFilesMetaData(Long mcContentId) + public List getOnlineFilesMetaData(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_ONLINE_FILES_METADATA) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; } - public List getOfflineFilesMetaData(Long mcContentId) + public List getOfflineFilesMetaData(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_OFFLINE_FILES_METADATA) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; @@ -228,9 +228,9 @@ Iterator listIterator=list.iterator(); while (listIterator.hasNext()) { - VoteUploadedFile mcFile=(VoteUploadedFile)listIterator.next(); + VoteUploadedFile voteFile=(VoteUploadedFile)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcFile); + templ.delete(voteFile); templ.flush(); } } @@ -265,7 +265,7 @@ { if (uid != null ) { - String query = "from uploadedFile in class org.lamsfoundation.lams.tool.mc.VoteUploadedFile" + String query = "from uploadedFile in class org.lamsfoundation.lams.tool.vote.VoteUploadedFile" + " where uploadedFile.uid = ?"; Object obj = this.getSession().createQuery(query) .setLong(0,uid.longValue()) @@ -276,84 +276,84 @@ } } - public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline) + public List retrieveVoteUploadedFiles(Long voteContentId, boolean fileOnline) { List listFilenames=null; if (fileOnline) { listFilenames=(getHibernateTemplate().findByNamedParam(GET_ONLINE_FILENAMES_FOR_CONTENT, - "mcContentId", - mcContentId)); + "voteContentId", + voteContentId)); } else { listFilenames=(getHibernateTemplate().findByNamedParam(GET_OFFLINE_FILENAMES_FOR_CONTENT, - "mcContentId", - mcContentId)); + "voteContentId", + voteContentId)); } return listFilenames; } - public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId) + public List retrieveVoteUploadedOfflineFilesUuid(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_OFFLINE_FILES_UUID) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; } - public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId) + public List retrieveVoteUploadedOnlineFilesUuid(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_ONLINE_FILES_UUID) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; } - public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId) + public List retrieveVoteUploadedOfflineFilesUuidPlusFilename(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_OFFLINE_FILES_UUIDPLUSFILENAME) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; } - public List retrieveMcUploadedOfflineFilesName(Long mcContentId) + public List retrieveVoteUploadedOfflineFilesName(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_OFFLINE_FILES_NAME) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; } - public List retrieveMcUploadedOnlineFilesName(Long mcContentId) + public List retrieveVoteUploadedOnlineFilesName(Long voteContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(GET_ONLINE_FILES_NAME) - .setLong("mcContentId", mcContentId.longValue()) + .setLong("voteContentId", voteContentId.longValue()) .list(); return list; } - public void deleteUploadFile(VoteUploadedFile mcUploadedFile) + public void deleteUploadFile(VoteUploadedFile voteUploadedFile) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcUploadedFile); + this.getHibernateTemplate().delete(voteUploadedFile); } public void flush() Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -36,23 +36,23 @@ */ public class VoteUserDAO extends HibernateDaoSupport implements IVoteUserDAO { - private static final String FIND_VOTE_USR_CONTENT = "from " + VoteQueUsr.class.getName() + " as mcu where que_usr_id=?"; + private static final String FIND_VOTE_USR_CONTENT = "from " + VoteQueUsr.class.getName() + " as voteu where que_usr_id=?"; - private static final String COUNT_USERS_IN_SESSION = "select mu.queUsrId from VoteQueUsr mu where mu.mcSession= :mcSession"; + private static final String COUNT_USERS_IN_SESSION = "select voteu.queUsrId from VoteQueUsr voteu where voteu.voteSession= :voteSession"; - private static final String COUNT_USERS = "select mu.queUsrId from VoteQueUsr"; + private static final String COUNT_USERS = "select voteu.queUsrId from VoteQueUsr"; - private static final String LOAD_USER_FOR_SESSION = "from mcQueUsr in class VoteQueUsr where mcQueUsr.mcSessionId= :mcSessionId"; + private static final String LOAD_USER_FOR_SESSION = "from voteQueUsr in class VoteQueUsr where voteQueUsr.voteSessionId= :voteSessionId"; - public VoteQueUsr getMcUserByUID(Long uid) + public VoteQueUsr getVoteUserByUID(Long uid) { return (VoteQueUsr) this.getHibernateTemplate() .get(VoteQueUsr.class, uid); } - public VoteQueUsr findMcUserById(Long userId) + public VoteQueUsr findVoteUserById(Long userId) { String query = "from VoteQueUsr user where user.queUsrId=?"; @@ -62,30 +62,30 @@ .list(); if(list != null && list.size() > 0){ - VoteQueUsr mcu = (VoteQueUsr) list.get(0); - return mcu; + VoteQueUsr voteu = (VoteQueUsr) list.get(0); + return voteu; } return null; } - public List getMcUserBySessionOnly(final VoteSession mcSession) + public List getVoteUserBySessionOnly(final VoteSession voteSession) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_USER_FOR_SESSION) - .setLong("mcSessionId", mcSession.getUid().longValue()) + .setLong("voteSessionId", voteSession.getUid().longValue()) .list(); return list; } - public VoteQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionId) + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId) { - String strGetUser = "from mcQueUsr in class VoteQueUsr where mcQueUsr.queUsrId=:queUsrId and mcQueUsr.mcSessionId=:mcSessionId"; + String strGetUser = "from voteQueUsr in class VoteQueUsr where voteQueUsr.queUsrId=:queUsrId and voteQueUsr.voteSessionId=:voteSessionId"; HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(strGetUser) .setLong("queUsrId", queUsrId.longValue()) - .setLong("mcSessionId", mcSessionId.longValue()) + .setLong("voteSessionId", voteSessionId.longValue()) .list(); if(list != null && list.size() > 0){ @@ -96,19 +96,19 @@ } - public void saveMcUser(VoteQueUsr mcUser) + public void saveVoteUser(VoteQueUsr voteUser) { - this.getHibernateTemplate().save(mcUser); + this.getHibernateTemplate().save(voteUser); } - public void updateMcUser(VoteQueUsr mcUser) + public void updateVoteUser(VoteQueUsr voteUser) { - this.getHibernateTemplate().update(mcUser); + this.getHibernateTemplate().update(voteUser); } - public void removeMcUserById(Long userId) + public void removeVoteUserById(Long userId) { HibernateTemplate templ = this.getHibernateTemplate(); if ( userId != null) { @@ -117,28 +117,28 @@ .list(); if(list != null && list.size() > 0){ - VoteQueUsr mcu = (VoteQueUsr) list.get(0); + VoteQueUsr voteu = (VoteQueUsr) list.get(0); this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(mcu); + templ.delete(voteu); templ.flush(); } } } - public void removeMcUser(VoteQueUsr mcUser) + public void removeVoteUser(VoteQueUsr voteUser) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcUser); + this.getHibernateTemplate().delete(voteUser); } - public int getNumberOfUsers(VoteSession mcSession) + public int getNumberOfUsers(VoteSession voteSession) { return (getHibernateTemplate().findByNamedParam(COUNT_USERS_IN_SESSION, - "mcSession", - mcSession)).size(); + "voteSession", + voteSession)).size(); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -38,26 +38,26 @@ public class VoteUsrAttemptDAO extends HibernateDaoSupport implements IVoteUsrAttemptDAO { static Logger logger = Logger.getLogger(VoteUsrAttemptDAO.class.getName()); - private static final String LOAD_HIGHEST_MARK_BY_USER_ID = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.queUsrId=:queUsrId"; + private static final String LOAD_HIGHEST_MARK_BY_USER_ID = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId"; - private static final String LOAD_HIGHEST_ATTEMPT_ORDER_BY_USER_ID = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.queUsrId=:queUsrId"; + private static final String LOAD_HIGHEST_ATTEMPT_ORDER_BY_USER_ID = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId"; - private static final String LOAD_ATTEMPT_FOR_QUE_CONTENT = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.queUsrId=:queUsrId and mcUsrAttempt.mcQueContentId=:mcQueContentId"; + private static final String LOAD_ATTEMPT_FOR_QUE_CONTENT = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId and voteUsrAttempt.voteQueContentId=:voteQueContentId"; - private static final String LOAD_ATTEMPT_FOR_USER = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.queUsrId=:queUsrId"; + private static final String LOAD_ATTEMPT_FOR_USER = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId"; - private static final String LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.queUsrId=:queUsrId and mcUsrAttempt.mcQueContentId=:mcQueContentId"; + private static final String LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId and voteUsrAttempt.voteQueContentId=:voteQueContentId"; - public VoteUsrAttempt getMcUserAttemptByUID(Long uid) + public VoteUsrAttempt getVoteUserAttemptByUID(Long uid) { return (VoteUsrAttempt) this.getHibernateTemplate() .get(VoteUsrAttempt.class, uid); } - public void saveMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) + public void saveVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt) { - this.getHibernateTemplate().save(mcUsrAttempt); + this.getHibernateTemplate().save(voteUsrAttempt); } @@ -70,47 +70,45 @@ return list; } - public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId) + public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT) .setLong("queUsrId", queUsrId.longValue()) - .setLong("mcQueContentId", mcQueContentId.longValue()) + .setLong("voteQueContentId", voteQueContentId.longValue()) .list(); return list; } - public List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId) + public List getAttemptForQueContent(final Long queUsrId, final Long voteQueContentId) { HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUE_CONTENT) .setLong("queUsrId", queUsrId.longValue()) - .setLong("mcQueContentId", mcQueContentId.longValue()) + .setLong("voteQueContentId", voteQueContentId.longValue()) .list(); return list; } - - public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) + public void updateVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt) { - this.getHibernateTemplate().update(mcUsrAttempt); + this.getHibernateTemplate().update(voteUsrAttempt); } - public void removeMcUsrAttemptByUID(Long uid) + public void removeVoteUsrAttemptByUID(Long uid) { - VoteUsrAttempt mca = (VoteUsrAttempt)getHibernateTemplate().get(VoteUsrAttempt.class, uid); + VoteUsrAttempt votea = (VoteUsrAttempt)getHibernateTemplate().get(VoteUsrAttempt.class, uid); this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mca); + this.getHibernateTemplate().delete(votea); } - public void removeMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) + public void removeVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt) { this.getSession().setFlushMode(FlushMode.AUTO); - this.getHibernateTemplate().delete(mcUsrAttempt); + this.getHibernateTemplate().delete(voteUsrAttempt); } - } \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java (.../VoteUsrAttempt.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java (.../VoteUsrAttempt.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -52,8 +52,6 @@ private String userEntry; - private boolean isNominated; - private Long queUsrId; private Long voteQueContentId; @@ -87,10 +85,9 @@ this.voteOptionsContent = voteOptionsContent; } - public VoteUsrAttempt(String userEntry, boolean isNominated, Date attemptTime, String timeZone, org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, + public VoteUsrAttempt(String userEntry, Date attemptTime, String timeZone, org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr, org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent voteOptionsContent) { this.userEntry=userEntry; - this.isNominated=isNominated; this.attemptTime = attemptTime; this.timeZone = timeZone; this.voteQueContent = voteQueContent; @@ -226,16 +223,5 @@ public void setUserEntry(String userEntry) { this.userEntry = userEntry; } - /** - * @return Returns the isNominated. - */ - public boolean isNominated() { - return isNominated; - } - /** - * @param isNominated The isNominated to set. - */ - public void setNominated(boolean isNominated) { - this.isNominated = isNominated; - } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -53,107 +53,99 @@ { public void configureContentRepository() throws VoteApplicationException; - public void createMc(VoteContent mcContent) throws VoteApplicationException; + public void createVote(VoteContent mcContent) throws VoteApplicationException; - public VoteContent retrieveMc(Long toolContentId) throws VoteApplicationException; + public VoteContent retrieveVote(Long toolContentId) throws VoteApplicationException; - public void createMcQue(VoteQueContent mcQueContent) throws VoteApplicationException; + public void createVoteQue(VoteQueContent mcQueContent) throws VoteApplicationException; - public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid) throws VoteApplicationException; - - public void createMcSession(VoteSession mcSession) throws VoteApplicationException; + public void createVoteSession(VoteSession mcSession) throws VoteApplicationException; - public void createMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException; + public void createVoteQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException; - public VoteQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionId) throws VoteApplicationException; + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long mcSessionId) throws VoteApplicationException; - public VoteQueUsr retrieveMcQueUsr(Long userId) throws VoteApplicationException; + public VoteQueUsr retrieveVoteQueUsr(Long userId) throws VoteApplicationException; - public void createMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException; + public void createVoteUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException; - public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException; + public void updateVoteUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException; public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException; - public VoteQueContent retrieveMcQueContentByUID(Long uid) throws VoteApplicationException; + public VoteQueContent retrieveVoteQueContentByUID(Long uid) throws VoteApplicationException; - public void removeMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException; + public void removeVoteQueContent(VoteQueContent mcQueContent) throws VoteApplicationException; - public VoteQueContent getMcQueContentByUID(Long uid) throws VoteApplicationException; + public VoteQueContent getVoteQueContentByUID(Long uid) throws VoteApplicationException; - public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException; + public void saveOrUpdateVoteQueContent(VoteQueContent mcQueContent) throws VoteApplicationException; - public void removeQuestionContentByMcUid(final Long mcContentUid) throws VoteApplicationException; + public void removeQuestionContentByVoteUid(final Long mcContentUid) throws VoteApplicationException; - public VoteOptsContent getMcOptionsContentByUID(Long uid) throws VoteApplicationException; + public VoteOptsContent getVoteOptionsContentByUID(Long uid) throws VoteApplicationException; public void cleanAllQuestionsSimple(final Long mcContentUid) throws VoteApplicationException; public void resetAllQuestions(final Long mcContentUid) throws VoteApplicationException; public void cleanAllQuestions(final Long mcContentUid) throws VoteApplicationException; - public List refreshQuestionContent(final Long mcContentId) throws VoteApplicationException; + public void removeVoteOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException; - public void removeMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException; + public void removeVoteOptionsContent(VoteOptsContent mcOptsContent); - public void removeMcOptionsContent(VoteOptsContent mcOptsContent); - public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid); - public List getPersistedSelectedOptions(Long mcQueContentId); + public void removeVoteQueContentByUID(Long uid) throws VoteApplicationException; - public void removeMcQueContentByUID(Long uid) throws VoteApplicationException; + public VoteQueUsr getVoteUserByUID(Long uid) throws VoteApplicationException; - public VoteQueUsr getMcUserByUID(Long uid) throws VoteApplicationException; - - public List getCorrectOption(Long mcQueContentId); - public List getAllQuestionEntries(final Long mcContentId) throws VoteApplicationException; - public VoteSession retrieveMcSession(Long mcSessionId) throws VoteApplicationException; + public VoteSession retrieveVoteSession(Long mcSessionId) throws VoteApplicationException; - public VoteContent retrieveMcBySessionId(Long mcSessionId) throws VoteApplicationException; + public VoteContent retrieveVoteBySessionId(Long mcSessionId) throws VoteApplicationException; - public void updateMc(VoteContent mc) throws VoteApplicationException; + public void updateVote(VoteContent mc) throws VoteApplicationException; - public void updateMcSession(VoteSession mcSession) throws VoteApplicationException; + public void updateVoteSession(VoteSession mcSession) throws VoteApplicationException; - public List getMcUserBySessionOnly(final VoteSession mcSession) throws VoteApplicationException; + public List getVoteUserBySessionOnly(final VoteSession mcSession) throws VoteApplicationException; - public VoteSession getMcSessionByUID(Long uid) throws VoteApplicationException; + public VoteSession getVoteSessionByUID(Long uid) throws VoteApplicationException; - public void deleteMc(VoteContent mc) throws VoteApplicationException; + public void deleteVote(VoteContent mc) throws VoteApplicationException; - public void deleteMcById(Long mcId) throws VoteApplicationException; + public void deleteVoteById(Long mcId) throws VoteApplicationException; - public void deleteMcSession(VoteSession mcSession) throws VoteApplicationException; + public void deleteVoteSession(VoteSession mcSession) throws VoteApplicationException; public List getSessionNamesFromContent(VoteContent mcContent) throws VoteApplicationException; public void removeAttempt (VoteUsrAttempt attempt) throws VoteApplicationException; - public void deleteMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException; + public void deleteVoteQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException; - public List findMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException; + public List findVoteOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException; - public void saveMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException; + public void saveVoteOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException; public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid); - public void updateMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException; + public void updateVoteOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException; - public void deleteMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException; + public void deleteVoteOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException; - public void deleteMcOptionsContentByUID(Long uid) throws VoteApplicationException; + public void deleteVoteOptionsContentByUID(Long uid) throws VoteApplicationException; public User getCurrentUserData(String username) throws VoteApplicationException; public int getTotalNumberOfUsers() throws VoteApplicationException; public Lesson getCurrentLesson(long lessonId) throws VoteApplicationException; - public void saveMcContent(VoteContent mc) throws VoteApplicationException; + public void saveVoteContent(VoteContent mc) throws VoteApplicationException; public boolean studentActivityOccurredGlobal(VoteContent mcContent) throws VoteApplicationException; @@ -163,8 +155,6 @@ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; - public void setAsForceCompleteSession(Long toolSessionId) throws VoteApplicationException; - public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException; public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException; @@ -201,15 +191,15 @@ public String getFileUuid(String filename) throws VoteApplicationException; - public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId) throws VoteApplicationException; + public List retrieveVoteUploadedOfflineFilesUuid(Long mcContentId) throws VoteApplicationException; - public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId) throws VoteApplicationException; + public List retrieveVoteUploadedOnlineFilesUuid(Long mcContentId) throws VoteApplicationException; - public List retrieveMcUploadedOfflineFilesName(Long mcContentId) throws VoteApplicationException; + public List retrieveVoteUploadedOfflineFilesName(Long mcContentId) throws VoteApplicationException; - public List retrieveMcUploadedOnlineFilesName(Long mcContentId) throws VoteApplicationException; + public List retrieveVoteUploadedOnlineFilesName(Long mcContentId) throws VoteApplicationException; - public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline) throws VoteApplicationException; + public List retrieveVoteUploadedFiles(Long mcContentId, boolean fileOnline) throws VoteApplicationException; public void cleanUploadedFilesMetaData() throws VoteApplicationException; @@ -221,12 +211,10 @@ public int countSessionComplete() throws VoteApplicationException; - public VoteSession findMcSessionById(Long mcSessionId) throws VoteApplicationException; + public VoteSession findVoteSessionById(Long mcSessionId) throws VoteApplicationException; public int countSessionIncomplete() throws VoteApplicationException; - public List getNextAvailableDisplayOrder(final long mcContentId) throws VoteApplicationException; - public NodeKey uploadFile(InputStream istream, String filename, String contentType, String fileType) throws RepositoryCheckedException; public NodeKey copyFile(Long uuid) throws RepositoryCheckedException; @@ -247,6 +235,6 @@ public List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException; - public List findMcOptionNamesByQueId(Long mcQueContentId) throws VoteApplicationException; + public List findVoteOptionNamesByQueId(Long mcQueContentId) throws VoteApplicationException; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -77,7 +77,7 @@ * * @author Ozgur Demirtas * - * The POJO implementation of Mc service. All business logics of Voting tool + * The POJO implementation of Voting service. All business logics of Voting tool * are implemented in this class. It translate the request from presentation * layer and perform appropriate database operation. * @@ -106,7 +106,7 @@ private IUserManagementService userManagementService; private ILearnerService learnerService; private ILamsToolService toolService; - private IToolContentHandler mcToolContentHandler = null; + private IToolContentHandler voteToolContentHandler = null; public VoteServicePOJO(){} @@ -132,128 +132,113 @@ } - public void createMc(VoteContent mcContent) throws VoteApplicationException + public void createVote(VoteContent voteContent) throws VoteApplicationException { try { - logger.debug("using mcContent defineLater:" + mcContent.isDefineLater()); - voteContentDAO.saveMcContent(mcContent); + logger.debug("using voteContent defineLater:" + voteContent.isDefineLater()); + voteContentDAO.saveVoteContent(voteContent); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is creating mc content: " + throw new VoteApplicationException("Exception occured when lams is creating vote content: " + e.getMessage(), e); } } - public VoteContent retrieveMc(Long toolContentId) throws VoteApplicationException + public VoteContent retrieveVote(Long toolContentId) throws VoteApplicationException { try { - return voteContentDAO.findMcContentById(toolContentId); + return voteContentDAO.findVoteContentById(toolContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is loading mc content: " + throw new VoteApplicationException("Exception occured when lams is loading vote content: " + e.getMessage(), e); } } - public void updateMcContent(VoteContent mcContent) throws VoteApplicationException + public void updateVoteContent(VoteContent voteContent) throws VoteApplicationException { try { - voteContentDAO.updateMcContent(mcContent); + voteContentDAO.updateVoteContent(voteContent); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is updating mc content: " + throw new VoteApplicationException("Exception occured when lams is updating vote content: " + e.getMessage(), e); } } - public void createMcQue(VoteQueContent mcQueContent) throws VoteApplicationException + public void createVoteQue(VoteQueContent voteQueContent) throws VoteApplicationException { try { - voteQueContentDAO.saveMcQueContent(mcQueContent); + voteQueContentDAO.saveVoteQueContent(voteQueContent); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is creating mc que content: " + throw new VoteApplicationException("Exception occured when lams is creating vote que content: " + e.getMessage(), e); } } - public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid) throws VoteApplicationException - { - try - { - return voteQueContentDAO.getQuestionContentByDisplayOrder(displayOrder, mcContentUid); - } - catch (DataAccessException e) - { - throw new VoteApplicationException("Exception occured when lams is getting mc que content by display order: " - + e.getMessage(), - e); - } - } - - - public VoteQueContent getMcQueContentByUID(Long uid) throws VoteApplicationException + public VoteQueContent getVoteQueContentByUID(Long uid) throws VoteApplicationException { try { - return voteQueContentDAO.getMcQueContentByUID(uid); + return voteQueContentDAO.getVoteQueContentByUID(uid); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is getting mc que content by uid: " + throw new VoteApplicationException("Exception occured when lams is getting vote que content by uid: " + e.getMessage(), e); } } - public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException + public void saveOrUpdateVoteQueContent(VoteQueContent voteQueContent) throws VoteApplicationException { try { - voteQueContentDAO.saveOrUpdateMcQueContent(mcQueContent); + voteQueContentDAO.saveOrUpdateVoteQueContent(voteQueContent); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is updating mc que content: " + throw new VoteApplicationException("Exception occured when lams is updating vote que content: " + e.getMessage(), e); } } - public void removeQuestionContentByMcUid(final Long mcContentUid) throws VoteApplicationException + public void removeQuestionContentByVoteUid(final Long voteContentUid) throws VoteApplicationException { try { - voteQueContentDAO.removeQuestionContentByMcUid(mcContentUid); + voteQueContentDAO.removeQuestionContentByVoteUid(voteContentUid); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is removing mc que content by mc content id: " + throw new VoteApplicationException("Exception occured when lams is removing vote que content by vote content id: " + e.getMessage(), e); } } - public void resetAllQuestions(final Long mcContentUid) throws VoteApplicationException + public void resetAllQuestions(final Long voteContentUid) throws VoteApplicationException { try { - voteQueContentDAO.resetAllQuestions(mcContentUid); + voteQueContentDAO.resetAllQuestions(voteContentUid); } catch (DataAccessException e) { @@ -265,11 +250,11 @@ - public void cleanAllQuestions(final Long mcContentUid) throws VoteApplicationException + public void cleanAllQuestions(final Long voteContentUid) throws VoteApplicationException { try { - voteQueContentDAO.cleanAllQuestions(mcContentUid); + voteQueContentDAO.cleanAllQuestions(voteContentUid); } catch (DataAccessException e) { @@ -280,150 +265,135 @@ } - public List getNextAvailableDisplayOrder(final long mcContentId) throws VoteApplicationException - { - try - { - return voteQueContentDAO.getNextAvailableDisplayOrder(mcContentId); - } - catch (DataAccessException e) - { - throw new VoteApplicationException("Exception occured when lams is getting the next available display order: " - + e.getMessage(), - e); - } - } - - - public void createMcSession(VoteSession mcSession) throws VoteApplicationException + public void createVoteSession(VoteSession voteSession) throws VoteApplicationException { try { - voteSessionDAO.saveMcSession(mcSession); + voteSessionDAO.saveVoteSession(voteSession); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is creating mc session: " + throw new VoteApplicationException("Exception occured when lams is creating vote session: " + e.getMessage(), e); } } - public VoteSession getMcSessionByUID(Long uid) throws VoteApplicationException + public VoteSession getVoteSessionByUID(Long uid) throws VoteApplicationException { try { - return voteSessionDAO.getMcSessionByUID(uid); + return voteSessionDAO.getVoteSessionByUID(uid); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is getting mcSession my uid: " + throw new VoteApplicationException("Exception occured when lams is getting voteSession my uid: " + e.getMessage(), e); } } - public void createMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException + public void createVoteQueUsr(VoteQueUsr voteQueUsr) throws VoteApplicationException { try { - voteUserDAO.saveMcUser(mcQueUsr); + voteUserDAO.saveVoteUser(voteQueUsr); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is creating mc QueUsr: " + throw new VoteApplicationException("Exception occured when lams is creating vote QueUsr: " + e.getMessage(), e); } } - public VoteQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionId) throws VoteApplicationException + public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId) throws VoteApplicationException { try { - return voteUserDAO.getMcUserBySession(queUsrId, mcSessionId); + return voteUserDAO.getVoteUserBySession(queUsrId, voteSessionId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is getting mc QueUsr: " + throw new VoteApplicationException("Exception occured when lams is getting vote QueUsr: " + e.getMessage(), e); } } - public VoteQueUsr getMcUserByUID(Long uid) throws VoteApplicationException + public VoteQueUsr getVoteUserByUID(Long uid) throws VoteApplicationException { try { - return voteUserDAO.getMcUserByUID(uid); + return voteUserDAO.getVoteUserByUID(uid); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is getting the mc QueUsr by uid." + throw new VoteApplicationException("Exception occured when lams is getting the vote QueUsr by uid." + e.getMessage(), e); } } - public VoteQueUsr retrieveMcQueUsr(Long userId) throws VoteApplicationException + public VoteQueUsr retrieveVoteQueUsr(Long userId) throws VoteApplicationException { try { - VoteQueUsr mcQueUsr=voteUserDAO.findMcUserById(userId); - return mcQueUsr; + VoteQueUsr voteQueUsr=voteUserDAO.findVoteUserById(userId); + return voteQueUsr; } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving McQueUsr: " + throw new VoteApplicationException("Exception occured when lams is retrieving VoteQueUsr: " + e.getMessage(), e); } } - public void createMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException + public void createVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt) throws VoteApplicationException { try { - voteUsrAttemptDAO.saveMcUsrAttempt(mcUsrAttempt); + voteUsrAttemptDAO.saveVoteUsrAttempt(voteUsrAttempt); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is creating mc UsrAttempt: " + throw new VoteApplicationException("Exception occured when lams is creating vote UsrAttempt: " + e.getMessage(), e); } } - public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException + public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) throws VoteApplicationException { try { - return voteUsrAttemptDAO.getAttemptsForUserAndQuestionContent(queUsrId, mcQueContentId); + return voteUsrAttemptDAO.getAttemptsForUserAndQuestionContent(queUsrId, voteQueContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is getting mc UsrAttempt by user id and que content id: " + throw new VoteApplicationException("Exception occured when lams is getting vote UsrAttempt by user id and que content id: " + e.getMessage(), e); } } - public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException + public void updateVoteUsrAttempt(VoteUsrAttempt voteUsrAttempt) throws VoteApplicationException { try { - voteUsrAttemptDAO.updateMcUsrAttempt(mcUsrAttempt); + voteUsrAttemptDAO.updateVoteUsrAttempt(voteUsrAttempt); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is updating mc UsrAttempt: " + throw new VoteApplicationException("Exception occured when lams is updating vote UsrAttempt: " + e.getMessage(), e); } @@ -446,11 +416,11 @@ } - public List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException + public List getAttemptForQueContent(final Long queUsrId, final Long voteQueContentId) throws VoteApplicationException { try { - return voteUsrAttemptDAO.getAttemptForQueContent(queUsrId, mcQueContentId); + return voteUsrAttemptDAO.getAttemptForQueContent(queUsrId, voteQueContentId); } catch (DataAccessException e) { @@ -461,30 +431,30 @@ } - public VoteQueContent retrieveMcQueContentByUID(Long uid) throws VoteApplicationException + public VoteQueContent retrieveVoteQueContentByUID(Long uid) throws VoteApplicationException { try { - return voteQueContentDAO.getMcQueContentByUID(uid); + return voteQueContentDAO.getVoteQueContentByUID(uid); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving by uid mc question content: " + throw new VoteApplicationException("Exception occured when lams is retrieving by uid vote question content: " + e.getMessage(), e); } } - public void cleanAllQuestionsSimple(final Long mcContentId) throws VoteApplicationException + public void cleanAllQuestionsSimple(final Long voteContentId) throws VoteApplicationException { try { - voteQueContentDAO.cleanAllQuestionsSimple(mcContentId); + voteQueContentDAO.cleanAllQuestionsSimple(voteContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is cleaning mc question content by mcContentId : " + throw new VoteApplicationException("Exception occured when lams is cleaning vote question content by voteContentId : " + e.getMessage(), e); } @@ -498,93 +468,62 @@ } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is getting by uid mc question content: " + throw new VoteApplicationException("Exception occured when lams is getting by uid vote question content: " + e.getMessage(), e); } } - public void removeMcQueContentByUID(Long uid) throws VoteApplicationException + public void removeVoteQueContentByUID(Long uid) throws VoteApplicationException { try { - voteQueContentDAO.removeMcQueContentByUID(uid); + voteQueContentDAO.removeVoteQueContentByUID(uid); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is removing by uid mc question content: " + throw new VoteApplicationException("Exception occured when lams is removing by uid vote question content: " + e.getMessage(), e); } } - public List refreshQuestionContent(final Long mcContentId) throws VoteApplicationException + public void removeVoteQueContent(VoteQueContent voteQueContent) throws VoteApplicationException { - try - { - return voteQueContentDAO.refreshQuestionContent(mcContentId); - } - catch (DataAccessException e) - { - throw new VoteApplicationException("Exception occured when lams is refreshing mc question content: " - + e.getMessage(), - e); - } - - } - - public void removeMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException - { try { - voteQueContentDAO.removeMcQueContent(mcQueContent); + voteQueContentDAO.removeVoteQueContent(voteQueContent); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is removing mc question content: " + throw new VoteApplicationException("Exception occured when lams is removing vote question content: " + e.getMessage(), e); } } - public void removeMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException + public void removeVoteOptionsContent(VoteOptsContent voteOptsContent) throws VoteApplicationException { try { - voteOptionsContentDAO.removeMcOptionsContent(mcOptsContent); + voteOptionsContentDAO.removeVoteOptionsContent(voteOptsContent); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is removing" - + " the mc options content: " + + " the vote options content: " + e.getMessage(),e); } } - public List getPersistedSelectedOptions(Long mcQueContentId) throws VoteApplicationException - { - try - { - return voteOptionsContentDAO.getPersistedSelectedOptions(mcQueContentId); - } - catch (DataAccessException e) - { - throw new VoteApplicationException("Exception occured when lams is gettong persisted selected" - + " the mc options content: " - + e.getMessage(),e); - } - - } - - - - public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentId) + + public VoteQueContent getQuestionContentByQuestionText(final String question, final Long voteContentId) { try { - return voteQueContentDAO.getQuestionContentByQuestionText(question, mcContentId); + return voteQueContentDAO.getQuestionContentByQuestionText(question, voteContentId); } catch (DataAccessException e) { @@ -595,41 +534,41 @@ } - public VoteSession retrieveMcSession(Long mcSessionId) throws VoteApplicationException + public VoteSession retrieveVoteSession(Long voteSessionId) throws VoteApplicationException { try { - return voteSessionDAO.findMcSessionById(mcSessionId); + return voteSessionDAO.findVoteSessionById(voteSessionId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving by id mc session : " + throw new VoteApplicationException("Exception occured when lams is retrieving by id vote session : " + e.getMessage(), e); } } - public VoteSession findMcSessionById(Long mcSessionId) throws VoteApplicationException + public VoteSession findVoteSessionById(Long voteSessionId) throws VoteApplicationException { try { - return voteSessionDAO.findMcSessionById(mcSessionId); + return voteSessionDAO.findVoteSessionById(voteSessionId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving by id mc session : " + throw new VoteApplicationException("Exception occured when lams is retrieving by id vote session : " + e.getMessage(), e); } } - public List getMcUserBySessionOnly(final VoteSession mcSession) throws VoteApplicationException + public List getVoteUserBySessionOnly(final VoteSession voteSession) throws VoteApplicationException { try { - return voteUserDAO.getMcUserBySessionOnly(mcSession); + return voteUserDAO.getVoteUserBySessionOnly(voteSession); } catch (DataAccessException e) { @@ -640,25 +579,25 @@ } - public VoteContent retrieveMcBySessionId(Long mcSessionId) throws VoteApplicationException + public VoteContent retrieveVoteBySessionId(Long voteSessionId) throws VoteApplicationException { try { - return voteContentDAO.getMcContentBySession(mcSessionId); + return voteContentDAO.getVoteContentBySession(voteSessionId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving mc by session id: " + throw new VoteApplicationException("Exception occured when lams is retrieving vote by session id: " + e.getMessage(), e); } } - public List getSessionNamesFromContent(VoteContent mcContent) throws VoteApplicationException + public List getSessionNamesFromContent(VoteContent voteContent) throws VoteApplicationException { try { - return voteSessionDAO.getSessionNamesFromContent(mcContent); + return voteSessionDAO.getSessionNamesFromContent(voteContent); } catch (DataAccessException e) { @@ -670,59 +609,59 @@ - public void updateMc(VoteContent mc) throws VoteApplicationException + public void updateVote(VoteContent vote) throws VoteApplicationException { try { - voteContentDAO.updateMcContent(mc); + voteContentDAO.updateVoteContent(vote); } catch(DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is updating" - + " the mc content: " + + " the vote content: " + e.getMessage(),e); } } - public void updateMcSession(VoteSession mcSession) throws VoteApplicationException + public void updateVoteSession(VoteSession voteSession) throws VoteApplicationException { try { - voteSessionDAO.updateMcSession(mcSession); + voteSessionDAO.updateVoteSession(voteSession); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is updating mc session : " + throw new VoteApplicationException("Exception occured when lams is updating vote session : " + e.getMessage(), e); } } - public void deleteMc(VoteContent mc) throws VoteApplicationException + public void deleteVote(VoteContent vote) throws VoteApplicationException { try { - voteContentDAO.removeMc(mc); + voteContentDAO.removeVote(vote); } catch(DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is removing" - + " the mc content: " + + " the vote content: " + e.getMessage(),e); } } - public void deleteMcById(Long mcId) throws VoteApplicationException + public void deleteVoteById(Long voteId) throws VoteApplicationException { try { - voteContentDAO.removeMcById(mcId); + voteContentDAO.removeVoteById(voteId); } catch(DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is removing by id" - + " the mc content: " + + " the vote content: " + e.getMessage(),e); } } @@ -753,16 +692,16 @@ } } - public void deleteMcSession(VoteSession mcSession) throws VoteApplicationException + public void deleteVoteSession(VoteSession voteSession) throws VoteApplicationException { try { - voteSessionDAO.removeMcSession(mcSession); + voteSessionDAO.removeVoteSession(voteSession); } catch(DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is deleting" - + " the mc session: " + + " the vote session: " + e.getMessage(),e); } } @@ -772,7 +711,7 @@ { try { - voteUsrAttemptDAO.removeMcUsrAttempt(attempt); + voteUsrAttemptDAO.removeVoteUsrAttempt(attempt); } catch(DataAccessException e) { @@ -783,11 +722,11 @@ } - public void deleteMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException + public void deleteVoteQueUsr(VoteQueUsr voteQueUsr) throws VoteApplicationException { try { - voteUserDAO.removeMcUser(mcQueUsr); + voteUserDAO.removeVoteUser(voteQueUsr); } catch(DataAccessException e) { @@ -798,42 +737,42 @@ } - public void saveMcContent(VoteContent mc) throws VoteApplicationException + public void saveVoteContent(VoteContent vote) throws VoteApplicationException { try { - voteContentDAO.saveMcContent(mc); + voteContentDAO.saveVoteContent(vote); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is saving" - + " the mc content: " + + " the vote content: " + e.getMessage(),e); } } - public List findMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException + public List findVoteOptionsContentByQueId(Long voteQueContentId) throws VoteApplicationException { try { - List list=voteOptionsContentDAO.findMcOptionsContentByQueId(mcQueContentId); + List list=voteOptionsContentDAO.findVoteOptionsContentByQueId(voteQueContentId); return list; } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is finding by que id" - + " the mc options: " + + " the vote options: " + e.getMessage(),e); } } - public VoteOptsContent getMcOptionsContentByUID(Long uid) throws VoteApplicationException + public VoteOptsContent getVoteOptionsContentByUID(Long uid) throws VoteApplicationException { try { - return getMcOptionsContentByUID(uid); + return getVoteOptionsContentByUID(uid); } catch (DataAccessException e) { @@ -843,25 +782,25 @@ } - public void saveMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException + public void saveVoteOptionsContent(VoteOptsContent voteOptsContent) throws VoteApplicationException { try { - voteOptionsContentDAO.saveMcOptionsContent(mcOptsContent); + voteOptionsContentDAO.saveVoteOptionsContent(voteOptsContent); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is saving" - + " the mc options content: " + + " the vote options content: " + e.getMessage(),e); } } - public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid) + public VoteOptsContent getOptionContentByOptionText(final String option, final Long voteQueContentUid) { try { - return voteOptionsContentDAO.getOptionContentByOptionText(option, mcQueContentUid); + return voteOptionsContentDAO.getOptionContentByOptionText(option, voteQueContentUid); } catch (DataAccessException e) { @@ -872,105 +811,91 @@ } - public List getCorrectOption(Long mcQueContentId) - { - try - { - return voteOptionsContentDAO.getCorrectOption(mcQueContentId); - } - catch (DataAccessException e) - { - throw new VoteApplicationException("Exception occured when lams is returning the " - + " correct option: " - + e.getMessage(),e); - } - } - - public void updateMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException + public void updateVoteOptionsContent(VoteOptsContent voteOptsContent) throws VoteApplicationException { try { - voteOptionsContentDAO.updateMcOptionsContent(mcOptsContent); + voteOptionsContentDAO.updateVoteOptionsContent(voteOptsContent); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is updating" - + " the mc options content: " + + " the vote options content: " + e.getMessage(),e); } } - public List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException + public List getSessionsFromContent(VoteContent voteContent) throws VoteApplicationException { try { - return voteSessionDAO.getSessionsFromContent(mcContent); + return voteSessionDAO.getSessionsFromContent(voteContent); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is getting" - + " the mc sessions list: " + + " the vote sessions list: " + e.getMessage(),e); } } - public void deleteMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException + public void deleteVoteOptionsContent(VoteOptsContent voteOptsContent) throws VoteApplicationException { try { - voteOptionsContentDAO.removeMcOptionsContent(mcOptsContent); + voteOptionsContentDAO.removeVoteOptionsContent(voteOptsContent); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is removing" - + " the mc options content: " + + " the vote options content: " + e.getMessage(),e); } } - public List findMcOptionNamesByQueId(Long mcQueContentId) throws VoteApplicationException + public List findVoteOptionNamesByQueId(Long voteQueContentId) throws VoteApplicationException { try { - return voteOptionsContentDAO.findMcOptionNamesByQueId(mcQueContentId); + return voteOptionsContentDAO.findVoteOptionNamesByQueId(voteQueContentId); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is finding" - + " the mc options name: " + + " the vote options name: " + e.getMessage(),e); } } - public void removeMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException + public void removeVoteOptionsContentByQueId(Long voteQueContentId) throws VoteApplicationException { try { - voteOptionsContentDAO.removeMcOptionsContentByQueId(mcQueContentId); + voteOptionsContentDAO.removeVoteOptionsContentByQueId(voteQueContentId); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is removing by que id" - + " the mc options content: " + + " the vote options content: " + e.getMessage(),e); } } - public void deleteMcOptionsContentByUID(Long uid) throws VoteApplicationException + public void deleteVoteOptionsContentByUID(Long uid) throws VoteApplicationException { try { - voteOptionsContentDAO.removeMcOptionsContentByUID(uid); + voteOptionsContentDAO.removeVoteOptionsContentByUID(uid); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is removing by uid" - + " the mc options content: " + + " the vote options content: " + e.getMessage(),e); } } @@ -984,7 +909,7 @@ } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is retrieving total number of McQueUsr: " + throw new VoteApplicationException("Exception occured when lams is retrieving total number of VoteQueUsr: " + e.getMessage(), e); } @@ -1049,13 +974,13 @@ * @return boolean * @throws VoteApplicationException */ - public boolean studentActivityOccurredGlobal(VoteContent mcContent) throws VoteApplicationException + public boolean studentActivityOccurredGlobal(VoteContent voteContent) throws VoteApplicationException { - Iterator questionIterator=mcContent.getVoteQueContents().iterator(); + Iterator questionIterator=voteContent.getVoteQueContents().iterator(); while (questionIterator.hasNext()) { - VoteQueContent mcQueContent=(VoteQueContent)questionIterator.next(); - Iterator attemptsIterator=mcQueContent.getVoteUsrAttempts().iterator(); + VoteQueContent voteQueContent=(VoteQueContent)questionIterator.next(); + Iterator attemptsIterator=voteQueContent.getVoteUsrAttempts().iterator(); while (attemptsIterator.hasNext()) { logger.debug("there is at least one attempt"); @@ -1070,9 +995,9 @@ } - public int countIncompleteSession(VoteContent mc) throws VoteApplicationException + public int countIncompleteSession(VoteContent vote) throws VoteApplicationException { - //int countIncompleteSession=voteSessionDAO.countIncompleteSession(mc); + //int countIncompleteSession=voteSessionDAO.countIncompleteSession(vote); int countIncompleteSession=2; return countIncompleteSession; } @@ -1082,11 +1007,11 @@ * * find out if any student has ever used (logged in through the url and replied) to this content * return true even if you have only one content passed as parameter referenced in the tool sessions table - * @param mc + * @param vote * @return boolean * @throws VoteApplicationException */ - public boolean studentActivityOccurred(VoteContent mc) throws VoteApplicationException + public boolean studentActivityOccurred(VoteContent vote) throws VoteApplicationException { //int countStudentActivity=voteSessionDAO.studentActivityOccurred(mc); int countStudentActivity=2; @@ -1136,7 +1061,7 @@ try { - VoteContent fromContent = voteContentDAO.findMcContentById(fromContentId); + VoteContent fromContent = voteContentDAO.findVoteContentById(fromContentId); if (fromContent == null) { @@ -1154,17 +1079,17 @@ throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!"); } - fromContent = voteContentDAO.findMcContentById(fromContentId); + fromContent = voteContentDAO.findVoteContentById(fromContentId); logger.debug("using fromContent: " + fromContent); } logger.debug("final - retrieved fromContent: " + fromContent); logger.debug("final - before new instance using " + fromContent + " and " + toContentId); - logger.debug("final - before new instance using mcToolContentHandler: " + mcToolContentHandler); + logger.debug("final - before new instance using mcToolContentHandler: " + voteToolContentHandler); try { - VoteContent toContent = VoteContent.newInstance(mcToolContentHandler, fromContent,toContentId); + VoteContent toContent = VoteContent.newInstance(voteToolContentHandler, fromContent,toContentId); if (toContent == null) { logger.debug("throwing ToolException: WARNING!, retrieved toContent is null."); @@ -1173,7 +1098,7 @@ else { logger.debug("retrieved toContent: " + toContent); - voteContentDAO.saveMcContent(toContent); + voteContentDAO.saveVoteContent(toContent); logger.debug("toContent has been saved successfully: " + toContent); } logger.debug("end of copyToolContent with ids: " + fromContentId + " and " + toContentId); @@ -1214,23 +1139,23 @@ throw new ToolException("toolContentId is missing"); } - VoteContent mcContent = voteContentDAO.findMcContentById(toolContentId); - logger.debug("retrieving mcContent: " + mcContent); + VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentId); + logger.debug("retrieving voteContent: " + voteContent); - if (mcContent != null) + if (voteContent != null) { logger.error("start deleting any uploaded file for this content from the content repository"); - Iterator filesIterator=mcContent.getVoteAttachments().iterator(); + Iterator filesIterator=voteContent.getVoteAttachments().iterator(); while (filesIterator.hasNext()) { - VoteUploadedFile mcUploadedFile=(VoteUploadedFile) filesIterator.next(); - logger.debug("iterated mcUploadedFile : " + mcUploadedFile); - String filesUuid=mcUploadedFile.getUuid(); + VoteUploadedFile voteUploadedFile=(VoteUploadedFile) filesIterator.next(); + logger.debug("iterated voteUploadedFile : " + voteUploadedFile); + String filesUuid=voteUploadedFile.getUuid(); if ((filesUuid != null) && (filesUuid.length() > 0)) { try { - mcToolContentHandler.deleteFile(new Long(filesUuid)); + voteToolContentHandler.deleteFile(new Long(filesUuid)); } catch(RepositoryCheckedException e) { @@ -1241,7 +1166,7 @@ } logger.debug("end deleting any uploaded files for this content."); - Iterator sessionIterator=mcContent.getVoteSessions().iterator(); + Iterator sessionIterator=voteContent.getVoteSessions().iterator(); while (sessionIterator.hasNext()) { if (removeSessionData == false) @@ -1250,58 +1175,39 @@ throw new SessionDataExistsException(); } - VoteSession mcSession=(VoteSession)sessionIterator.next(); - logger.debug("iterated mcSession : " + mcSession); + VoteSession voteSession=(VoteSession)sessionIterator.next(); + logger.debug("iterated voteSession : " + voteSession); - Iterator sessionUsersIterator=mcSession.getVoteQueUsers().iterator(); + Iterator sessionUsersIterator=voteSession.getVoteQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { - VoteQueUsr mcQueUsr=(VoteQueUsr) sessionUsersIterator.next(); - logger.debug("iterated mcQueUsr : " + mcQueUsr); + VoteQueUsr voteQueUsr=(VoteQueUsr) sessionUsersIterator.next(); + logger.debug("iterated voteQueUsr : " + voteQueUsr); - Iterator sessionUsersAttemptsIterator=mcQueUsr.getVoteUsrAttempts().iterator(); + Iterator sessionUsersAttemptsIterator=voteQueUsr.getVoteUsrAttempts().iterator(); while (sessionUsersAttemptsIterator.hasNext()) { - VoteUsrAttempt mcUsrAttempt=(VoteUsrAttempt)sessionUsersAttemptsIterator.next(); - logger.debug("iterated mcUsrAttempt : " + mcUsrAttempt); - removeAttempt(mcUsrAttempt); - logger.debug("removed mcUsrAttempt : " + mcUsrAttempt); + VoteUsrAttempt voteUsrAttempt=(VoteUsrAttempt)sessionUsersAttemptsIterator.next(); + logger.debug("iterated voteUsrAttempt : " + voteUsrAttempt); + removeAttempt(voteUsrAttempt); + logger.debug("removed voteUsrAttempt : " + voteUsrAttempt); } } } logger.debug("removed all existing responses of toolContent with toolContentId:" + toolContentId); - voteContentDAO.removeMcById(toolContentId); - logger.debug("removed mcContent:" + mcContent); + voteContentDAO.removeVoteById(toolContentId); + logger.debug("removed voteContent:" + voteContent); } else { - logger.error("Warning!!!, We should have not come here. mcContent is null."); + logger.error("Warning!!!, We should have not come here. voteContent is null."); throw new ToolException("toolContentId is missing"); } } - /** - * TO BE DEFINED-FUTURE API - * gets called from monitoring module - * - * update the tool session status to COMPLETE for this tool session - * - * @param Long toolSessionId - */ - public void setAsForceCompleteSession(Long toolSessionId) throws VoteApplicationException - { - VoteSession mcSession=retrieveMcSession(toolSessionId); - mcSession.setSessionStatus(VoteSession.COMPLETED); - updateMcSession(mcSession); - } - - - - - /** * Implemented as part of the tool contract. Sets the defineLater to true on this content. * setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException * @param toolContentId @@ -1317,14 +1223,14 @@ throw new DataMissingException("toolContentId is missing"); } - VoteContent mcContent=retrieveMc(toolContentId); - if (mcContent == null) + VoteContent voteContent=retrieveVote(toolContentId); + if (voteContent == null) { - logger.error("throwing DataMissingException: WARNING!: retrieved mcContent is null."); - throw new DataMissingException("mcContent is missing"); + logger.error("throwing DataMissingException: WARNING!: retrieved voteContent is null."); + throw new DataMissingException("voteContent is missing"); } - mcContent.setDefineLater(true); - saveMcContent(mcContent); + voteContent.setDefineLater(true); + saveVoteContent(voteContent); logger.debug("success: end of setAsDefineLater on toolContentId:" + toolContentId); } @@ -1345,14 +1251,14 @@ logger.error("throwing DataMissingException: WARNING!: retrieved toolContentId is null."); throw new DataMissingException("toolContentId is missing"); } - VoteContent mcContent = voteContentDAO.findMcContentById(toolContentId); - if (mcContent == null) + VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentId); + if (voteContent == null) { - logger.error("throwing DataMissingException: WARNING!: retrieved mcContent is null."); - throw new DataMissingException("mcContent is missing"); + logger.error("throwing DataMissingException: WARNING!: retrieved voteContent is null."); + throw new DataMissingException("voteContent is missing"); } - mcContent.setRunOffline(true); - saveMcContent(mcContent); + voteContent.setRunOffline(true); + saveVoteContent(voteContent); logger.debug("success: end of setAsRunOffline on toolContentId:" + toolContentId); } @@ -1366,16 +1272,16 @@ */ public boolean existsSession(Long toolSessionId) { - VoteSession mcSession= retrieveMcSession(toolSessionId); + VoteSession voteSession= retrieveVoteSession(toolSessionId); - if (mcSession == null) + if (voteSession == null) { - logger.error("mcSession does not exist yet: " + toolSessionId); + logger.error("voteSession does not exist yet: " + toolSessionId); return false; } else { - logger.debug("retrieving an existing mcSession: " + mcSession + " " + toolSessionId); + logger.debug("retrieving an existing voteSession: " + voteSession + " " + toolSessionId); } return true; } @@ -1422,12 +1328,12 @@ } logger.debug("final toolSessionId and toolContentId: " + toolSessionId + " " + toolContentId); - VoteContent mcContent = voteContentDAO.findMcContentById(toolContentId); - logger.debug("retrieved mcContent: " + mcContent); + VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentId); + logger.debug("retrieved voteContent: " + voteContent); - if (mcContent == null) + if (voteContent == null) { - logger.error("mcContent is null."); + logger.error("voteContent is null."); logger.error("attempt retrieving tool's default content id with signatute : " + MY_SIGNATURE); try @@ -1442,9 +1348,9 @@ throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!"); } - mcContent = voteContentDAO.findMcContentById(toolContentId); + voteContent = voteContentDAO.findVoteContentById(toolContentId); } - logger.debug("final - retrieved mcContent: " + mcContent); + logger.debug("final - retrieved voteContent: " + voteContent); /* @@ -1454,16 +1360,16 @@ { try { - VoteSession mcSession = new VoteSession(toolSessionId, + VoteSession voteSession = new VoteSession(toolSessionId, new Date(System.currentTimeMillis()), VoteSession.INCOMPLETE, toolSessionName, - mcContent, + voteContent, new TreeSet()); - logger.debug("created mcSession: " + mcSession); - voteSessionDAO.saveMcSession(mcSession); - logger.debug("created mcSession in the db: " + mcSession); + logger.debug("created voteSession: " + voteSession); + voteSessionDAO.saveVoteSession(voteSession); + logger.debug("created voteSession in the db: " + voteSession); } catch(Exception e) @@ -1493,35 +1399,35 @@ } - VoteSession mcSession=null; + VoteSession voteSession=null; try { - mcSession=retrieveMcSession(toolSessionId); - logger.debug("retrieved mcSession: " + mcSession); + voteSession=retrieveVoteSession(toolSessionId); + logger.debug("retrieved voteSession: " + voteSession); } catch(VoteApplicationException e) { - throw new DataMissingException("error retrieving mcSession: " + e); + throw new DataMissingException("error retrieving voteSession: " + e); } catch(Exception e) { - throw new ToolException("error retrieving mcSession: " + e); + throw new ToolException("error retrieving voteSession: " + e); } - if (mcSession == null) + if (voteSession == null) { - logger.error("mcSession is null"); - throw new DataMissingException("mcSession is missing"); + logger.error("voteSession is null"); + throw new DataMissingException("voteSession is missing"); } try { - voteSessionDAO.removeMcSession(mcSession); - logger.debug("mcSession " + mcSession + " has been deleted successfully."); + voteSessionDAO.removeVoteSession(voteSession); + logger.debug("voteSession " + voteSession + " has been deleted successfully."); } catch(VoteApplicationException e) { - throw new ToolException("error deleting mcSession:" + e); + throw new ToolException("error deleting voteSession:" + e); } } @@ -1555,23 +1461,23 @@ throw new DataMissingException("toolSessionId is missing"); } - VoteSession mcSession=null; + VoteSession voteSession=null; try { - mcSession=retrieveMcSession(toolSessionId); - logger.debug("retrieved mcSession: " + mcSession); + voteSession=retrieveVoteSession(toolSessionId); + logger.debug("retrieved voteSession: " + voteSession); } catch(VoteApplicationException e) { - throw new DataMissingException("error retrieving mcSession: " + e); + throw new DataMissingException("error retrieving voteSession: " + e); } catch(Exception e) { - throw new ToolException("error retrieving mcSession: " + e); + throw new ToolException("error retrieving voteSession: " + e); } - mcSession.setSessionStatus(COMPLETED); - voteSessionDAO.updateMcSession(mcSession); - logger.debug("updated mcSession to COMPLETED" + mcSession); + voteSession.setSessionStatus(COMPLETED); + voteSessionDAO.updateVoteSession(voteSession); + logger.debug("updated voteSession to COMPLETED" + voteSession); String nextUrl= learnerService.completeToolSession(toolSessionId,learnerId); logger.debug("nextUrl: " + nextUrl); @@ -1626,16 +1532,16 @@ public VoteQueContent getToolDefaultQuestionContent(long contentId) throws VoteApplicationException { - VoteQueContent mcQueContent=voteQueContentDAO.getToolDefaultQuestionContent(contentId); - logger.debug("retrieved mcQueContent : " + mcQueContent); - return mcQueContent; + VoteQueContent voteQueContent=voteQueContentDAO.getToolDefaultQuestionContent(contentId); + logger.debug("retrieved voteQueContent : " + voteQueContent); + return voteQueContent; } - public List getToolSessionsForContent(VoteContent mc) + public List getToolSessionsForContent(VoteContent vote) { - logger.debug("attempt retrieving listToolSessionIds for : " + mc); - List listToolSessionIds=voteSessionDAO.getSessionsFromContent(mc); + logger.debug("attempt retrieving listToolSessionIds for : " + vote); + List listToolSessionIds=voteSessionDAO.getSessionsFromContent(vote); return listToolSessionIds; } @@ -1646,8 +1552,8 @@ { attachment.setVoteContent(null); content.getVoteAttachments().remove(attachment); - mcToolContentHandler.deleteFile(new Long(attachment.getUuid())); - saveMcContent(content); + voteToolContentHandler.deleteFile(new Long(attachment.getUuid())); + saveVoteContent(content); } catch (DataAccessException e) { @@ -1659,13 +1565,13 @@ public NodeKey uploadFile(InputStream istream, String filename, String contentType, String fileType) throws RepositoryCheckedException { - return mcToolContentHandler.uploadFile(istream, filename, contentType, fileType); + return voteToolContentHandler.uploadFile(istream, filename, contentType, fileType); } public NodeKey copyFile(Long uuid) throws RepositoryCheckedException { - return mcToolContentHandler.copyFile(uuid); + return voteToolContentHandler.copyFile(uuid); } /** @@ -1776,11 +1682,11 @@ } - public void removeOffLineFile(String filename, Long mcContentId) throws VoteApplicationException + public void removeOffLineFile(String filename, Long voteContentId) throws VoteApplicationException { try { - voteUploadedFileDAO.removeOffLineFile(filename, mcContentId); + voteUploadedFileDAO.removeOffLineFile(filename, voteContentId); } catch (DataAccessException e) { @@ -1790,11 +1696,11 @@ } } - public void removeOnLineFile(String filename, Long mcContentId) throws VoteApplicationException + public void removeOnLineFile(String filename, Long voteContentId) throws VoteApplicationException { try { - voteUploadedFileDAO.removeOnLineFile(filename, mcContentId); + voteUploadedFileDAO.removeOnLineFile(filename, voteContentId); } catch (DataAccessException e) { @@ -1848,15 +1754,15 @@ } - public List getOnlineFilesMetaData(Long mcContentId) throws VoteApplicationException + public List getOnlineFilesMetaData(Long voteContentId) throws VoteApplicationException { - return voteUploadedFileDAO.getOnlineFilesMetaData(mcContentId); + return voteUploadedFileDAO.getOnlineFilesMetaData(voteContentId); } - public List getOfflineFilesMetaData(Long mcContentId) throws VoteApplicationException + public List getOfflineFilesMetaData(Long voteContentId) throws VoteApplicationException { - return voteUploadedFileDAO.getOfflineFilesMetaData(mcContentId); + return voteUploadedFileDAO.getOfflineFilesMetaData(voteContentId); } public boolean isUuidPersisted(String uuid) throws VoteApplicationException @@ -1867,13 +1773,13 @@ /** * adds a new entry to the uploaded files table */ - public void persistFile(String uuid, boolean isOnlineFile, String fileName, VoteContent mcContent) throws VoteApplicationException { + public void persistFile(String uuid, boolean isOnlineFile, String fileName, VoteContent voteContent) throws VoteApplicationException { - logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName + " " + mcContent); - VoteUploadedFile mcUploadedFile= new VoteUploadedFile(uuid, isOnlineFile, fileName, mcContent); - logger.debug("created mcUploadedFile: " + mcUploadedFile); - voteUploadedFileDAO.saveUploadFile(mcUploadedFile); - logger.debug("persisted mcUploadedFile: " + mcUploadedFile); + logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName + " " + voteContent); + VoteUploadedFile voteUploadedFile= new VoteUploadedFile(uuid, isOnlineFile, fileName, voteContent); + logger.debug("created voteUploadedFile: " + voteUploadedFile); + voteUploadedFileDAO.saveUploadFile(voteUploadedFile); + logger.debug("persisted voteUploadedFile: " + voteUploadedFile); } /** @@ -1887,80 +1793,80 @@ } - public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline) throws VoteApplicationException { + public List retrieveVoteUploadedFiles(Long voteContentId, boolean fileOnline) throws VoteApplicationException { try { - return voteUploadedFileDAO.retrieveMcUploadedFiles(mcContentId, fileOnline); + return voteUploadedFileDAO.retrieveVoteUploadedFiles(voteContentId, fileOnline); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: " + throw new VoteApplicationException("Exception occured when lams is loading vote uploaded files: " + e.getMessage(), e); } } - public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId) throws VoteApplicationException { + public List retrieveVoteUploadedOfflineFilesUuid(Long voteContentId) throws VoteApplicationException { try { - return voteUploadedFileDAO.retrieveMcUploadedOfflineFilesUuid(mcContentId); + return voteUploadedFileDAO.retrieveVoteUploadedOfflineFilesUuid(voteContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: offline + uuids " + throw new VoteApplicationException("Exception occured when lams is loading vote uploaded files: offline + uuids " + e.getMessage(), e); } } - public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId) throws VoteApplicationException { + public List retrieveVoteUploadedOnlineFilesUuid(Long voteContentId) throws VoteApplicationException { try { - return voteUploadedFileDAO.retrieveMcUploadedOnlineFilesUuid(mcContentId); + return voteUploadedFileDAO.retrieveVoteUploadedOnlineFilesUuid(voteContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: online + uuids " + throw new VoteApplicationException("Exception occured when lams is loading vote uploaded files: online + uuids " + e.getMessage(), e); } } - public List retrieveMcUploadedOfflineFilesName(Long mcContentId) throws VoteApplicationException { + public List retrieveVoteUploadedOfflineFilesName(Long voteContentId) throws VoteApplicationException { try { - return voteUploadedFileDAO.retrieveMcUploadedOfflineFilesName(mcContentId); + return voteUploadedFileDAO.retrieveVoteUploadedOfflineFilesName(voteContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: offline + fileNames " + throw new VoteApplicationException("Exception occured when lams is loading vote uploaded files: offline + fileNames " + e.getMessage(), e); } } - public List retrieveMcUploadedOnlineFilesName(Long mcContentId) throws VoteApplicationException { + public List retrieveVoteUploadedOnlineFilesName(Long voteContentId) throws VoteApplicationException { try { - return voteUploadedFileDAO.retrieveMcUploadedOnlineFilesName(mcContentId); + return voteUploadedFileDAO.retrieveVoteUploadedOnlineFilesName(voteContentId); } catch (DataAccessException e) { - throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: online + fileNames " + throw new VoteApplicationException("Exception occured when lams is loading vote uploaded files: online + fileNames " + e.getMessage(), e); } } /* - public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId) throws VoteApplicationException { + public List retrieveVoteUploadedOfflineFilesUuidPlusFilename(Long mcContentId) throws VoteApplicationException { try { - return voteUploadedFileDAO.retrieveMcUploadedOfflineFilesUuidPlusFilename(mcContentId); + return voteUploadedFileDAO.retrieveVoteUploadedOfflineFilesUuidPlusFilename(mcContentId); } catch (DataAccessException e) { @@ -2111,16 +2017,16 @@ } /** - * @return Returns the mcToolContentHandler. + * @return Returns the voteToolContentHandler. */ - public IToolContentHandler getMcToolContentHandler() { - return mcToolContentHandler; + public IToolContentHandler getVoteToolContentHandler() { + return voteToolContentHandler; } /** * @param mcToolContentHandler The mcToolContentHandler to set. */ - public void setMcToolContentHandler(IToolContentHandler mcToolContentHandler) { - this.mcToolContentHandler = mcToolContentHandler; + public void setVoteToolContentHandler(IToolContentHandler voteToolContentHandler) { + this.voteToolContentHandler = voteToolContentHandler; } /** * @return Returns the learnerService. Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java (.../VoteServiceProxy.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java (.../VoteServiceProxy.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -49,22 +49,22 @@ * @param servletContext the servletContext for current application * @return mcq service object. */ - public static final IVoteService getMcService(ServletContext servletContext) + public static final IVoteService getVoteService(ServletContext servletContext) { - return (IVoteService)getMcDomainService(servletContext); + return (IVoteService)getVoteDomainService(servletContext); } - public static final ToolSessionManager getMcSessionManager(ServletContext servletContext) + public static final ToolSessionManager getVoteSessionManager(ServletContext servletContext) { - return (ToolSessionManager)getMcDomainService(servletContext); + return (ToolSessionManager)getVoteDomainService(servletContext); } - public static final ToolContentManager getMcContentManager(ServletContext servletContext) + public static final ToolContentManager getVoteContentManager(ServletContext servletContext) { - return (ToolContentManager)getMcDomainService(servletContext); + return (ToolContentManager)getVoteDomainService(servletContext); } - private static Object getMcDomainService(ServletContext servletContext) + private static Object getVoteDomainService(ServletContext servletContext) { WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); return wac.getBean("voteService"); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -290,13 +290,13 @@ logger.debug("doing createContent..."); IVoteService mcService =VoteUtils.getToolService(request); - /* the tool content id is passed from the container to the tool and placed into session in the McStarterAction */ + /* the tool content id is passed from the container to the tool and placed into session in the VoteStarterAction */ Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); if ((toolContentId != null) && (toolContentId.longValue() != 0)) { logger.debug("passed TOOL_CONTENT_ID : " + toolContentId); /*delete the existing content in the database before applying new content*/ - mcService.deleteMcById(toolContentId); + mcService.deleteVoteById(toolContentId); logger.debug("post-deletion existing content"); } @@ -422,7 +422,7 @@ logger.debug("mc content :" + mc); /*create the content in the db*/ - mcService.createMc(mc); + mcService.createVote(mc); logger.debug("mc created with content id: " + toolContentId); return mc; @@ -841,7 +841,7 @@ { IVoteService mcService =VoteUtils.getToolService(request); - List allOfflineFilenames=mcService.retrieveMcUploadedOfflineFilesName(mcContent.getUid()); + List allOfflineFilenames=mcService.retrieveVoteUploadedOfflineFilesName(mcContent.getUid()); logger.debug("allOfflineFilenames:" + allOfflineFilenames); List listOfflineFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); @@ -888,7 +888,7 @@ { IVoteService mcService =VoteUtils.getToolService(request); - List allOnlineFilenames=mcService.retrieveMcUploadedOnlineFilesName(mcContent.getUid()); + List allOnlineFilenames=mcService.retrieveVoteUploadedOnlineFilesName(mcContent.getUid()); logger.debug("allOnlineFilenames:" + allOnlineFilenames); List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportAction.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportAction.java (.../VoteExportAction.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportAction.java (.../VoteExportAction.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -83,7 +83,7 @@ logger.debug("retrieving mcService from session: " + mcService); if (mcService == null) { - mcService = VoteServiceProxy.getMcService(getServlet().getServletContext()); + mcService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); logger.debug("retrieving mcService from proxy: " + mcService); request.getSession().setAttribute(TOOL_SERVICE, mcService); } @@ -102,7 +102,7 @@ Long toolSessionId =(Long)request.getSession().getAttribute(TOOL_SESSION_ID); logger.debug("toolSessionId: " + toolSessionId); - VoteSession mcSession=mcService.findMcSessionById(toolSessionId); + VoteSession mcSession=mcService.findVoteSessionById(toolSessionId); logger.debug("mcSession: " + mcSession); if (mcSession == null) { @@ -118,7 +118,7 @@ Long exportUserId =(Long)request.getSession().getAttribute(EXPORT_USER_ID); logger.debug("exportUserId : " + exportUserId); - VoteQueUsr mcQueUsr=mcService.getMcUserBySession(exportUserId, toolSessionUid); + VoteQueUsr mcQueUsr=mcService.getVoteUserBySession(exportUserId, toolSessionUid); logger.debug("existing tool user mcQueUsr : " + mcQueUsr); if (mcQueUsr == null) { @@ -129,7 +129,7 @@ } logger.debug("getting mcContent based on toolSessionId : " + toolSessionId); - VoteContent mcContent=mcService.retrieveMcBySessionId(toolSessionId); + VoteContent mcContent=mcService.retrieveVoteBySessionId(toolSessionId); logger.debug("mcContent : " + mcContent); if (mcContent == null) { @@ -166,7 +166,7 @@ logger.debug("retrieving mcService from session: " + mcService); if (mcService == null) { - mcService = VoteServiceProxy.getMcService(getServlet().getServletContext()); + mcService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); logger.debug("retrieving mcService from proxy: " + mcService); request.getSession().setAttribute(TOOL_SERVICE, mcService); } @@ -184,7 +184,7 @@ Long toolContentId =(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); logger.debug("toolContentId: " + toolContentId); - VoteContent mcContent=mcService.retrieveMc(toolContentId); + VoteContent mcContent=mcService.retrieveVote(toolContentId); logger.debug("mcContent:" + mcContent); if (mcContent == null) Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -71,11 +71,13 @@ The author is given warnings when the content in use by learners OR when the content is being edited in the Monitoring interface. */ -/* TO DO: enable show feedback on questions.*/ - package org.lamsfoundation.lams.tool.vote.web; import java.io.IOException; +import java.util.Iterator; +import java.util.LinkedList; import java.util.List; +import java.util.Map; +import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -89,12 +91,16 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; +import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; import org.lamsfoundation.lams.tool.vote.service.IVoteService; +import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; +import org.lamsfoundation.lams.web.util.AttributeNames; public class VoteStarterAction extends Action implements VoteAppConstants { @@ -106,9 +112,279 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, VoteApplicationException { - return null; + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("init authoring mode. removed attributes..."); + + IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("voteService: " + voteService); + if (voteService == null) + { + logger.debug("will retrieve voteService"); + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("retrieving voteService from cache: " + voteService); + } + request.getSession().setAttribute(TOOL_SERVICE, voteService); + + String servletPath=request.getServletPath(); + logger.debug("getServletPath: "+ servletPath); + if (servletPath.indexOf("authoringStarter") > 0) + { + logger.debug("request is for authoring module"); + request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); + } + else + { + logger.debug("request is for define later module. either direct or by monitoring module"); + request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + } + + initialiseAttributes(request); + /* determine whether the request is from Monitoring url Edit Activity. + * null sourceVoteStarter indicates that the request is from authoring url. + * */ + + String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); + logger.debug("sourceVoteStarter: " + sourceVoteStarter); + + + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + voteAuthoringForm.resetRadioBoxes(); + + ActionForward validateSignature=readSignature(request,mapping); + logger.debug("validateSignature: " + validateSignature); + if (validateSignature != null) + { + logger.debug("validateSignature not null : " + validateSignature); + return validateSignature; + } + else + { + logger.debug("no problems getting the default content, will render authoring screen"); + String strToolContentId=""; + /*the authoring url must be passed a tool content id*/ + strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + logger.debug("strToolContentId: " + strToolContentId); + + if (strToolContentId == null) + { + /*it is possible that the original request for authoring module is coming from monitoring url which keeps the + TOOL_CONTENT_ID in the session*/ + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + if (toolContentId != null) + { + strToolContentId= toolContentId.toString(); + logger.debug("cached strToolContentId from the session: " + strToolContentId); + } + else + { + logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session."); + /*use default content instead of giving a warning*/ + String defaultContentId=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID); + logger.debug("using Voting defaultContentId: " + defaultContentId); + strToolContentId=defaultContentId; + } + } + logger.debug("final strToolContentId: " + strToolContentId); + + if ((strToolContentId == null) || (strToolContentId.equals(""))) + { + VoteUtils.cleanUpSessionAbsolute(request); + request.getSession().setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true).toString()); + persistError(request,"error.contentId.required"); + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("forwarding to: " + ERROR_LIST); + return (mapping.findForward(ERROR_LIST)); + } + + /* Process incoming tool content id. + * Either exists or not exists in the db yet, a toolContentId must be passed to the tool from the container */ + long toolContentId=0; + try + { + toolContentId=new Long(strToolContentId).longValue(); + logger.debug("passed TOOL_CONTENT_ID : " + toolContentId); + request.getSession().setAttribute(TOOL_CONTENT_ID, new Long(strToolContentId)); + } + catch(NumberFormatException e) + { + VoteUtils.cleanUpSessionAbsolute(request); + request.getSession().setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString()); + persistError(request,"error.numberFormatException"); + logger.debug("forwarding to: " + ERROR_LIST); + return (mapping.findForward(ERROR_LIST)); + } + + + /* note: copyToolContent and removeToolContent code is redundant for production. + * test whether the authoring level tool contract: + public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; + * is working or not + * + * test code starts from here... + */ + String copyToolContent= (String) request.getParameter(COPY_TOOL_CONTENT); + logger.debug("copyToolContent: " + copyToolContent); + + if ((copyToolContent != null) && (copyToolContent.equals("1"))) + { + logger.debug("user request to copy the content"); + Long fromContentId=new Long(strToolContentId); + logger.debug("fromContentId: " + fromContentId); + + Long toContentId=new Long(9876); + logger.debug("toContentId: " + toContentId); + + try + { + voteService.copyToolContent(fromContentId, toContentId); + } + catch(ToolException e) + { + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("error copying the content: " + e); + } + } + + String removeToolContent= (String) request.getParameter(REMOVE_TOOL_CONTENT); + logger.debug("removeToolContent: " + removeToolContent); + + if ((removeToolContent != null) && (removeToolContent.equals("1"))) + { + logger.debug("user request to remove the content"); + Long fromContentId=new Long(strToolContentId); + logger.debug("fromContentId: " + fromContentId); + + try + { + voteService.removeToolContent(fromContentId, true); + } + catch(ToolException e) + { + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("error removing the content: " + e); + } + } + + String setDefineLater= (String) request.getParameter("setDefineLater"); + logger.debug("setDefineLater: " + setDefineLater); + + if ((setDefineLater != null) && (setDefineLater.equals("1"))) + { + logger.debug("user request to set content as define later"); + Long fromContentId=new Long(strToolContentId); + logger.debug("fromContentId: " + fromContentId); + + try + { + voteService.setAsDefineLater(fromContentId); + } + catch(ToolException e) + { + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("error setting the define later on the content: " + e); + } + } + + + String strSetRunoffline= (String) request.getParameter("strSetRunoffline"); + logger.debug("strSetRunoffline: " + strSetRunoffline); + + if ((setDefineLater != null) && (setDefineLater.equals("1"))) + { + logger.debug("user request to set content as run offline"); + Long fromContentId=new Long(strToolContentId); + logger.debug("fromContentId: " + fromContentId); + + try + { + voteService.setAsRunOffline(fromContentId); + } + catch(ToolException e) + { + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("error setting the run offline on the content: " + e); + } + } + /* ...testing code ends here*/ + + + /* + * find out if the passed tool content id exists in the db + * present user either a first timer screen with default content data or fetch the existing content. + * + * if the toolcontentid does not exist in the db, create the default Map, + * there is no need to check if the content is in use in this case. + * It is always unlocked -> not in use since it is the default content. + */ + Map mapQuestionContent= new TreeMap(new VoteComparator()); + logger.debug("mapQuestionContent: " + mapQuestionContent); + + if (!existsContent(toolContentId, request)) + { + logger.debug("getting default content"); + /*fetch default content*/ + String defaultContentIdStr=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID_STR); + logger.debug("defaultContentIdStr:" + defaultContentIdStr); + logger.debug("will get content for defaultContentIdStr:" + defaultContentIdStr); + retrieveContent(request, mapping, voteAuthoringForm, mapQuestionContent, new Long(defaultContentIdStr).longValue()); + } + else + { + logger.debug("getting existing content"); + /* it is possible that the content is in use by learners.*/ + VoteContent voteContent=voteService.retrieveVote(new Long(strToolContentId)); + logger.debug("voteContent: " + voteContent); + if (voteService.studentActivityOccurredGlobal(voteContent)) + { + VoteUtils.cleanUpSessionAbsolute(request); + logger.debug("student activity occurred on this content:" + voteContent); + request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString()); + persistError(request, "error.content.inUse"); + logger.debug("add error.content.inUse to ActionMessages."); + return (mapping.findForward(ERROR_LIST)); + } + logger.debug("will get content for strToolContentId:" + strToolContentId); + retrieveContent(request, mapping, voteAuthoringForm, mapQuestionContent, new Long(strToolContentId).longValue()); + } + } + + voteAuthoringForm.resetUserAction(); + + logger.debug("will return to jsp with: " + sourceVoteStarter); + String destination=VoteUtils.getDestination(sourceVoteStarter); + logger.debug("destination: " + destination); + return (mapping.findForward(destination)); } + + + + protected void initialiseAttributes(HttpServletRequest request) + { + logger.debug("starting initialiseAttributes..."); + + /* needs to run only once per tool*/ + /* VoteUtils.configureContentRepository(request, voteService); */ + + /* these two are for Instructions jsp */ + LinkedList listUploadedOfflineFileNames= new LinkedList(); + LinkedList listUploadedOnlineFileNames= new LinkedList(); + + request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); + request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); + + LinkedList listOfflineFilesMetaData= new LinkedList(); + LinkedList listOnlineFilesMetaData= new LinkedList(); + request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); + request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); + } + + /** * each tool has a signature. Voting tool's signature is stored in MY_SIGNATURE. The default tool content id and * other depending content ids are obtained in this method. @@ -121,13 +397,13 @@ */ public ActionForward readSignature(HttpServletRequest request, ActionMapping mapping) { - IVoteService mcService =VoteUtils.getToolService(request); + IVoteService voteService =VoteUtils.getToolService(request); /* retrieve the default content id based on tool signature */ long contentId=0; try { logger.debug("attempt retrieving tool with signature : " + MY_SIGNATURE); - contentId=mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE); + contentId=voteService.getToolDefaultContentIdBySignature(MY_SIGNATURE); logger.debug("retrieved tool default contentId: " + contentId); if (contentId == 0) { @@ -152,18 +428,18 @@ try { logger.debug("retrieve uid of the content based on default content id determined above: " + contentId); - VoteContent mcContent=mcService.retrieveMc(new Long(contentId)); - if (mcContent == null) + VoteContent voteContent=voteService.retrieveVote(new Long(contentId)); + if (voteContent == null) { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default options content"); request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); persistError(request,"error.defaultContent.notSetup"); return (mapping.findForward(ERROR_LIST)); } - logger.debug("using mcContent: " + mcContent); - logger.debug("using mcContent uid: " + mcContent.getUid()); - contentUID=mcContent.getUid().longValue(); + logger.debug("using voteContent: " + voteContent); + logger.debug("using voteContent uid: " + voteContent.getUid()); + contentUID=voteContent.getUid().longValue(); } catch(Exception e) { @@ -180,18 +456,18 @@ try { logger.debug("retrieve the default question content based on default content UID: " + queContentUID); - VoteQueContent mcQueContent=mcService.getToolDefaultQuestionContent(contentUID); - logger.debug("using mcQueContent: " + mcQueContent); - if (mcQueContent == null) + VoteQueContent voteQueContent=voteService.getToolDefaultQuestionContent(contentUID); + logger.debug("using voteQueContent: " + voteQueContent); + if (voteQueContent == null) { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default options content"); request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); persistError(request,"error.defaultContent.notSetup"); return (mapping.findForward(ERROR_LIST)); } - logger.debug("using mcQueContent uid: " + mcQueContent.getUid()); - queContentUID=mcQueContent.getUid().longValue(); + logger.debug("using voteQueContent uid: " + voteQueContent.getUid()); + queContentUID=voteQueContent.getUid().longValue(); request.getSession().setAttribute(DEFAULT_QUESTION_UID, new Long(queContentUID)); logger.debug("DEFAULT_QUESTION_UID: " + queContentUID); } @@ -209,7 +485,7 @@ try { logger.debug("retrieve the default options content based on default question content UID: " + queContentUID); - List list=mcService.findMcOptionsContentByQueId(new Long(queContentUID)); + List list=voteService.findVoteOptionsContentByQueId(new Long(queContentUID)); logger.debug("using options list: " + list); if (list == null) { @@ -232,10 +508,119 @@ logger.debug("Voting tool has the default content id: " + contentId); request.getSession().setAttribute(DEFAULT_CONTENT_ID, new Long(contentId).toString()); + request.getSession().setAttribute(DEFAULT_CONTENT_ID_STR, new Long(contentId).toString()); return null; } + + protected void retrieveContent(HttpServletRequest request, ActionMapping mapping, VoteAuthoringForm voteAuthoringForm, Map mapQuestionContent, long toolContentId) + { + logger.debug("starting retrieveExistingContent for toolContentId: " + toolContentId); + + IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("voteService: " + voteService); + if (voteService == null) + { + logger.debug("will retrieve voteService"); + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("retrieving voteService from session: " + voteService); + } + request.getSession().setAttribute(TOOL_SERVICE, voteService); + + logger.debug("getting existing content with id:" + toolContentId); + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentId)); + logger.debug("voteContent: " + voteContent); + + VoteUtils.setDefaultSessionAttributes(request, voteContent, voteAuthoringForm); + logger.debug("form title is: : " + voteAuthoringForm.getTitle()); + + request.getSession().setAttribute(IS_DEFINE_LATER, new Boolean(voteContent.isDefineLater())); + + voteAuthoringForm.setTitle(voteContent.getTitle()); + voteAuthoringForm.setInstructions(voteContent.getInstructions()); + + if (voteContent.getTitle() == null) + { + request.getSession().setAttribute(ACTIVITY_TITLE, "Questions and Answers"); + request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Please answer the questions."); + } + else + { + request.getSession().setAttribute(ACTIVITY_TITLE, voteContent.getTitle()); + request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, voteContent.getInstructions()); + } + + + logger.debug("Title is: " + voteContent.getTitle()); + logger.debug("Instructions is: " + voteContent.getInstructions()); + if ((voteAuthoringForm.getTitle() == null) || (voteAuthoringForm.getTitle().equals(""))) + { + logger.debug("resetting title"); + String activityTitle=(String)request.getSession().getAttribute(ACTIVITY_TITLE); + logger.debug("activityTitle: " + activityTitle); + voteAuthoringForm.setTitle(activityTitle); + } + + if ((voteAuthoringForm.getInstructions() == null) || (voteAuthoringForm.getInstructions().equals(""))) + { + logger.debug("resetting instructions"); + String activityInstructions=(String)request.getSession().getAttribute(ACTIVITY_INSTRUCTIONS); + logger.debug("activityInstructions: " + activityInstructions); + voteAuthoringForm.setInstructions(activityInstructions); + } + + + /* + * get the existing question content + */ + logger.debug("setting existing content data from the db"); + mapQuestionContent.clear(); + Iterator queIterator=voteContent.getVoteQueContents().iterator(); + Long mapIndex=new Long(1); + logger.debug("mapQuestionContent: " + mapQuestionContent); + while (queIterator.hasNext()) + { + VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); + if (voteQueContent != null) + { + logger.debug("question: " + voteQueContent.getQuestion()); + mapQuestionContent.put(mapIndex.toString(),voteQueContent.getQuestion()); + /** + * make the first entry the default(first) one for jsp + */ + if (mapIndex.longValue() == 1) + request.getSession().setAttribute(DEFAULT_QUESTION_CONTENT, voteQueContent.getQuestion()); + mapIndex=new Long(mapIndex.longValue()+1); + } + } + logger.debug("Map initialized with existing contentid to: " + mapQuestionContent); + + logger.debug("callling presentInitialUserInterface for the existing content."); + + request.getSession().setAttribute(MAP_QUESTION_CONTENT, mapQuestionContent); + logger.debug("starter initialized the Comparable Map: " + request.getSession().getAttribute("mapQuestionContent") ); + + logger.debug("final title: " + voteAuthoringForm.getTitle()); + logger.debug("final ins: " + voteAuthoringForm.getInstructions()); + + /* + * load questions page + */ + voteAuthoringForm.resetUserAction(); + } + + protected boolean existsContent(long toolContentId, HttpServletRequest request) + { + IVoteService voteService =VoteUtils.getToolService(request); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId)); + if (voteContent == null) + return false; + + return true; + } + + /** * persists error messages to request scope * @param request Index: lams_tool_vote/web/META-INF/MANIFEST.MF =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/web/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/web/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -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-lamc11.jar ./lams-contentrepository.jar ./lams-learning.jar +Class-Path: ./lams.jar ./lams-tool-vote11.jar ./lams-contentrepository.jar ./lams-learning.jar Index: lams_tool_vote/web/WEB-INF/struts-config.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -52,8 +52,44 @@ /> + + + + + + + + + + + + Index: lams_tool_vote/web/WEB-INF/tiles/tiles-defs.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/web/WEB-INF/tiles/tiles-defs.xml (.../tiles-defs.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/web/WEB-INF/tiles/tiles-defs.xml (.../tiles-defs.xml) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -42,23 +42,23 @@ - + - + - - + + - - + + @@ -70,69 +70,69 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + \ No newline at end of file Index: lams_tool_vote/web/WEB-INF/web.xml =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1c7c157a72edb59e9bbd8b7300d0b31eb52df88d --- lams_tool_vote/web/WEB-INF/web.xml (.../web.xml) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/web/WEB-INF/web.xml (.../web.xml) (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -23,7 +23,7 @@ --> javax.servlet.jsp.jstl.fmt.localizationContext - org.lamsfoundation.lams.tool.vote.web.VoteResources + org.lamsfoundation.lams.tool.vote.web.ApplicationResources @@ -52,7 +52,7 @@ sessionFactoryBeanName - mcSessionFactory + voteSessionFactory @@ -123,7 +123,7 @@ org.lamsfoundation.lams.contentrepository.client.ToolDownload toolContentHandlerBeanName - mcToolContentHandler + voteToolContentHandler 3 Index: lams_tool_vote/web/authoring/AdvancedContent.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/AdvancedContent.jsp (revision 0) +++ lams_tool_vote/web/authoring/AdvancedContent.jsp (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -0,0 +1,128 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + : + + + + + + + + + + + +
+ + : + + + + + + + + + + + +
+ + : + + + + + + + + + + + +
+ + : + + + + + +
+ + : + + + + + +
+    +
+ + \ No newline at end of file Index: lams_tool_vote/web/authoring/AuthoringMaincontent.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/AuthoringMaincontent.jsp (revision 0) +++ lams_tool_vote/web/authoring/AuthoringMaincontent.jsp (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -0,0 +1,171 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + +<%@ page import="java.util.LinkedHashSet" %> +<%@ page import="java.util.Set" %> + + <% + Set tabs = new LinkedHashSet(); + tabs.add("label.basic"); + tabs.add("label.advanced"); + tabs.add("label.instructions"); + pageContext.setAttribute("tabs", tabs); + + Set tabsBasic = new LinkedHashSet(); + tabsBasic.add("label.basic"); + pageContext.setAttribute("tabsBasic", tabsBasic); + %> + + + + + + + + + <bean:message key="label.authoring"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + Index: lams_tool_vote/web/authoring/Basic.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/Basic.jsp (revision 0) +++ lams_tool_vote/web/authoring/Basic.jsp (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -0,0 +1,35 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + Index: lams_tool_vote/web/authoring/BasicContent.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/BasicContent.jsp (revision 0) +++ lams_tool_vote/web/authoring/BasicContent.jsp (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -0,0 +1,142 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + +

+ + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
: + +
: + +
+ : + + +
: + + + + + + + + + + + + + + +
+ + + +
+ +
+

+ + +

+ + Index: lams_tool_vote/web/authoring/InstructionsContent.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/InstructionsContent.jsp (revision 0) +++ lams_tool_vote/web/authoring/InstructionsContent.jsp (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -0,0 +1,182 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + : + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOfflineFile');"> +
+
+ + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOnlineFile');"> +
+
+   +
Index: lams_tool_vote/web/authoring/OptionsContent.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/OptionsContent.jsp (revision 0) +++ lams_tool_vote/web/authoring/OptionsContent.jsp (revision 1c7c157a72edb59e9bbd8b7300d0b31eb52df88d) @@ -0,0 +1,210 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-logic-el" prefix="logic-el" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + : + + + + " + size="50" maxlength="255"> + +
+   +
+ + + + + + + + + + + + + + + + + + + + + + + + + "> + + + + + +
+ +
: + + + " value="" + size="50" maxlength="255"> + + + + + + + + + + + + + + + + + + + + + + images/delete.gif" align=left onclick="javascript:deleteOption(1,'removeOption');"> + +
: + + + " value="" + size="50" maxlength="255"> + + + + + + + + + + + + + + + + + + + images/delete.gif" align=left onclick="javascript:deleteOption(,'removeOption');"> + +
+ + + + + +
+   +
+ + + + + +
+ + + + + +
+ + + + + +