Index: lams_tool_vote/.classpath
===================================================================
diff -u
--- lams_tool_vote/.classpath (revision 0)
+++ lams_tool_vote/.classpath (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/.mymetadata
===================================================================
diff -u
--- lams_tool_vote/.mymetadata (revision 0)
+++ lams_tool_vote/.mymetadata (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
Index: lams_tool_vote/.project
===================================================================
diff -u
--- lams_tool_vote/.project (revision 0)
+++ lams_tool_vote/.project (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,43 @@
+
+
+ lams_tool_vote
+
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator
+
+
+
+
+ com.ibm.etools.validation.validationbuilder
+
+
+
+
+ com.ibm.sse.model.structuredbuilder
+
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.webnature
+ org.eclipse.jdt.core.javanature
+
+
Index: lams_tool_vote/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs
===================================================================
diff -u
--- lams_tool_vote/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs (revision 0)
+++ lams_tool_vote/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,3 @@
+#Wed Mar 22 19:20:43 EET 2006
+eclipse.preferences.version=1
+xdoclet.build.policy=automatic
Index: lams_tool_vote/JUnit/junit-3.7/lib/junit-3.7.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/JUnit/junit.jar
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/build.properties
===================================================================
diff -u
--- lams_tool_vote/build.properties (revision 0)
+++ lams_tool_vote/build.properties (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,21 @@
+# properties for building the Lams voting Tool
+
+#name of this project
+signature=vote11
+
+#submit files package definition
+vote.package=org.lamsfoundation.lams.tool.vote
+vote.path=org/lamsfoundation/lams/tool/vote
+
+#configuration files
+conf.includes.dir=${basedir}/web/includes
+conf.template.dir=${basedir}/web/template
+conf.resources.dir=${conf.web.dir}/resources
+
+# Build directory
+build.webinf.dir=${build.web}/WEB-INF/resources
+build.web.includes=${build}/web/includes
+build.web.template=${build}/web/template
+
+testweb=${basedir}/test/web
+testwebinf=${testweb}/WEB-INF
Index: lams_tool_vote/build.xml
===================================================================
diff -u
--- lams_tool_vote/build.xml (revision 0)
+++ lams_tool_vote/build.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,466 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You must download several jar files before you can build Middlegen.
+ Execute the "download-deps" target. Then try to build again.
+
+ If you are behind a proxy, you should define the properties
+ http.proxyHost and http.proxyPort. Example:
+
+ ant -Dhttp.proxyHost=foo.com -Dhttp.proxyPort=8080
+
+ It's also possible to download the jars manually.
+
+
+
+
+
+
+
+
+ The JDBC driver you have specified by including one of the files in ${basedir}/config/database
+ doesn't exist. You have to download this driver separately and put it in ${db.driver.jar}
+ Please make sure you're using a version that is equal or superior to the one we looked for.
+ If you name the driver jar file differently, please update the db.driver.jar property
+ in the ${basedir}/config/database/xxx.xml file accordingly.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deploying the Voting tool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml (revision 0)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/conf/jar/META-INF/MANIFEST.MF
===================================================================
diff -u
--- lams_tool_vote/conf/jar/META-INF/MANIFEST.MF (revision 0)
+++ lams_tool_vote/conf/jar/META-INF/MANIFEST.MF (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,3 @@
+Implementation-Title: LAMS QnA Tool
+Implementation-Version: 0.1
+Implementation-Vendor: LAMS Foundation (http://lamsfoundation.org)
Index: lams_tool_vote/conf/language/VoteResources.properties
===================================================================
diff -u
--- lams_tool_vote/conf/language/VoteResources.properties (revision 0)
+++ lams_tool_vote/conf/language/VoteResources.properties (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,245 @@
+# CVS ID: $Id$
+# Language strings for the Multiple Choice tool.
+
+# ========== Values for tool and library activity. Sent to Flash as part of the learning design toolkit. ======
+activity.title=Voting
+activity.description=Voting description
+activity.helptext=Voting help text
+
+tool.display.name=Voting
+tool.description=Voting description
+
+#Authoring mode resources
+label.tool.shortname =Voting
+label.authoring.mc =Voting
+label.basic =Basic
+label.advanced =Advanced
+label.instructions =Instructions
+label.summary =Summary
+label.stats =Stats
+label.editActivity =Edit Activity
+label.authoring =MCQ Authoring
+label.learning =MCQ Learning
+label.preview =MCQ Preview
+label.exportPortfolio =MCQ Export Portfolio
+label.exportPortfolio.simple =Export Portfolio
+label.authoring.mc.basic =Please define the questions.
+label.monitoring =MCQ Monitoring
+label.mc.questions =Multiple Choice Questions
+label.authoring.mc.basic.editOptions =Please define the question and/or its options.
+label.advanced.definitions =Advanced Definitions
+label.authoring.title =Title
+label.authoring.instructions =Instructions
+label.Questions =Questions
+label.weight =Weight
+label.addNewQuestion =Add New Question
+label.moveDown =Down
+label.add.question =Add New
+label.add.option =Add New
+label.mc.options =Candidate Answers
+label.mc.options.col =Candidate Answers:
+label.fileContent =File Content
+label.assessment =Assessment
+label.learner.message =Answer the questions until you reach the passmark.
+label.withRetries =Multiple Choice with Retries
+label.withoutRetries =Multiple Choice without Retries
+label.individual.results.withRetries =Results for Multiple Choice with Retries
+label.individual.results.withoutRetries =Results for Multiple Choice without Retries
+label.viewAnswers =Previous Answers
+label.learner.viewAnswers =Learner's Answers
+label.withRetries.results.summary =Multiple Choice with Retries Summary
+label.withoutRetries.results.summary =Multiple Choice without Retries Summary
+label.learnersFinished =learners have finished. Minimum passmark is
+label.learnersFinished.simple =learners have finished.
+label.topMark =Top Mark:
+label.avMark =Average Mark:
+label.loMark =Lowest Mark:
+count.total.user =Total Users Count:
+count.finished.user =Finished User Count:
+count.max.attempt =Maximum Attempt Count:
+label.attempts =Attempts
+label.mark =Mark:
+label.you.answered =You answered:
+label.learner.answered =Learner answered:
+label.redo.questions =Redo Questions
+label.view.summary =View Summary
+label.view.answers =View Answers
+label.view =View
+label.download =Download
+label.delete =Delete
+label.finished =Finished
+label.attempt =Attempt
+button.cancel =Cancel
+button.upload =Upload
+button.preview =Preview
+button.advanced =Advanced
+button.instructions =Instructions
+tool.icon.name =MC
+button.add =Add
+button.addNewQuestion =Add
+button.remove =Delete
+button.submit =Submit
+button.done =Done
+button.getNextQuestion =Next
+button.next =Next
+button.nextQuestion =Next Question
+button.continue =Continue
+button.getPreviousQuestion =Previous
+label.percent =%
+label.option =Option
+label.option1 =Option 1
+label.options =Options
+label.option.correct =Correct
+label.candidateAnswers =Candidate Answers
+label.isCorrect =Correct?
+sbmt.successful =The content has been created successfully.
+label.monitoringReport.title =Monitoring Report Title
+label.question.only =Question
+label.question =Question:
+label.question.col =Question:
+label.question1 =Question 1
+radiobox.defineLater =Define Later
+radiobox.synchInMonitor =Sync in Monitor
+radiobox.forceOffline =Force Offline
+radiobox.usernameVisible =Username Visible
+radiobox.questionsSequenced =Questions Sequenced
+radiobox.passmark =Pass Mark
+radiobox.showFeedback =Show Feedback
+radiobox.sln =Show Learner's Report
+radiobox.onepq =1 page per question
+radiobox.retries =Allow Retries
+label.report.title =Report Title
+label.report.endLearningMessage =End of Activity Message
+label.offlineInstructions =Offline Instructions
+label.offlineInstructions.col =Offline Instructions:
+label.onlineInstructions =Online Instructions
+label.onlineInstructions.col =Online Instructions:
+label.offlineFiles =Offline Files:
+label.onlineFiles =Online Files:
+label.uploadedOfflineFiles =Uploaded Offline Files:
+label.uploadedOnlineFiles =Uploaded Online Files:
+option.on =ON
+option.off =OFF
+option.correct =Correct
+option.incorrect =Incorrect
+label.feedback.incorrect =Feedback if answered incorrectly:
+label.feedback.correct =Feedback if answered correctly:
+label.learner.redo =Are you sure you want to answer the questions again?
+label.learner.bestMark =Your best mark so far is
+label.outof =out of
+label.mustGet =Must get at least
+label.toFinish =to finish
+label.save =Save
+label.cancel =Cancel
+
+feedback =Please address the following issues before submit.
+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.mc=A system exception has occured. Please contact Lams International technical support at 95806666. The error to report is\:
{0}
+
+
Index: lams_tool_vote/conf/middlegen/lams_tool_lamc11-prefs.properties
===================================================================
diff -u
--- lams_tool_vote/conf/middlegen/lams_tool_lamc11-prefs.properties (revision 0)
+++ lams_tool_vote/conf/middlegen/lams_tool_lamc11-prefs.properties (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,174 @@
+# Middlegen Preferences
+hibernate.tables.tl_lamc11_content.base-class-name=TlLamc11Content
+hibernate.tables.tl_lamc11_content.columns.content_in_use.java-name=contentInUse
+hibernate.tables.tl_lamc11_content.columns.content_in_use.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.created_by.java-name=createdBy
+hibernate.tables.tl_lamc11_content.columns.created_by.java-type=long
+hibernate.tables.tl_lamc11_content.columns.creation_date.java-name=creationDate
+hibernate.tables.tl_lamc11_content.columns.creation_date.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.define_later.java-name=defineLater
+hibernate.tables.tl_lamc11_content.columns.define_later.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.end_learning_message.java-name=endLearningMessage
+hibernate.tables.tl_lamc11_content.columns.end_learning_message.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.instructions.java-name=instructions
+hibernate.tables.tl_lamc11_content.columns.instructions.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.mc_content_id.java-name=mcContentId
+hibernate.tables.tl_lamc11_content.columns.mc_content_id.java-type=long
+hibernate.tables.tl_lamc11_content.columns.monitoring_report_title.java-name=monitoringReportTitle
+hibernate.tables.tl_lamc11_content.columns.monitoring_report_title.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.offline_instructions.java-name=offlineInstructions
+hibernate.tables.tl_lamc11_content.columns.offline_instructions.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.online_instructions.java-name=onlineInstructions
+hibernate.tables.tl_lamc11_content.columns.online_instructions.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.pass_mark.java-name=passMark
+hibernate.tables.tl_lamc11_content.columns.pass_mark.java-type=java.lang.Integer
+hibernate.tables.tl_lamc11_content.columns.qa_content_id.java-name=qaContentId
+hibernate.tables.tl_lamc11_content.columns.qa_content_id.java-type=long
+hibernate.tables.tl_lamc11_content.columns.questions_sequenced.java-name=questionsSequenced
+hibernate.tables.tl_lamc11_content.columns.questions_sequenced.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.report_title.java-name=reportTitle
+hibernate.tables.tl_lamc11_content.columns.report_title.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.retries.java-name=retries
+hibernate.tables.tl_lamc11_content.columns.retries.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.run_offline.java-name=runOffline
+hibernate.tables.tl_lamc11_content.columns.run_offline.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.show_feedback.java-name=showFeedback
+hibernate.tables.tl_lamc11_content.columns.show_feedback.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.show_top_users.java-name=showTopUsers
+hibernate.tables.tl_lamc11_content.columns.show_top_users.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.synch_in_monitor.java-name=synchInMonitor
+hibernate.tables.tl_lamc11_content.columns.synch_in_monitor.java-type=byte
+hibernate.tables.tl_lamc11_content.columns.title.java-name=title
+hibernate.tables.tl_lamc11_content.columns.title.java-type=java.lang.String
+hibernate.tables.tl_lamc11_content.columns.uid.java-name=uid
+hibernate.tables.tl_lamc11_content.columns.uid.java-type=java.lang.Long
+hibernate.tables.tl_lamc11_content.columns.update_date.java-name=updateDate
+hibernate.tables.tl_lamc11_content.columns.update_date.java-type=java.sql.Timestamp
+hibernate.tables.tl_lamc11_content.columns.username_visible.java-name=usernameVisible
+hibernate.tables.tl_lamc11_content.columns.username_visible.java-type=byte
+hibernate.tables.tl_lamc11_options_content.base-class-name=TlLamc11OptionsContent
+hibernate.tables.tl_lamc11_options_content.columns.correct_option.java-name=correctOption
+hibernate.tables.tl_lamc11_options_content.columns.correct_option.java-type=byte
+hibernate.tables.tl_lamc11_options_content.columns.mc_que_content_id.java-name=mcQueContentId
+hibernate.tables.tl_lamc11_options_content.columns.mc_que_content_id.java-type=long
+hibernate.tables.tl_lamc11_options_content.columns.mc_que_option_id.java-name=mcQueOptionId
+hibernate.tables.tl_lamc11_options_content.columns.mc_que_option_id.java-type=long
+hibernate.tables.tl_lamc11_options_content.columns.mc_que_option_text.java-name=mcQueOptionText
+hibernate.tables.tl_lamc11_options_content.columns.mc_que_option_text.java-type=java.lang.String
+hibernate.tables.tl_lamc11_options_content.columns.qa_que_content_id.java-name=qaQueContentId
+hibernate.tables.tl_lamc11_options_content.columns.qa_que_content_id.java-type=long
+hibernate.tables.tl_lamc11_options_content.columns.qa_que_option_id.java-name=qaQueOptionId
+hibernate.tables.tl_lamc11_options_content.columns.qa_que_option_id.java-type=long
+hibernate.tables.tl_lamc11_options_content.columns.qa_que_option_text.java-name=qaQueOptionText
+hibernate.tables.tl_lamc11_options_content.columns.qa_que_option_text.java-type=java.lang.String
+hibernate.tables.tl_lamc11_options_content.columns.uid.java-name=uid
+hibernate.tables.tl_lamc11_options_content.columns.uid.java-type=java.lang.Long
+hibernate.tables.tl_lamc11_options_content.keygenerator=native
+hibernate.tables.tl_lamc11_que_content.base-class-name=TlLamc11QueContent
+hibernate.tables.tl_lamc11_que_content.columns.display_order.java-name=displayOrder
+hibernate.tables.tl_lamc11_que_content.columns.display_order.java-type=java.lang.Integer
+hibernate.tables.tl_lamc11_que_content.columns.mc_content_id.java-name=mcContentId
+hibernate.tables.tl_lamc11_que_content.columns.mc_content_id.java-type=long
+hibernate.tables.tl_lamc11_que_content.columns.mc_que_content_id.java-name=mcQueContentId
+hibernate.tables.tl_lamc11_que_content.columns.mc_que_content_id.java-type=long
+hibernate.tables.tl_lamc11_que_content.columns.qa_content_id.java-name=qaContentId
+hibernate.tables.tl_lamc11_que_content.columns.qa_content_id.java-type=long
+hibernate.tables.tl_lamc11_que_content.columns.qa_que_content_id.java-name=qaQueContentId
+hibernate.tables.tl_lamc11_que_content.columns.qa_que_content_id.java-type=long
+hibernate.tables.tl_lamc11_que_content.columns.question.java-name=question
+hibernate.tables.tl_lamc11_que_content.columns.question.java-type=java.lang.String
+hibernate.tables.tl_lamc11_que_content.columns.uid.java-name=uid
+hibernate.tables.tl_lamc11_que_content.columns.uid.java-type=java.lang.Long
+hibernate.tables.tl_lamc11_que_content.keygenerator=assigned
+hibernate.tables.tl_lamc11_que_usr.base-class-name=TlLamc11QueUsr
+hibernate.tables.tl_lamc11_que_usr.columns.fullname.java-name=fullname
+hibernate.tables.tl_lamc11_que_usr.columns.fullname.java-type=java.lang.String
+hibernate.tables.tl_lamc11_que_usr.columns.mc_session_id.java-name=mcSessionId
+hibernate.tables.tl_lamc11_que_usr.columns.mc_session_id.java-type=long
+hibernate.tables.tl_lamc11_que_usr.columns.qa_session_id.java-name=qaSessionId
+hibernate.tables.tl_lamc11_que_usr.columns.qa_session_id.java-type=long
+hibernate.tables.tl_lamc11_que_usr.columns.que_usr_id.java-name=queUsrId
+hibernate.tables.tl_lamc11_que_usr.columns.que_usr_id.java-type=long
+hibernate.tables.tl_lamc11_que_usr.columns.uid.java-name=uid
+hibernate.tables.tl_lamc11_que_usr.columns.uid.java-type=java.lang.Long
+hibernate.tables.tl_lamc11_que_usr.columns.username.java-name=username
+hibernate.tables.tl_lamc11_que_usr.columns.username.java-type=java.lang.String
+hibernate.tables.tl_lamc11_session.base-class-name=TlLamc11Session
+hibernate.tables.tl_lamc11_session.columns.mc_content_id.java-name=mcContentId
+hibernate.tables.tl_lamc11_session.columns.mc_content_id.java-type=long
+hibernate.tables.tl_lamc11_session.columns.mc_session_id.java-name=mcSessionId
+hibernate.tables.tl_lamc11_session.columns.mc_session_id.java-type=long
+hibernate.tables.tl_lamc11_session.columns.qa_content_id.java-name=qaContentId
+hibernate.tables.tl_lamc11_session.columns.qa_content_id.java-type=long
+hibernate.tables.tl_lamc11_session.columns.qa_session_id.java-name=qaSessionId
+hibernate.tables.tl_lamc11_session.columns.qa_session_id.java-type=long
+hibernate.tables.tl_lamc11_session.columns.session_end_date.columnspecialty=property
+hibernate.tables.tl_lamc11_session.columns.session_end_date.java-name=sessionEndDate
+hibernate.tables.tl_lamc11_session.columns.session_end_date.java-type=java.sql.Timestamp
+hibernate.tables.tl_lamc11_session.columns.session_start_date.java-name=sessionStartDate
+hibernate.tables.tl_lamc11_session.columns.session_start_date.java-type=java.sql.Timestamp
+hibernate.tables.tl_lamc11_session.columns.session_status.java-name=sessionStatus
+hibernate.tables.tl_lamc11_session.columns.session_status.java-type=java.lang.String
+hibernate.tables.tl_lamc11_session.columns.uid.columnspecialty=key
+hibernate.tables.tl_lamc11_session.columns.uid.java-name=uid
+hibernate.tables.tl_lamc11_session.columns.uid.java-type=java.lang.Long
+hibernate.tables.tl_lamc11_usr_attempt.base-class-name=TlLamc11UsrAttempt
+hibernate.tables.tl_lamc11_usr_attempt.columns.attempt_id.columnspecialty=property
+hibernate.tables.tl_lamc11_usr_attempt.columns.attempt_id.java-name=attemptId
+hibernate.tables.tl_lamc11_usr_attempt.columns.attempt_id.java-type=long
+hibernate.tables.tl_lamc11_usr_attempt.columns.attempt_time.java-name=attemptTime
+hibernate.tables.tl_lamc11_usr_attempt.columns.attempt_time.java-type=java.sql.Timestamp
+hibernate.tables.tl_lamc11_usr_attempt.columns.mc_que_content_id.java-name=mcQueContentId
+hibernate.tables.tl_lamc11_usr_attempt.columns.mc_que_content_id.java-type=long
+hibernate.tables.tl_lamc11_usr_attempt.columns.mc_que_option_id.java-name=mcQueOptionId
+hibernate.tables.tl_lamc11_usr_attempt.columns.mc_que_option_id.java-type=long
+hibernate.tables.tl_lamc11_usr_attempt.columns.qa_que_content_id.java-name=qaQueContentId
+hibernate.tables.tl_lamc11_usr_attempt.columns.qa_que_content_id.java-type=long
+hibernate.tables.tl_lamc11_usr_attempt.columns.qa_que_option_id.java-name=qaQueOptionId
+hibernate.tables.tl_lamc11_usr_attempt.columns.qa_que_option_id.java-type=long
+hibernate.tables.tl_lamc11_usr_attempt.columns.que_usr_id.java-name=queUsrId
+hibernate.tables.tl_lamc11_usr_attempt.columns.que_usr_id.java-type=long
+hibernate.tables.tl_lamc11_usr_attempt.columns.time_zone.java-name=timeZone
+hibernate.tables.tl_lamc11_usr_attempt.columns.time_zone.java-type=java.lang.String
+hibernate.tables.tl_lamc11_usr_attempt.columns.uid.java-name=uid
+hibernate.tables.tl_lamc11_usr_attempt.columns.uid.java-type=java.lang.Long
+relations.tl_lamc11_content-tl_lamc11_que_content.tl_lamc11_content-has-tl_lamc11_que_content.enabled=true
+relations.tl_lamc11_content-tl_lamc11_que_content.tl_lamc11_content-has-tl_lamc11_que_content.target-many=true
+relations.tl_lamc11_content-tl_lamc11_que_content.tl_lamc11_que_content-has-tl_lamc11_content.enabled=true
+relations.tl_lamc11_content-tl_lamc11_que_content.tl_lamc11_que_content-has-tl_lamc11_content.target-many=false
+relations.tl_lamc11_content-tl_lamc11_session.tl_lamc11_content-has-tl_lamc11_session.enabled=true
+relations.tl_lamc11_content-tl_lamc11_session.tl_lamc11_content-has-tl_lamc11_session.target-many=true
+relations.tl_lamc11_content-tl_lamc11_session.tl_lamc11_session-has-tl_lamc11_content.enabled=true
+relations.tl_lamc11_content-tl_lamc11_session.tl_lamc11_session-has-tl_lamc11_content.target-many=false
+relations.tl_lamc11_options_content-tl_lamc11_usr_attempt.tl_lamc11_options_content-has-tl_lamc11_usr_attempt.enabled=true
+relations.tl_lamc11_options_content-tl_lamc11_usr_attempt.tl_lamc11_options_content-has-tl_lamc11_usr_attempt.target-many=true
+relations.tl_lamc11_options_content-tl_lamc11_usr_attempt.tl_lamc11_usr_attempt-has-tl_lamc11_options_content.enabled=true
+relations.tl_lamc11_options_content-tl_lamc11_usr_attempt.tl_lamc11_usr_attempt-has-tl_lamc11_options_content.target-many=false
+relations.tl_lamc11_que_content-tl_lamc11_options_content.tl_lamc11_options_content-has-tl_lamc11_que_content.enabled=true
+relations.tl_lamc11_que_content-tl_lamc11_options_content.tl_lamc11_options_content-has-tl_lamc11_que_content.target-many=false
+relations.tl_lamc11_que_content-tl_lamc11_options_content.tl_lamc11_que_content-has-tl_lamc11_options_content.enabled=true
+relations.tl_lamc11_que_content-tl_lamc11_options_content.tl_lamc11_que_content-has-tl_lamc11_options_content.target-many=true
+relations.tl_lamc11_que_content-tl_lamc11_usr_attempt.tl_lamc11_que_content-has-tl_lamc11_usr_attempt.enabled=true
+relations.tl_lamc11_que_content-tl_lamc11_usr_attempt.tl_lamc11_que_content-has-tl_lamc11_usr_attempt.target-many=true
+relations.tl_lamc11_que_content-tl_lamc11_usr_attempt.tl_lamc11_usr_attempt-has-tl_lamc11_que_content.enabled=true
+relations.tl_lamc11_que_content-tl_lamc11_usr_attempt.tl_lamc11_usr_attempt-has-tl_lamc11_que_content.target-many=false
+relations.tl_lamc11_que_usr-tl_lamc11_usr_attempt.tl_lamc11_que_usr-has-tl_lamc11_usr_attempt.enabled=true
+relations.tl_lamc11_que_usr-tl_lamc11_usr_attempt.tl_lamc11_que_usr-has-tl_lamc11_usr_attempt.target-many=true
+relations.tl_lamc11_que_usr-tl_lamc11_usr_attempt.tl_lamc11_usr_attempt-has-tl_lamc11_que_usr.enabled=true
+relations.tl_lamc11_que_usr-tl_lamc11_usr_attempt.tl_lamc11_usr_attempt-has-tl_lamc11_que_usr.target-many=false
+relations.tl_lamc11_session-tl_lamc11_que_usr.tl_lamc11_que_usr-has-tl_lamc11_session.enabled=true
+relations.tl_lamc11_session-tl_lamc11_que_usr.tl_lamc11_que_usr-has-tl_lamc11_session.target-many=false
+relations.tl_lamc11_session-tl_lamc11_que_usr.tl_lamc11_session-has-tl_lamc11_que_usr.enabled=true
+relations.tl_lamc11_session-tl_lamc11_que_usr.tl_lamc11_session-has-tl_lamc11_que_usr.target-many=true
+tables.tl_lamc11_content.x=50
+tables.tl_lamc11_content.y=50
+tables.tl_lamc11_options_content.x=110
+tables.tl_lamc11_options_content.y=110
+tables.tl_lamc11_que_content.x=69
+tables.tl_lamc11_que_content.y=69
+tables.tl_lamc11_que_usr.x=90
+tables.tl_lamc11_que_usr.y=90
+tables.tl_lamc11_session.x=10
+tables.tl_lamc11_session.y=10
+tables.tl_lamc11_usr_attempt.x=30
+tables.tl_lamc11_usr_attempt.y=30
Index: lams_tool_vote/conf/war/META-INF/MANIFEST.MF
===================================================================
diff -u
--- lams_tool_vote/conf/war/META-INF/MANIFEST.MF (revision 0)
+++ lams_tool_vote/conf/war/META-INF/MANIFEST.MF (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +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
+
+
Index: lams_tool_vote/db/model/lams_tool_vote.clay
===================================================================
diff -u
--- lams_tool_vote/db/model/lams_tool_vote.clay (revision 0)
+++ lams_tool_vote/db/model/lams_tool_vote.clay (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,701 @@
+
+
+
+Voting Tool for Lams 1.1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/db/sql/activity_insert.sql
===================================================================
diff -u
--- lams_tool_vote/db/sql/activity_insert.sql (revision 0)
+++ lams_tool_vote/db/sql/activity_insert.sql (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,101 @@
+-- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+-- =============================================================
+-- License Information: http://lamsfoundation.org/licensing/lams/2.0/
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License version 2.0 as
+-- published by the Free Software Foundation.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+-- USA
+--
+-- http://www.gnu.org/licenses/gpl.txt
+-- ****************************************************************
+--
+-- $Id$
+
+INSERT INTO lams_learning_activity
+(
+activity_ui_id
+, description
+, title
+, help_text
+, xcoord
+, ycoord
+, parent_activity_id
+, parent_ui_id
+, learning_activity_type_id
+, grouping_support_type_id
+, apply_grouping_flag
+, grouping_id
+, grouping_ui_id
+, order_id
+, define_later_flag
+, learning_design_id
+, learning_library_id
+, create_date_time
+, run_offline_flag
+, max_number_of_options
+, min_number_of_options
+, options_instructions
+, tool_id
+, tool_content_id
+, activity_category_id
+, gate_activity_level_id
+, gate_open_flag
+, gate_start_time_offset
+, gate_end_time_offset
+, gate_start_date_time
+, gate_end_date_time
+, library_activity_ui_image
+, create_grouping_id
+, create_grouping_ui_id
+, library_activity_id
+, language_file
+)
+VALUES
+(
+NULL
+, 'Allows creation and use of voting format'
+, 'Voting'
+, 'Help text'
+, NULL
+, NULL
+, NULL
+, NULL
+, 1
+, 2
+, 0
+, NULL
+, NULL
+, NULL
+, 0
+, NULL
+, ${learning_library_id}
+, NOW()
+, 0
+, NULL
+, NULL
+, NULL
+, ${tool_id}
+, NULL
+, 4
+, NULL
+, NULL
+, NULL
+, NULL
+, NULL
+, NULL
+, 'tool/lamc11/images/icon_mcq.swf'
+, NULL
+, NULL
+, NULL
+,'org.lamsfoundation.lams.tool.vote.VoteResources'
+)
Index: lams_tool_vote/db/sql/create_lams_tool_vote.sql
===================================================================
diff -u
--- lams_tool_vote/db/sql/create_lams_tool_vote.sql (revision 0)
+++ lams_tool_vote/db/sql/create_lams_tool_vote.sql (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,137 @@
+-- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+-- =============================================================
+-- License Information: http://lamsfoundation.org/licensing/lams/2.0/
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License version 2.0 as
+-- published by the Free Software Foundation.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+-- USA
+--
+-- http://www.gnu.org/licenses/gpl.txt
+-- ****************************************************************
+--
+-- $Id$
+
+CREATE TABLE tl_vote11_content (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , content_id BIGINT(20) NOT NULL
+ , title TEXT NOT NULL
+ , instructions TEXT NOT NULL
+ , creation_date DATETIME
+ , update_date DATETIME
+ , questions_sequenced TINYINT(1) NOT NULL DEFAULT 0
+ , username_visible TINYINT(1) NOT NULL DEFAULT 0
+ , created_by BIGINT(20) NOT NULL DEFAULT 0
+ , monitoring_report_title TEXT NOT NULL
+ , report_title TEXT NOT NULL
+ , run_offline TINYINT(1) NOT NULL DEFAULT 0
+ , define_later TINYINT(1) NOT NULL DEFAULT 0
+ , offline_instructions TEXT
+ , online_instructions TEXT
+ , end_learning_message TEXT NOT NULL
+ , content_in_use TINYINT(1) NOT NULL DEFAULT 0
+ , lock_on_finish TINYINT NOT NULL DEFAULT 0
+ , retries TINYINT(1) NOT NULL DEFAULT 0
+ , show_feedback TINYINT(1) NOT NULL DEFAULT 0
+ , show_report TINYINT(1) NOT NULL DEFAULT 0
+ , UNIQUE UQ_tl_lamc11_content_1 (content_id)
+ , PRIMARY KEY (uid)
+)TYPE=InnoDB;
+
+CREATE TABLE tl_vote11_que_content (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , question VARCHAR(255)
+ , disabled TINYINT(1) NOT NULL DEFAULT 1
+ , vote_content_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (uid)
+ , INDEX (vote_content_id)
+ , CONSTRAINT FK_tl_vote_que_content_1 FOREIGN KEY (vote_content_id)
+ REFERENCES tl_vote11_content (uid)
+)TYPE=InnoDB;
+
+CREATE TABLE tl_vote11_options_content (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , vote_que_content_id BIGINT(20) NOT NULL
+ , vote_que_option_text VARCHAR(250)
+ , PRIMARY KEY (uid)
+ , INDEX (vote_que_content_id)
+ , CONSTRAINT FK_tl_vote_options_content_1 FOREIGN KEY (vote_que_content_id)
+ REFERENCES tl_vote11_que_content (uid)
+)TYPE=InnoDB;
+
+CREATE TABLE tl_vote11_session (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , vote_session_id BIGINT(20) NOT NULL
+ , session_start_date DATETIME
+ , session_end_date DATETIME
+ , session_name VARCHAR(100)
+ , session_status VARCHAR(100)
+ , vote_content_id BIGINT(20) NOT NULL
+ , UNIQUE UQ_tl_lamc11_session_1 (vote_session_id)
+ , PRIMARY KEY (uid)
+ , INDEX (vote_content_id)
+ , CONSTRAINT FK_tl_vote_session_1 FOREIGN KEY (vote_content_id)
+ REFERENCES tl_vote11_content (uid)
+)TYPE=InnoDB;
+
+CREATE TABLE tl_vote11_que_usr (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , que_usr_id BIGINT(20) NOT NULL
+ , vote_session_id BIGINT(20) NOT NULL
+ , username VARCHAR(100)
+ , fullname VARCHAR(100)
+ , UNIQUE UQ_tl_lamc11_que_usr_1 (que_usr_id)
+ , PRIMARY KEY (uid)
+ , INDEX (vote_session_id)
+ , CONSTRAINT FK_tl_vote_que_usr_1 FOREIGN KEY (vote_session_id)
+ REFERENCES tl_vote11_session (uid)
+)TYPE=InnoDB;
+
+CREATE TABLE tl_vote11_usr_attempt (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , que_usr_id BIGINT(20) NOT NULL
+ , vote_que_content_id BIGINT(20) NOT NULL
+ , vote_que_option_id BIGINT(20) NOT NULL
+ , attempt_time DATETIME
+ , time_zone VARCHAR(255)
+ , userEntry VARCHAR(255)
+ , isNominated TINYINT NOT NULL
+ , PRIMARY KEY (uid)
+ , INDEX (que_usr_id)
+ , CONSTRAINT FK_tl_vote_usr_attempt_1 FOREIGN KEY (que_usr_id)
+ REFERENCES tl_vote11_que_usr (uid)
+ , INDEX (vote_que_content_id)
+ , CONSTRAINT FK_tl_vote_usr_attempt_4 FOREIGN KEY (vote_que_content_id)
+ REFERENCES tl_vote11_que_content (uid)
+ , INDEX (vote_que_option_id)
+ , CONSTRAINT FK_tl_vote_usr_attempt_3 FOREIGN KEY (vote_que_option_id)
+ REFERENCES tl_vote11_options_content (uid)
+)TYPE=InnoDB;
+
+CREATE TABLE tl_vote11_uploadedfile (
+ uid BIGINT(20) NOT NULL AUTO_INCREMENT
+ , uuid VARCHAR(255) NOT NULL
+ , vote_content_id BIGINT(20) NOT NULL
+ , isOnline_File TINYINT(1) NOT NULL
+ , filename VARCHAR(255) NOT NULL
+ , PRIMARY KEY (uid)
+ , INDEX (vote_content_id)
+ , CONSTRAINT FK_tl_vote_uploadedfile_1 FOREIGN KEY (vote_content_id)
+ REFERENCES tl_vote11_content (uid)
+)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_que_content (uid,question, disabled, vote_content_id) VALUES (1, 'sample posting', 0, 1);
+
+INSERT INTO tl_vote11_options_content (uid, vote_que_content_id, vote_que_option_text) VALUES (1, 1,'sample nomination');
\ No newline at end of file
Index: lams_tool_vote/db/sql/drop_lams_tool_vote.sql
===================================================================
diff -u
--- lams_tool_vote/db/sql/drop_lams_tool_vote.sql (revision 0)
+++ lams_tool_vote/db/sql/drop_lams_tool_vote.sql (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,38 @@
+-- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+-- =============================================================
+-- License Information: http://lamsfoundation.org/licensing/lams/2.0/
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License version 2.0 as
+-- published by the Free Software Foundation.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+-- USA
+--
+-- http://www.gnu.org/licenses/gpl.txt
+-- ****************************************************************
+--
+-- $Id$
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE tl_vote11_uploadedfile;
+DROP TABLE tl_vote11_usr_attempt;
+DROP TABLE tl_vote11_que_usr;
+DROP TABLE tl_vote11_session;
+DROP TABLE tl_vote11_options_content;
+DROP TABLE tl_vote11_que_content;
+DROP TABLE tl_vote11_content;
+SET FOREIGN_KEY_CHECKS=1;
+
+
+
+
+
+
+
Index: lams_tool_vote/db/sql/insert_lams_tool_vote.sql
===================================================================
diff -u
--- lams_tool_vote/db/sql/insert_lams_tool_vote.sql (revision 0)
+++ lams_tool_vote/db/sql/insert_lams_tool_vote.sql (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,24 @@
+-- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+-- =============================================================
+-- License Information: http://lamsfoundation.org/licensing/lams/2.0/
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License version 2.0 as
+-- published by the Free Software Foundation.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+-- USA
+--
+-- http://www.gnu.org/licenses/gpl.txt
+-- ****************************************************************
+--
+-- $Id$
+
+
Index: lams_tool_vote/db/sql/library_insert.sql
===================================================================
diff -u
--- lams_tool_vote/db/sql/library_insert.sql (revision 0)
+++ lams_tool_vote/db/sql/library_insert.sql (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,37 @@
+-- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+-- =============================================================
+-- License Information: http://lamsfoundation.org/licensing/lams/2.0/
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License version 2.0 as
+-- published by the Free Software Foundation.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+-- USA
+--
+-- http://www.gnu.org/licenses/gpl.txt
+-- ****************************************************************
+--
+-- $Id$
+
+INSERT INTO lams_learning_library
+(
+description,
+title,
+valid_flag,
+create_date_time
+)
+VALUES
+(
+'Voting Learning Library Description',
+'Voting',
+0,
+NOW()
+)
Index: lams_tool_vote/db/sql/tool_insert.sql
===================================================================
diff -u
--- lams_tool_vote/db/sql/tool_insert.sql (revision 0)
+++ lams_tool_vote/db/sql/tool_insert.sql (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,75 @@
+-- Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+-- =============================================================
+-- License Information: http://lamsfoundation.org/licensing/lams/2.0/
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License version 2.0 as
+-- published by the Free Software Foundation.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+-- USA
+--
+-- http://www.gnu.org/licenses/gpl.txt
+-- ****************************************************************
+--
+-- $Id$
+
+INSERT INTO lams_tool
+(
+tool_signature,
+service_name,
+tool_display_name,
+description,
+tool_identifier,
+tool_version,
+learning_library_id,
+default_tool_content_id,
+valid_flag,
+grouping_support_type_id,
+supports_run_offline_flag,
+learner_url,
+learner_preview_url,
+learner_progress_url,
+author_url,
+monitor_url,
+define_later_url,
+export_pfolio_learner_url,
+export_pfolio_class_url,
+contribute_url,
+moderation_url,
+language_file,
+create_date_time
+)
+VALUES
+(
+'vote11',
+'voteService',
+'Voting',
+'Voting',
+'vote',
+'1.1',
+NULL,
+NULL,
+0,
+2,
+1,
+'tool/vote11/learningStarter.do?mode=learner',
+'tool/vote11/learningStarter.do?mode=author',
+'tool/vote11/learningStarter.do?mode=teacher',
+'tool/vote11/authoringStarter.do',
+'tool/vote11/monitoringStarter.do',
+'tool/vote11/defineLaterStarter.do',
+'tool/vote11/portfolioExport?mode=learner',
+'tool/vote11/portfolioExport?mode=teacher',
+'tool/vote11/monitoringStarter.do',
+'tool/vote11/monitoringStarter.do',
+'org.lamsfoundation.lams.tool.vote.VoteResources',
+NOW()
+)
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Nullable.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Nullable.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Nullable.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+
+/**
+ * Null Object pattern. This interface is defined to avoid the use of NULL.
+ * The domain object that allows NULL as return value should implement this
+ * interface.
+ *
+ * @author Ozgur Demirtas
+ *
+ */
+public interface Nullable
+{
+ /**
+ * contract to indicate whether current object is null.
+ * @return
+ */
+ public boolean isNull();
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,306 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+/**
+ * @author Ozgur Demirtas
+ * Defines constants used throughout the application
+ */
+public interface VoteAppConstants {
+
+ public static final String MY_SIGNATURE ="vote11";
+ public static final String DEFAULT_CONTENT_ID ="defaultContentId";
+ public static final String TOOL_SERVICE ="tool_service";
+ public static final String ERROR_VOTEAPPLICATION = "error.exception.VoteApplication";
+
+ /*
+ * Struts level constants
+ */
+ public static final String LOAD ="load";
+ public static final String LOAD_QUESTIONS ="load";
+ public static final String LOAD_STARTER ="starter";
+ public static final String AUTHORING_STARTER ="starter";
+ public static final String LEARNING_STARTER ="learningStarter";
+ public static final String MONITORING_STARTER ="monitoringStarter";
+ public static final String LOAD_LEARNER ="loadLearner";
+ public static final String LOAD_MONITORING_CONTENT ="loadMonitoring";
+ public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity";
+ public static final String EXPORT_PORTFOLIO = "exportPortfolio";
+ public static final String INDIVIDUAL_REPORT ="individualReport";
+ public static final String VIEW_SUMMARY ="viewSummary";
+ public static final String REDO_QUESTIONS ="redoQuestions";
+ public static final String SINGLE_QUESTION_ANSWERS ="singleQuestionAnswers";
+ public static final String RESULTS_SUMMARY ="resultsSummary";
+ public static final String ERROR_LIST ="errorList";
+ public static final String PREVIEW ="preview";
+ public static final String LEARNER_PROGRESS ="learnerProgress";
+ 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 AUTHORING_CANCELLED ="authoringCancelled";
+ public static final String DEFINE_LATER_EDIT_ACTIVITY ="defineLaterEditActivity";
+ public static final String ACTIVE_MODULE ="activeModule";
+ public static final String EDIT_OPTIONS_MODE ="editOptionsMode";
+ public static final String DEFINE_LATER_IN_EDIT_MODE ="defineLaterInEditMode";
+ public static final String SUBMIT_SUCCESS ="sbmtSuccess";
+
+ /*
+ * authoring mode controllers
+ */
+ public static final String IS_ADD_QUESTION ="isAddQuestion";
+ public static final String IS_REMOVE_QUESTION ="isRemoveQuestion";
+ public static final String IS_REMOVE_CONTENT ="isRemoveContent";
+ public static final String IS_REVISITING_USER ="isRevisitingUser";
+
+ public static final String USER = "user";
+ public static final String TOOL_CONTENT_ID = "toolContentID";
+ public static final String TOOL_CONTENT_UID = "toolContentUID";
+ public static final String TOOL_SESSION_ID = "toolSessionID";
+ public static final String USER_ID = "userID";
+ public static final String MAX_QUESTION_INDEX = "maxQuestionIndex";
+ public static final String COPY_TOOL_CONTENT = "copyToolContent";
+ public static final String REMOVE_TOOL_CONTENT = "removeToolContent";
+
+ /*
+ * refers to number of questions presented initially, we have a single record for default content
+ */
+ public static final Long INITIAL_QUESTION_COUNT =new Long(1);
+ public static final long MAX_QUESTION_COUNT =20;
+ public static final long MAX_OPTION_COUNT =10;
+ public static final int MAX_ATTEMPT_HISTORY =30;
+
+
+ /*
+ * authoring mode constants
+ */
+ public static final String MAP_QUESTIONS_CONTENT ="mapQuestionsContent";
+ public static final String MAP_OPTIONS_CONTENT ="mapOptionsContent";
+ public static final String MAP_DEFAULTOPTIONS_CONTENT ="mapDefaultOptionsContent";
+ public static final String MAP_DISABLED_QUESTIONS ="mapDisabledQuestions";
+ public static final String MAP_GENERAL_OPTIONS_CONTENT ="mapGeneralOptionsContent";
+ public static final String MAP_GENERAL_SELECTED_OPTIONS_CONTENT ="mapGeneralSelectedOptionsContent";
+ public static final String MAP_STARTUP_GENERAL_OPTIONS_CONTENT ="mapStartupGeneralOptionsContent";
+ public static final String MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT ="mapStartupGeneralSelectedOptionsContent";
+ public static final String MAP_STARTUP_GENERAL_OPTIONS_QUEID ="mapStartupGeneralOptionsQueId";
+ public static final String QUESTIONS_WITHNO_OPTIONS ="questionsWithNoOptions";
+
+ public static final String MAP_GENERAL_CHECKED_OPTIONS_CONTENT ="mapGeneralCheckedOptionsContent";
+ public static final String MAP_LEARNER_QUESTIONS_CONTENT ="mapLearnerQuestionsContent";
+ public static final String MAP_LEARNER_CHECKED_OPTIONS_CONTENT ="mapLearnerCheckedOptionsContent";
+ public static final String MAP_LEARNER_ASSESSMENT_RESULTS ="mapLearnerAssessmentResults";
+ public static final String MAP_LEARNER_FEEDBACK_INCORRECT ="mapLeanerFeedbackIncorrect";
+ public static final String MAP_LEARNER_FEEDBACK_CORRECT ="mapLeanerFeedbackCorrect";
+ public static final String MAP_QUESTION_WEIGHTS ="mapQuestionWeights";
+ public static final String MAP_QUE_ATTEMPTS ="mapQueAttempts";
+ public static final String MAP_QUE_CORRECT_ATTEMPTS ="mapQueCorrectAttempts";
+ public static final String MAP_QUE_INCORRECT_ATTEMPTS ="mapQueIncorrectAttempts";
+
+
+ public static final String MAP_WEIGHTS ="mapWeights";
+ public static final String MAP_CHECKBOX_STATES ="mapCheckBoxStates";
+ public static final String MAP_SELECTED_OPTIONS ="mapSelectedOptions";
+ public static final String MAP_FEEDBACK_INCORRECT ="mapFeedbackIncorrect";
+ public static final String MAP_INCORRECT_FEEDBACK ="mapIncorrectFeedback";
+
+ public static final String MAP_INCORRECT_FEEDBACK_LEARNER ="mapIncorrectFeedbackLearner";
+ public static final String MAP_CORRECT_FEEDBACK_LEARNER ="mapCorrectFeedbackLearner";
+ public static final String MAP_CORRECT_FEEDBACK ="mapCorrectFeedback";
+ public static final String MAP_FEEDBACK_CORRECT ="mapFeedbackCorrect";
+
+
+ public static final String SELECTED_QUESTION ="selectedQuestion";
+ public static final String SELECTED_QUESTION_INDEX ="selectedQuestionIndex";
+ public static final String DEFAULT_QUESTION_UID ="defaultQuestionUid";
+
+ public static final String TITLE ="title";
+ public static final String INSTRUCTIONS ="instructions";
+ public static final String CREATION_DATE ="creationDate";
+ public static final String DEFINE_LATER ="defineLater";
+ public static final String RETRIES ="retries";
+ public static final String PASSMARK ="passMark";
+ public static final String VIEW_ANSWERS ="viewAnswers";
+ public static final String SHOW_AUTHORING_TABS ="showAuthoringTabs";
+
+ public static final String ON ="ON";
+ public static final String OFF ="OFF";
+ public static final String RICHTEXT_FEEDBACK_CORRECT ="richTextFeedbackCorrect";
+ public static final String RICHTEXT_INCORRECT_FEEDBACK ="richTextIncorrectFeedback";
+ public static final String RICHTEXT_CORRECT_FEEDBACK ="richTextCorrectFeedback";
+ public static final String RICHTEXT_FEEDBACK_INCORRECT ="richTextFeedbackInCorrect";
+ public static final String RICHTEXT_OFFLINEINSTRUCTIONS ="richTextOfflineInstructions";
+ public static final String RICHTEXT_ONLINEINSTRUCTIONS ="richTextOnlineInstructions";
+ public static final String RICHTEXT_REPORT_TITLE ="richTextReportTitle";
+ public static final String RICHTEXT_END_LEARNING_MSG ="richTextEndLearningMsg";
+ public static final String RICHTEXT_TITLE ="richTextTitle";
+ public static final String RICHTEXT_INSTRUCTIONS ="richTextInstructions";
+ public static final String RICHTEXT_BLANK ="
";
+ public static final String SUBMIT_OFFLINE_FILE ="submitOfflineFile";
+ public static final String SUBMIT_ONLINE_FILE ="submitOnlineFile";
+ public static final String LIST_UPLOADED_OFFLINE_FILENAMES ="listUploadedOfflineFileNames";
+ public static final String LIST_UPLOADED_ONLINE_FILENAMES ="listUploadedOnlineFileNames";
+ public static final String LIST_OFFLINEFILES_METADATA ="listOfflineFilesMetadata";
+ public static final String LIST_ONLINEFILES_METADATA ="listOnlineFilesMetadata";
+
+ public static final String COUNT_SESSION_COMPLETE ="countSessionComplete";
+ public static final String COUNT_ALL_USERS ="countAllUsers";
+ public static final String COUNT_MAX_ATTEMPT ="countMaxAttempt";
+ public static final String TOP_MARK ="topMark";
+ public static final String LOWEST_MARK ="lowestMark";
+ public static final String AVERAGE_MARK ="averageMark";
+
+
+ /*
+ * the learner or monitoring environment provides toolSessionId
+ */
+ public final long ONE_DAY =60 * 60 * 1000 * 24;
+ public final static String NOT_ATTEMPTED ="NOT_ATTEMPTED";
+ public final static String INCOMPLETE ="INCOMPLETE";
+ public static final String COMPLETED ="COMPLETED";
+
+ public static final String MAP_TOOL_SESSIONS ="mapToolSessions";
+ public static final Integer MAX_TOOL_SESSION_COUNT =new Integer(500);
+ public static final String IS_TOOL_SESSION_CHANGED ="isToolSessionChanged";
+ public static final String OPTION_OFF ="false";
+ public static final String ACTIVITY_TITLE = "activityTitle";
+ public static final String ACTIVITY_INSTRUCTIONS = "activityInstructions";
+
+
+ /*
+ * user actions
+ */
+ public static final String ADD_NEW_QUESTION ="addNewQuestion";
+ public static final String REMOVE_QUESTION ="removeQuestion";
+ public static final String REMOVE_ALL_CONTENT ="removeAllContent";
+ public static final String SUBMIT_ALL_CONTENT ="submitAllContent";
+ public static final String SUBMIT_TAB_DONE ="submitTabDone";
+
+
+ /* learner mode contants */
+ public static final String MAP_QUESTION_CONTENT_LEARNER ="mapQuestionContentLearner";
+ public static final String CURRENT_QUESTION_INDEX ="currentQuestionIndex";
+ public static final String TOTAL_QUESTION_COUNT ="totalQuestionCount";
+ public static final String LEARNER_MARK ="learnerMark";
+ public static final String LEARNER_BEST_MARK ="learnerBestMark";
+ public static final String LEARNER_LAST_ATTEMPT_ORDER ="learnerLastAttemptOrder";
+ public static final String LEARNER_MARK_ATLEAST ="learnerMarkAtLeast";
+ public static final String MAP_ANSWERS ="mapAnswers";
+ public static final String CURRENT_ANSWER ="currentAnswer";
+ public static final String USER_FEEDBACK ="userFeedback";
+ public static final String REPORT_TITLE_LEARNER ="reportTitleLearner";
+ public static final String TOTAL_COUNT_REACHED ="totalCountReached";
+
+
+ public static final String IS_TOOL_ACTIVITY_OFFLINE ="isToolActivityOffline";
+ public static final String IS_USERNAME_VISIBLE ="isUsernameVisible";
+ public static final String IS_CONTENT_IN_USE ="isContentInUse";
+ public static final String IS_MONITORED_CONTENT_IN_USE ="isMonitoredContentInUse";
+ public static final String IS_RETRIES ="isRetries";
+ public static final String IS_SHOW_FEEDBACK ="isShowFeedback";
+ public static final String IS_SHOW_LEARNERS_REPORT ="isShowLearnersReport";
+ public static final String IS_ALL_SESSIONS_COMPLETED ="isAllSessionsCompleted";
+ public static final String CHECK_ALL_SESSIONS_COMPLETED ="checkAllSessionsCompleted";
+ public static final String FROM_TOOL_CONTENT_ID ="fromToolContentId";
+ public static final String TO_TOOL_CONTENT_ID ="toToolContentId";
+ public static final String LEARNER_REPORT ="learnerReport";
+ public static final String MAP_USER_RESPONSES ="mapUserResponses";
+ public static final String MAP_MAIN_REPORT ="mapMainReport";
+ public static final String MAP_STATS ="mapStats";
+
+ /*
+ * Monitoring Mode constants
+ */
+ public static final String CURRENT_MONITORING_TAB ="currentMonitoringTab";
+ public static final String REPORT_TITLE_MONITOR ="reportTitleMonitor";
+ public static final String MONITOR_USER_ID ="userId";
+ public static final String MONITORING_REPORT ="monitoringReport";
+ public static final String MONITORING_ERROR ="monitoringError";
+ public static final String MAP_MONITORING_QUESTIONS ="mapMonitoringQuestions";
+ public static final String SUMMARY_TOOL_SESSIONS ="summaryToolSessions";
+ public static final String SUMMARY_TOOL_SESSIONS_ID ="summaryToolSessionsId";
+ public static final String MONITORED_CONTENT_ID ="monitoredContentId";
+ public static final String EDITACTIVITY_EDITMODE ="editActivityEditMode";
+ public static final String FORM_INDEX ="formIndex";
+ public static final String CURRENT_MONITORED_TOOL_SESSION ="currentMonitoredToolSession";
+ public static final String SELECTION_CASE ="selectionCase";
+ public static final String LIST_MONITORED_ANSWERS_CONTAINER_DTO ="listMonitoredAnswersContainerDto";
+ public static final String TIMEZONE ="timeZone";
+
+ public static final String QUESTION_LISTING_MODE ="questionListingMode";
+ public static final String QUESTION_LISTING_MODE_SEQUENTIAL ="questionListingModeSequential";
+ public static final String QUESTION_LISTING_MODE_COMBINED ="questionListingModeCombined";
+ public static final String PREVIEW_ONLY ="previewOnly";
+
+ public static final String MODE ="mode";
+ public static final String LEARNING_MODE ="learningMode";
+
+ public static final String EXPORT_USER_ID ="exportUserId";
+
+ /*
+ * exception constants
+ */
+ public static final String USER_EXCEPTION_WRONG_FORMAT ="userExceptionWrongFormat";
+ public static final String USER_EXCEPTION_INCOMPATIBLE_IDS ="userExceptionIncompatibleIds";
+ public static final String USER_EXCEPTION_NUMBERFORMAT ="userExceptionNumberFormat";
+ public static final String USER_EXCEPTION_CONTENT_DOESNOTEXIST ="userExceptionContentDoesNotExist";
+ public static final String USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST ="userExceptionToolSessionDoesNotExist";
+ public static final String USER_EXCEPTION_TOOLCONTENT_DOESNOTEXIST ="userExceptionToolContentDoesNotExist";
+ public static final String USER_EXCEPTION_LEARNER_REQUIRED ="userExceptionLearnerRequired";
+ public static final String USER_EXCEPTION_CONTENTID_REQUIRED ="userExceptionContentIdRequired";
+ public static final String USER_EXCEPTION_TOOLSESSIONID_REQUIRED ="userExceptionToolSessionIdRequired";
+ public static final String USER_EXCEPTION_TOOLSESSIONID_INCONSISTENT ="userExceptionToolSessionIdInconsistent";
+ public static final String USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE ="userExceptionDefaultContentNotAvailable";
+ public static final String USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE ="userExceptionDefaultQuestionContentNotAvailable";
+ public static final String USER_EXCEPTION_DEFAULTOPTIONSCONTENT_NOT_AVAILABLE ="userExceptionDefaultOptionsContentNotAvailable";
+ public static final String USER_EXCEPTION_USERID_NOTAVAILABLE ="userExceptionUserIdNotAvailable";
+ public static final String USER_EXCEPTION_USERID_NOTNUMERIC ="userExceptionUserIdNotNumeric";
+ public static final String USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS ="userExceptionOnlyContentAndNoSessions";
+ public static final String USER_EXCEPTION_USERID_EXISTING ="userExceptionUserIdExisting";
+ public static final String USER_EXCEPTION_USER_DOESNOTEXIST ="userExceptionUserDoesNotExist";
+ public static final String USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED ="userExceptionMonitoringTabContentIdRequired";
+ public static final String USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP ="userExceptionDefaultContentNotSetup";
+ public static final String USER_EXCEPTION_NO_TOOL_SESSIONS ="userExceptionNoToolSessions";
+ public static final String USER_EXCEPTION_NO_STUDENT_ACTIVITY ="userExceptionNoStudentActivity";
+ public static final String USER_EXCEPTION_MODE_REQUIRED ="userExceptionModeRequired";
+ public static final String USER_EXCEPTION_CONTENT_IN_USE ="userExceptionContentInUse";
+ public static final String USER_EXCEPTION_CONTENT_BEING_MODIFIED ="userExceptionContentBeingModified";
+ public static final String USER_EXCEPTION_CONTENT_RUNOFFLINE ="userExceptionContentRunOffline";
+ public static final String USER_EXCEPTION_CONTENT_DEFINE_LATER ="userExceptionContentDefineLater";
+ public static final String USER_EXCEPTION_MODE_INVALID ="userExceptionModeInvalid";
+ public static final String USER_EXCEPTION_QUESTION_EMPTY ="userExceptionQuestionEmpty";
+ public static final String USER_EXCEPTION_ANSWER_EMPTY ="userExceptionAnswerEmpty";
+ public static final String USER_EXCEPTION_WEIGHT_TOTAL ="userExceptionWeightTotal";
+ public static final String USER_EXCEPTION_WEIGHT_EMPTY ="userExceptionWeightEmpty";
+ public static final String USER_EXCEPTION_WEIGHT_NOTINTEGER ="userExceptionWeightNotInteger";
+ public static final String USER_EXCEPTION_WEIGHT_ZERO ="userExceptionWeightZero";
+ public static final String USER_EXCEPTION_ANSWERS_DUPLICATE ="userExceptionAnswersDuplicate";
+ public static final String USER_EXCEPTION_OPTIONS_COUNT_ZERO ="userExceptionOptionsCountZero";
+ public static final String USER_EXCEPTION_CHKBOXES_EMPTY ="userExceptionChkboxesEmpty";
+ public static final String USER_EXCEPTION_SUBMIT_NONE ="userExceptionSubmitNone";
+ public static final String USER_EXCEPTION_PASSMARK_NOTINTEGER ="userExceptionPassmarkNotInteger";
+ public static final String USER_EXCEPTION_PASSMARK_EMPTY ="userExceptionPassmarkEmpty";
+ public static final String USER_EXCEPTION_PASSMARK_GREATER100 ="userExceptionPassmarkGreater100";
+ public static final String USER_EXCEPTION_FILENAME_EMPTY ="userExceptionFilenameEmpty";
+ public static final String USER_EXCEPTION_WEIGHT_MUST_EQUAL100 ="userExceptionWeightMustEqual100";
+ public static final String USER_EXCEPTION_SINGLE_OPTION ="userExceptionSingleOption";
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteApplicationException.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteApplicationException.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteApplicationException.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+
+/**
+ * This exception wraps all basic exception occured in the voting tool. It is
+ * not suppose to be try and catched in any level. The struts should be taking
+ * care of handling this exception.
+ *
+* @author Ozgur Demirtas
+ *
+ */
+public class VoteApplicationException extends RuntimeException
+{
+ /**
+ * Default Constructor
+ */
+ public VoteApplicationException()
+ {
+ super();
+ }
+
+ /**
+ * Constructor for customized error message
+ * @param message
+ */
+ public VoteApplicationException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Constructor for wrapping the throwable object
+ * @param cause
+ */
+ public VoteApplicationException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ /**
+ * Constructor for wrapping both the customized error message and
+ * throwable exception object.
+ * @param message
+ * @param cause
+ */
+ public VoteApplicationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAttachmentDTO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAttachmentDTO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAttachmentDTO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,90 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+
+/**
+ * DTO that holds file attachment data for jsp purposes
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteAttachmentDTO
+{
+ private String uid;
+
+ private String uuid;
+
+ private boolean isOfflineFile;
+
+ private String filename;
+ /**
+ * @return Returns the filename.
+ */
+ public String getFilename() {
+ return filename;
+ }
+ /**
+ * @param filename The filename to set.
+ */
+ public void setFilename(String filename) {
+ this.filename = filename;
+ }
+
+ /**
+ * @return Returns the uuid.
+ */
+ public String getUuid() {
+ return uuid;
+ }
+ /**
+ * @param uuid The uuid to set.
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+ /**
+ * @return Returns the isOfflineFile.
+ */
+ public boolean isOfflineFile() {
+ return isOfflineFile;
+ }
+ /**
+ * @param isOfflineFile The isOfflineFile to set.
+ */
+ public void setOfflineFile(boolean isOfflineFile) {
+ this.isOfflineFile = isOfflineFile;
+ }
+ /**
+ * @return Returns the uid.
+ */
+ public String getUid() {
+ return uid;
+ }
+ /**
+ * @param uid The uid to set.
+ */
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteComparator.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteComparator.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteComparator.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+/**
+ * @author Ozgur Demirtas
+ * A comparator implementation that can be used as a constructor to collections.
+ * The TreeMap in the web layer makes use of it.
+ *
+ */
+public class VoteComparator implements Comparator, Serializable {
+
+ public int compare(Object o1, Object o2) {
+ String s1 = (String)o1;
+ String s2 = (String)o2;
+
+ int key1=new Long(s1).intValue();
+ int key2=new Long(s2).intValue();
+ //logger.debug(logger + " " + this.getClass().getName() + "comparing key1 and key2:" + key1 + " and " + key2);
+ return key1 - key2;
+ }
+
+ public boolean equals(Object o) {
+ String s = (String)o;
+ return compare(this, o)==0;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredAnswersDTO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,114 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * DTO that holds question/candidate answers data as well as user attempts data for jsp purposes
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteMonitoredAnswersDTO implements Comparable
+{
+ private String questionUid;
+
+ private String question;
+
+ private List candidateAnswers;
+
+ private Map questionAttempts;
+
+
+ /**
+ * @return Returns the candidateAnswers.
+ */
+ public List getCandidateAnswers() {
+ return candidateAnswers;
+ }
+ /**
+ * @param candidateAnswers The candidateAnswers to set.
+ */
+ public void setCandidateAnswers(List candidateAnswers) {
+ this.candidateAnswers = candidateAnswers;
+ }
+ /**
+ * @return Returns the question.
+ */
+ public String getQuestion() {
+ return question;
+ }
+ /**
+ * @param question The question to set.
+ */
+ public void setQuestion(String question) {
+ this.question = question;
+ }
+ /**
+ * @return Returns the questionUid.
+ */
+ public String getQuestionUid() {
+ return questionUid;
+ }
+ /**
+ * @param questionUid The questionUid to set.
+ */
+ public void setQuestionUid(String questionUid) {
+ this.questionUid = questionUid;
+ }
+
+ /**
+ * @return Returns the questionAttempts.
+ */
+ public Map getQuestionAttempts() {
+ return questionAttempts;
+ }
+ /**
+ * @param questionAttempts The questionAttempts to set.
+ */
+ public void setQuestionAttempts(Map questionAttempts) {
+ this.questionAttempts = questionAttempts;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("question", getQuestion())
+ .toString();
+ }
+
+ public int compareTo(Object o)
+ {
+ VoteMonitoredAnswersDTO mcMonitoredAnswersDTO = (VoteMonitoredAnswersDTO) o;
+
+ if (mcMonitoredAnswersDTO == null)
+ return 1;
+ else
+ return (int) (new Long(questionUid).longValue() - new Long(mcMonitoredAnswersDTO.questionUid).longValue());
+ }
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredUserDTO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredUserDTO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteMonitoredUserDTO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,193 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote;
+
+import java.util.Map;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * DTO that holds users attempt history data for jsp purposes
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteMonitoredUserDTO implements Comparable
+{
+ private String queUsrId;
+
+ private String uid;
+
+ private String attemptTime;
+
+ private String timeZone;
+
+ private String userName;
+
+ private String isCorrect;
+
+ private String response;
+
+ private String sessionId;
+
+ private String questionUid;
+
+ private Map usersAttempts;
+
+ /**
+ * @return Returns the queUsrId.
+ */
+ public String getQueUsrId() {
+ return queUsrId;
+ }
+ /**
+ * @param queUsrId The queUsrId to set.
+ */
+ public void setQueUsrId(String queUsrId) {
+ this.queUsrId = queUsrId;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("queUsrId and username", getQueUsrId() + " and " + getUserName())
+ .toString();
+ }
+ /**
+ * @return Returns the usersAttempts.
+ */
+ public Map getUsersAttempts() {
+ return usersAttempts;
+ }
+ /**
+ * @param usersAttempts The usersAttempts to set.
+ */
+ public void setUsersAttempts(Map usersAttempts) {
+ this.usersAttempts = usersAttempts;
+ }
+
+ public int compareTo(Object o)
+ {
+ VoteMonitoredUserDTO VoteMonitoredUserDTO = (VoteMonitoredUserDTO) o;
+
+ if (VoteMonitoredUserDTO == null)
+ return 1;
+ else
+ return (int) (new Long(queUsrId).longValue() - new Long(VoteMonitoredUserDTO.queUsrId).longValue());
+ }
+ /**
+ * @return Returns the attemptTime.
+ */
+ public String getAttemptTime() {
+ return attemptTime;
+ }
+ /**
+ * @param attemptTime The attemptTime to set.
+ */
+ public void setAttemptTime(String attemptTime) {
+ this.attemptTime = attemptTime;
+ }
+ /**
+ * @return Returns the isCorrect.
+ */
+ public String getIsCorrect() {
+ return isCorrect;
+ }
+ /**
+ * @param isCorrect The isCorrect to set.
+ */
+ public void setIsCorrect(String isCorrect) {
+ this.isCorrect = isCorrect;
+ }
+ /**
+ * @return Returns the response.
+ */
+ public String getResponse() {
+ return response;
+ }
+ /**
+ * @param response The response to set.
+ */
+ public void setResponse(String response) {
+ this.response = response;
+ }
+ /**
+ * @return Returns the timeZone.
+ */
+ public String getTimeZone() {
+ return timeZone;
+ }
+ /**
+ * @param timeZone The timeZone to set.
+ */
+ public void setTimeZone(String timeZone) {
+ this.timeZone = timeZone;
+ }
+ /**
+ * @return Returns the uid.
+ */
+ public String getUid() {
+ return uid;
+ }
+ /**
+ * @param uid The uid to set.
+ */
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+ /**
+ * @return Returns the userName.
+ */
+ public String getUserName() {
+ return userName;
+ }
+ /**
+ * @param userName The userName to set.
+ */
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ /**
+ * @return Returns the sessionId.
+ */
+ public String getSessionId() {
+ return sessionId;
+ }
+ /**
+ * @param sessionId The sessionId to set.
+ */
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+ /**
+ * @return Returns the questionUid.
+ */
+ public String getQuestionUid() {
+ return questionUid;
+ }
+ /**
+ * @param questionUid The questionUid to set.
+ */
+ public void setQuestionUid(String questionUid) {
+ this.questionUid = questionUid;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteStringComparator.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteStringComparator.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteStringComparator.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+
+package org.lamsfoundation.lams.tool.vote;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author Ozgur Demirtas
+ * * A comparator implementation that can be used as a constructor to collections.
+ * The TreeMap in the web layer makes use of it.
+ *
+ */
+public class VoteStringComparator implements Comparator, Serializable {
+ static Logger logger = Logger.getLogger(VoteStringComparator.class.getName());
+
+ public int compare(Object o1, Object o2) {
+ String s1 = (String)o1;
+ String s2 = (String)o2;
+
+ return s1.compareTo(s2);
+ }
+
+ public boolean equals(Object o) {
+ return compare(this, o)==0;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,600 @@
+
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.TimeZone;
+import java.util.TreeMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+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.usermanagement.User;
+import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+import org.lamsfoundation.lams.web.session.SessionManager;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+
+
+/**
+ * @author Ozgur Demirtas
+ * Common MCQ utility functions live here.
+ */
+public abstract class VoteUtils implements VoteAppConstants {
+
+ static Logger logger = Logger.getLogger(VoteUtils.class.getName());
+
+ /**
+ * returns the service object from the session cache
+ * IMcService getToolService(HttpServletRequest request)
+ *
+ * @param request
+ * @return
+ */
+ public static IVoteService getToolService(HttpServletRequest request)
+ {
+ IVoteService mcService=(IVoteService)request.getSession().getAttribute(TOOL_SERVICE);
+ return mcService;
+ }
+
+ /**
+ *
+ * getGMTDateTime(HttpServletRequest request)
+ *
+ * @param request
+ * @return
+ */
+ /* fix this */
+ public static Date getGMTDateTime()
+ {
+ Date date=new Date(System.currentTimeMillis());
+ logger.debug("date: " + date);
+ return date;
+ }
+
+
+ public static UserDTO getToolUser()
+ {
+ /*obtain user object from the session*/
+ HttpSession ss = SessionManager.getSession();
+ /* get back login user DTO */
+ UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ logger.debug("retrieving toolUser: " + toolUser);
+ return toolUser;
+ }
+
+
+ public static Long getUserId()
+ {
+ UserDTO toolUser=getToolUser();
+ long userId=toolUser.getUserID().longValue();
+ logger.debug("userId: " + userId);
+ return new Long(userId);
+ }
+
+ public static String getUserName()
+ {
+ /* double check if username and login is the same */
+ UserDTO toolUser=getToolUser();
+ String userName=toolUser.getLogin();
+ logger.debug("userName: " + userName);
+ return userName;
+ }
+
+ public static String getUserFullName()
+ {
+ UserDTO toolUser=getToolUser();
+ String fullName=toolUser.getFirstName() + " " + toolUser.getLastName();
+ logger.debug("fullName: " + fullName);
+ return fullName;
+ }
+
+ public static String getFormattedDateString(Date date)
+ {
+ logger.debug("getFormattedDateString: " +
+ DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date));
+ return (DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date));
+ }
+
+ public static void persistTimeZone(HttpServletRequest request)
+ {
+ TimeZone timeZone=TimeZone.getDefault();
+ logger.debug("current timezone: " + timeZone.getDisplayName());
+ request.getSession().setAttribute(TIMEZONE, timeZone.getDisplayName());
+ logger.debug("current timezone id: " + timeZone.getID());
+ }
+
+ public static String getCurrentTimeZone()
+ {
+ TimeZone timeZone=TimeZone.getDefault();
+ logger.debug("current timezone: " + timeZone.getDisplayName());
+ return timeZone.getDisplayName();
+ }
+
+
+ /**
+ * existsContent(long toolContentId)
+ * @param long toolContentId
+ * @return boolean
+ * determine whether a specific toolContentId exists in the db
+ */
+ public static boolean existsContent(Long toolContentId, HttpServletRequest request)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+ /*
+ VoteContent mcContent=mcService.retrieveMc(toolContentId);
+ logger.debug("retrieving mcContent: " + mcContent);
+ if (mcContent == null)
+ return false;
+ */
+
+ return true;
+ }
+
+ /**
+ * it is expected that the tool session id already exists in the tool sessions table
+ * existsSession(long toolSessionId)
+ * @param toolSessionId
+ * @return boolean
+ */
+ public static boolean existsSession(Long toolSessionId, HttpServletRequest request)
+ {
+ logger.debug("existsSession");
+ IVoteService mcService =VoteUtils.getToolService(request);
+ VoteSession mcSession=mcService.retrieveMcSession(toolSessionId);
+ logger.debug("mcSession:" + mcSession);
+
+ if (mcSession == null)
+ return false;
+
+ return true;
+ }
+
+
+ /**
+ * returns a Map of options
+ * generateOptionsMap(List listMcOptions)
+ *
+ * @param listMcOptions
+ * @return Map
+ */
+ public static Map generateOptionsMap(List listMcOptions)
+ {
+ logger.debug("incoming listMcOptions" + listMcOptions);
+ Map mapOptionsContent= new TreeMap(new VoteStringComparator());
+
+ Iterator listIterator=listMcOptions.iterator();
+ Long mapIndex=new Long(1);
+ while (listIterator.hasNext())
+ {
+ VoteOptsContent mcOptionsContent = (VoteOptsContent)listIterator.next();
+ logger.debug("mcOptionsContent:" + mcOptionsContent);
+ mapOptionsContent.put(mapIndex.toString(),mcOptionsContent.getVoteQueOptionText());
+ mapIndex=new Long(mapIndex.longValue()+1);
+ }
+ logger.debug("generated mcOptionsContent: " + mapOptionsContent);
+ return mapOptionsContent;
+ }
+
+
+ public static void persistRichText(HttpServletRequest request)
+ {
+ String richTextOfflineInstructions=request.getParameter(RICHTEXT_OFFLINEINSTRUCTIONS);
+ logger.debug("read parameter richTextOfflineInstructions: " + richTextOfflineInstructions);
+ String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS);
+ logger.debug("read parameter richTextOnlineInstructions: " + richTextOnlineInstructions);
+
+ if ((richTextOfflineInstructions != null) && (richTextOfflineInstructions.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS,richTextOfflineInstructions);
+ }
+
+ if ((richTextOnlineInstructions != null) && (richTextOnlineInstructions.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS,richTextOnlineInstructions);
+ }
+
+
+ String richTextTitle=request.getParameter(RICHTEXT_TITLE);
+ logger.debug("read parameter richTextTitle: " + richTextTitle);
+ String richTextInstructions=request.getParameter(RICHTEXT_INSTRUCTIONS);
+ logger.debug("read parameter richTextInstructions: " + richTextInstructions);
+
+
+ if ((richTextTitle != null) && (richTextTitle.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle);
+ }
+
+ if ((richTextInstructions != null) && (richTextInstructions.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions);
+ }
+
+ String richTextIncorrectFeedback=request.getParameter(RICHTEXT_INCORRECT_FEEDBACK);
+ logger.debug("read parameter richTextIncorrectFeedback: " + richTextIncorrectFeedback);
+
+ if ((richTextIncorrectFeedback != null) && (richTextIncorrectFeedback.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_INCORRECT_FEEDBACK,richTextIncorrectFeedback);
+ }
+
+
+ String richTextCorrectFeedback=request.getParameter(RICHTEXT_CORRECT_FEEDBACK);
+ logger.debug("read parameter richTextCorrectFeedback: " + richTextCorrectFeedback);
+
+ if ((richTextCorrectFeedback != null) && (richTextCorrectFeedback.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_CORRECT_FEEDBACK,richTextCorrectFeedback);
+ }
+
+
+ String richTextReportTitle=request.getParameter(RICHTEXT_REPORT_TITLE);
+ logger.debug("read parameter richTextReportTitle: " + richTextReportTitle);
+
+ String richTextEndLearningMessage=request.getParameter(RICHTEXT_END_LEARNING_MSG);
+ logger.debug("read parameter richTextEndLearningMessage: " + richTextEndLearningMessage);
+
+ if ((richTextReportTitle != null) && (richTextReportTitle.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_REPORT_TITLE,richTextReportTitle);
+ }
+
+ if ((richTextEndLearningMessage != null) && (richTextEndLearningMessage.length() > 0))
+ {
+ request.getSession().setAttribute(RICHTEXT_END_LEARNING_MSG,richTextEndLearningMessage);
+ }
+
+ Map mapIncorrectFeedback=(Map)request.getSession().getAttribute(MAP_INCORRECT_FEEDBACK);
+ }
+
+
+ public static void configureContentRepository(HttpServletRequest request, IVoteService mcService)
+ {
+ logger.debug("attempt configureContentRepository");
+ mcService.configureContentRepository();
+ logger.debug("configureContentRepository ran successfully");
+ }
+
+ /**
+ * retrieves existing updated file information
+ * populateUploadedFilesData(HttpServletRequest request, McContent defaultMcContent)
+ *
+ * @param request
+ * @param defaultMcContent
+ */
+ public static void populateUploadedFilesData(HttpServletRequest request, VoteContent defaultMcContent)
+ {
+ logger.debug("attempt populateUploadedFilesData for: " + defaultMcContent);
+ IVoteService mcService =VoteUtils.getToolService(request);
+ logger.debug("mcService: " + mcService);
+
+ /** read the uploaded offline uuid + file name pair */
+ List listOffFilesName=mcService.retrieveMcUploadedOfflineFilesName(defaultMcContent.getUid());
+ logger.debug("initial listOfflineFilesName: " + listOffFilesName);
+
+ /** read the uploaded online uuid + file name pair */
+ List listOnFilesName=mcService.retrieveMcUploadedOnlineFilesName(defaultMcContent.getUid());
+ logger.debug("initial listOnlineFilesName: " + listOnFilesName);
+
+ request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES, listOffFilesName);
+ request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listOnFilesName);
+ }
+
+
+ /**
+ * temporary function
+ * @return
+ */
+ public static long generateId()
+ {
+ Random generator = new Random();
+ long longId=generator.nextLong();
+ if (longId < 0) longId=longId * (-1) ;
+ return longId;
+ }
+
+ /**
+ * temporary function
+ * @return
+ */
+ public static int generateIntegerId()
+ {
+ Random generator = new Random();
+ int intId=generator.nextInt();
+ if (intId < 0) intId=intId * (-1) ;
+ return intId;
+ }
+
+
+ /**
+ * temporary function
+ * @return
+ */
+ public static int getCurrentUserId(HttpServletRequest request) throws VoteApplicationException
+ {
+ HttpSession ss = SessionManager.getSession();
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ logger.debug(logger + " " + "VoteUtils" + " Current user is: " + user + " with id: " + user.getUserID());
+ return user.getUserID().intValue();
+ }
+
+
+ /**
+ * temporary function
+ * @return
+ */
+ public static User createSimpleUser(Integer userId)
+ {
+ User user=new User();
+ user.setUserId(userId);
+ return user;
+ }
+
+ /**
+ * temporary function
+ * @return
+ */
+ public static boolean getDefineLaterStatus()
+ {
+ return false;
+ }
+
+
+ /**
+ * builds a map from a list
+ * convertToMap(List sessionsList)
+ *
+ * @param sessionsList
+ * @return Map
+ */
+ public static Map convertToMap(List sessionsList, String listType)
+ {
+ Map map= new TreeMap(new VoteComparator());
+ logger.debug("listType: " + listType);
+
+ Iterator listIterator=sessionsList.iterator();
+ Long mapIndex=new Long(1);
+
+
+ while (listIterator.hasNext())
+ {
+ if (listType.equals("String"))
+ {
+ String text=(String)listIterator.next();
+ map.put(mapIndex.toString(), text);
+ }
+ else if (listType.equals("Long"))
+ {
+ Long LongValue=(Long)listIterator.next();
+ map.put(mapIndex.toString(), LongValue);
+ }
+ mapIndex=new Long(mapIndex.longValue()+1);
+ }
+ return map;
+ }
+
+
+ /**
+ * builds a String based map from a list
+ * convertToMap(List sessionsList)
+ *
+ * @param sessionsList
+ * @return Map
+ */
+ public static Map convertToStringMap(List sessionsList, String listType)
+ {
+ Map map= new TreeMap(new VoteComparator());
+ logger.debug("listType: " + listType);
+
+ Iterator listIterator=sessionsList.iterator();
+ Long mapIndex=new Long(1);
+
+
+ while (listIterator.hasNext())
+ {
+ if (listType.equals("String"))
+ {
+ logger.debug("listType String");
+ String text=(String)listIterator.next();
+ map.put(mapIndex.toString(), text);
+ }
+ else if (listType.equals("Long"))
+ {
+ logger.debug("listType Long");
+ Long LongValue=(Long)listIterator.next();
+ map.put(mapIndex.toString(), LongValue.toString());
+ }
+ mapIndex=new Long(mapIndex.longValue()+1);
+ }
+ return map;
+ }
+
+
+ /**
+ * find out if the content is in use or not. If it is in use, the author can not modify it.
+ * 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)
+ * @param mcContent
+ * @return boolean
+ */
+ public static boolean isContentInUse(VoteContent mcContent)
+ {
+ logger.debug("is content inuse: " + mcContent.isContentInUse());
+ return mcContent.isContentInUse();
+ }
+
+
+ /**
+ * 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)
+ * @param mcContent
+ * @return boolean
+ */
+ public static boolean isDefineLater(VoteContent mcContent)
+ {
+ logger.debug("is define later: " + mcContent.isDefineLater());
+ return mcContent.isDefineLater();
+ }
+
+
+ /**
+ * 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)
+ *
+ * @param mcContent
+ * @return boolean
+ */
+ public static boolean isRunOffline(VoteContent mcContent)
+ {
+ logger.debug("is run offline: " + mcContent.isRunOffline());
+ return mcContent.isRunOffline();
+ }
+
+
+ /**
+ * sets/resets the define later flag of the content
+ * setDefineLater(HttpServletRequest request, boolean value)
+ *
+ * @param request
+ * @param value
+ */
+ public static void setDefineLater(HttpServletRequest request, boolean value)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+ Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID);
+ logger.debug("toolContentId:" + toolContentId);
+ logger.debug("value:" + value);
+
+ VoteContent mcContent=mcService.retrieveMc(toolContentId);
+ logger.debug("mcContent:" + mcContent);
+ if (mcContent != null)
+ {
+ mcContent.setDefineLater(value);
+ logger.debug("defineLater has been set to true");
+ mcService.saveMcContent(mcContent);
+ }
+ }
+
+
+ public static String getDestination(String sourceMcStarter)
+ {
+ logger.debug("sourceMcStarter: " + sourceMcStarter);
+
+ if ((sourceMcStarter != null) && !sourceMcStarter.equals("monitoring"))
+ {
+ logger.debug("request is from authoring or define Later url. return to: " + LOAD_QUESTIONS);
+ return LOAD_QUESTIONS;
+ }
+ else if (sourceMcStarter == null)
+ {
+ logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS);
+ return LOAD_QUESTIONS;
+ }
+ else
+ {
+ logger.debug("request is from monitoring url. return to: " + LOAD_MONITORING_CONTENT_EDITACTIVITY);
+ return LOAD_MONITORING_CONTENT_EDITACTIVITY;
+ }
+ }
+
+
+
+ /**
+ * the only attributes kept are TOOL_SESSION and TOOL_CONTENT_ID and CURRENT_MONITORED_TOOL_SESSION
+ * cleanUpSessionAbsolute(HttpServletRequest request)
+ * @param request
+ */
+ public static void cleanUpSessionAbsolute(HttpServletRequest request)
+ {
+ request.getSession().removeAttribute(MY_SIGNATURE);
+
+
+ cleanUpUserExceptions(request);
+ logger.debug("completely cleaned the session.");
+ }
+
+ /**
+ *removes attributes except USER_EXCEPTION_NO_STUDENT_ACTIVITY
+ */
+ public static void cleanUpUserExceptions(HttpServletRequest request)
+ {
+ request.getSession().removeAttribute(USER_EXCEPTION_WRONG_FORMAT);
+ request.getSession().removeAttribute(USER_EXCEPTION_INCOMPATIBLE_IDS);
+ request.getSession().removeAttribute(USER_EXCEPTION_NUMBERFORMAT);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST);
+ request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST);
+ request.getSession().removeAttribute(USER_EXCEPTION_TOOLCONTENT_DOESNOTEXIST);
+ request.getSession().removeAttribute(USER_EXCEPTION_LEARNER_REQUIRED);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENTID_REQUIRED);
+ request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED);
+ request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSIONID_INCONSISTENT);
+ request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE);
+ request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE);
+ request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTOPTIONSCONTENT_NOT_AVAILABLE);
+ request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE);
+ request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTNUMERIC);
+ request.getSession().removeAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS);
+ request.getSession().removeAttribute(USER_EXCEPTION_USERID_EXISTING);
+ request.getSession().removeAttribute(USER_EXCEPTION_USER_DOESNOTEXIST);
+ request.getSession().removeAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED);
+ request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP);
+ request.getSession().removeAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS);
+ request.getSession().removeAttribute(USER_EXCEPTION_MODE_REQUIRED);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_BEING_MODIFIED);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_RUNOFFLINE);
+ request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_DEFINE_LATER);
+ request.getSession().removeAttribute(USER_EXCEPTION_MODE_INVALID);
+ request.getSession().removeAttribute(USER_EXCEPTION_QUESTION_EMPTY);
+ request.getSession().removeAttribute(USER_EXCEPTION_ANSWER_EMPTY);
+ request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_TOTAL);
+ request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_EMPTY);
+ request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_NOTINTEGER);
+ request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_ZERO);
+ request.getSession().removeAttribute(USER_EXCEPTION_ANSWERS_DUPLICATE);
+ request.getSession().removeAttribute(USER_EXCEPTION_OPTIONS_COUNT_ZERO);
+ request.getSession().removeAttribute(USER_EXCEPTION_CHKBOXES_EMPTY);
+ request.getSession().removeAttribute(USER_EXCEPTION_SUBMIT_NONE);
+ request.getSession().removeAttribute(USER_EXCEPTION_PASSMARK_NOTINTEGER);
+ request.getSession().removeAttribute(USER_EXCEPTION_NUMBERFORMAT);
+ request.getSession().removeAttribute(USER_EXCEPTION_PASSMARK_EMPTY);
+ request.getSession().removeAttribute(USER_EXCEPTION_PASSMARK_GREATER100);
+ request.getSession().removeAttribute(USER_EXCEPTION_FILENAME_EMPTY);
+ request.getSession().removeAttribute(USER_EXCEPTION_WEIGHT_MUST_EQUAL100);
+ request.getSession().removeAttribute(USER_EXCEPTION_SINGLE_OPTION);
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteContentDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteContentDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteContentDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+
+public interface IVoteContentDAO {
+ public VoteContent getMcContentByUID(Long uid);
+
+ public VoteContent findMcContentById(Long mcContentId);
+
+ public VoteContent getMcContentBySession(Long mcSessionId);
+
+ public void saveMcContent(VoteContent mcContent);
+
+ public void updateMcContent(VoteContent mcContent);
+
+ public void removeMc(VoteContent mcContent);
+
+ public void removeMcById(Long mcContentId);
+
+ public void removeMcSessions(VoteContent mcContent);
+
+ public void addMcSession(Long mcContentId, VoteSession mcSession);
+
+ public List findAll(Class objClass);
+
+ public void flush();
+ }
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteOptionsContentDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteOptionsContentDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteOptionsContentDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ *
+ */
+public interface IVoteOptionsContentDAO
+{
+ public VoteOptsContent getMcOptionsContentByUID(Long uid);
+
+ public List findMcOptionsContentByQueId(Long mcQueContentId);
+
+ public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid);
+
+ public List getPersistedSelectedOptions(Long mcQueContentId);
+
+ public List getCorrectOption(Long mcQueContentId);
+
+ 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);
+}
+
+
+
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteQueContentDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteQueContentDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteQueContentDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent;
+
+
+/**
+ *
+ * @author Ozgur Demirtas
+ *
+ *
+ */
+public interface IVoteQueContentDAO
+{
+ public VoteQueContent getMcQueContentByUID(Long uid);
+
+ public VoteQueContent getToolDefaultQuestionContent(final long mcContentId);
+
+ public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid);
+
+ public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid);
+
+ public List getAllQuestionEntries(final long mcContentId);
+
+ 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 updateMcQueContent(VoteQueContent mcQueContent);
+
+ public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent);
+
+ public void removeMcQueContentByUID(Long uid);
+
+ public void removeMcQueContent(VoteQueContent mcQueContent);
+
+ public List getNextAvailableDisplayOrder(final long mcContentId);
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteSessionDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao;
+
+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.VoteSession;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ *
+ */
+public interface IVoteSessionDAO {
+ public VoteSession getMcSessionByUID(Long uid);
+
+ public VoteSession findMcSessionById(Long mcSessionId);
+
+ public void saveMcSession(VoteSession mcSession);
+
+ public void updateMcSession(VoteSession mcSession);
+
+ public void removeMcSessionByUID(Long uid);
+
+ public void removeMcSessionById(Long mcSessionId);
+
+ public void removeMcSession(VoteSession mcSession);
+
+ public VoteSession getMcSessionByUser(Long userId);
+
+ public void addMcUsers(Long mcSessionId, VoteQueUsr user);
+
+ public List getSessionsFromContent(VoteContent mcContent);
+
+ public List getSessionNamesFromContent(VoteContent mcContent);
+
+ public int countSessionComplete();
+
+ public int countSessionIncomplete();
+}
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUploadedFileDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUploadedFileDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUploadedFileDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,80 @@
+/*
+ *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
+ */
+package org.lamsfoundation.lams.tool.vote.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUploadedFile;
+
+/**
+ *
+ * @author Ozgur Demirtas
+ *
+ *
+ */
+public interface IVoteUploadedFileDAO
+{
+ public VoteUploadedFile loadUploadedFileById(long submissionId);
+
+ public void updateUploadFile(VoteUploadedFile mcUploadedFile);
+
+ public void saveUploadFile(VoteUploadedFile mcUploadedFile);
+
+ public void createUploadFile(VoteUploadedFile mcUploadedFile);
+
+ public void UpdateUploadFile(VoteUploadedFile mcUploadedFile);
+
+ public void removeUploadFile(Long submissionId);
+
+ 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();
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUserDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+
+package org.lamsfoundation.lams.tool.vote.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ */
+public interface IVoteUserDAO {
+
+ public VoteQueUsr getMcUserByUID(Long uid);
+
+ public VoteQueUsr findMcUserById(Long userId);
+
+ public VoteQueUsr getMcUserBySession(Long userId, Long sessionId);
+
+ 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();
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/IVoteUsrAttemptDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt;
+
+
+/**
+ *
+ * @author Ozgur Demirtas
+ * *
+ *
+ */
+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 List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId);
+
+ public List getAttemptsForUser(final Long queUsrId);
+
+ public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId);
+}
+
+
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,151 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.FlushMode;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteContentDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+import org.springframework.orm.hibernate3.HibernateCallback;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * @author Ozgur Demirtas
+ * Hibernate implementation for database access to VoteContent for the voting tool.
+ */
+
+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 LOAD_VOTE_BY_SESSION = "select mc from VoteContent mc left join fetch "
+ + "mc.mcSessions session where session.mcSessionId=:sessionId";
+
+ public VoteContent getMcContentByUID(Long uid)
+ {
+ return (VoteContent) this.getHibernateTemplate().get(VoteContent.class, uid);
+ }
+
+ public VoteContent findMcContentById(Long mcContentId)
+ {
+ String query = "from VoteContent as mc where mc.mcContentId = ?";
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(query)
+ .setLong(0,mcContentId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteContent mc = (VoteContent) list.get(0);
+ return mc;
+ }
+ return null;
+ }
+
+
+ public VoteContent getMcContentBySession(final Long mcSessionId)
+ {
+ return (VoteContent) getHibernateTemplate().execute(new HibernateCallback()
+ {
+
+ public Object doInHibernate(Session session) throws HibernateException
+ {
+ return session.createQuery(LOAD_VOTE_BY_SESSION)
+ .setLong("sessionId",
+ mcSessionId.longValue())
+ .uniqueResult();
+ }
+ });
+ }
+
+
+ public void saveMcContent(VoteContent mcContent)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ logger.debug("before saveOrUpdate");
+ this.getHibernateTemplate().saveOrUpdate(mcContent);
+ logger.debug("after saveOrUpdate");
+ }
+
+ public void updateMcContent(VoteContent mcContent)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().update(mcContent);
+ }
+
+
+ public void removeMcById(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ if ( mcContentId != null) {
+ List list = getSession().createQuery(FIND_VOTE_CONTENT)
+ .setLong(0,mcContentId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteContent mc = (VoteContent) list.get(0);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mc);
+ templ.flush();
+ }
+ }
+ }
+
+ public void removeMc(VoteContent mcContent)
+ {
+ this.getHibernateTemplate().delete(mcContent);
+ }
+
+
+ public void removeMcSessions(VoteContent mcContent)
+ {
+ this.getHibernateTemplate().deleteAll(mcContent.getVoteSessions());
+ }
+
+ public void addMcSession(Long mcContentId, VoteSession mcSession)
+ {
+ /*
+ VoteContent content = findMcContentById(mcContentId);
+ mcSession.setMcContent(content);
+ content.getMcSessions().add(mcSession);
+ this.getHibernateTemplate().saveOrUpdate(mcSession);
+ this.getHibernateTemplate().saveOrUpdate(content);
+ */
+ }
+
+ public List findAll(Class objClass) {
+ String query="from obj in class " + objClass.getName();
+ return this.getHibernateTemplate().find(query);
+ }
+
+ public void flush()
+ {
+ this.getHibernateTemplate().flush();
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteOptionsContentDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteOptionsContentDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteOptionsContentDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,176 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.FlushMode;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteOptionsContentDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+
+/**
+ * @author Ozgur Demirtas
+ * Hibernate implementation for database access to voteOptionsContent for the voting tool.
+ */
+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 LOAD_VOTE_CONTENT_BY_OPTION_TEXT = "from mcOptsContent in class VoteOptsContent where mcOptsContent.mcQueOptionText=:option and mcOptsContent.mcQueContentId=:mcQueContentUid";
+
+ 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)
+ {
+ return (VoteOptsContent) this.getHibernateTemplate()
+ .get(VoteOptsContent.class, uid);
+ }
+
+
+ public List findMcOptionsContentByQueId(Long mcQueContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ if ( mcQueContentId != null) {
+ List list = getSession().createQuery(FIND_VOTE_OPTIONS_CONTENT)
+ .setLong(0,mcQueContentId.longValue())
+ .list();
+ return list;
+ }
+ return null;
+ }
+
+ public List findMcOptionNamesByQueId(Long mcQueContentId)
+ {
+
+ List listOptionNames= new LinkedList();
+
+ HibernateTemplate templ = this.getHibernateTemplate();
+ if ( mcQueContentId != null) {
+ List list = getSession().createQuery(FIND_VOTE_OPTIONS_CONTENT)
+ .setLong(0,mcQueContentId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteOptsContent mcOptsContent=(VoteOptsContent)listIterator.next();
+ listOptionNames.add(mcOptsContent.getVoteQueOptionText());
+ }
+ }
+ }
+ return listOptionNames;
+ }
+
+ public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_VOTE_CONTENT_BY_OPTION_TEXT)
+ .setString("option", option)
+ .setLong("mcQueContentUid", mcQueContentUid.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteOptsContent mcq = (VoteOptsContent) list.get(0);
+ return mcq;
+ }
+ 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)
+ {
+ this.getHibernateTemplate().save(mcOptsContent);
+ }
+
+ public void updateMcOptionsContent(VoteOptsContent mcOptsContent)
+ {
+ this.getHibernateTemplate().update(mcOptsContent);
+ }
+
+
+ public void removeMcOptionsContentByUID(Long uid)
+ {
+ VoteOptsContent mco = (VoteOptsContent)getHibernateTemplate().get(VoteOptsContent.class, uid);
+ this.getHibernateTemplate().delete(mco);
+ }
+
+
+ public void removeMcOptionsContentByQueId(Long mcQueContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(FIND_VOTE_OPTIONS_CONTENT)
+ .setLong(0,mcQueContentId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteOptsContent mcOptsContent=(VoteOptsContent)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcOptsContent);
+ }
+ }
+ }
+
+
+ public void removeMcOptionsContent(VoteOptsContent mcOptsContent)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcOptsContent);
+ }
+
+ public void flush()
+ {
+ this.getHibernateTemplate().flush();
+ }
+ }
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,256 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.FlushMode;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteQueContentDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * Hibernate implementation for database access to McQueContent for the mc tool.
+ */
+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 mcQueContent in class VoteQueContent where mcQueContent.mcContentId=:mcContentId";
+
+ 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 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)
+ {
+ return (VoteQueContent) this.getHibernateTemplate()
+ .get(VoteQueContent.class, uid);
+ }
+
+
+ public VoteQueContent getToolDefaultQuestionContent(final long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID)
+ .setLong("mcContentId", mcContentId)
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteQueContent mcq = (VoteQueContent) list.get(0);
+ return mcq;
+ }
+ return null;
+ }
+
+
+ public List getAllQuestionEntries(final long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID)
+ .setLong("mcContentId", mcContentId)
+ .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)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT)
+ .setString("question", question)
+ .setLong("mcContentUid", mcContentUid.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteQueContent mcq = (VoteQueContent) list.get(0);
+ return mcq;
+ }
+ return null;
+ }
+
+
+ public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid)
+ {
+ 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())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteQueContent mcQueContent=(VoteQueContent)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcQueContent);
+ templ.flush();
+ }
+ }
+ }
+
+
+ public void resetAllQuestions(final Long mcContentUid)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID)
+ .setLong("mcContentId", mcContentUid.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteQueContent mcQueContent=(VoteQueContent)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.update(mcQueContent);
+ }
+ }
+ }
+
+
+ public void cleanAllQuestions(final Long mcContentUid)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(CLEAN_QUESTION_CONTENT_BY_CONTENT_ID)
+ .setLong("mcContentId", mcContentUid.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteQueContent mcQueContent=(VoteQueContent)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ logger.debug("deleting mcQueContent: " + mcQueContent);
+ templ.delete(mcQueContent);
+ }
+ }
+ }
+
+
+ public void cleanAllQuestionsSimple(final Long mcContentUid)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE)
+ .setLong("mcContentId", mcContentUid.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteQueContent mcQueContent=(VoteQueContent)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ logger.debug("deleting mcQueContent: " + mcQueContent);
+ templ.delete(mcQueContent);
+ }
+ }
+ }
+
+
+ public List getNextAvailableDisplayOrder(final long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_NEXT_AVAILABLE_DISPLAY_ORDER)
+ .setLong("mcContentId", mcContentId)
+ .list();
+
+ return list;
+ }
+
+
+ public void saveMcQueContent(VoteQueContent mcQueContent)
+ {
+ this.getHibernateTemplate().save(mcQueContent);
+ }
+
+ public void updateMcQueContent(VoteQueContent mcQueContent)
+ {
+ this.getHibernateTemplate().update(mcQueContent);
+ }
+
+ public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent)
+ {
+ this.getHibernateTemplate().saveOrUpdate(mcQueContent);
+ }
+
+ public void removeMcQueContentByUID(Long uid)
+ {
+ VoteQueContent mcq = (VoteQueContent)getHibernateTemplate().get(VoteQueContent.class, uid);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcq);
+ }
+
+
+ public void removeMcQueContent(VoteQueContent mcQueContent)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcQueContent);
+ }
+
+ public void flush()
+ {
+ this.getHibernateTemplate().flush();
+ }
+ }
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,200 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.List;
+
+import org.hibernate.FlushMode;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteSessionDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+import org.springframework.orm.hibernate3.HibernateCallback;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * @author ozgurd
+ * Hibernate implementation for database access to Mc sessions for the mc 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 LOAD_MCSESSION_BY_USER = "select ms from VoteSession ms left join fetch "
+ + "ms.mcQueUsers 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 COUNT_SESSION_COMPLETE = "from mcSession in class where mcSession.sessionStatus='COMPLETE'";
+
+ private static final String COUNT_SESSION_INCOMPLETE = "from mcSession in class where mcSession.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";
+
+ public VoteSession getMcSessionByUID(Long uid)
+ {
+ return (VoteSession) this.getHibernateTemplate()
+ .get(VoteSession.class, uid);
+ }
+
+ public VoteSession findMcSessionById(Long mcSessionId)
+ {
+ String query = "from VoteSession mcs where mcs.mcSessionId=?";
+
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(query)
+ .setLong(0,mcSessionId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteSession mcs = (VoteSession) list.get(0);
+ return mcs;
+ }
+ return null;
+ }
+
+ public int countSessionComplete()
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(COUNT_SESSION_COMPLETE)
+ .list();
+
+ if(list != null && list.size() > 0){
+ return list.size();
+ }
+ else return 0;
+ }
+
+ public int countSessionIncomplete()
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(COUNT_SESSION_INCOMPLETE)
+ .list();
+
+ if(list != null && list.size() > 0){
+ return list.size();
+ }
+ else return 0;
+ }
+
+
+ public void saveMcSession(VoteSession mcSession)
+ {
+ this.getHibernateTemplate().save(mcSession);
+ }
+
+
+ public void updateMcSession(VoteSession mcSession)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().update(mcSession);
+ }
+
+
+ public void removeMcSessionByUID(Long uid)
+ {
+ VoteSession ms = (VoteSession)getHibernateTemplate().get(VoteSession.class, uid);
+ this.getHibernateTemplate().delete(ms);
+ }
+
+ public void removeMcSessionById(Long mcSessionId)
+ {
+ String query = "from VoteSession as mcs where mcs.mcSessionId =";
+
+ HibernateTemplate templ = this.getHibernateTemplate();
+ if ( mcSessionId != null) {
+ List list = getSession().createQuery(FIND_VOTE_SESSION_CONTENT)
+ .setLong(0,mcSessionId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteSession mcs = (VoteSession) list.get(0);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcs);
+ templ.flush();
+ }
+ }
+
+
+ }
+
+ public void removeMcSession(VoteSession mcSession)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcSession);
+ }
+
+
+
+ public VoteSession getMcSessionByUser(final Long userId)
+ {
+ return (VoteSession) getHibernateTemplate().execute(new HibernateCallback()
+ {
+
+ public Object doInHibernate(Session session) throws HibernateException
+ {
+ return session.createQuery(LOAD_MCSESSION_BY_USER)
+ .setLong("userId",
+ userId.longValue())
+ .uniqueResult();
+ }
+ });
+ }
+
+
+ public void removeMcUsers(VoteSession mcSession)
+ {
+ this.getHibernateTemplate().deleteAll(mcSession.getVoteQueUsers());
+ }
+
+
+ public void addMcUsers(Long mcSessionId, VoteQueUsr user)
+ {
+ VoteSession session = findMcSessionById(mcSessionId);
+ user.setVoteSession(session);
+ session.getVoteQueUsers().add(user);
+ this.getHibernateTemplate().saveOrUpdate(user);
+ this.getHibernateTemplate().saveOrUpdate(session);
+
+ }
+
+
+ public List getSessionsFromContent(VoteContent mcContent)
+ {
+ return (getHibernateTemplate().findByNamedParam(GET_SESSIONS_FROM_CONTENT,
+ "mcContent",
+ mcContent));
+ }
+
+ public List getSessionNamesFromContent(VoteContent mcContent)
+ {
+ return (getHibernateTemplate().findByNamedParam(GET_SESSIONNAMES_FROM_CONTENT,
+ "mcContent",
+ mcContent));
+ }
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,363 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.FlushMode;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteUploadedFileDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUploadedFile;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+
+/**
+ * @author ozgurd
+ * Hibernate implementation for database access to McUploadedFile for the mc 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_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_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_FILES_UUID ="select mcUploadedFile.uuid from VoteUploadedFile mcUploadedFile where mcUploadedFile.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 FIND_ALL_UPLOADED_FILE_DATA = "from mcUploadedFile in class VoteUploadedFile";
+
+ private static final String IS_UUID_PERSISTED ="select mcUploadedFile.uuid from VoteUploadedFile mcUploadedFile where mcUploadedFile.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_OFFLINE_FILES_METADATA = "from mcUploadedFile in class VoteUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.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_ONLINE_FILENAME_PERSISTED ="select mcUploadedFile from VoteUploadedFile mcUploadedFile where mcUploadedFile.mcContentId = :mcContentId and mcUploadedFile.filename=:filename and mcUploadedFile.fileOnline=1";
+
+
+ public VoteUploadedFile getUploadedFileById(long submissionId)
+ {
+ return (VoteUploadedFile) this.getHibernateTemplate()
+ .load(VoteUploadedFile.class, new Long(submissionId));
+ }
+
+ /**
+ *
+ * return null if not found
+ */
+ public VoteUploadedFile loadUploadedFileById(long uid)
+ {
+ return (VoteUploadedFile) this.getHibernateTemplate().get(VoteUploadedFile.class, new Long(uid));
+ }
+
+
+
+ public void updateUploadFile(VoteUploadedFile mcUploadedFile)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().update(mcUploadedFile);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ }
+
+
+ public void saveUploadFile(VoteUploadedFile mcUploadedFile)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().save(mcUploadedFile);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ }
+
+ public void createUploadFile(VoteUploadedFile mcUploadedFile)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().save(mcUploadedFile);
+ }
+
+ public void UpdateUploadFile(VoteUploadedFile mcUploadedFile)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().update(mcUploadedFile);
+ }
+
+
+ public void removeOffLineFile(String filename, Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(IS_OFFLINE_FILENAME_PERSISTED)
+ .setString("filename", filename)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteUploadedFile mcFile=(VoteUploadedFile)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcFile);
+ templ.flush();
+ }
+ }
+ }
+
+ public void removeOnLineFile(String filename, Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(IS_ONLINE_FILENAME_PERSISTED)
+ .setString("filename", filename)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteUploadedFile mcFile=(VoteUploadedFile)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcFile);
+ templ.flush();
+ }
+ }
+ }
+
+ public boolean isOffLineFilePersisted(String filename)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(IS_OFFLINE_FILENAME_PERSISTED)
+ .setString("filename", filename)
+ .list();
+
+ if (list != null && list.size() > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ public boolean isOnLineFilePersisted(String filename)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(IS_ONLINE_FILENAME_PERSISTED)
+ .setString("filename", filename)
+ .list();
+
+ if (list != null && list.size() > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ public List getOnlineFilesMetaData(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_ONLINE_FILES_METADATA)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+
+ public List getOfflineFilesMetaData(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_OFFLINE_FILES_METADATA)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+
+ public boolean isUuidPersisted(String uuid)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(IS_UUID_PERSISTED)
+ .setString("uuid", uuid)
+ .list();
+
+ if (list != null && list.size() > 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ public void cleanUploadedFilesMetaData()
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(FIND_ALL_UPLOADED_FILE_DATA)
+ .list();
+
+ if(list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ VoteUploadedFile mcFile=(VoteUploadedFile)listIterator.next();
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcFile);
+ templ.flush();
+ }
+ }
+ }
+
+
+ public String getFileUuid(String filename)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_FILES_UUID)
+ .setString("filename", filename)
+ .list();
+
+ if (list != null && list.size() > 0){
+ Iterator listIterator=list.iterator();
+ while (listIterator.hasNext())
+ {
+ String uuid=(String)listIterator.next();
+ logger.debug("uuid :" + uuid);
+ return uuid;
+ }
+ }
+ else
+ {
+ return null;
+ }
+ return null;
+ }
+
+
+ public void removeUploadFile(Long uid)
+ {
+ if (uid != null ) {
+
+ String query = "from uploadedFile in class org.lamsfoundation.lams.tool.mc.VoteUploadedFile"
+ + " where uploadedFile.uid = ?";
+ Object obj = this.getSession().createQuery(query)
+ .setLong(0,uid.longValue())
+ .uniqueResult();
+ if ( obj != null ) {
+ this.getHibernateTemplate().delete(obj);
+ }
+ }
+ }
+
+ public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline)
+ {
+ List listFilenames=null;
+
+ if (fileOnline)
+ {
+ listFilenames=(getHibernateTemplate().findByNamedParam(GET_ONLINE_FILENAMES_FOR_CONTENT,
+ "mcContentId",
+ mcContentId));
+ }
+ else
+ {
+ listFilenames=(getHibernateTemplate().findByNamedParam(GET_OFFLINE_FILENAMES_FOR_CONTENT,
+ "mcContentId",
+ mcContentId));
+ }
+ return listFilenames;
+ }
+
+
+ public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_OFFLINE_FILES_UUID)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+
+ return list;
+ }
+
+ public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_ONLINE_FILES_UUID)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+ public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_OFFLINE_FILES_UUIDPLUSFILENAME)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+
+ public List retrieveMcUploadedOfflineFilesName(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_OFFLINE_FILES_NAME)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+
+ public List retrieveMcUploadedOnlineFilesName(Long mcContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(GET_ONLINE_FILES_NAME)
+ .setLong("mcContentId", mcContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+
+ public void deleteUploadFile(VoteUploadedFile mcUploadedFile)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcUploadedFile);
+ }
+
+ public void flush()
+ {
+ this.getHibernateTemplate().flush();
+ }
+}
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,150 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.List;
+
+import org.hibernate.FlushMode;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteUserDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * @author Ozgur Demirtas
+ * Hibernate implementation for database access to Voting users (learners) for the voting tool.
+ */
+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 COUNT_USERS_IN_SESSION = "select mu.queUsrId from VoteQueUsr mu where mu.mcSession= :mcSession";
+
+ private static final String COUNT_USERS = "select mu.queUsrId from VoteQueUsr";
+
+ private static final String LOAD_USER_FOR_SESSION = "from mcQueUsr in class VoteQueUsr where mcQueUsr.mcSessionId= :mcSessionId";
+
+
+ public VoteQueUsr getMcUserByUID(Long uid)
+ {
+ return (VoteQueUsr) this.getHibernateTemplate()
+ .get(VoteQueUsr.class, uid);
+ }
+
+
+ public VoteQueUsr findMcUserById(Long userId)
+ {
+ String query = "from VoteQueUsr user where user.queUsrId=?";
+
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(query)
+ .setLong(0,userId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteQueUsr mcu = (VoteQueUsr) list.get(0);
+ return mcu;
+ }
+ return null;
+ }
+
+
+ public List getMcUserBySessionOnly(final VoteSession mcSession)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_USER_FOR_SESSION)
+ .setLong("mcSessionId", mcSession.getUid().longValue())
+ .list();
+ return list;
+ }
+
+ public VoteQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionId)
+ {
+
+ String strGetUser = "from mcQueUsr in class VoteQueUsr where mcQueUsr.queUsrId=:queUsrId and mcQueUsr.mcSessionId=:mcSessionId";
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(strGetUser)
+ .setLong("queUsrId", queUsrId.longValue())
+ .setLong("mcSessionId", mcSessionId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteQueUsr usr = (VoteQueUsr) list.get(0);
+ return usr;
+ }
+ return null;
+ }
+
+
+ public void saveMcUser(VoteQueUsr mcUser)
+ {
+ this.getHibernateTemplate().save(mcUser);
+ }
+
+
+ public void updateMcUser(VoteQueUsr mcUser)
+ {
+ this.getHibernateTemplate().update(mcUser);
+ }
+
+
+ public void removeMcUserById(Long userId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ if ( userId != null) {
+ List list = getSession().createQuery(FIND_VOTE_USR_CONTENT)
+ .setLong(0,userId.longValue())
+ .list();
+
+ if(list != null && list.size() > 0){
+ VoteQueUsr mcu = (VoteQueUsr) list.get(0);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ templ.delete(mcu);
+ templ.flush();
+ }
+ }
+
+ }
+
+
+ public void removeMcUser(VoteQueUsr mcUser)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcUser);
+ }
+
+
+ public int getNumberOfUsers(VoteSession mcSession)
+ {
+ return (getHibernateTemplate().findByNamedParam(COUNT_USERS_IN_SESSION,
+ "mcSession",
+ mcSession)).size();
+ }
+
+
+ public int getTotalNumberOfUsers() {
+ String query="from obj in class VoteQueUsr";
+ return this.getHibernateTemplate().find(query).size();
+ }
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,116 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.dao.hibernate;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.FlushMode;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteUsrAttemptDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * @author Ozgur Demirtas
+ * Hibernate implementation for database access to VoteUsrAttemptDAO for the voting tool.
+ */
+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_ATTEMPT_ORDER_BY_USER_ID = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.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_USER = "from mcUsrAttempt in class VoteUsrAttempt where mcUsrAttempt.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";
+
+
+ public VoteUsrAttempt getMcUserAttemptByUID(Long uid)
+ {
+ return (VoteUsrAttempt) this.getHibernateTemplate()
+ .get(VoteUsrAttempt.class, uid);
+ }
+
+ public void saveMcUsrAttempt(VoteUsrAttempt mcUsrAttempt)
+ {
+ this.getHibernateTemplate().save(mcUsrAttempt);
+ }
+
+
+ public List getAttemptsForUser(final Long queUsrId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER)
+ .setLong("queUsrId", queUsrId.longValue())
+ .list();
+ return list;
+ }
+
+ public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT)
+ .setLong("queUsrId", queUsrId.longValue())
+ .setLong("mcQueContentId", mcQueContentId.longValue())
+ .list();
+
+ return list;
+ }
+
+
+ public List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId)
+ {
+ HibernateTemplate templ = this.getHibernateTemplate();
+ List list = getSession().createQuery(LOAD_ATTEMPT_FOR_QUE_CONTENT)
+ .setLong("queUsrId", queUsrId.longValue())
+ .setLong("mcQueContentId", mcQueContentId.longValue())
+ .list();
+ return list;
+ }
+
+
+
+ public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt)
+ {
+ this.getHibernateTemplate().update(mcUsrAttempt);
+ }
+
+ public void removeMcUsrAttemptByUID(Long uid)
+ {
+ VoteUsrAttempt mca = (VoteUsrAttempt)getHibernateTemplate().get(VoteUsrAttempt.class, uid);
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mca);
+ }
+
+
+ public void removeMcUsrAttempt(VoteUsrAttempt mcUsrAttempt)
+ {
+ this.getSession().setFlushMode(FlushMode.AUTO);
+ this.getHibernateTemplate().delete(mcUsrAttempt);
+ }
+
+}
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,507 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.contentrepository.ItemNotFoundException;
+import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
+import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
+
+/**
+ * Persistent object/bean that defines the content for the Voting tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_content
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteContent implements Serializable {
+ static Logger logger = Logger.getLogger(VoteContent.class.getName());
+
+ /** identifier field */
+ private Long uid;
+
+ /** persistent field */
+ private Long voteContentId;
+
+ /** persistent field, used for export portfolio */
+ private String content;
+
+ /** nullable persistent field */
+ private String title;
+
+ /** nullable persistent field */
+ private String instructions;
+
+ /** nullable persistent field */
+ private boolean defineLater;
+
+ /** nullable persistent field */
+ private boolean runOffline;
+
+ /** nullable persistent field */
+ private Date creationDate;
+
+ /** nullable persistent field */
+ private Date updateDate;
+
+ /** nullable persistent field */
+ private boolean questionsSequenced;
+
+ /** nullable persistent field */
+ private boolean usernameVisible;
+
+ /** nullable persistent field */
+ private String reportTitle;
+
+ /** nullable persistent field */
+ private String monitoringReportTitle;
+
+ /** nullable persistent field */
+ private long createdBy;
+
+ /** nullable persistent field */
+ private boolean lockOnFinish;
+
+ /** nullable persistent field */
+ private boolean contentInUse;
+
+ /** nullable persistent field */
+ private String offlineInstructions;
+
+ /** nullable persistent field */
+ private String onlineInstructions;
+
+ /** nullable persistent field */
+ private String endLearningMessage;
+
+ /** nullable persistent field */
+ private boolean retries;
+
+ private boolean showReport;
+
+
+ /** persistent field */
+ private Set voteQueContents;
+
+ /** persistent field */
+ private Set voteSessions;
+
+ /** persistent field */
+ private Set voteAttachments;
+
+ /** full constructor */
+ public VoteContent(Long voteContentId, String content, String title, String instructions, boolean defineLater, boolean runOffline,
+ Date creationDate, Date updateDate, boolean questionsSequenced, boolean usernameVisible, String reportTitle,
+ String monitoringReportTitle, long createdBy, boolean lockOnFinish, boolean contentInUse, String offlineInstructions,
+ String onlineInstructions, String endLearningMessage, boolean showReport, boolean retries, Set voteQueContents, Set voteSessions,
+ Set voteAttachments) {
+ this.voteContentId = voteContentId;
+ this.content=content;
+ this.title = title;
+ this.instructions = instructions;
+ this.defineLater = defineLater;
+ this.runOffline = runOffline;
+ this.creationDate = creationDate;
+ this.updateDate = updateDate;
+ this.questionsSequenced = questionsSequenced;
+ this.usernameVisible = usernameVisible;
+ this.reportTitle = reportTitle;
+ this.monitoringReportTitle = monitoringReportTitle;
+ this.createdBy = createdBy;
+ this.lockOnFinish = lockOnFinish;
+ this.contentInUse = contentInUse;
+ this.offlineInstructions = offlineInstructions;
+ this.onlineInstructions = onlineInstructions;
+ this.endLearningMessage = endLearningMessage;
+ this.retries=retries;
+ this.showReport = showReport;
+ this.voteQueContents = voteQueContents;
+ this.voteSessions = voteSessions;
+ this.voteAttachments = voteAttachments;
+ }
+
+ /** default constructor */
+ public VoteContent() {
+ }
+
+ /** minimal constructor */
+ public VoteContent(Long voteContentId, Set voteQueContents, Set voteSessions) {
+ this.voteContentId = voteContentId;
+ this.voteQueContents = voteQueContents;
+ this.voteSessions = voteSessions;
+ }
+
+
+ /**
+ * gets called as part of the copyToolContent
+ *
+ * Copy Construtor to create a new mc content instance. Note that we
+ * don't copy the mc session data here because the mc session
+ * will be created after we copied tool content.
+ * @param mc the original mc content.
+ * @param newContentId the new mc content id.
+ * @return the new mc content object.
+ */
+ public static VoteContent newInstance(IToolContentHandler toolContentHandler, VoteContent mc,
+ Long newContentId)
+ throws ItemNotFoundException, RepositoryCheckedException
+ {
+ VoteContent newContent = new VoteContent(
+ newContentId,
+ mc.getContent(),
+ mc.getTitle(),
+ mc.getInstructions(),
+ mc.isDefineLater(),
+ mc.isRunOffline(),
+ mc.getCreationDate(),
+ mc.getUpdateDate(),
+ mc.isQuestionsSequenced(),
+ mc.isUsernameVisible(),
+ mc.getReportTitle(),
+ mc.getMonitoringReportTitle(),
+ mc.getCreatedBy(),
+ mc.isLockOnFinish(),
+ mc.isContentInUse(),
+ mc.getOfflineInstructions(),
+ mc.getOnlineInstructions(),
+ mc.getEndLearningMessage(),
+ mc.isShowReport(),
+ mc.isRetries(),
+ new TreeSet(),
+ new TreeSet(),
+ new TreeSet()
+ );
+ newContent.setVoteQueContents(mc.deepCopyMcQueContent(newContent));
+ newContent.setVoteAttachments(mc.deepCopyMcAttachments(toolContentHandler, newContent));
+
+ return newContent;
+ }
+
+ /**
+ * gets called as part of the copyToolContent
+ *
+ * @param newQaContent
+ * @return Set
+ */
+ public Set deepCopyMcQueContent(VoteContent newMcContent)
+ {
+
+ Set newMcQueContent = new TreeSet();
+ for (Iterator i = this.getVoteQueContents().iterator(); i.hasNext();)
+ {
+ VoteQueContent queContent = (VoteQueContent) i.next();
+ if (queContent.getMcContent() != null)
+ {
+ VoteQueContent mcQueContent=VoteQueContent.newInstance(queContent,
+ newMcContent);
+ newMcQueContent.add(mcQueContent);
+ }
+ }
+ return newMcQueContent;
+ }
+
+ /**
+ * gets called as part of the copyToolContent
+ *
+ * @param newMcContent
+ * @return Set
+ */
+ public Set deepCopyMcAttachments(IToolContentHandler toolContentHandler,VoteContent newMcContent)
+ throws ItemNotFoundException, RepositoryCheckedException
+ {
+ Set newMcQueContent = new TreeSet();
+ for (Iterator i = this.getVoteAttachments().iterator(); i.hasNext();)
+ {
+ VoteUploadedFile mcUploadedFile = (VoteUploadedFile) i.next();
+ if (mcUploadedFile.getVoteContent() != null)
+ {
+ VoteUploadedFile newMcUploadedFile=VoteUploadedFile.newInstance(toolContentHandler, mcUploadedFile,
+ newMcContent);
+ newMcQueContent.add(newMcUploadedFile);
+ }
+ }
+ return newMcQueContent;
+ }
+
+
+ public Long getUid() {
+ return this.uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+
+ public String getTitle() {
+ return this.title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getInstructions() {
+ return this.instructions;
+ }
+
+ public void setInstructions(String instructions) {
+ this.instructions = instructions;
+ }
+
+ public boolean isDefineLater() {
+ return this.defineLater;
+ }
+
+ public void setDefineLater(boolean defineLater) {
+ this.defineLater = defineLater;
+ }
+
+ public boolean isRunOffline() {
+ return this.runOffline;
+ }
+
+ public void setRunOffline(boolean runOffline) {
+ this.runOffline = runOffline;
+ }
+
+ public Date getUpdateDate() {
+ return this.updateDate;
+ }
+
+ public void setUpdateDate(Date updateDate) {
+ this.updateDate = updateDate;
+ }
+
+ public boolean isQuestionsSequenced() {
+ return this.questionsSequenced;
+ }
+
+ public void setQuestionsSequenced(boolean questionsSequenced) {
+ this.questionsSequenced = questionsSequenced;
+ }
+
+ public boolean isUsernameVisible() {
+ return this.usernameVisible;
+ }
+
+ public void setUsernameVisible(boolean usernameVisible) {
+ this.usernameVisible = usernameVisible;
+ }
+
+ public String getReportTitle() {
+ return this.reportTitle;
+ }
+
+ public void setReportTitle(String reportTitle) {
+ this.reportTitle = reportTitle;
+ }
+
+ public String getMonitoringReportTitle() {
+ return this.monitoringReportTitle;
+ }
+
+ public void setMonitoringReportTitle(String monitoringReportTitle) {
+ this.monitoringReportTitle = monitoringReportTitle;
+ }
+
+ public long getCreatedBy() {
+ return this.createdBy;
+ }
+
+ public void setCreatedBy(long createdBy) {
+ this.createdBy = createdBy;
+ }
+
+
+ public boolean isContentInUse() {
+ return this.contentInUse;
+ }
+
+ public void setContentInUse(boolean contentInUse) {
+ this.contentInUse = contentInUse;
+ }
+
+ public String getOfflineInstructions() {
+ return this.offlineInstructions;
+ }
+
+ public void setOfflineInstructions(String offlineInstructions) {
+ this.offlineInstructions = offlineInstructions;
+ }
+
+ public String getOnlineInstructions() {
+ return this.onlineInstructions;
+ }
+
+ public void setOnlineInstructions(String onlineInstructions) {
+ this.onlineInstructions = onlineInstructions;
+ }
+
+ public String getEndLearningMessage() {
+ return this.endLearningMessage;
+ }
+
+ public void setEndLearningMessage(String endLearningMessage) {
+ this.endLearningMessage = endLearningMessage;
+ }
+
+
+ /**
+ * @return Returns the voteQueContents.
+ */
+ public Set getVoteQueContents() {
+ if (this.voteQueContents == null)
+ setVoteQueContents(new HashSet());
+ return this.voteQueContents;
+
+ }
+ /**
+ * @param voteQueContents The voteQueContents to set.
+ */
+ public void setVoteQueContents(Set voteQueContents) {
+ this.voteQueContents = voteQueContents;
+ }
+
+
+ /**
+ * @return Returns the voteSessions.
+ */
+ public Set getVoteSessions() {
+ if (this.voteSessions == null)
+ setVoteSessions(new HashSet());
+ return this.voteSessions;
+ }
+
+ /**
+ * @param voteSessions The voteSessions to set.
+ */
+ public void setVoteSessions(Set voteSessions) {
+ this.voteSessions = voteSessions;
+ }
+
+
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uid", getUid())
+ .toString();
+ }
+
+ /**
+ * @return Returns the retries.
+ */
+ public boolean isRetries() {
+ return retries;
+ }
+ /**
+ * @param retries The retries to set.
+ */
+ public void setRetries(boolean retries) {
+ this.retries = retries;
+ }
+
+ /**
+ * @return Returns the showReport.
+ */
+ public boolean isShowReport() {
+ return showReport;
+ }
+ /**
+ * @param showReport The showReport to set.
+ */
+ public void setShowReport(boolean showReport) {
+ this.showReport = showReport;
+ }
+
+ /**
+ * @return Returns the voteAttachments.
+ */
+ public Set getVoteAttachments() {
+ return voteAttachments;
+ }
+ /**
+ * @param voteAttachments The voteAttachments to set.
+ */
+ public void setVoteAttachments(Set voteAttachments) {
+ this.voteAttachments = voteAttachments;
+ }
+
+ /**
+ * @return Returns the creationDate.
+ */
+ public Date getCreationDate() {
+ return creationDate;
+ }
+ /**
+ * @param creationDate The creationDate to set.
+ */
+ public void setCreationDate(Date creationDate) {
+ this.creationDate = creationDate;
+ }
+ /**
+ * @return Returns the content.
+ */
+ public String getContent() {
+ return content;
+ }
+ /**
+ * @param content The content to set.
+ */
+ public void setContent(String content) {
+ this.content = content;
+ }
+ /**
+ * @return Returns the lockOnFinish.
+ */
+ public boolean isLockOnFinish() {
+ return lockOnFinish;
+ }
+ /**
+ * @param lockOnFinish The lockOnFinish to set.
+ */
+ public void setLockOnFinish(boolean lockOnFinish) {
+ this.lockOnFinish = lockOnFinish;
+ }
+ /**
+ * @return Returns the voteContentId.
+ */
+ public Long getVoteContentId() {
+ return voteContentId;
+ }
+ /**
+ * @param voteContentId The voteContentId to set.
+ */
+ public void setVoteContentId(Long voteContentId) {
+ this.voteContentId = voteContentId;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteOptsContent.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteOptsContent.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteOptsContent.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,184 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+
+
+/**
+ * Persistent object/bean that defines the content for the voting tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_options_content
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteOptsContent implements Serializable, Comparable {
+ static Logger logger = Logger.getLogger(VoteOptsContent.class.getName());
+
+ /** identifier field */
+ private Long uid;
+
+ private Long voteQueOptionId;
+
+
+ /** nullable persistent field */
+ private String voteQueOptionText;
+
+ /** non persistent field */
+ private Long voteQueContentId;
+
+ /** persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent;
+
+ /** persistent field */
+ private Set voteUsrAttempts;
+
+
+ public VoteOptsContent(Long voteQueOptionId, String voteQueOptionText,
+ org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, Set voteUsrAttempts) {
+ this.voteQueOptionId=voteQueOptionId;
+ this.voteQueOptionText = voteQueOptionText;
+ this.voteQueContent = voteQueContent;
+ this.voteUsrAttempts=voteUsrAttempts;
+ }
+
+
+ public VoteOptsContent(String voteQueOptionText, org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent, Set voteUsrAttempts) {
+ this.voteQueOptionText = voteQueOptionText;
+ this.voteQueContent = voteQueContent;
+ this.voteUsrAttempts=voteUsrAttempts;
+ }
+
+ public static VoteOptsContent newInstance(VoteOptsContent voteOptsContent,
+ VoteQueContent newVoteQueContent)
+
+ {
+ VoteOptsContent newVoteOptsContent = new VoteOptsContent(
+ voteOptsContent.getVoteQueOptionText(),
+ newVoteQueContent,
+ new TreeSet());
+ return newVoteOptsContent;
+ }
+
+
+ /** default constructor */
+ public VoteOptsContent() {
+ }
+
+ public Long getUid() {
+ return this.uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uid", getUid())
+ .toString();
+ }
+
+ /**
+ * @return Returns the mcUsrAttempts.
+ */
+ public Set getVoteUsrAttempts() {
+ if (this.voteUsrAttempts == null)
+ setVoteUsrAttempts(new HashSet());
+ return this.voteUsrAttempts;
+ }
+ /**
+ * @param mcUsrAttempts The mcUsrAttempts to set.
+ */
+ public void setVoteUsrAttempts(Set voteUsrAttempts) {
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+
+
+ public int compareTo(Object o)
+ {
+ VoteOptsContent optContent = (VoteOptsContent) o;
+ //if the object does not exist yet, then just return any one of 0, -1, 1. Should not make a difference.
+ if (voteQueOptionId == null)
+ return 1;
+ else
+ return (int) (voteQueOptionId.longValue() - optContent.voteQueOptionId.longValue());
+ }
+ /**
+ * @return Returns the voteQueContentId.
+ */
+ public Long getVoteQueContentId() {
+ return voteQueContentId;
+ }
+ /**
+ * @param voteQueContentId The voteQueContentId to set.
+ */
+ public void setVoteQueContentId(Long voteQueContentId) {
+ this.voteQueContentId = voteQueContentId;
+ }
+ /**
+ * @return Returns the voteQueOptionText.
+ */
+ public String getVoteQueOptionText() {
+ return voteQueOptionText;
+ }
+ /**
+ * @param voteQueOptionText The voteQueOptionText to set.
+ */
+ public void setVoteQueOptionText(String voteQueOptionText) {
+ this.voteQueOptionText = voteQueOptionText;
+ }
+ /**
+ * @return Returns the voteQueOptionId.
+ */
+ public Long getVoteQueOptionId() {
+ return voteQueOptionId;
+ }
+ /**
+ * @param voteQueOptionId The voteQueOptionId to set.
+ */
+ public void setVoteQueOptionId(Long voteQueOptionId) {
+ this.voteQueOptionId = voteQueOptionId;
+ }
+ /**
+ * @return Returns the voteQueContent.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent getVoteQueContent() {
+ return voteQueContent;
+ }
+ /**
+ * @param voteQueContent The voteQueContent to set.
+ */
+ public void setVoteQueContent(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent) {
+ this.voteQueContent = voteQueContent;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,273 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+
+
+/**
+ * Persistent object/bean that defines the question content for the Voting tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_que_content
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteQueContent implements Serializable, Comparable {
+ static Logger logger = Logger.getLogger(VoteQueContent.class.getName());
+
+ /** identifier field */
+ private Long uid;
+
+ /** persistent field */
+ private Long voteQueContentId;
+
+ /** nullable persistent field */
+ private String question;
+
+
+ /** non persistent field */
+ private Long voteContentId;
+
+ /** persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent;
+
+ /** persistent field */
+ private Set voteUsrAttempts;
+
+ /** persistent field */
+ private Set voteOptionsContents;
+
+ /** full constructor */
+ public VoteQueContent(Long voteQueContentId, String question, VoteContent voteContent, Set voteUsrAttempts, Set voteOptionsContents) {
+ this.voteQueContentId = voteQueContentId;
+ this.question = question;
+ this.voteContent=voteContent;
+ this.voteUsrAttempts = voteUsrAttempts;
+ this.voteOptionsContents = voteOptionsContents;
+ }
+
+ public VoteQueContent(String question, VoteContent voteContent, Set voteUsrAttempts, Set voteOptionsContents) {
+ this.question = question;
+ this.voteContent=voteContent;
+ this.voteUsrAttempts = voteUsrAttempts;
+ this.voteOptionsContents = voteOptionsContents;
+ }
+
+ public VoteQueContent(Long voteQueContentId, String question, Set voteUsrAttempts, Set voteOptionsContents) {
+ this.voteQueContentId = voteQueContentId;
+ this.question = question;
+ this.voteUsrAttempts = voteUsrAttempts;
+ this.voteOptionsContents = voteOptionsContents;
+ }
+
+ public VoteQueContent(String question, Set voteUsrAttempts, Set voteOptionsContents) {
+ this.question = question;
+ this.voteUsrAttempts = voteUsrAttempts;
+ this.voteOptionsContents = voteOptionsContents;
+ }
+
+
+
+ /** default constructor */
+ public VoteQueContent() {
+ }
+
+ /** minimal constructor */
+ public VoteQueContent(Long voteQueContentId, org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent, Set voteUsrAttempts, Set voteOptionsContents) {
+ this.voteQueContentId = voteQueContentId;
+ this.voteContent = voteContent;
+ this.voteUsrAttempts = voteUsrAttempts;
+ this.voteOptionsContents = voteOptionsContents;
+ }
+
+
+ /**
+ * gets called by copyToolContent
+ *
+ * Copy constructor
+ * @param queContent the original qa question content
+ * @return the new qa question content object
+ */
+ public static VoteQueContent newInstance(VoteQueContent queContent,
+ VoteContent newMcContent)
+
+ {
+ VoteQueContent newQueContent = new VoteQueContent(queContent.getQuestion(),
+ newMcContent,
+ new TreeSet(),
+ new TreeSet());
+
+ newQueContent.setVoteOptionsContents(queContent.deepCopyMcOptionsContent(newQueContent));
+ return newQueContent;
+ }
+
+
+ public Set deepCopyMcOptionsContent(VoteQueContent newQueContent)
+ {
+ Set newMcOptionsContent = new TreeSet();
+ for (Iterator i = this.getVoteOptionsContents().iterator(); i.hasNext();)
+ {
+ VoteOptsContent mcOptsContent = (VoteOptsContent) i.next();
+ VoteOptsContent mcNewOptsContent= VoteOptsContent.newInstance(mcOptsContent,newQueContent);
+
+ if (mcNewOptsContent.getVoteQueContent() != null)
+ {
+ newMcOptionsContent.add(mcNewOptsContent);
+ }
+ }
+ return newMcOptionsContent;
+ }
+
+
+ public Long getUid() {
+ return this.uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ public String getQuestion() {
+ return this.question;
+ }
+
+ public void setQuestion(String question) {
+ this.question = question;
+ }
+
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteContent getMcContent() {
+ return this.voteContent;
+ }
+
+ public void setMcContent(org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent) {
+ this.voteContent = voteContent;
+ }
+
+ public Set getVoteUsrAttempts() {
+ if (this.voteUsrAttempts == null)
+ setVoteUsrAttempts(new HashSet());
+ return this.voteUsrAttempts;
+ }
+
+
+ public void setMcUsrAttempts(Set voteUsrAttempts) {
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+
+
+ public Set getVoteOptionsContents() {
+ if (this.voteOptionsContents == null)
+ setVoteOptionsContents(new HashSet());
+ return this.voteOptionsContents;
+ }
+
+ public void setMcOptionsContents(Set mcOptionsContents) {
+ this.voteOptionsContents = voteOptionsContents;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uid", getUid())
+ .toString();
+ }
+
+
+ public int compareTo(Object o)
+ {
+ VoteQueContent queContent = (VoteQueContent) o;
+ //if the object does not exist yet, then just return any one of 0, -1, 1. Should not make a difference.
+ if (voteQueContentId == null)
+ return 1;
+ else
+ return (int) (voteQueContentId.longValue() - queContent.voteQueContentId.longValue());
+ }
+ /**
+ * @return Returns the voteQueContentId.
+ */
+ public Long getVoteQueContentId() {
+ return voteQueContentId;
+ }
+ /**
+ * @param voteQueContentId The voteQueContentId to set.
+ */
+ public void setVoteQueContentId(Long voteQueContentId) {
+ this.voteQueContentId = voteQueContentId;
+ }
+ /**
+ * @return Returns the voteContentId.
+ */
+ public Long getVoteContentId() {
+ return voteContentId;
+ }
+ /**
+ * @param voteContentId The voteContentId to set.
+ */
+ public void setVoteContentId(Long voteContentId) {
+ this.voteContentId = voteContentId;
+ }
+ /**
+ * @return Returns the logger.
+ */
+ public static Logger getLogger() {
+ return logger;
+ }
+ /**
+ * @param logger The logger to set.
+ */
+ public static void setLogger(Logger logger) {
+ VoteQueContent.logger = logger;
+ }
+ /**
+ * @return Returns the voteContent.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteContent getVoteContent() {
+ return voteContent;
+ }
+ /**
+ * @param voteContent The voteContent to set.
+ */
+ public void setVoteContent(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent) {
+ this.voteContent = voteContent;
+ }
+ /**
+ * @param voteUsrAttempts The voteUsrAttempts to set.
+ */
+ public void setVoteUsrAttempts(Set voteUsrAttempts) {
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+ /**
+ * @param voteOptionsContents The voteOptionsContents to set.
+ */
+ public void setVoteOptionsContents(Set voteOptionsContents) {
+ this.voteOptionsContents = voteOptionsContents;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueUsr.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,160 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * Persistent object/bean that defines the user for the Voting tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_que_usr
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteQueUsr implements Serializable {
+
+ /** identifier field */
+ private Long uid;
+
+ /** persistent field */
+ private Long queUsrId;
+
+ /** nullable persistent field */
+ private String username;
+
+ /** nullable persistent field */
+ private String fullname;
+
+ private Long voteSessionId;
+
+ /** nullable persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteSession voteSession;
+
+ /** persistent field */
+ private Set voteUsrAttempts;
+
+ /** full constructor */
+ public VoteQueUsr(Long queUsrId, String username, String fullname, org.lamsfoundation.lams.tool.vote.pojos.VoteSession voteSession, Set voteUsrAttempts) {
+ this.queUsrId = queUsrId;
+ this.username = username;
+ this.fullname = fullname;
+ this.voteSession = voteSession;
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+
+ /** default constructor */
+ public VoteQueUsr() {
+ }
+
+ /** minimal constructor */
+ public VoteQueUsr(Long queUsrId, Set voteUsrAttempts) {
+ this.queUsrId = queUsrId;
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+
+ public Long getUid() {
+ return this.uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ public Long getQueUsrId() {
+ return this.queUsrId;
+ }
+
+ public void setQueUsrId(Long queUsrId) {
+ this.queUsrId = queUsrId;
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getFullname() {
+ return this.fullname;
+ }
+
+ public void setFullname(String fullname) {
+ this.fullname = fullname;
+ }
+
+ public Set getVoteUsrAttempts() {
+ if (this.voteUsrAttempts == null)
+ setVoteUsrAttempts(new HashSet());
+ return this.voteUsrAttempts;
+ }
+
+
+ public void setMcUsrAttempts(Set voteUsrAttempts) {
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uid", getUid())
+ .toString();
+ }
+ /**
+ * @return Returns the voteSessionId.
+ */
+ public Long getVoteSessionId() {
+ return voteSessionId;
+ }
+ /**
+ * @param voteSessionId The voteSessionId to set.
+ */
+ public void setVoteSessionId(Long voteSessionId) {
+ this.voteSessionId = voteSessionId;
+ }
+ /**
+ * @return Returns the voteSession.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteSession getVoteSession() {
+ return voteSession;
+ }
+ /**
+ * @param voteSession The voteSession to set.
+ */
+ public void setVoteSession(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteSession voteSession) {
+ this.voteSession = voteSession;
+ }
+ /**
+ * @param voteUsrAttempts The voteUsrAttempts to set.
+ */
+ public void setVoteUsrAttempts(Set voteUsrAttempts) {
+ this.voteUsrAttempts = voteUsrAttempts;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteSession.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteSession.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteSession.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,222 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * Persistent object/bean that defines the content for the Voting tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_session
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteSession implements Serializable {
+
+ public final static String INCOMPLETE = "INCOMPLETE";
+
+ public static final String COMPLETED = "COMPLETED";
+
+ /** identifier field */
+ private Long uid;
+
+ /** persistent field */
+ private Long voteSessionId;
+
+ /** nullable persistent field */
+ private Date sessionStartDate;
+
+ /** nullable persistent field */
+ private Date sessionEndDate;
+
+ /** nullable persistent field */
+ private String sessionStatus;
+
+ private String session_name;
+
+ /** nullable persistent field */
+ private Long voteContentId;
+
+ /** nullable persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent;
+
+ /** persistent field */
+ private Set voteQueUsers;
+
+ /** full constructor */
+ public VoteSession(Long voteSessionId, Date sessionStartDate, Date sessionEndDate, String sessionStatus, org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent, Set voteQueUsers) {
+ this.voteSessionId = voteSessionId;
+ this.sessionStartDate = sessionStartDate;
+ this.sessionEndDate = sessionEndDate;
+ this.sessionStatus = sessionStatus;
+ this.voteContent = voteContent;
+ this.voteQueUsers = voteQueUsers;
+ }
+
+ public VoteSession(Long voteSessionId, Date sessionStartDate, String sessionStatus, String session_name, org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent, Set voteQueUsers) {
+ this.voteSessionId = voteSessionId;
+ this.sessionStartDate = sessionStartDate;
+ this.sessionStatus = sessionStatus;
+ this.session_name = session_name;
+ this.voteContent = voteContent;
+ this.voteQueUsers = voteQueUsers;
+ }
+
+ public VoteSession(Long voteSessionId, Date sessionStartDate, String sessionStatus, org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent, Set voteQueUsers) {
+ this.voteSessionId = voteSessionId;
+ this.sessionStartDate = sessionStartDate;
+ this.sessionStatus = sessionStatus;
+ this.voteContent = voteContent;
+ this.voteQueUsers = voteQueUsers;
+ }
+
+ /** default constructor */
+ public VoteSession() {
+ }
+
+ /** minimal constructor */
+ public VoteSession(Long voteSessionId, Set voteQueUsers) {
+ this.voteSessionId = voteSessionId;
+ this.voteQueUsers = voteQueUsers;
+ }
+
+ public Long getUid() {
+ return this.uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uid", getUid())
+ .toString();
+ }
+
+ /**
+ * @return Returns the sessionEndDate.
+ */
+ public Date getSessionEndDate() {
+ return sessionEndDate;
+ }
+ /**
+ * @param sessionEndDate The sessionEndDate to set.
+ */
+ public void setSessionEndDate(Date sessionEndDate) {
+ this.sessionEndDate = sessionEndDate;
+ }
+ /**
+ * @return Returns the sessionStartDate.
+ */
+ public Date getSessionStartDate() {
+ return sessionStartDate;
+ }
+ /**
+ * @param sessionStartDate The sessionStartDate to set.
+ */
+ public void setSessionStartDate(Date sessionStartDate) {
+ this.sessionStartDate = sessionStartDate;
+ }
+ /**
+ * @return Returns the sessionStatus.
+ */
+ public String getSessionStatus() {
+ return sessionStatus;
+ }
+ /**
+ * @param sessionStatus The sessionStatus to set.
+ */
+ public void setSessionStatus(String sessionStatus) {
+ this.sessionStatus = sessionStatus;
+ }
+
+ /**
+ * @return Returns the session_name.
+ */
+ public String getSession_name() {
+ return session_name;
+ }
+ /**
+ * @param session_name The session_name to set.
+ */
+ public void setSession_name(String session_name) {
+ this.session_name = session_name;
+ }
+ /**
+ * @return Returns the voteSessionId.
+ */
+ public Long getVoteSessionId() {
+ return voteSessionId;
+ }
+ /**
+ * @param voteSessionId The voteSessionId to set.
+ */
+ public void setVoteSessionId(Long voteSessionId) {
+ this.voteSessionId = voteSessionId;
+ }
+ /**
+ * @return Returns the voteContentId.
+ */
+ public Long getVoteContentId() {
+ return voteContentId;
+ }
+ /**
+ * @param voteContentId The voteContentId to set.
+ */
+ public void setVoteContentId(Long voteContentId) {
+ this.voteContentId = voteContentId;
+ }
+ /**
+ * @return Returns the voteContent.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteContent getVoteContent() {
+ return voteContent;
+ }
+ /**
+ * @param voteContent The voteContent to set.
+ */
+ public void setVoteContent(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteContent voteContent) {
+ this.voteContent = voteContent;
+ }
+ /**
+ * @return Returns the voteQueUsers.
+ */
+ public Set getVoteQueUsers() {
+ return voteQueUsers;
+ }
+ /**
+ * @param voteQueUsers The voteQueUsers to set.
+ */
+ public void setVoteQueUsers(Set voteQueUsers) {
+ this.voteQueUsers = voteQueUsers;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,228 @@
+/*
+ *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
+ */
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.contentrepository.ItemNotFoundException;
+import org.lamsfoundation.lams.contentrepository.NodeKey;
+import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
+import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
+
+/**
+ * Persistent object/bean that defines the uploaded file for the MCQ tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_uploadedfile
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteUploadedFile implements Serializable, Comparable
+{
+ static Logger logger = Logger.getLogger(VoteUploadedFile.class.getName());
+
+ /** identifier field */
+ private Long uid;
+
+ /** persistent field */
+ private String uuid;
+
+ /** persistent field */
+ private boolean fileOnline;
+
+ /** persistent field */
+ private String filename;
+
+
+ private Long voteContentId;
+
+ /** persistent field */
+ private VoteContent voteContent;
+
+ public VoteUploadedFile(){};
+
+ /** full constructor */
+ public VoteUploadedFile(Long uid,
+ String uuid,
+ boolean fileOnline,
+ String filename,
+ VoteContent voteContent)
+ {
+ this.uid=uid;
+ this.uuid = uuid;
+ this.fileOnline = fileOnline;
+ this.filename = filename;
+ this.voteContent=voteContent;
+ }
+
+ public VoteUploadedFile(String uuid,
+ boolean fileOnline,
+ String filename,
+ VoteContent voteContent)
+ {
+ this.uuid = uuid;
+ this.fileOnline = fileOnline;
+ this.filename = filename;
+ this.voteContent=voteContent;
+ }
+
+ public VoteUploadedFile(String uuid,
+ boolean fileOnline,
+ String filename,
+ Long voteContentId)
+ {
+ this.uuid = uuid;
+ this.fileOnline = fileOnline;
+ this.filename = filename;
+ this.voteContentId=voteContentId;
+ }
+
+
+ public static VoteUploadedFile newInstance(IToolContentHandler toolContentHandler, VoteUploadedFile mcUploadedFile,
+ VoteContent newMcContent) throws ItemNotFoundException, RepositoryCheckedException
+
+ {
+ VoteUploadedFile newMcUploadedFile=null;
+
+ try
+ {
+ NodeKey copiedNodeKey = toolContentHandler.copyFile(new Long(mcUploadedFile.getUuid()));
+ logger.debug("copied NodeKey: " + copiedNodeKey);
+ logger.debug("copied NodeKey uuid: " + copiedNodeKey.getUuid().toString());
+ newMcUploadedFile = new VoteUploadedFile(copiedNodeKey.getUuid().toString(),
+ mcUploadedFile.isFileOnline(),
+ mcUploadedFile.getFilename(),
+ newMcContent);
+
+ }
+ catch(RepositoryCheckedException e)
+ {
+ logger.debug("error occurred: " + e);
+ }
+
+ return newMcUploadedFile;
+ }
+
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uuid: ", getUuid())
+ .toString();
+ }
+
+
+ /**
+ * @return Returns the uid.
+ */
+ public Long getSubmissionId() {
+ return uid;
+ }
+ /**
+ * @param uid The uid to set.
+ */
+ public void setSubmissionId(Long uid) {
+ this.uid = uid;
+ }
+ /**
+ * @return Returns the uuid.
+ */
+ public String getUuid() {
+ return uuid;
+ }
+ /**
+ * @param uuid The uuid to set.
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+ /**
+ * @return Returns the fileOnline.
+ */
+ public boolean isFileOnline() {
+ return fileOnline;
+ }
+ /**
+ * @param fileOnline The fileOnline to set.
+ */
+ public void setFileOnline(boolean fileOnline) {
+ this.fileOnline = fileOnline;
+ }
+ /**
+ * @return Returns the uid.
+ */
+ public Long getUid() {
+ return uid;
+ }
+ /**
+ * @param uid The uid to set.
+ */
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+ /**
+ * @return Returns the filename.
+ */
+ public String getFilename() {
+ return filename;
+ }
+ /**
+ * @param filename The filename to set.
+ */
+ public void setFilename(String filename) {
+ this.filename = filename;
+ }
+
+ public int compareTo(Object o)
+ {
+ VoteUploadedFile optContent = (VoteUploadedFile) o;
+ //if the object does not exist yet, then just return any one of 0, -1, 1. Should not make a difference.
+ if (uid == null)
+ return 1;
+ else
+ return (int) (uid.longValue() - optContent.uid.longValue());
+ }
+ /**
+ * @return Returns the voteContentId.
+ */
+ public Long getVoteContentId() {
+ return voteContentId;
+ }
+ /**
+ * @param voteContentId The voteContentId to set.
+ */
+ public void setVoteContentId(Long voteContentId) {
+ this.voteContentId = voteContentId;
+ }
+ /**
+ * @return Returns the voteContent.
+ */
+ public VoteContent getVoteContent() {
+ return voteContent;
+ }
+ /**
+ * @param voteContent The voteContent to set.
+ */
+ public void setVoteContent(VoteContent voteContent) {
+ this.voteContent = voteContent;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUsrAttempt.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,241 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.pojos;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * Persistent object/bean that defines the user attempt for the MCQ tool.
+ * Provides accessors and mutators to get/set attributes
+ * It maps to database table: tl_vote11_usr_attempt
+ *
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteUsrAttempt implements Serializable {
+
+ /** identifier field */
+ private Long uid;
+
+ /** persistent field */
+ private Long attemptId;
+
+ /** nullable persistent field */
+ private Date attemptTime;
+
+ /** nullable persistent field */
+ private String timeZone;
+
+ private String userEntry;
+
+ private boolean isNominated;
+
+ private Long queUsrId;
+
+ private Long voteQueContentId;
+
+ /** persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent;
+
+ /** persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr;
+
+ /** persistent field */
+ private org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent voteOptionsContent;
+
+ /** full constructor */
+ public VoteUsrAttempt(Long attemptId, 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.attemptId = attemptId;
+ this.attemptTime = attemptTime;
+ this.timeZone = timeZone;
+ this.voteQueContent = voteQueContent;
+ this.voteQueUsr = voteQueUsr;
+ this.voteOptionsContent = voteOptionsContent;
+ }
+
+ public VoteUsrAttempt(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.attemptTime = attemptTime;
+ this.timeZone = timeZone;
+ this.voteQueContent = voteQueContent;
+ this.voteQueUsr = voteQueUsr;
+ this.voteOptionsContent = voteOptionsContent;
+ }
+
+ public VoteUsrAttempt(String userEntry, boolean isNominated, 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;
+ this.voteQueUsr = voteQueUsr;
+ this.voteOptionsContent = voteOptionsContent;
+ }
+
+
+ /** default constructor */
+ public VoteUsrAttempt() {
+ }
+
+ /** minimal constructor */
+ public VoteUsrAttempt(Long attemptId, 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.attemptId = attemptId;
+ this.voteQueContent = voteQueContent;
+ this.voteQueUsr = voteQueUsr;
+ this.voteOptionsContent = voteOptionsContent;
+ }
+
+ public Long getUid() {
+ return this.uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ public Long getAttemptId() {
+ return this.attemptId;
+ }
+
+ public void setAttemptId(Long attemptId) {
+ this.attemptId = attemptId;
+ }
+
+ public Date getAttemptTime() {
+ return this.attemptTime;
+ }
+
+ public void setAttemptTime(Date attemptTime) {
+ this.attemptTime = attemptTime;
+ }
+
+ public String getTimeZone() {
+ return this.timeZone;
+ }
+
+ public void setTimeZone(String timeZone) {
+ this.timeZone = timeZone;
+ }
+
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("uid", getUid())
+ .toString();
+ }
+
+ /**
+ * @return Returns the queUsrId.
+ */
+ public Long getQueUsrId() {
+ return queUsrId;
+ }
+ /**
+ * @param queUsrId The queUsrId to set.
+ */
+ public void setQueUsrId(Long queUsrId) {
+ this.queUsrId = queUsrId;
+ }
+ /**
+ * @return Returns the voteQueContentId.
+ */
+ public Long getVoteQueContentId() {
+ return voteQueContentId;
+ }
+ /**
+ * @param voteQueContentId The voteQueContentId to set.
+ */
+ public void setVoteQueContentId(Long voteQueContentId) {
+ this.voteQueContentId = voteQueContentId;
+ }
+ /**
+ * @return Returns the voteQueContent.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent getVoteQueContent() {
+ return voteQueContent;
+ }
+ /**
+ * @param voteQueContent The voteQueContent to set.
+ */
+ public void setVoteQueContent(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent voteQueContent) {
+ this.voteQueContent = voteQueContent;
+ }
+ /**
+ * @return Returns the voteQueUsr.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr getVoteQueUsr() {
+ return voteQueUsr;
+ }
+ /**
+ * @param voteQueUsr The voteQueUsr to set.
+ */
+ public void setVoteQueUsr(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr voteQueUsr) {
+ this.voteQueUsr = voteQueUsr;
+ }
+ /**
+ * @return Returns the voteOptionsContent.
+ */
+ public org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent getVoteOptionsContent() {
+ return voteOptionsContent;
+ }
+ /**
+ * @param voteOptionsContent The voteOptionsContent to set.
+ */
+ public void setVoteOptionsContent(
+ org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent voteOptionsContent) {
+ this.voteOptionsContent = voteOptionsContent;
+ }
+ /**
+ * @return Returns the userEntry.
+ */
+ public String getUserEntry() {
+ return userEntry;
+ }
+ /**
+ * @param userEntry The userEntry to set.
+ */
+ 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
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,252 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.service;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.lamsfoundation.lams.contentrepository.ITicket;
+import org.lamsfoundation.lams.contentrepository.NodeKey;
+import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
+import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.tool.IToolVO;
+import org.lamsfoundation.lams.tool.ToolSessionExportOutputData;
+import org.lamsfoundation.lams.tool.exception.DataMissingException;
+import org.lamsfoundation.lams.tool.exception.SessionDataExistsException;
+import org.lamsfoundation.lams.tool.exception.ToolException;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt;
+import org.lamsfoundation.lams.usermanagement.User;
+
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * Interface that defines the contract that all Voting service provider must follow.
+ */
+public interface IVoteService
+{
+ public void configureContentRepository() throws VoteApplicationException;
+
+ public void createMc(VoteContent mcContent) throws VoteApplicationException;
+
+ public VoteContent retrieveMc(Long toolContentId) throws VoteApplicationException;
+
+ public void createMcQue(VoteQueContent mcQueContent) throws VoteApplicationException;
+
+ public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long mcContentUid) throws VoteApplicationException;
+
+ public void createMcSession(VoteSession mcSession) throws VoteApplicationException;
+
+ public void createMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException;
+
+ public VoteQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionId) throws VoteApplicationException;
+
+ public VoteQueUsr retrieveMcQueUsr(Long userId) throws VoteApplicationException;
+
+ public void createMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException;
+
+ public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException;
+
+ public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException;
+
+ public VoteQueContent retrieveMcQueContentByUID(Long uid) throws VoteApplicationException;
+
+ public void removeMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException;
+
+ public VoteQueContent getMcQueContentByUID(Long uid) throws VoteApplicationException;
+
+ public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException;
+
+ public void removeQuestionContentByMcUid(final Long mcContentUid) throws VoteApplicationException;
+
+ public VoteOptsContent getMcOptionsContentByUID(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 removeMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException;
+
+ public void removeMcOptionsContent(VoteOptsContent mcOptsContent);
+
+ public VoteQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid);
+
+ public List getPersistedSelectedOptions(Long mcQueContentId);
+
+ public void removeMcQueContentByUID(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 VoteContent retrieveMcBySessionId(Long mcSessionId) throws VoteApplicationException;
+
+ public void updateMc(VoteContent mc) throws VoteApplicationException;
+
+ public void updateMcSession(VoteSession mcSession) throws VoteApplicationException;
+
+ public List getMcUserBySessionOnly(final VoteSession mcSession) throws VoteApplicationException;
+
+ public VoteSession getMcSessionByUID(Long uid) throws VoteApplicationException;
+
+ public void deleteMc(VoteContent mc) throws VoteApplicationException;
+
+ public void deleteMcById(Long mcId) throws VoteApplicationException;
+
+ public void deleteMcSession(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 List findMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException;
+
+ public void saveMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException;
+
+ public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid);
+
+ public void updateMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException;
+
+ public void deleteMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException;
+
+ public void deleteMcOptionsContentByUID(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 boolean studentActivityOccurredGlobal(VoteContent mcContent) throws VoteApplicationException;
+
+ public int countIncompleteSession(VoteContent mc) throws VoteApplicationException;
+
+ public boolean studentActivityOccurred(VoteContent mc) throws VoteApplicationException;
+
+ 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;
+
+ public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException;
+
+ public boolean existsSession(Long toolSessionId);
+
+ public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException;
+
+ public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException;
+
+ public String leaveToolSession(Long toolSessionId,Long learnerId) throws DataMissingException, ToolException;
+
+ public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException;
+
+ public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException, ToolException;
+
+ public IToolVO getToolBySignature(String toolSignature) throws VoteApplicationException;
+
+ public long getToolDefaultContentIdBySignature(String toolSignature) throws VoteApplicationException;
+
+ public VoteQueContent getToolDefaultQuestionContent(long contentId) throws VoteApplicationException;
+
+ public List getToolSessionsForContent(VoteContent mc);
+
+ public ITicket getRepositoryLoginTicket() throws VoteApplicationException;
+
+ public void deleteFromRepository(Long uuid, Long versionID);
+
+ public NodeKey uploadFileToRepository(InputStream stream, String fileName) throws VoteApplicationException;
+
+ public InputStream downloadFile(Long uuid, Long versionID) throws VoteApplicationException;
+
+ public String getFileUuid(String filename) throws VoteApplicationException;
+
+ public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId) throws VoteApplicationException;
+
+ public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId) throws VoteApplicationException;
+
+ public List retrieveMcUploadedOfflineFilesName(Long mcContentId) throws VoteApplicationException;
+
+ public List retrieveMcUploadedOnlineFilesName(Long mcContentId) throws VoteApplicationException;
+
+ public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline) throws VoteApplicationException;
+
+ public void cleanUploadedFilesMetaData() throws VoteApplicationException;
+
+ public void persistFile(String uuid, boolean isOnlineFile, String fileName, VoteContent mcContent) throws VoteApplicationException;
+
+ public List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException;
+
+ public List getAttemptsForUser(final Long queUsrId) throws VoteApplicationException;
+
+ public int countSessionComplete() throws VoteApplicationException;
+
+ public VoteSession findMcSessionById(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;
+
+ public void removeOffLineFile(String filename, Long mcContentId) throws VoteApplicationException;
+
+ public void removeOnLineFile(String filename, Long mcContentId) throws VoteApplicationException;
+
+ public boolean isOffLineFilePersisted(String filename) throws VoteApplicationException;
+
+ public boolean isOnLineFilePersisted(String filename) throws VoteApplicationException;
+
+ public boolean isUuidPersisted(String uuid) throws VoteApplicationException;
+
+ public List getOnlineFilesMetaData(Long mcContentId) throws VoteApplicationException;
+
+ public List getOfflineFilesMetaData(Long mcContentId) throws VoteApplicationException;
+
+ public List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException;
+
+ public List findMcOptionNamesByQueId(Long mcQueContentId) throws VoteApplicationException;
+}
+
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,2256 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.service;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TreeSet;
+
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.contentrepository.AccessDeniedException;
+import org.lamsfoundation.lams.contentrepository.FileException;
+import org.lamsfoundation.lams.contentrepository.ICredentials;
+import org.lamsfoundation.lams.contentrepository.ITicket;
+import org.lamsfoundation.lams.contentrepository.IVersionedNode;
+import org.lamsfoundation.lams.contentrepository.ItemExistsException;
+import org.lamsfoundation.lams.contentrepository.ItemNotFoundException;
+import org.lamsfoundation.lams.contentrepository.LoginException;
+import org.lamsfoundation.lams.contentrepository.NodeKey;
+import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
+import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException;
+import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
+import org.lamsfoundation.lams.contentrepository.service.IRepositoryService;
+import org.lamsfoundation.lams.contentrepository.service.RepositoryProxy;
+import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials;
+import org.lamsfoundation.lams.learning.service.ILearnerService;
+import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.tool.IToolVO;
+import org.lamsfoundation.lams.tool.ToolContentManager;
+import org.lamsfoundation.lams.tool.ToolSessionExportOutputData;
+import org.lamsfoundation.lams.tool.ToolSessionManager;
+import org.lamsfoundation.lams.tool.exception.DataMissingException;
+import org.lamsfoundation.lams.tool.exception.SessionDataExistsException;
+import org.lamsfoundation.lams.tool.exception.ToolException;
+import org.lamsfoundation.lams.tool.service.ILamsToolService;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteContentDAO;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteOptionsContentDAO;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteQueContentDAO;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteSessionDAO;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteUploadedFileDAO;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteUserDAO;
+import org.lamsfoundation.lams.tool.vote.dao.IVoteUsrAttemptDAO;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteOptsContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUploadedFile;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt;
+import org.lamsfoundation.lams.usermanagement.User;
+import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
+import org.springframework.dao.DataAccessException;
+
+/**
+ *
+ * @author Ozgur Demirtas
+ *
+ * The POJO implementation of Mc service. All business logics of Voting tool
+ * are implemented in this class. It translate the request from presentation
+ * layer and perform appropriate database operation.
+ *
+ */
+public class VoteServicePOJO implements
+ IVoteService, ToolContentManager, ToolSessionManager, VoteAppConstants
+
+{
+ static Logger logger = Logger.getLogger(VoteServicePOJO.class.getName());
+
+ /*repository access related constants */
+ private final String repositoryUser = "vote11";
+ private final char[] repositoryId = {'v','o','t','e','_','1', '1'};
+ private final String repositoryWorkspace = "vote11";
+ private IRepositoryService repositoryService;
+ private ICredentials cred;
+
+ private IVoteContentDAO voteContentDAO;
+ private IVoteQueContentDAO voteQueContentDAO;
+ private IVoteOptionsContentDAO voteOptionsContentDAO;
+ private IVoteSessionDAO voteSessionDAO;
+ private IVoteUserDAO voteUserDAO;
+ private IVoteUsrAttemptDAO voteUsrAttemptDAO;
+
+ private IVoteUploadedFileDAO voteUploadedFileDAO;
+ private IUserManagementService userManagementService;
+ private ILearnerService learnerService;
+ private ILamsToolService toolService;
+ private IToolContentHandler mcToolContentHandler = null;
+
+ public VoteServicePOJO(){}
+
+ public void configureContentRepository() throws VoteApplicationException {
+ logger.debug("retrieved repService: " + repositoryService);
+ cred = new SimpleCredentials(repositoryUser, repositoryId);
+ logger.debug("retrieved cred: "+ cred);
+ try
+ {
+ repositoryService.createCredentials(cred);
+ logger.debug("created credentails.");
+ repositoryService.addWorkspace(cred,repositoryWorkspace);
+ logger.debug("created workspace.");
+ } catch (ItemExistsException ie) {
+ logger.warn("Tried to configure repository but it "
+ +" appears to be already configured. Exception thrown by repository being ignored. ", ie);
+ } catch (RepositoryCheckedException e) {
+ String error = "Error occured while trying to configure repository."
+ +" Unable to recover from error: "+e.getMessage();
+ logger.error(error, e);
+ throw new VoteApplicationException(error,e);
+ }
+ }
+
+
+ public void createMc(VoteContent mcContent) throws VoteApplicationException
+ {
+ try
+ {
+ logger.debug("using mcContent defineLater:" + mcContent.isDefineLater());
+ voteContentDAO.saveMcContent(mcContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is creating mc content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteContent retrieveMc(Long toolContentId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteContentDAO.findMcContentById(toolContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public void updateMcContent(VoteContent mcContent) throws VoteApplicationException
+ {
+ try
+ {
+ voteContentDAO.updateMcContent(mcContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is updating mc content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public void createMcQue(VoteQueContent mcQueContent) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.saveMcQueContent(mcQueContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is creating mc 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
+ {
+ try
+ {
+ return voteQueContentDAO.getMcQueContentByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting mc que content by uid: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void saveOrUpdateMcQueContent(VoteQueContent mcQueContent) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.saveOrUpdateMcQueContent(mcQueContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is updating mc que content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void removeQuestionContentByMcUid(final Long mcContentUid) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.removeQuestionContentByMcUid(mcContentUid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing mc que content by mc content id: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public void resetAllQuestions(final Long mcContentUid) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.resetAllQuestions(mcContentUid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is resetting all questions: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+
+ public void cleanAllQuestions(final Long mcContentUid) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.cleanAllQuestions(mcContentUid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is cleaning all questions: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ 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
+ {
+ try
+ {
+ voteSessionDAO.saveMcSession(mcSession);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is creating mc session: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteSession getMcSessionByUID(Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.getMcSessionByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting mcSession my uid: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void createMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException
+ {
+ try
+ {
+ voteUserDAO.saveMcUser(mcQueUsr);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is creating mc QueUsr: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteQueUsr getMcUserBySession(final Long queUsrId, final Long mcSessionId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUserDAO.getMcUserBySession(queUsrId, mcSessionId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting mc QueUsr: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteQueUsr getMcUserByUID(Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUserDAO.getMcUserByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting the mc QueUsr by uid."
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public VoteQueUsr retrieveMcQueUsr(Long userId) throws VoteApplicationException
+ {
+ try
+ {
+ VoteQueUsr mcQueUsr=voteUserDAO.findMcUserById(userId);
+ return mcQueUsr;
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving McQueUsr: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void createMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException
+ {
+ try
+ {
+ voteUsrAttemptDAO.saveMcUsrAttempt(mcUsrAttempt);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is creating mc UsrAttempt: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUsrAttemptDAO.getAttemptsForUserAndQuestionContent(queUsrId, mcQueContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting mc UsrAttempt by user id and que content id: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void updateMcUsrAttempt(VoteUsrAttempt mcUsrAttempt) throws VoteApplicationException
+ {
+ try
+ {
+ voteUsrAttemptDAO.updateMcUsrAttempt(mcUsrAttempt);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is updating mc UsrAttempt: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List getAttemptsForUser(final Long queUsrId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUsrAttemptDAO.getAttemptsForUser(queUsrId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting the attempts by user id: "
+ + e.getMessage(),
+ e);
+ }
+
+ }
+
+
+ public List getAttemptForQueContent(final Long queUsrId, final Long mcQueContentId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUsrAttemptDAO.getAttemptForQueContent(queUsrId, mcQueContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting the learner's attempts by user id and que content id: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteQueContent retrieveMcQueContentByUID(Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ return voteQueContentDAO.getMcQueContentByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving by uid mc question content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void cleanAllQuestionsSimple(final Long mcContentId) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.cleanAllQuestionsSimple(mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is cleaning mc question content by mcContentId : "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public List getAllQuestionEntries(final Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ return voteQueContentDAO.getAllQuestionEntries(uid.longValue());
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting by uid mc question content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public void removeMcQueContentByUID(Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ voteQueContentDAO.removeMcQueContentByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing by uid mc question content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List refreshQuestionContent(final Long mcContentId) 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);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing mc question content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public void removeMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException
+ {
+ try
+ {
+ voteOptionsContentDAO.removeMcOptionsContent(mcOptsContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing"
+ + " the mc 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)
+ {
+ try
+ {
+ return voteQueContentDAO.getQuestionContentByQuestionText(question, mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving question content by question text: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteSession retrieveMcSession(Long mcSessionId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.findMcSessionById(mcSessionId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving by id mc session : "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteSession findMcSessionById(Long mcSessionId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.findMcSessionById(mcSessionId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving by id mc session : "
+ + e.getMessage(),
+ e);
+ }
+
+ }
+
+ public List getMcUserBySessionOnly(final VoteSession mcSession) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUserDAO.getMcUserBySessionOnly(mcSession);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving users by session: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public VoteContent retrieveMcBySessionId(Long mcSessionId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteContentDAO.getMcContentBySession(mcSessionId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving mc by session id: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public List getSessionNamesFromContent(VoteContent mcContent) throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.getSessionNamesFromContent(mcContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting session names from content: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+
+ public void updateMc(VoteContent mc) throws VoteApplicationException
+ {
+ try
+ {
+ voteContentDAO.updateMcContent(mc);
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is updating"
+ + " the mc content: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void updateMcSession(VoteSession mcSession) throws VoteApplicationException
+ {
+ try
+ {
+ voteSessionDAO.updateMcSession(mcSession);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is updating mc session : "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public void deleteMc(VoteContent mc) throws VoteApplicationException
+ {
+ try
+ {
+ voteContentDAO.removeMc(mc);
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing"
+ + " the mc content: "
+ + e.getMessage(),e);
+ }
+ }
+
+ public void deleteMcById(Long mcId) throws VoteApplicationException
+ {
+ try
+ {
+ voteContentDAO.removeMcById(mcId);
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing by id"
+ + " the mc content: "
+ + e.getMessage(),e);
+ }
+ }
+
+ public int countSessionComplete() throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.countSessionComplete();
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is counting incomplete sessions"
+ + e.getMessage(),e);
+ }
+ }
+
+ public int countSessionIncomplete() throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.countSessionIncomplete();
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is counting incomplete sessions"
+ + e.getMessage(),e);
+ }
+ }
+
+ public void deleteMcSession(VoteSession mcSession) throws VoteApplicationException
+ {
+ try
+ {
+ voteSessionDAO.removeMcSession(mcSession);
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is deleting"
+ + " the mc session: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void removeAttempt (VoteUsrAttempt attempt) throws VoteApplicationException
+ {
+ try
+ {
+ voteUsrAttemptDAO.removeMcUsrAttempt(attempt);
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing"
+ + " the attempt: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void deleteMcQueUsr(VoteQueUsr mcQueUsr) throws VoteApplicationException
+ {
+ try
+ {
+ voteUserDAO.removeMcUser(mcQueUsr);
+ }
+ catch(DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing"
+ + " the user: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void saveMcContent(VoteContent mc) throws VoteApplicationException
+ {
+ try
+ {
+ voteContentDAO.saveMcContent(mc);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is saving"
+ + " the mc content: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public List findMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException
+ {
+ try
+ {
+ List list=voteOptionsContentDAO.findMcOptionsContentByQueId(mcQueContentId);
+ return list;
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is finding by que id"
+ + " the mc options: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public VoteOptsContent getMcOptionsContentByUID(Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ return getMcOptionsContentByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting opt content by uid"
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void saveMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException
+ {
+ try
+ {
+ voteOptionsContentDAO.saveMcOptionsContent(mcOptsContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is saving"
+ + " the mc options content: "
+ + e.getMessage(),e);
+ }
+ }
+
+ public VoteOptsContent getOptionContentByOptionText(final String option, final Long mcQueContentUid)
+ {
+ try
+ {
+ return voteOptionsContentDAO.getOptionContentByOptionText(option, mcQueContentUid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is returning the"
+ + " option by option text: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ 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
+ {
+ try
+ {
+ voteOptionsContentDAO.updateMcOptionsContent(mcOptsContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is updating"
+ + " the mc options content: "
+ + e.getMessage(),e);
+ }
+ }
+
+ public List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException
+ {
+ try
+ {
+ return voteSessionDAO.getSessionsFromContent(mcContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is getting"
+ + " the mc sessions list: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void deleteMcOptionsContent(VoteOptsContent mcOptsContent) throws VoteApplicationException
+ {
+ try
+ {
+ voteOptionsContentDAO.removeMcOptionsContent(mcOptsContent);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing"
+ + " the mc options content: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public List findMcOptionNamesByQueId(Long mcQueContentId) throws VoteApplicationException
+ {
+ try
+ {
+ return voteOptionsContentDAO.findMcOptionNamesByQueId(mcQueContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is finding"
+ + " the mc options name: "
+ + e.getMessage(),e);
+ }
+
+ }
+
+
+ public void removeMcOptionsContentByQueId(Long mcQueContentId) throws VoteApplicationException
+ {
+ try
+ {
+ voteOptionsContentDAO.removeMcOptionsContentByQueId(mcQueContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing by que id"
+ + " the mc options content: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public void deleteMcOptionsContentByUID(Long uid) throws VoteApplicationException
+ {
+ try
+ {
+ voteOptionsContentDAO.removeMcOptionsContentByUID(uid);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing by uid"
+ + " the mc options content: "
+ + e.getMessage(),e);
+ }
+ }
+
+
+ public int getTotalNumberOfUsers() throws VoteApplicationException
+ {
+ try
+ {
+ return voteUserDAO.getTotalNumberOfUsers();
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is retrieving total number of McQueUsr: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public User getCurrentUserData(String username) throws VoteApplicationException
+ {
+ try
+ {
+ logger.debug("getCurrentUserData: " + username);
+ /**
+ * this will return null if the username not found
+ */
+ User user=userManagementService.getUserByLogin(username);
+ if (user == null)
+ {
+ logger.error("No user with the username: "+ username + " exists.");
+ throw new VoteApplicationException("No user with that username exists.");
+ }
+ return user;
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Unable to find current user information"
+ + " Root Cause: ["
+ + e.getMessage() + "]",
+ e);
+ }
+ }
+
+ /**
+ *
+ * Unused method
+ * @param lessonId
+ * @return
+ * @throws VoteApplicationException
+ */
+ public Lesson getCurrentLesson(long lessonId) throws VoteApplicationException
+ {
+ try
+ {
+ /**this is a mock implementation to make the project compile and
+ work. When the Lesson service is ready, we need to switch to
+ real service implementation.
+ */
+ return new Lesson();
+ /**return lsDAO.find(lsessionId); */
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading"
+ + " learning session:"
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ /**
+ * checks the parameter content in the user responses table
+ * @param mcContent
+ * @return boolean
+ * @throws VoteApplicationException
+ */
+ public boolean studentActivityOccurredGlobal(VoteContent mcContent) throws VoteApplicationException
+ {
+ Iterator questionIterator=mcContent.getVoteQueContents().iterator();
+ while (questionIterator.hasNext())
+ {
+ VoteQueContent mcQueContent=(VoteQueContent)questionIterator.next();
+ Iterator attemptsIterator=mcQueContent.getVoteUsrAttempts().iterator();
+ while (attemptsIterator.hasNext())
+ {
+ logger.debug("there is at least one attempt");
+ /**
+ * proved the fact that there is at least one attempt for this content.
+ */
+ return true;
+ }
+ }
+ logger.debug("there is no response for this content");
+ return false;
+ }
+
+
+ public int countIncompleteSession(VoteContent mc) throws VoteApplicationException
+ {
+ //int countIncompleteSession=voteSessionDAO.countIncompleteSession(mc);
+ int countIncompleteSession=2;
+ return countIncompleteSession;
+ }
+
+ /**
+ * checks the parameter content in the tool sessions table
+ *
+ * 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
+ * @return boolean
+ * @throws VoteApplicationException
+ */
+ public boolean studentActivityOccurred(VoteContent mc) throws VoteApplicationException
+ {
+ //int countStudentActivity=voteSessionDAO.studentActivityOccurred(mc);
+ int countStudentActivity=2;
+
+ if (countStudentActivity > 0)
+ return true;
+ return false;
+ }
+
+
+ /**
+ * implemented as part of the Tool Contract
+ * copyToolContent(Long fromContentId, Long toContentId) throws ToolException
+ * @param fromContentId
+ * @param toContentId
+ * @return
+ * @throws ToolException
+ *
+ */
+ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException
+ {
+ logger.debug("start of copyToolContent with ids: " + fromContentId + " and " + toContentId);
+
+ if (fromContentId == null)
+ {
+ logger.error("fromContentId is null.");
+ logger.debug("attempt retrieving tool's default content id with signatute : " + MY_SIGNATURE);
+ long defaultContentId=0;
+ try
+ {
+ defaultContentId=getToolDefaultContentIdBySignature(MY_SIGNATURE);
+ fromContentId= new Long(defaultContentId);
+ }
+ catch(Exception e)
+ {
+ logger.error("default content id has not been setup for signature: " + MY_SIGNATURE);
+ throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!");
+ }
+ }
+
+ if (toContentId == null)
+ {
+ logger.error("throwing ToolException: toContentId is null");
+ throw new ToolException("toContentId is missing");
+ }
+ logger.debug("final - copyToolContent using ids: " + fromContentId + " and " + toContentId);
+
+ try
+ {
+ VoteContent fromContent = voteContentDAO.findMcContentById(fromContentId);
+
+ if (fromContent == null)
+ {
+ logger.error("fromContent is null.");
+ logger.error("attempt retrieving tool's default content id with signatute : " + MY_SIGNATURE);
+ long defaultContentId=0;
+ try
+ {
+ defaultContentId=getToolDefaultContentIdBySignature(MY_SIGNATURE);
+ fromContentId= new Long(defaultContentId);
+ }
+ catch(Exception e)
+ {
+ logger.error("default content id has not been setup for signature: " + MY_SIGNATURE);
+ throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!");
+ }
+
+ fromContent = voteContentDAO.findMcContentById(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);
+
+ try
+ {
+ VoteContent toContent = VoteContent.newInstance(mcToolContentHandler, fromContent,toContentId);
+ if (toContent == null)
+ {
+ logger.debug("throwing ToolException: WARNING!, retrieved toContent is null.");
+ throw new ToolException("WARNING! Fail to create toContent. Can't continue!");
+ }
+ else
+ {
+ logger.debug("retrieved toContent: " + toContent);
+ voteContentDAO.saveMcContent(toContent);
+ logger.debug("toContent has been saved successfully: " + toContent);
+ }
+ logger.debug("end of copyToolContent with ids: " + fromContentId + " and " + toContentId);
+
+ }
+ catch(ItemNotFoundException e)
+ {
+ logger.error("exception occurred: " + e);
+ }
+ catch(RepositoryCheckedException e)
+ {
+ logger.error("exception occurred: " + e);
+ }
+ }
+ catch (DataAccessException e)
+ {
+ logger.error("throwing ToolException: Exception occured when lams is copying content between content ids.");
+ throw new ToolException("Exception occured when lams is copying content between content ids.");
+ }
+ }
+
+
+ /**
+ * implemented as part of the tool contract. Removes content and uploaded files from the content repository.
+ * removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException
+ * @param toContentId
+ * @param removeSessionData
+ * @return
+ * @throws ToolException
+ */
+ public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException
+ {
+ logger.debug("start of removeToolContent with toolContentId: " + toolContentId + "removeSessionData: " + removeSessionData);
+
+ if (toolContentId == null)
+ {
+ logger.error("toolContentId is null");
+ throw new ToolException("toolContentId is missing");
+ }
+
+ VoteContent mcContent = voteContentDAO.findMcContentById(toolContentId);
+ logger.debug("retrieving mcContent: " + mcContent);
+
+ if (mcContent != null)
+ {
+ logger.error("start deleting any uploaded file for this content from the content repository");
+ Iterator filesIterator=mcContent.getVoteAttachments().iterator();
+ while (filesIterator.hasNext())
+ {
+ VoteUploadedFile mcUploadedFile=(VoteUploadedFile) filesIterator.next();
+ logger.debug("iterated mcUploadedFile : " + mcUploadedFile);
+ String filesUuid=mcUploadedFile.getUuid();
+ if ((filesUuid != null) && (filesUuid.length() > 0))
+ {
+ try
+ {
+ mcToolContentHandler.deleteFile(new Long(filesUuid));
+ }
+ catch(RepositoryCheckedException e)
+ {
+ logger.error("exception occured deleting files from content repository : " + e);
+ throw new ToolException("undeletable file in the content repository");
+ }
+ }
+ }
+ logger.debug("end deleting any uploaded files for this content.");
+
+ Iterator sessionIterator=mcContent.getVoteSessions().iterator();
+ while (sessionIterator.hasNext())
+ {
+ if (removeSessionData == false)
+ {
+ logger.debug("removeSessionData is false, throwing SessionDataExistsException.");
+ throw new SessionDataExistsException();
+ }
+
+ VoteSession mcSession=(VoteSession)sessionIterator.next();
+ logger.debug("iterated mcSession : " + mcSession);
+
+ Iterator sessionUsersIterator=mcSession.getVoteQueUsers().iterator();
+ while (sessionUsersIterator.hasNext())
+ {
+ VoteQueUsr mcQueUsr=(VoteQueUsr) sessionUsersIterator.next();
+ logger.debug("iterated mcQueUsr : " + mcQueUsr);
+
+ Iterator sessionUsersAttemptsIterator=mcQueUsr.getVoteUsrAttempts().iterator();
+ while (sessionUsersAttemptsIterator.hasNext())
+ {
+ VoteUsrAttempt mcUsrAttempt=(VoteUsrAttempt)sessionUsersAttemptsIterator.next();
+ logger.debug("iterated mcUsrAttempt : " + mcUsrAttempt);
+ removeAttempt(mcUsrAttempt);
+ logger.debug("removed mcUsrAttempt : " + mcUsrAttempt);
+ }
+ }
+ }
+ logger.debug("removed all existing responses of toolContent with toolContentId:" +
+ toolContentId);
+ voteContentDAO.removeMcById(toolContentId);
+ logger.debug("removed mcContent:" + mcContent);
+ }
+ else
+ {
+ logger.error("Warning!!!, We should have not come here. mcContent 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
+ * @return
+ * @throws ToolException
+ */
+ public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException
+ {
+ logger.debug("request for setAsDefineLater with toolContentId: " + toolContentId);
+ if (toolContentId == null)
+ {
+ logger.error("throwing DataMissingException: WARNING!: retrieved toolContentId is null.");
+ throw new DataMissingException("toolContentId is missing");
+ }
+
+ VoteContent mcContent=retrieveMc(toolContentId);
+ if (mcContent == null)
+ {
+ logger.error("throwing DataMissingException: WARNING!: retrieved mcContent is null.");
+ throw new DataMissingException("mcContent is missing");
+ }
+ mcContent.setDefineLater(true);
+ saveMcContent(mcContent);
+ logger.debug("success: end of setAsDefineLater on toolContentId:" + toolContentId);
+ }
+
+
+ /**
+ * Implemented as part of the tool contract. Sets the runOffline to true on this content.
+ * setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException
+ *
+ * @param toolContentId
+ * return
+ * @throws ToolException
+ */
+ public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException
+ {
+ logger.debug("request for setAsRunOffline with toolContentId:" + toolContentId);
+ if (toolContentId == null)
+ {
+ logger.error("throwing DataMissingException: WARNING!: retrieved toolContentId is null.");
+ throw new DataMissingException("toolContentId is missing");
+ }
+ VoteContent mcContent = voteContentDAO.findMcContentById(toolContentId);
+ if (mcContent == null)
+ {
+ logger.error("throwing DataMissingException: WARNING!: retrieved mcContent is null.");
+ throw new DataMissingException("mcContent is missing");
+ }
+ mcContent.setRunOffline(true);
+ saveMcContent(mcContent);
+ logger.debug("success: end of setAsRunOffline on toolContentId:" + toolContentId);
+ }
+
+
+ /**
+ * it is possible that the tool session id already exists in the tool sessions table
+ * as the users from the same session are involved.
+ * existsSession(long toolSessionId)
+ * @param toolSessionId
+ * @return boolean
+ */
+ public boolean existsSession(Long toolSessionId)
+ {
+ VoteSession mcSession= retrieveMcSession(toolSessionId);
+
+ if (mcSession == null)
+ {
+ logger.error("mcSession does not exist yet: " + toolSessionId);
+ return false;
+ }
+ else
+ {
+ logger.debug("retrieving an existing mcSession: " + mcSession + " " + toolSessionId);
+ }
+ return true;
+ }
+
+ /**
+ * Implemented as part of the tool contract.
+ * Gets called only in the Learner mode.
+ * All the learners in the same group have the same toolSessionId.
+ *
+ * @param toolSessionId the generated tool session id.
+ * @param toolSessionName the tool session name.
+ * @param toolContentId the tool content id specified.
+ * @throws ToolException if an error occurs e.g. defaultContent is missing.
+ *
+ */
+ public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException
+ {
+ logger.debug("start of createToolSession with ids: " + toolSessionId + " and " + toolContentId);
+ logger.debug("toolSessionName: " + toolSessionName);
+
+ if (toolSessionId == null)
+ {
+ logger.error("toolSessionId is null");
+ throw new ToolException("toolSessionId is missing");
+ }
+
+ long defaultContentId=0;
+ if (toolContentId == null)
+ {
+ logger.error("toolContentId is null.");
+ logger.error("attempt retrieving tool's default content id with signatute : " + MY_SIGNATURE);
+
+ try
+ {
+ defaultContentId=getToolDefaultContentIdBySignature(MY_SIGNATURE);
+ toolContentId=new Long(defaultContentId);
+ logger.debug("updated toolContentId to: " + toolContentId);
+ }
+ catch(Exception e)
+ {
+ logger.error("default content id has not been setup for signature: " + MY_SIGNATURE);
+ throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!");
+ }
+ }
+ logger.debug("final toolSessionId and toolContentId: " + toolSessionId + " " + toolContentId);
+
+ VoteContent mcContent = voteContentDAO.findMcContentById(toolContentId);
+ logger.debug("retrieved mcContent: " + mcContent);
+
+ if (mcContent == null)
+ {
+ logger.error("mcContent is null.");
+ logger.error("attempt retrieving tool's default content id with signatute : " + MY_SIGNATURE);
+
+ try
+ {
+ defaultContentId=getToolDefaultContentIdBySignature(MY_SIGNATURE);
+ toolContentId=new Long(defaultContentId);
+ logger.debug("updated toolContentId to: " + toolContentId);
+ }
+ catch(Exception e)
+ {
+ logger.error("default content id has not been setup for signature: " + MY_SIGNATURE);
+ throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!");
+ }
+
+ mcContent = voteContentDAO.findMcContentById(toolContentId);
+ }
+ logger.debug("final - retrieved mcContent: " + mcContent);
+
+
+ /*
+ * create a new a new tool session if it does not already exist in the tool session table
+ */
+ if (!existsSession(toolSessionId))
+ {
+ try
+ {
+ VoteSession mcSession = new VoteSession(toolSessionId,
+ new Date(System.currentTimeMillis()),
+ VoteSession.INCOMPLETE,
+ toolSessionName,
+ mcContent,
+ new TreeSet());
+
+ logger.debug("created mcSession: " + mcSession);
+ voteSessionDAO.saveMcSession(mcSession);
+ logger.debug("created mcSession in the db: " + mcSession);
+
+ }
+ catch(Exception e)
+ {
+ logger.error("Error creating new toolsession in the db");
+ throw new ToolException("Error creating new toolsession in the db: " + e);
+ }
+ }
+ }
+
+
+ /**
+ * Implemented as part of the tool contract.
+ * removeToolSession(Long toolSessionId) throws DataMissingException, ToolException
+ * @param toolSessionId
+ * @param toolContentId
+ * return
+ * @throws ToolException
+ */
+ public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException
+ {
+ logger.debug("start of removeToolSession with id: " + toolSessionId);
+ if (toolSessionId == null)
+ {
+ logger.error("toolSessionId is null");
+ throw new DataMissingException("toolSessionId is missing");
+ }
+
+
+ VoteSession mcSession=null;
+ try
+ {
+ mcSession=retrieveMcSession(toolSessionId);
+ logger.debug("retrieved mcSession: " + mcSession);
+ }
+ catch(VoteApplicationException e)
+ {
+ throw new DataMissingException("error retrieving mcSession: " + e);
+ }
+ catch(Exception e)
+ {
+ throw new ToolException("error retrieving mcSession: " + e);
+ }
+
+ if (mcSession == null)
+ {
+ logger.error("mcSession is null");
+ throw new DataMissingException("mcSession is missing");
+ }
+
+ try
+ {
+ voteSessionDAO.removeMcSession(mcSession);
+ logger.debug("mcSession " + mcSession + " has been deleted successfully.");
+ }
+ catch(VoteApplicationException e)
+ {
+ throw new ToolException("error deleting mcSession:" + e);
+ }
+ }
+
+
+ /**
+ * Implemtented as part of the tool contract.
+ * leaveToolSession(Long toolSessionId,Long learnerId) throws DataMissingException, ToolException
+ * @param toolSessionId
+ * @param learnerId
+ * return String
+ * @throws ToolException
+ *
+ */
+ public String leaveToolSession(Long toolSessionId,Long learnerId) throws DataMissingException, ToolException
+ {
+ logger.debug("start of leaveToolSession with toolSessionId:" + toolSessionId + " and learnerId:" + learnerId);
+ logger.debug("make sure learnerService is available. Is it?" + learnerService);
+
+ if (learnerService == null)
+ return "dummyNextUrl";
+
+ if (learnerId == null)
+ {
+ logger.error("learnerId is null");
+ throw new DataMissingException("learnerId is missing");
+ }
+
+ if (toolSessionId == null)
+ {
+ logger.error("toolSessionId is null");
+ throw new DataMissingException("toolSessionId is missing");
+ }
+
+ VoteSession mcSession=null;
+ try
+ {
+ mcSession=retrieveMcSession(toolSessionId);
+ logger.debug("retrieved mcSession: " + mcSession);
+ }
+ catch(VoteApplicationException e)
+ {
+ throw new DataMissingException("error retrieving mcSession: " + e);
+ }
+ catch(Exception e)
+ {
+ throw new ToolException("error retrieving mcSession: " + e);
+ }
+ mcSession.setSessionStatus(COMPLETED);
+ voteSessionDAO.updateMcSession(mcSession);
+ logger.debug("updated mcSession to COMPLETED" + mcSession);
+
+ String nextUrl= learnerService.completeToolSession(toolSessionId,learnerId);
+ logger.debug("nextUrl: " + nextUrl);
+ if (nextUrl == null)
+ {
+ logger.error("nextUrl is null");
+ throw new ToolException("nextUrl is null");
+ }
+ return nextUrl;
+ }
+
+
+ /**
+ * exportToolSession(Long toolSessionId) throws DataMissingException, ToolException
+ * @param toolSessionId
+ * return ToolSessionExportOutputData
+ * @throws ToolException
+ */
+ public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException
+ {
+ throw new ToolException("not yet implemented");
+ }
+
+
+ /**
+ * exportToolSession(Long toolSessionId) throws DataMissingException, ToolException
+ * @param toolSessionIds
+ * return ToolSessionExportOutputData
+ * @throws ToolException
+ */
+ public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException, ToolException
+ {
+ throw new ToolException("not yet implemented");
+
+ }
+
+ public IToolVO getToolBySignature(String toolSignature) throws VoteApplicationException
+ {
+ logger.debug("attempt retrieving tool with signature : " + toolSignature);
+ IToolVO tool=toolService.getToolBySignature(toolSignature);
+ logger.debug("retrieved tool: " + tool);
+ return tool;
+ }
+
+ public long getToolDefaultContentIdBySignature(String toolSignature) throws VoteApplicationException
+ {
+ long contentId=0;
+ contentId=toolService.getToolDefaultContentIdBySignature(toolSignature);
+ logger.debug("tool default contentId : " + contentId);
+ return contentId;
+ }
+
+ public VoteQueContent getToolDefaultQuestionContent(long contentId) throws VoteApplicationException
+ {
+ VoteQueContent mcQueContent=voteQueContentDAO.getToolDefaultQuestionContent(contentId);
+ logger.debug("retrieved mcQueContent : " + mcQueContent);
+ return mcQueContent;
+ }
+
+
+ public List getToolSessionsForContent(VoteContent mc)
+ {
+ logger.debug("attempt retrieving listToolSessionIds for : " + mc);
+ List listToolSessionIds=voteSessionDAO.getSessionsFromContent(mc);
+ return listToolSessionIds;
+ }
+
+
+ public void removeAttachment(VoteContent content, VoteUploadedFile attachment) throws RepositoryCheckedException
+ {
+ try
+ {
+ attachment.setVoteContent(null);
+ content.getVoteAttachments().remove(attachment);
+ mcToolContentHandler.deleteFile(new Long(attachment.getUuid()));
+ saveMcContent(content);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("EXCEPTION: An exception has occurred while trying to remove this attachment"
+ + e.getMessage(), e);
+ }
+ }
+
+
+ public NodeKey uploadFile(InputStream istream, String filename, String contentType, String fileType) throws RepositoryCheckedException
+ {
+ return mcToolContentHandler.uploadFile(istream, filename, contentType, fileType);
+ }
+
+
+ public NodeKey copyFile(Long uuid) throws RepositoryCheckedException
+ {
+ return mcToolContentHandler.copyFile(uuid);
+ }
+
+ /**
+ * This method verifies the credentials of the SubmitFiles Tool and gives it
+ * the Ticket
to login and access the Content Repository.
+ *
+ * A valid ticket is needed in order to access the content from the
+ * repository. This method would be called evertime the tool needs to
+ * upload/download files from the content repository.
+ *
+ * @return ITicket The ticket for repostory access
+ * @throws SubmitFilesException
+ */
+ public ITicket getRepositoryLoginTicket() throws VoteApplicationException {
+ repositoryService = RepositoryProxy.getRepositoryService();
+ logger.debug("retrieved repositoryService : " + repositoryService);
+
+ ICredentials credentials = new SimpleCredentials(
+ repositoryUser,
+ repositoryId);
+ try {
+ ITicket ticket = repositoryService.login(credentials,
+ repositoryWorkspace);
+ logger.debug("retrieved ticket: " + ticket);
+ return ticket;
+ } catch (AccessDeniedException e) {
+ throw new VoteApplicationException("Access Denied to repository."
+ + e.getMessage());
+ } catch (WorkspaceNotFoundException e) {
+ throw new VoteApplicationException("Workspace not found."
+ + e.getMessage());
+ } catch (LoginException e) {
+ throw new VoteApplicationException("Login failed." + e.getMessage());
+ }
+ }
+
+
+ /**
+ * This method deletes the content with the given uuid
and
+ * versionID
from the content repository
+ *
+ * @param uuid
+ * The uuid
of the node to be deleted
+ * @param versionID
+ * The version_id
of the node to be deleted.
+ * @throws SubmitFilesException
+ */
+ public void deleteFromRepository(Long uuid, Long versionID)
+ throws VoteApplicationException {
+ ITicket ticket = getRepositoryLoginTicket();
+ logger.debug("retrieved ticket: " + ticket);
+ try {
+ String files[] = repositoryService.deleteVersion(ticket, uuid,versionID);
+ logger.debug("retrieved files: " + files);
+ } catch (Exception e) {
+ throw new VoteApplicationException(
+ "Exception occured while deleting files from"
+ + " the repository " + e.getMessage());
+ }
+ }
+
+
+ /**
+ * This method is called everytime a new content has to be added to the
+ * repository. In order to do so first of all a valid ticket is obtained
+ * from the Repository hence authenticating the tool(SubmitFiles) and then
+ * the corresponding file is added to the repository.
+ *
+ * @param stream
+ * The InputStream
representing the data to be
+ * added
+ * @param fileName
+ * The name of the file being added
+ * @param mimeType
+ * The MIME type of the file (eg. TXT, DOC, GIF etc)
+ * @return NodeKey Represents the two part key - UUID and Version.
+ * @throws SubmitFilesException
+ */
+ public NodeKey uploadFileToRepository(InputStream stream, String fileName) throws VoteApplicationException {
+ logger.debug("attempt getting the ticket");
+ ITicket ticket = getRepositoryLoginTicket();
+ logger.debug("retrieved ticket: " + ticket);
+
+ try {
+ NodeKey nodeKey = repositoryService.addFileItem(ticket, stream,
+ fileName, null, null);
+ logger.debug("retrieved nodeKey from repository service: " + nodeKey);
+ return nodeKey;
+ } catch (Exception e) {
+ throw new VoteApplicationException("Exception occured while trying to"
+ + " upload file into the repository" + e.getMessage());
+ }
+ }
+
+ public InputStream downloadFile(Long uuid, Long versionID)throws VoteApplicationException{
+ ITicket ticket = getRepositoryLoginTicket();
+ try{
+ IVersionedNode node = repositoryService.getFileItem(ticket,uuid,null);
+ logger.debug("retrieved node: " + node);
+ return node.getFile();
+ }catch(AccessDeniedException e){
+ throw new VoteApplicationException("AccessDeniedException occured while trying to download file " + e.getMessage());
+ }catch(FileException e){
+ throw new VoteApplicationException("FileException occured while trying to download file " + e.getMessage());
+ }catch(ItemNotFoundException e){
+ throw new VoteApplicationException("ItemNotFoundException occured while trying to download file " + e.getMessage());
+ }
+ }
+
+
+ public void removeOffLineFile(String filename, Long mcContentId) throws VoteApplicationException
+ {
+ try
+ {
+ voteUploadedFileDAO.removeOffLineFile(filename, mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing offline filename"
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public void removeOnLineFile(String filename, Long mcContentId) throws VoteApplicationException
+ {
+ try
+ {
+ voteUploadedFileDAO.removeOnLineFile(filename, mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is removing online filename"
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public boolean isOffLineFilePersisted(String filename) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUploadedFileDAO.isOffLineFilePersisted(filename);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is checking if offline filename is persisted: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public boolean isOnLineFilePersisted(String filename) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUploadedFileDAO.isOnLineFilePersisted(filename);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is checking if online filename is persisted: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public String getFileUuid(String filename) throws VoteApplicationException
+ {
+ try
+ {
+ return voteUploadedFileDAO.getFileUuid(filename);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading uuid by filename: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List getOnlineFilesMetaData(Long mcContentId) throws VoteApplicationException
+ {
+ return voteUploadedFileDAO.getOnlineFilesMetaData(mcContentId);
+ }
+
+
+ public List getOfflineFilesMetaData(Long mcContentId) throws VoteApplicationException
+ {
+ return voteUploadedFileDAO.getOfflineFilesMetaData(mcContentId);
+ }
+
+ public boolean isUuidPersisted(String uuid) throws VoteApplicationException
+ {
+ return voteUploadedFileDAO.isUuidPersisted(uuid);
+ }
+
+ /**
+ * adds a new entry to the uploaded files table
+ */
+ public void persistFile(String uuid, boolean isOnlineFile, String fileName, VoteContent mcContent) 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);
+ }
+
+ /**
+ *
+ * removes all the entries in the uploaded files table
+ */
+ public void cleanUploadedFilesMetaData() throws VoteApplicationException {
+ logger.debug("attempt cleaning up uploaded file meta data table from the db");
+ voteUploadedFileDAO.cleanUploadedFilesMetaData();
+ logger.debug("files meta data has been cleaned up");
+ }
+
+
+ public List retrieveMcUploadedFiles(Long mcContentId, boolean fileOnline) throws VoteApplicationException {
+ try
+ {
+ return voteUploadedFileDAO.retrieveMcUploadedFiles(mcContentId, fileOnline);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+ public List retrieveMcUploadedOfflineFilesUuid(Long mcContentId) throws VoteApplicationException {
+ try
+ {
+ return voteUploadedFileDAO.retrieveMcUploadedOfflineFilesUuid(mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: offline + uuids "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List retrieveMcUploadedOnlineFilesUuid(Long mcContentId) throws VoteApplicationException {
+ try
+ {
+ return voteUploadedFileDAO.retrieveMcUploadedOnlineFilesUuid(mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: online + uuids "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List retrieveMcUploadedOfflineFilesName(Long mcContentId) throws VoteApplicationException {
+ try
+ {
+ return voteUploadedFileDAO.retrieveMcUploadedOfflineFilesName(mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: offline + fileNames "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ public List retrieveMcUploadedOnlineFilesName(Long mcContentId) throws VoteApplicationException {
+ try
+ {
+ return voteUploadedFileDAO.retrieveMcUploadedOnlineFilesName(mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc uploaded files: online + fileNames "
+ + e.getMessage(),
+ e);
+ }
+ }
+
+
+ /*
+ public List retrieveMcUploadedOfflineFilesUuidPlusFilename(Long mcContentId) throws VoteApplicationException {
+ try
+ {
+ return voteUploadedFileDAO.retrieveMcUploadedOfflineFilesUuidPlusFilename(mcContentId);
+ }
+ catch (DataAccessException e)
+ {
+ throw new VoteApplicationException("Exception occured when lams is loading mc uploaded offline file uuid plus filename: "
+ + e.getMessage(),
+ e);
+ }
+ }
+ */
+
+
+ /**
+ * @return Returns the logger.
+ */
+ public static Logger getLogger() {
+ return logger;
+ }
+
+ /**
+ * @return Returns the cred.
+ */
+ public ICredentials getCred() {
+ return cred;
+ }
+ /**
+ * @param cred The cred to set.
+ */
+ public void setCred(ICredentials cred) {
+ this.cred = cred;
+ }
+
+ /*
+ !!! COMPLETE THIS !!!
+ public IQaUploadedFileDAO getQaUploadedFileDAO() {
+ return qaUploadedFileDAO;
+ }
+
+ public void setQaUploadedFileDAO(IQaUploadedFileDAO qaUploadedFileDAO) {
+ this.qaUploadedFileDAO = qaUploadedFileDAO;
+ }
+
+ */
+
+
+ /**
+ * @return Returns the repositoryId.
+ */
+ public char[] getRepositoryId() {
+ return repositoryId;
+ }
+ /**
+ * @return Returns the repositoryUser.
+ */
+ public String getRepositoryUser() {
+ return repositoryUser;
+ }
+ /**
+ * @return Returns the repositoryWorkspace.
+ */
+ public String getRepositoryWorkspace() {
+ return repositoryWorkspace;
+ }
+
+ /**
+ * @return Returns the toolService.
+ */
+ public ILamsToolService getToolService() {
+ return toolService;
+ }
+ /**
+ * @return Returns the userManagementService.
+ */
+ public IUserManagementService getUserManagementService() {
+ return userManagementService;
+ }
+
+ /**
+ * @return Returns the voteSessionDAO.
+ */
+ public IVoteSessionDAO getvoteSessionDAO() {
+ return voteSessionDAO;
+ }
+ /**
+ * @param voteSessionDAO The voteSessionDAO to set.
+ */
+ public void setvoteSessionDAO(IVoteSessionDAO voteSessionDAO) {
+ this.voteSessionDAO = voteSessionDAO;
+ }
+ /**
+ * @return Returns the voteUserDAO.
+ */
+ public IVoteUserDAO getvoteUserDAO() {
+ return voteUserDAO;
+ }
+ /**
+ * @param voteUserDAO The voteUserDAO to set.
+ */
+ public void setvoteUserDAO(IVoteUserDAO voteUserDAO) {
+ this.voteUserDAO = voteUserDAO;
+ }
+ /**
+ * @return Returns the voteUsrAttemptDAO.
+ */
+ public IVoteUsrAttemptDAO getvoteUsrAttemptDAO() {
+ return voteUsrAttemptDAO;
+ }
+ /**
+ * @param voteUsrAttemptDAO The voteUsrAttemptDAO to set.
+ */
+ public void setvoteUsrAttemptDAO(IVoteUsrAttemptDAO voteUsrAttemptDAO) {
+ this.voteUsrAttemptDAO = voteUsrAttemptDAO;
+ }
+
+ /**
+ * @return Returns the repositoryService.
+ */
+ public IRepositoryService getRepositoryService() {
+ return repositoryService;
+ }
+ /**
+ * @param repositoryService The repositoryService to set.
+ */
+ public void setRepositoryService(IRepositoryService repositoryService) {
+ this.repositoryService = repositoryService;
+ }
+
+ public void setUserManagementService(IUserManagementService userManagementService)
+ {
+ this.userManagementService = userManagementService;
+ }
+
+ public void setToolService(ILamsToolService toolService)
+ {
+ this.toolService = toolService;
+ }
+
+ /**
+ * @return Returns the voteUploadedFileDAO.
+ */
+ public IVoteUploadedFileDAO getvoteUploadedFileDAO() {
+ return voteUploadedFileDAO;
+ }
+ /**
+ * @param voteUploadedFileDAO The voteUploadedFileDAO to set.
+ */
+ public void setvoteUploadedFileDAO(IVoteUploadedFileDAO voteUploadedFileDAO) {
+ this.voteUploadedFileDAO = voteUploadedFileDAO;
+ }
+
+ /**
+ * @return Returns the mcToolContentHandler.
+ */
+ public IToolContentHandler getMcToolContentHandler() {
+ return mcToolContentHandler;
+ }
+ /**
+ * @param mcToolContentHandler The mcToolContentHandler to set.
+ */
+ public void setMcToolContentHandler(IToolContentHandler mcToolContentHandler) {
+ this.mcToolContentHandler = mcToolContentHandler;
+ }
+ /**
+ * @return Returns the learnerService.
+ */
+ public ILearnerService getLearnerService() {
+ return learnerService;
+ }
+ /**
+ * @param learnerService The learnerService to set.
+ */
+ public void setLearnerService(ILearnerService learnerService) {
+ this.learnerService = learnerService;
+ }
+ /**
+ * @return Returns the voteContentDAO.
+ */
+ public IVoteContentDAO getvoteContentDAO() {
+ return voteContentDAO;
+ }
+ /**
+ * @param voteContentDAO The voteContentDAO to set.
+ */
+ public void setvoteContentDAO(IVoteContentDAO voteContentDAO) {
+ this.voteContentDAO = voteContentDAO;
+ }
+
+ /**
+ * @return Returns the voteQueContentDAO.
+ */
+ public IVoteQueContentDAO getvoteQueContentDAO() {
+ return voteQueContentDAO;
+ }
+ /**
+ * @param voteQueContentDAO The voteQueContentDAO to set.
+ */
+ public void setvoteQueContentDAO(IVoteQueContentDAO voteQueContentDAO) {
+ this.voteQueContentDAO = voteQueContentDAO;
+ }
+
+
+ /**
+ * @return Returns the voteContentDAO.
+ */
+ public IVoteContentDAO getVoteContentDAO() {
+ return voteContentDAO;
+ }
+ /**
+ * @param voteContentDAO The voteContentDAO to set.
+ */
+ public void setVoteContentDAO(IVoteContentDAO voteContentDAO) {
+ this.voteContentDAO = voteContentDAO;
+ }
+ /**
+ * @return Returns the voteQueContentDAO.
+ */
+ public IVoteQueContentDAO getVoteQueContentDAO() {
+ return voteQueContentDAO;
+ }
+ /**
+ * @param voteQueContentDAO The voteQueContentDAO to set.
+ */
+ public void setVoteQueContentDAO(IVoteQueContentDAO voteQueContentDAO) {
+ this.voteQueContentDAO = voteQueContentDAO;
+ }
+ /**
+ * @return Returns the voteSessionDAO.
+ */
+ public IVoteSessionDAO getVoteSessionDAO() {
+ return voteSessionDAO;
+ }
+ /**
+ * @param voteSessionDAO The voteSessionDAO to set.
+ */
+ public void setVoteSessionDAO(IVoteSessionDAO voteSessionDAO) {
+ this.voteSessionDAO = voteSessionDAO;
+ }
+ /**
+ * @return Returns the voteUploadedFileDAO.
+ */
+ public IVoteUploadedFileDAO getVoteUploadedFileDAO() {
+ return voteUploadedFileDAO;
+ }
+ /**
+ * @param voteUploadedFileDAO The voteUploadedFileDAO to set.
+ */
+ public void setVoteUploadedFileDAO(IVoteUploadedFileDAO voteUploadedFileDAO) {
+ this.voteUploadedFileDAO = voteUploadedFileDAO;
+ }
+ /**
+ * @return Returns the voteUserDAO.
+ */
+ public IVoteUserDAO getVoteUserDAO() {
+ return voteUserDAO;
+ }
+ /**
+ * @param voteUserDAO The voteUserDAO to set.
+ */
+ public void setVoteUserDAO(IVoteUserDAO voteUserDAO) {
+ this.voteUserDAO = voteUserDAO;
+ }
+ /**
+ * @return Returns the voteUsrAttemptDAO.
+ */
+ public IVoteUsrAttemptDAO getVoteUsrAttemptDAO() {
+ return voteUsrAttemptDAO;
+ }
+ /**
+ * @param voteUsrAttemptDAO The voteUsrAttemptDAO to set.
+ */
+ public void setVoteUsrAttemptDAO(IVoteUsrAttemptDAO voteUsrAttemptDAO) {
+ this.voteUsrAttemptDAO = voteUsrAttemptDAO;
+ }
+ /**
+ * @param logger The logger to set.
+ */
+ public static void setLogger(Logger logger) {
+ VoteServicePOJO.logger = logger;
+ }
+
+ /**
+ * @return Returns the voteOptionsContentDAO.
+ */
+ public IVoteOptionsContentDAO getVoteOptionsContentDAO() {
+ return voteOptionsContentDAO;
+ }
+ /**
+ * @param voteOptionsContentDAO The voteOptionsContentDAO to set.
+ */
+ public void setVoteOptionsContentDAO(
+ IVoteOptionsContentDAO voteOptionsContentDAO) {
+ this.voteOptionsContentDAO = voteOptionsContentDAO;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.service;
+
+import javax.servlet.ServletContext;
+
+import org.lamsfoundation.lams.tool.ToolContentManager;
+import org.lamsfoundation.lams.tool.ToolSessionManager;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+
+
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * This class act as the proxy between web layer and service layer. It is
+ * designed to decouple the presentation logic and business logic completely.
+ * In this way, the presentation tier will no longer be aware of the changes in
+ * service layer. Therefore we can feel free to switch the business logic
+ * implementation.
+ */
+public class VoteServiceProxy
+{
+ /**
+ * Return the mc domain service object. It will delegate to the Spring
+ * helper method to retrieve the proper bean from Spring bean factory.
+ * @param servletContext the servletContext for current application
+ * @return mcq service object.
+ */
+ public static final IVoteService getMcService(ServletContext servletContext)
+ {
+ return (IVoteService)getMcDomainService(servletContext);
+ }
+
+ public static final ToolSessionManager getMcSessionManager(ServletContext servletContext)
+ {
+ return (ToolSessionManager)getMcDomainService(servletContext);
+ }
+
+ public static final ToolContentManager getMcContentManager(ServletContext servletContext)
+ {
+ return (ToolContentManager)getMcDomainService(servletContext);
+ }
+
+ private static Object getMcDomainService(ServletContext servletContext)
+ {
+ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
+ return wac.getBean("voteService");
+ }
+
+}
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/util/VoteToolContentHandler.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/util/VoteToolContentHandler.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/util/VoteToolContentHandler.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.util;
+
+import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler;
+
+/**
+ * Simple client for accessing the content repository.
+ *
+ * @author Ozgur Demirtas
+ */
+public class VoteToolContentHandler extends ToolContentHandler {
+
+ private static String repositoryWorkspaceName = "vote11";
+ private final String repositoryUser = "vote11";
+ private final char[] repositoryId = {'v','o','t','e','_','1', '1'};
+
+
+ public VoteToolContentHandler() {
+ super();
+ }
+
+ public String getRepositoryWorkspaceName() {
+ return repositoryWorkspaceName;
+ }
+
+ public String getRepositoryUser() {
+ return repositoryUser;
+ }
+
+ public char[] getRepositoryId() {
+ return repositoryId;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED, -VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,readOnly,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+
+
+
+
+
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,997 @@
+
+
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.web;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.upload.FormFile;
+import org.lamsfoundation.lams.contentrepository.FileException;
+import org.lamsfoundation.lams.contentrepository.NodeKey;
+import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
+import org.lamsfoundation.lams.tool.exception.ToolException;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteAttachmentDTO;
+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.VoteUploadedFile;
+import org.lamsfoundation.lams.tool.vote.service.IVoteService;
+import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+import org.lamsfoundation.lams.web.session.SessionManager;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+
+/**
+ *
+ * Keeps all operations needed for Authoring mode.
+ * @author Ozgur Demirtas
+ *
+ */
+public class AuthoringUtil implements VoteAppConstants {
+ static Logger logger = Logger.getLogger(AuthoringUtil.class.getName());
+
+ public static void readData(HttpServletRequest request, VoteAuthoringForm mcAuthoringForm)
+ {
+ /** define the next tab as Basic tab by default*/
+ request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0));
+
+ VoteUtils.persistRichText(request);
+ AuthoringUtil.populateParameters(request, mcAuthoringForm);
+ }
+
+
+ protected static void populateParameters(HttpServletRequest request, VoteAuthoringForm mcAuthoringForm)
+ {
+ String selectedQuestion=request.getParameter(SELECTED_QUESTION);
+
+ if ((selectedQuestion != null) && (selectedQuestion.length() > 0))
+ {
+ request.getSession().setAttribute(SELECTED_QUESTION,selectedQuestion);
+ logger.debug("updated SELECTED_QUESTION");
+ }
+ }
+
+
+ protected static void setRadioboxes(VoteContent mcContent, VoteAuthoringForm mcAuthoringForm)
+ {
+ if (mcContent.isQuestionsSequenced())
+ {
+ mcAuthoringForm.setQuestionsSequenced(ON);
+ logger.debug("setting questionsSequenced to true");
+ }
+ else
+ {
+ mcAuthoringForm.setQuestionsSequenced(OFF);
+ logger.debug("setting questionsSequenced to false");
+ }
+
+ if (mcContent.isRetries())
+ {
+ mcAuthoringForm.setRetries(ON);
+ logger.debug("setting retries to true");
+ }
+ else
+ {
+ mcAuthoringForm.setRetries(OFF);
+ logger.debug("setting retries to false");
+ }
+
+
+ if (mcContent.isShowReport())
+ {
+ mcAuthoringForm.setSln(ON);
+ logger.debug("setting sln to true");
+ }
+ else
+ {
+ mcAuthoringForm.setSln(OFF);
+ logger.debug("setting sln to false");
+ }
+ }
+
+
+ public static boolean verifyDuplicatesOptionsMap(Map mapOptionsContent)
+ {
+ Map originalMapOptionsContent=mapOptionsContent;
+ Map backupMapOptionsContent=mapOptionsContent;
+
+ int optionCount=0;
+ for (long i=1; i <= MAX_OPTION_COUNT ; i++)
+ {
+ String currentOption=(String)originalMapOptionsContent.get(new Long(i).toString());
+ logger.debug("verified currentOption " + currentOption);
+
+ optionCount=0;
+ for (long j=1; j <= MAX_OPTION_COUNT ; j++)
+ {
+ String backedOption=(String)backupMapOptionsContent.get(new Long(j).toString());
+
+ if ((currentOption != null) && (backedOption !=null))
+ {
+ if (currentOption.equals(backedOption))
+ {
+ optionCount++;
+ logger.debug("optionCount for " + currentOption + " is: " + optionCount);
+ }
+
+ if (optionCount > 1)
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+
+ public static boolean verifyMapNoEmptyString(Map map)
+ {
+ Iterator itMap = map.entrySet().iterator();
+ while (itMap.hasNext()) {
+ Map.Entry pairs = (Map.Entry)itMap.next();
+ logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue());
+
+ if ((pairs.getValue() != null) && (pairs.getValue().toString().length() == 0))
+ return false;
+
+ }
+ return true;
+ }
+
+
+ public static boolean validateQuestionsNotEmpty(Map mapQuestionsContent)
+ {
+ Iterator itMap = mapQuestionsContent.entrySet().iterator();
+ while (itMap.hasNext()) {
+ Map.Entry pairs = (Map.Entry)itMap.next();
+ logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue());
+
+ if ((pairs.getValue() != null) && (pairs.getValue().toString().length() == 0))
+ return false;
+
+ }
+ return true;
+ }
+
+
+ public static Map sequenceMap(Map globalMap)
+ {
+ logger.debug("globalMap:"+ globalMap);
+ Map mapTemp= new TreeMap(new VoteComparator());
+
+ long mapCounter=0;
+ Iterator itMap = globalMap.entrySet().iterator();
+ while (itMap.hasNext()) {
+ Map.Entry pairs = (Map.Entry)itMap.next();
+ logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue());
+ Map optionsMap=(Map)pairs.getValue();
+ logger.debug("optionsMap:"+ optionsMap);
+ mapCounter++;
+ mapTemp.put(new Long(mapCounter).toString(), optionsMap);
+ }
+
+ logger.debug("final mapTemp:"+ mapTemp);
+ return mapTemp;
+ }
+
+
+ public static Map repopulateMap(HttpServletRequest request, String parameterType)
+ {
+ Map mapTempQuestionsContent= new TreeMap(new VoteComparator());
+ logger.debug("parameterType: " + parameterType);
+
+ long mapCounter=0;
+ for (long i=1; i <= MAX_QUESTION_COUNT ; i++)
+ {
+ String candidateEntry =request.getParameter(parameterType + i);
+ if (
+ (candidateEntry != null) &&
+ (candidateEntry.length() > 0)
+ )
+ {
+ mapCounter++;
+ mapTempQuestionsContent.put(new Long(mapCounter).toString(), candidateEntry);
+ }
+ }
+ logger.debug("return repopulated Map: " + mapTempQuestionsContent);
+ return mapTempQuestionsContent;
+ }
+
+
+ /**
+ * returns the value of the entry for a given index
+ * getRequiredWeightEntry(Map mapWeights, String questionIndex)
+ *
+ * @param mapWeights
+ * @param questionIndex
+ * @return
+ */
+ public static String getRequiredWeightEntry(Map mapWeights, String questionIndex)
+ {
+ logger.debug("mapWeights: " + mapWeights);
+
+ Iterator itMap = mapWeights.entrySet().iterator();
+ while (itMap.hasNext()) {
+ Map.Entry pairs = (Map.Entry)itMap.next();
+ logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue());
+ if (questionIndex.equals(pairs.getKey().toString()))
+ {
+ String weight=pairs.getValue().toString();
+ logger.debug("required weight:" + weight);
+ return weight;
+ }
+ }
+ return null;
+ }
+
+
+
+
+ /**
+ * removes options from mapGlobalOptionsContent
+ * removeFromOptionsMap(Map mapGlobalOptionsContent, String questionIndex )
+ *
+ * @param mapGlobalOptionsContent
+ * @param questionIndex
+ * @param direction
+ * @return Map
+ */
+ public static Map removeFromMap(Map mapContent, String index)
+ {
+ /* mapGlobalOptionsContent refers to mapGenaralOptionsContent and mapGeneralSelectedlOptionsContent */
+ /* map to be returned */
+ Map mapTempContent= new TreeMap(new VoteComparator());
+ mapTempContent= mapContent;
+
+ mapTempContent.remove(index);
+ logger.debug("entry at index removed from mapTempContent...");
+
+ logger.debug("final mapTempContent: " + mapTempContent);
+ return mapTempContent;
+ }
+
+
+
+ public static VoteContent createContent(HttpServletRequest request, VoteAuthoringForm mcAuthoringForm)
+ {
+ 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 */
+ 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);
+ logger.debug("post-deletion existing content");
+ }
+
+ String title;
+ String instructions;
+ Long createdBy;
+ String monitoringReportTitle="";
+ String reportTitle="";
+
+ String offlineInstructions="";
+ String onlineInstructions="";
+ String endLearningMessage="";
+ Date creationDate=null;
+ int passmark=0;
+
+ boolean isQuestionsSequenced=false;
+ boolean isSynchInMonitor=false;
+ boolean isUsernameVisible=false;
+ boolean isRunOffline=false;
+ boolean isDefineLater=false;
+ boolean isContentInUse=false;
+ boolean isRetries=false;
+ boolean isShowFeedback=false;
+ boolean isSln=false;
+
+ logger.debug("isQuestionsSequenced: " + mcAuthoringForm.getQuestionsSequenced());
+ if (mcAuthoringForm.getQuestionsSequenced().equalsIgnoreCase(ON))
+ isQuestionsSequenced=true;
+
+ logger.debug("isSynchInMonitor: " + mcAuthoringForm.getSynchInMonitor());
+ if (mcAuthoringForm.getSynchInMonitor().equalsIgnoreCase(ON))
+ isSynchInMonitor=true;
+
+ logger.debug("isUsernameVisible: " + mcAuthoringForm.getUsernameVisible());
+ if (mcAuthoringForm.getUsernameVisible().equalsIgnoreCase(ON))
+ isUsernameVisible=true;
+
+ logger.debug("isRetries: " + mcAuthoringForm.getRetries());
+ if (mcAuthoringForm.getRetries().equalsIgnoreCase(ON))
+ isRetries=true;
+
+ logger.debug("isSln" + mcAuthoringForm.getSln());
+ if (mcAuthoringForm.getSln().equalsIgnoreCase(ON))
+ isSln=true;
+
+ logger.debug("passmark: " + mcAuthoringForm.getPassmark());
+ if ((mcAuthoringForm.getPassmark() != null) && (mcAuthoringForm.getPassmark().length() > 0))
+ passmark= new Integer(mcAuthoringForm.getPassmark()).intValue();
+
+ logger.debug("isShowFeedback: " + mcAuthoringForm.getShowFeedback());
+ if (mcAuthoringForm.getShowFeedback().equalsIgnoreCase(ON))
+ isShowFeedback=true;
+
+
+ String richTextTitle="";
+ richTextTitle = (String)request.getSession().getAttribute(RICHTEXT_TITLE);
+ logger.debug("createContent richTextTitle from session: " + richTextTitle);
+ if (richTextTitle == null) richTextTitle="";
+
+ String richTextInstructions="";
+ richTextInstructions = (String)request.getSession().getAttribute(RICHTEXT_INSTRUCTIONS);
+ logger.debug("createContent richTextInstructions from session: " + richTextInstructions);
+ if (richTextInstructions == null) richTextInstructions="";
+
+ String richTextOfflineInstructions="";
+ richTextOfflineInstructions = (String)request.getSession().getAttribute(RICHTEXT_OFFLINEINSTRUCTIONS);
+ logger.debug("createContent richTextOfflineInstructions from session: " + richTextOfflineInstructions);
+ if (richTextOfflineInstructions == null) richTextOfflineInstructions="";
+
+ String richTextOnlineInstructions="";
+ richTextOnlineInstructions = (String)request.getSession().getAttribute(RICHTEXT_ONLINEINSTRUCTIONS);
+ logger.debug("createContent richTextOnlineInstructions from session: " + richTextOnlineInstructions);
+ if (richTextOnlineInstructions == null) richTextOnlineInstructions="";
+
+
+ String richTextReportTitle=(String)request.getSession().getAttribute(RICHTEXT_REPORT_TITLE);
+ logger.debug("richTextReportTitle: " + richTextReportTitle);
+
+ String richTextEndLearningMessage=(String)request.getSession().getAttribute(RICHTEXT_END_LEARNING_MSG);
+ logger.debug("richTextEndLearningMessage: " + richTextEndLearningMessage);
+
+ creationDate=(Date)request.getSession().getAttribute(CREATION_DATE);
+ if (creationDate == null)
+ creationDate=new Date(System.currentTimeMillis());
+
+ logger.debug("using creationDate: " + creationDate);
+
+ /*obtain user object from the session*/
+ HttpSession ss = SessionManager.getSession();
+ /* get back login user DTO */
+ UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ logger.debug("retrieving toolUser: " + toolUser);
+ logger.debug("retrieving toolUser userId: " + toolUser.getUserID());
+ String fullName= toolUser.getFirstName() + " " + toolUser.getLastName();
+ logger.debug("retrieving toolUser fullname: " + fullName);
+ long userId=toolUser.getUserID().longValue();
+ logger.debug("userId: " + userId);
+
+ /* create a new qa content and leave the default content intact*/
+ VoteContent mc = new VoteContent();
+ mc.setVoteContentId(toolContentId);
+ mc.setTitle(richTextTitle);
+ mc.setInstructions(richTextInstructions);
+ mc.setCreationDate(creationDate); /*preserve this from the db*/
+ mc.setUpdateDate(new Date(System.currentTimeMillis())); /* keep updating this one*/
+ mc.setCreatedBy(userId); /* make sure we are setting the userId from the User object above*/
+ mc.setUsernameVisible(isUsernameVisible);
+ mc.setQuestionsSequenced(isQuestionsSequenced); /* the default question listing in learner mode will be all in the same page*/
+ mc.setOnlineInstructions(richTextOnlineInstructions);
+ mc.setOfflineInstructions(richTextOfflineInstructions);
+ mc.setRunOffline(false);
+ mc.setDefineLater(false);
+ mc.setContentInUse(isContentInUse);
+ mc.setEndLearningMessage("Thanks");
+ mc.setRunOffline(isRunOffline);
+ mc.setReportTitle(richTextReportTitle);
+ mc.setMonitoringReportTitle(monitoringReportTitle);
+ mc.setEndLearningMessage(richTextEndLearningMessage);
+ mc.setRetries(isRetries);
+ mc.setShowReport(isSln);
+ mc.setVoteQueContents(new TreeSet());
+ mc.setVoteSessions(new TreeSet());
+ logger.debug("mc content :" + mc);
+
+ /*create the content in the db*/
+ mcService.createMc(mc);
+ logger.debug("mc created with content id: " + toolContentId);
+
+ return mc;
+ }
+
+
+ public static Map mergeMaps(Map map1, Map map2)
+ {
+ Map mapMergedMap= new TreeMap(new VoteComparator());
+ logger.debug("merging maps now...");
+
+ Iterator itMap1 = map1.entrySet().iterator();
+ while (itMap1.hasNext())
+ {
+ Map.Entry pairs = (Map.Entry)itMap1.next();
+ logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue());
+ mapMergedMap.put(pairs.getKey(), pairs.getValue());
+ }
+
+ logger.debug("adding the other map...");
+ Iterator itMap2 = map2.entrySet().iterator();
+ while (itMap2.hasNext())
+ {
+ Map.Entry pairs = (Map.Entry)itMap2.next();
+ logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue());
+ mapMergedMap.put(pairs.getKey(), pairs.getValue());
+ }
+
+ logger.debug("final merged map: " + mapMergedMap);
+ return mapMergedMap;
+ }
+
+
+
+ public static boolean isOptionSelected(Map mapGeneralSelectedOptionsContent, String optionText, String questionIndex)
+ {
+ Iterator itGSOMap = mapGeneralSelectedOptionsContent.entrySet().iterator();
+ logger.debug("questionIndex: " + questionIndex);
+ logger.debug("optionText: " + optionText);
+ while (itGSOMap.hasNext())
+ {
+ Map.Entry pairs = (Map.Entry)itGSOMap.next();
+ if (pairs.getKey().toString().equals(questionIndex))
+ {
+ Map currentOptionsMap= (Map)pairs.getValue();
+ logger.debug("currentOptionsMap: " + currentOptionsMap);
+ boolean isOptionSelectedInMap=isOptionSelectedInMap(optionText, currentOptionsMap);
+ logger.debug("isOptionSelectedInMap: " + isOptionSelectedInMap);
+ return isOptionSelectedInMap;
+ }
+ }
+ return false;
+ }
+
+
+ public static boolean isOptionSelectedInMap(String optionText, Map currentOptionsMap)
+ {
+ logger.debug("optionText: " + optionText);
+ Iterator itCOMap = currentOptionsMap.entrySet().iterator();
+ while (itCOMap.hasNext())
+ {
+ Map.Entry pairs = (Map.Entry)itCOMap.next();
+ if (pairs.getValue().toString().equals(optionText))
+ {
+ logger.debug("option text found in the map: " + optionText);
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ public static void assignStaterMapsToCurrentMaps(HttpServletRequest request)
+ {
+ logger.debug("assigning maps..");
+ Map mapStartupGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_STARTUP_GENERAL_OPTIONS_CONTENT);
+ logger.debug("mapStartupGeneralOptionsContent: " + mapStartupGeneralOptionsContent);
+
+ Map mapStartupGeneralSelectedOptionsContent=(Map) request.getSession().getAttribute(MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT);
+ logger.debug("mapStartupGeneralSelectedOptionsContent: " + mapStartupGeneralSelectedOptionsContent);
+
+ request.getSession().setAttribute(MAP_GENERAL_OPTIONS_CONTENT, mapStartupGeneralOptionsContent);
+ request.getSession().setAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT, mapStartupGeneralSelectedOptionsContent);
+ }
+
+
+ public static VoteAttachmentDTO uploadFile(HttpServletRequest request, VoteAuthoringForm mcAuthoringForm, boolean isOfflineFile) throws RepositoryCheckedException
+ {
+ logger.debug("doing uploadFile...");
+ logger.debug("isOfflineFile:" + isOfflineFile);
+
+ InputStream stream=null;
+ String fileName=null;
+ String mimeType=null;
+ String fileProperty=null;
+
+ if (isOfflineFile)
+ {
+ FormFile theOfflineFile = mcAuthoringForm.getTheOfflineFile();
+ logger.debug("retrieved theOfflineFile: " + theOfflineFile);
+
+ try
+ {
+ stream = theOfflineFile.getInputStream();
+ fileName=theOfflineFile.getFileName();
+ if (fileName.length() == 0)
+ {
+ return null;
+ }
+ logger.debug("retrieved fileName: " + fileName);
+ fileProperty="OFFLINE";
+
+ }
+ catch(FileNotFoundException e)
+ {
+ logger.debug("filenotfound exception occured in accessing the repository server for the offline file : " + e.getMessage());
+ }
+ catch(IOException e)
+ {
+ logger.debug("io exception occured in accessing the repository server for the offline file : " + e.getMessage());
+ }
+
+ if (fileName.length() > 0)
+ {
+ List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES);
+ logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames);
+ int index=findFileNameIndex(listUploadedOfflineFileNames, fileName);
+ logger.debug("index:" + index);
+ if (index == 0)
+ {
+ listUploadedOfflineFileNames.add(fileName);
+ logger.debug("listUploadedOfflineFileNames after add :" + listUploadedOfflineFileNames);
+ request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames);
+ }
+ }
+
+ }
+ else
+ {
+ FormFile theOnlineFile = mcAuthoringForm.getTheOnlineFile();
+ logger.debug("retrieved theOnlineFile: " + theOnlineFile);
+
+ try
+ {
+ stream = theOnlineFile.getInputStream();
+ fileName=theOnlineFile.getFileName();
+
+ if (fileName.length() == 0)
+ {
+ return null;
+ }
+
+ logger.debug("retrieved fileName: " + fileName);
+ fileProperty="ONLINE";
+
+ }
+ catch(FileNotFoundException e)
+ {
+ logger.debug("filenotfound exception occured in accessing the repository server for the online file : " + e.getMessage());
+ }
+ catch(IOException e)
+ {
+ logger.debug("io exception occured in accessing the repository server for the online file : " + e.getMessage());
+ }
+
+ if (fileName.length() > 0)
+ {
+ List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES);
+ logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames);
+ int index=findFileNameIndex(listUploadedOnlineFileNames, fileName);
+ logger.debug("index:" + index);
+ if (index == 0)
+ {
+ listUploadedOnlineFileNames.add(fileName);
+ logger.debug("listUploadedOnlineFileNames after add :" + listUploadedOnlineFileNames);
+ request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames);
+ }
+ }
+ }
+
+ IVoteService mcService =VoteUtils.getToolService(request);
+ logger.debug("calling uploadFile with:");
+ logger.debug("istream:" + stream);
+ logger.debug("filename:" + fileName);
+ logger.debug("mimeType:" + mimeType);
+ logger.debug("fileProperty:" + fileProperty);
+
+ NodeKey nodeKey=null;
+ try{
+ nodeKey=mcService.uploadFile(stream, fileName, mimeType, fileProperty);
+ logger.debug("nodeKey:" + nodeKey);
+ logger.debug("nodeKey uuid:" + nodeKey.getUuid());
+ }
+ catch(FileException e)
+ {
+ logger.debug("exception writing raw data:" + e);
+ /* return a null dto*/
+ return null;
+ }
+
+ VoteAttachmentDTO mcAttachmentDTO= new VoteAttachmentDTO();
+ mcAttachmentDTO.setUid(null);
+ mcAttachmentDTO.setUuid(nodeKey.getUuid().toString());
+ mcAttachmentDTO.setFilename(fileName);
+ mcAttachmentDTO.setOfflineFile(isOfflineFile);
+
+ return mcAttachmentDTO;
+ }
+
+
+ public static List populateMetaDataAsAttachments(List listOfflineFilesMetaData)
+ {
+ List listAttachments=new LinkedList();
+
+ Iterator itList = listOfflineFilesMetaData.iterator();
+ while (itList.hasNext())
+ {
+ VoteUploadedFile mcUploadedFile=(VoteUploadedFile)itList.next();
+ logger.debug("mcUploadedFile:" + mcUploadedFile);
+ logger.debug("mcUploadedFile details, uid" + mcUploadedFile.getUid().toString());
+ logger.debug("mcUploadedFile details, uuid" + mcUploadedFile.getUuid());
+ logger.debug("mcUploadedFile details, filename" + mcUploadedFile.getFilename());
+ logger.debug("mcUploadedFile details, isOfflineFile" + !mcUploadedFile.isFileOnline());
+
+ VoteAttachmentDTO mcAttachmentDTO= new VoteAttachmentDTO();
+ mcAttachmentDTO.setUid(mcUploadedFile.getUid().toString());
+ mcAttachmentDTO.setUuid(mcUploadedFile.getUuid());
+ mcAttachmentDTO.setFilename(mcUploadedFile.getFilename());
+ mcAttachmentDTO.setOfflineFile(!mcUploadedFile.isFileOnline());
+
+ listAttachments.add(mcAttachmentDTO);
+ logger.debug("listAttachments after add" + listAttachments);
+ }
+ logger.debug("final listAttachments after populating all: " + listAttachments);
+ return listAttachments;
+ }
+
+
+ public static List populateMetaDataAsFilenames(List listFilesMetaData)
+ {
+ List listFilenames=new LinkedList();
+
+ Iterator itList = listFilesMetaData.iterator();
+ while (itList.hasNext())
+ {
+ VoteAttachmentDTO mcAttachmentDTO=(VoteAttachmentDTO)itList.next();
+ logger.debug("current filename" + mcAttachmentDTO.getFilename());
+ listFilenames.add(mcAttachmentDTO.getFilename());
+ logger.debug("listFilenames after add" + listFilenames);
+ }
+ logger.debug("final listFilenames after populating all: " + listFilenames);
+ return listFilenames;
+ }
+
+
+ public static void removeFileItem(HttpServletRequest request, String filename, String offlineFile)
+ {
+ logger.debug("offlineFile:" + offlineFile);
+ if (offlineFile.equals("1"))
+ {
+ logger.debug("will remove an offline file");
+ List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES);
+ logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames);
+
+ listUploadedOfflineFileNames.remove(filename);
+ logger.debug("removed offline filename:" + filename);
+
+ logger.debug("listUploadedOfflineFileNames after remove :" + listUploadedOfflineFileNames);
+ request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames);
+ }
+ else
+ {
+ logger.debug("will remove an online file");
+ List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES);
+ logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames);
+
+ listUploadedOnlineFileNames.remove(filename);
+ logger.debug("removed online filename:" + filename);
+
+ logger.debug("listUploadedOnlineFileNames after remove :" + listUploadedOnlineFileNames);
+ request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames);
+ }
+ }
+
+
+ /**
+ * findFileNameIndex(List listUploadedFileNames, String filename)
+ *
+ * @param listUploadedFileNames
+ * @param filename
+ * @return int
+ */
+ public static int findFileNameIndex(List listUploadedFileNames, String filename)
+ {
+ Iterator itListUploadedFileNames = listUploadedFileNames.iterator();
+ int mainIndex=0;
+ while (itListUploadedFileNames.hasNext())
+ {
+ mainIndex++;
+ String currentFilename=(String) itListUploadedFileNames.next();
+ logger.debug("currentFilename :" + currentFilename);
+ if (currentFilename.equals(filename))
+ {
+ logger.debug("currentFilename found in the list at mainIndex :" + mainIndex);
+ return mainIndex;
+ }
+ }
+ return 0;
+ }
+
+
+ /**
+ * removeFileItem(List listFilesMetaData, String uuid)
+ *
+ * @param listFilesMetaData
+ * @param uuid
+ * @return List
+ */
+ public static List removeFileItem(List listFilesMetaData, String uuid)
+ {
+ VoteAttachmentDTO deletableAttachmentDTO=null;
+
+ Iterator itList = listFilesMetaData.iterator();
+ int mainIndex=0;
+ while (itList.hasNext())
+ {
+ mainIndex++;
+ VoteAttachmentDTO currentAttachmentDTO=(VoteAttachmentDTO) itList.next();
+ logger.debug("currentAttachmentDTO :" + currentAttachmentDTO);
+ logger.debug("currentAttachmentDTO uuid :" + currentAttachmentDTO.getUuid());
+
+ if (currentAttachmentDTO.getUuid().equals(uuid))
+ {
+ logger.debug("equal uuid found uuid :" + uuid);
+ deletableAttachmentDTO=currentAttachmentDTO;
+ break;
+ }
+ }
+
+ logger.debug("equal uuid found at index :" + mainIndex);
+ logger.debug("deletable attachment is:" + deletableAttachmentDTO);
+
+ listFilesMetaData.remove(deletableAttachmentDTO);
+ logger.debug("listOfflineFilesMetaData after remove:" + listFilesMetaData);
+
+ return listFilesMetaData;
+ }
+
+
+ public static void persistFilesMetaData(HttpServletRequest request, boolean isOfflineFile, VoteContent mcContent)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+
+ List listFilesMetaData=null;
+ logger.debug("doing persistFilesMetaData...");
+ logger.debug("isOfflineFile:" + isOfflineFile);
+
+ if (isOfflineFile)
+ {
+ listFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA);
+ }
+ else
+ {
+ listFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA);
+ }
+ logger.debug("listFilesMetaData:" + listFilesMetaData);
+
+ Iterator itListFilesMetaData = listFilesMetaData.iterator();
+ while (itListFilesMetaData.hasNext())
+ {
+ VoteAttachmentDTO mcAttachmentDTO=(VoteAttachmentDTO)itListFilesMetaData.next();
+ logger.debug("mcAttachmentDTO:" + mcAttachmentDTO);
+ String uid=mcAttachmentDTO.getUid();
+ logger.debug("uid:" + uid);
+
+ String uuid=mcAttachmentDTO.getUuid();
+ boolean isOnlineFile=!mcAttachmentDTO.isOfflineFile();
+ String fileName=mcAttachmentDTO.getFilename();
+
+ if (uid == null)
+ {
+ logger.debug("persisting files metadata...");
+ if (!mcService.isUuidPersisted(uuid))
+ {
+ mcService.persistFile(uuid, isOnlineFile, fileName, mcContent);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * extractFileNames(List listFilesMetaData)
+ *
+ * @param listFilesMetaData
+ * @return List
+ */
+ public static List extractFileNames(List listFilesMetaData)
+ {
+ Iterator itList = listFilesMetaData.iterator();
+ LinkedList listFilenames= new LinkedList();
+
+ while (itList.hasNext())
+ {
+ VoteAttachmentDTO mcAttachmentDTO=(VoteAttachmentDTO)itList.next();
+ String filename=mcAttachmentDTO.getFilename();
+ logger.debug("extracted filename: " + filename);
+ listFilenames.add(filename);
+ }
+ logger.debug("final extracted listFilenames: " + listFilenames);
+ return listFilenames;
+ }
+
+
+ public static void removeRedundantOfflineFileItems(HttpServletRequest request, VoteContent mcContent)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+
+ List allOfflineFilenames=mcService.retrieveMcUploadedOfflineFilesName(mcContent.getUid());
+ logger.debug("allOfflineFilenames:" + allOfflineFilenames);
+
+ List listOfflineFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA);
+ logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData);
+
+ List listUploadedOfflineFileNames=extractFileNames(listOfflineFilesMetaData);
+ logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames);
+
+ boolean matchFound=false;
+ Iterator itAllOfflineFiles = allOfflineFilenames.iterator();
+ while (itAllOfflineFiles.hasNext())
+ {
+ String filename =(String)itAllOfflineFiles.next();
+ logger.debug("filename: " + filename);
+
+ matchFound=false;
+ Iterator itFiles = listUploadedOfflineFileNames.iterator();
+ while (itFiles.hasNext())
+ {
+ matchFound=false;
+ String currentFilename =(String)itFiles.next();
+ logger.debug("currentFilename: " + currentFilename);
+
+ if (filename.equals(currentFilename))
+ {
+ logger.debug("filename match found : " + currentFilename);
+ matchFound=true;
+ break;
+ }
+ }
+
+ logger.debug("matchFound : " + matchFound);
+ if (matchFound == false)
+ {
+ logger.debug("matchFound is false for filename: " + filename);
+ mcService.removeOffLineFile(filename, mcContent.getUid());
+ logger.debug("filename removed: " + filename);
+ }
+ }
+ }
+
+
+ public static void removeRedundantOnlineFileItems(HttpServletRequest request, VoteContent mcContent)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+
+ List allOnlineFilenames=mcService.retrieveMcUploadedOnlineFilesName(mcContent.getUid());
+ logger.debug("allOnlineFilenames:" + allOnlineFilenames);
+
+ List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA);
+ logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData);
+
+ List listUploadedOnlineFileNames=extractFileNames(listOnlineFilesMetaData);
+ logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames);
+
+
+ boolean matchFound=false;
+ Iterator itAllOnlineFiles = allOnlineFilenames.iterator();
+ while (itAllOnlineFiles.hasNext())
+ {
+ String filename =(String)itAllOnlineFiles.next();
+ logger.debug("filename: " + filename);
+
+ matchFound=false;
+ Iterator itFiles = listUploadedOnlineFileNames.iterator();
+ while (itFiles.hasNext())
+ {
+ matchFound=false;
+ String currentFilename =(String)itFiles.next();
+ logger.debug("currentFilename: " + currentFilename);
+
+ if (filename.equals(currentFilename))
+ {
+ logger.debug("filename match found : " + currentFilename);
+ matchFound=true;
+ break;
+ }
+ }
+
+ logger.debug("matchFound : " + matchFound);
+ if (matchFound == false)
+ {
+ logger.debug("matchFound is false for filename: " + filename);
+ mcService.removeOnLineFile(filename, mcContent.getUid());
+ logger.debug("filename removed: " + filename);
+ }
+ }
+ }
+
+ /**
+ * simulatePropertyInspector_RunOffline(HttpServletRequest request)
+ * @param request
+ */
+ public void simulatePropertyInspector_RunOffline(HttpServletRequest request)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+
+ String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID);
+ if ((toolContentId != null) && (!toolContentId.equals("")))
+ {
+ logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId));
+ try
+ {
+ mcService.setAsRunOffline(new Long(toolContentId));
+ }
+ catch(ToolException e)
+ {
+ logger.debug("we should never come here");
+ }
+
+ logger.debug("post-RunAsOffline");
+ }
+ logger.debug("end of simulating RunOffline on content id: " + toolContentId);
+ }
+
+ /**
+ * Normally, a request to set defineLaterproperty of the content comes directly from container through the property inspector.
+ * What we do below is simulate that for development purposes.
+ * @param request
+ */
+ public void simulatePropertyInspector_setAsDefineLater(HttpServletRequest request)
+ {
+ IVoteService mcService =VoteUtils.getToolService(request);
+
+ String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID);
+ if ((toolContentId != null) && (!toolContentId.equals("")))
+ {
+ logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId));
+ try
+ {
+ mcService.setAsDefineLater(new Long(toolContentId));
+ }
+ catch(ToolException e)
+ {
+ logger.debug("we should never come here");
+ }
+
+ logger.debug("post-setAsDefineLater");
+ }
+ logger.debug("end of simulating setAsDefineLater on content id: " + toolContentId);
+ }
+
+
+ /**
+ * cleans up authoring http session
+ * cleanupAuthoringSession(HttpServletRequest request)
+ * @param request
+ */
+ public static void cleanupAuthoringSession(HttpServletRequest request)
+ {
+
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/CustomStrutsExceptionHandler.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/CustomStrutsExceptionHandler.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/CustomStrutsExceptionHandler.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,87 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ExceptionHandler;
+import org.apache.struts.config.ExceptionConfig;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+
+/**
+ * Struts action level exception handler
+ * @author Ozgur Demirtas
+ */
+public class CustomStrutsExceptionHandler extends ExceptionHandler {
+ private static Logger logger = Logger.getLogger(CustomStrutsExceptionHandler.class);
+
+ public ActionForward execute(Exception ex,
+ ExceptionConfig ae,
+ ActionMapping mapping,
+ ActionForm formInstance,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ {
+ logger.error("fatal System exception: [" + ex.getMessage() + "] ", ex);
+ ActionForward forward = null;
+ String property = null;
+
+ /*
+ * Get the path for the forward either from the exception element or
+ * from the input attribute.
+ */
+
+ String path = null;
+ if (ae.getPath() != null)
+ {
+ path = ae.getPath();
+ }
+ else
+ {
+ path = mapping.getInput();
+ }
+ logger.error("path: " + path);
+ forward = new ActionForward(path);
+ logger.error("forward: " + forward);
+
+ /* some exceptions do have null messages, so be careful! */
+ String exceptionMessage = ex.getMessage();
+ logger.error("exceptionMessage: " + exceptionMessage);
+ String errorMessage = exceptionMessage == null || exceptionMessage.equals("null") ? ex.getClass().getName() : ex.getMessage();
+ logger.error("errorMessage: " + errorMessage);
+ ActionMessage error = null;
+ if (VoteApplicationException.class.isInstance(ex) ) {
+ error = new ActionMessage(VoteAppConstants.ERROR_VOTEAPPLICATION, errorMessage );
+ }
+ storeException(request, property, error, forward, ae.getScope( ));
+ /* process the exception as normal */
+ return forward;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+
+/**
+ *
+ * Keeps all operations needed for Learning mode.
+ * @author Ozgur Demirtas
+ *
+ */
+public class LearningUtil implements VoteAppConstants {
+ static Logger logger = Logger.getLogger(LearningUtil.class.getName());
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+
+/**
+ *
+ * Keeps all operations needed for Monitoring mode.
+ * @author Ozgur Demirtas
+ *
+ */
+public class MonitoringUtil implements VoteAppConstants{
+ static Logger logger = Logger.getLogger(MonitoringUtil.class.getName());
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,134 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.tool.vote.service.IVoteService;
+import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+
+/**
+ * * @author Ozgur Demirtas
+ *
+ * Action class that controls the logic of tool behavior.
+ *
+ * Note that Struts action class only has the responsibility to navigate
+ * page flow. All database operation should go to service layer and data
+ * transformation from domain model to struts form bean should go to form
+ * bean class. This ensure clean and maintainable code.
+ *
+ *
+ * SystemException
is thrown whenever an known error condition is
+ * identified. No system exception error handling code should appear in the
+ * Struts action class as all of them are handled in
+ * CustomStrutsExceptionHandler.
+ *
+
+
+*/
+public class VoteAction extends LamsDispatchAction implements VoteAppConstants
+{
+ /*
+ * when to reset define later and synchin monitor etc..
+ *
+ * make sure the tool gets called on:
+ * setAsForceComplete(Long userId) throws VoteApplicationException
+ */
+ static Logger logger = Logger.getLogger(VoteAction.class.getName());
+
+ /**
+ * Default struts dispatch method.
+ *
+ * It is assuming that progress engine should pass in the tool access
+ * mode and the tool session id as http parameters.
+ *
+ * @param mapping An ActionMapping class that will be used by the Action class to tell
+ * the ActionServlet where to send the end-user.
+ *
+ * @param form The ActionForm class that will contain any data submitted
+ * by the end-user via a form.
+ * @param request A standard Servlet HttpServletRequest class.
+ * @param response A standard Servlet HttpServletResponse class.
+ * @return An ActionForward class that will be returned to the ActionServlet indicating where
+ * the user is to go next.
+ * @throws IOException
+ * @throws ServletException
+ * @throws VoteApplicationException the known runtime exception
+ *
+ * unspecified(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException
+
+ * main content/question content management and workflow logic
+ *
+ * if the passed toolContentId exists in the db, we need to get the relevant data into the Map
+ * if not, create the default Map
+ */
+ public ActionForward unspecified(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ VoteAuthoringForm mcAuthoringForm = (VoteAuthoringForm) form;
+ IVoteService mcService =VoteUtils.getToolService(request);
+ AuthoringUtil.readData(request, mcAuthoringForm);
+ mcAuthoringForm.resetUserAction();
+
+
+ request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0));
+ return null;
+ }
+
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
+
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,823 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import org.apache.struts.upload.FormFile;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * ActionForm for the Authoring environment
+ */
+public class VoteAuthoringForm extends VoteLearningForm implements VoteAppConstants {
+ /* form controllers */
+ protected String addOptionContent;
+ protected String currentTab;
+
+ protected String questionIndex;
+ protected String optionIndex;
+ protected String selectedIndex;
+ protected String deletableOptionIndex;
+
+ protected String editDefaultQuestion;
+ protected String removeOptionContent;
+
+ protected String fileItem;
+ protected String uuid;
+
+ protected FormFile receivedFile;
+ protected String offlineFile;
+
+ protected String addContent;
+ protected String removeContent;
+ protected String removeAllContent;
+ protected String submitAllContent;
+ protected String submitTabDone;
+ protected String submitOfflineFile;
+ protected String submitOnlineFile;
+
+ // dispatch controls which method is called by the Lookup map */
+ protected String dispatch;
+
+ /* tab controller, these may go away once the Flash wraps the jsp */
+ protected String choice;
+ protected String choiceBasic;
+ protected String choiceAdvanced;
+ protected String choiceInstructions;
+
+ protected String submit;
+
+ /* basic content */
+ protected String title;
+ protected String instructions;
+
+ protected String isRemoveContent;
+ protected String toolContentId;
+ protected String toolContentID;
+
+ /* instructions content */
+ protected String onlineInstructions;
+ protected String offlineInstructions;
+ protected FormFile theOfflineFile;
+ protected FormFile theOnlineFile;
+
+ protected String richTextOfflineInstructions;
+ protected String richTextOnlineInstructions;
+
+ /* advanced content */
+ protected String synchInMonitor;
+ protected String showFeedback;
+ protected String retries;
+ protected String sln;
+
+ protected String passmark;
+
+ protected String reportTitle;
+ protected String monitoringReportTitle;
+ protected String endLearningMessage;
+ protected String usernameVisible;
+ protected String questionsSequenced;
+
+ /* proxy controllers for Monitoring tabs */
+ protected String summaryMonitoring;
+ protected String instructionsMonitoring;
+ protected String editActivityMonitoring;
+ protected String statsMonitoring;
+
+ protected String edit;
+
+ public void resetUserAction()
+ {
+ this.editDefaultQuestion=null;
+ this.addOptionContent=null;
+ this.removeOptionContent=null;
+
+ this.fileItem=null;
+
+ this.addContent=null;
+ this.removeContent=null;
+ this.removeAllContent=null;
+ this.submitAllContent=null;
+ this.submitTabDone=null;
+ this.submitOfflineFile=null;
+ this.submitOnlineFile=null;
+
+ this.dispatch=null;
+
+ this.summaryMonitoring=null;
+ this.instructionsMonitoring=null;
+ this.editActivityMonitoring=null;
+ this.statsMonitoring=null;
+ this.edit=null;
+ this.submit=null;
+ }
+
+ public void reset()
+ {
+ this.editDefaultQuestion=null;
+ this.addOptionContent=null;
+ this.removeOptionContent=null;
+
+ this.fileItem=null;
+ this.uuid=null;
+ this.receivedFile=null;
+
+ this.addContent=null;
+ this.removeContent=null;
+ this.removeAllContent=null;
+ this.submitAllContent=null;
+ this.submitTabDone=null;
+ this.submitOfflineFile=null;
+ this.submitOnlineFile=null;
+ this.offlineFile=null;
+
+ this.dispatch=null;
+
+ this.choice=null;
+ this.choiceBasic=null;
+ this.choiceAdvanced=null;
+ this.choiceInstructions=null;
+
+ this.title=null;
+ this.instructions=null;
+ this.questionIndex=null;
+ this.optionIndex=null;
+ this.selectedIndex=null;
+ this.deletableOptionIndex=null;
+ this.isRemoveContent=null;
+ this.toolContentId=null;
+ this.toolContentID=null;
+
+ this.onlineInstructions=null;
+ this.offlineInstructions=null;
+
+ this.richTextOfflineInstructions=null;
+ this.richTextOnlineInstructions=null;
+
+ this.endLearningMessage=null;
+ this.synchInMonitor=null;
+ this.reportTitle=null;
+ this.monitoringReportTitle=null;
+ this.questionsSequenced=null;
+ this.showFeedback=null;
+ this.retries=null;
+ this.sln=null;
+ this.passmark=null;
+
+ this.summaryMonitoring=null;
+ this.instructionsMonitoring=null;
+ this.editActivityMonitoring=null;
+ this.statsMonitoring=null;
+ this.edit=null;
+ this.submit=null;
+ }
+
+ public void resetRadioBoxes()
+ {
+ this.synchInMonitor =OPTION_OFF;
+ this.questionsSequenced =OPTION_OFF;
+ this.retries =OPTION_OFF;
+ this.sln =OPTION_OFF;
+ this.showFeedback =OPTION_OFF;
+ this.usernameVisible =OPTION_OFF;
+ }
+
+
+ /**
+ * @return Returns the isRemoveContent.
+ */
+ public String getIsRemoveContent() {
+ return isRemoveContent;
+ }
+ /**
+ * @param isRemoveContent The isRemoveContent to set.
+ */
+ public void setIsRemoveContent(String isRemoveContent) {
+ this.isRemoveContent = isRemoveContent;
+ }
+ /**
+ * @return Returns the questionIndex.
+ */
+ public String getQuestionIndex() {
+ return questionIndex;
+ }
+ /**
+ * @param questionIndex The questionIndex to set.
+ */
+ public void setQuestionIndex(String questionIndex) {
+ this.questionIndex = questionIndex;
+ }
+
+ /**
+ * @return Returns the addContent.
+ */
+ public String getAddContent() {
+ return addContent;
+ }
+ /**
+ * @param addContent The addContent to set.
+ */
+ public void setAddContent(String addContent) {
+ this.addContent = addContent;
+ }
+ /**
+ * @return Returns the removeContent.
+ */
+ public String getRemoveContent() {
+ return removeContent;
+ }
+ /**
+ * @param removeContent The removeContent to set.
+ */
+ public void setRemoveContent(String removeContent) {
+ this.removeContent = removeContent;
+ }
+ /**
+ * @return Returns the removeAllContent.
+ */
+ public String getRemoveAllContent() {
+ return removeAllContent;
+ }
+ /**
+ * @param removeAllContent The removeAllContent to set.
+ */
+ public void setRemoveAllContent(String removeAllContent) {
+ this.removeAllContent = removeAllContent;
+ }
+ /**
+ * @return Returns the submitAllContent.
+ */
+ public String getSubmitAllContent() {
+ return submitAllContent;
+ }
+ /**
+ * @param submitAllContent The submitAllContent to set.
+ */
+ public void setSubmitAllContent(String submitAllContent) {
+ this.submitAllContent = submitAllContent;
+ }
+ /**
+ * @return Returns the instructions.
+ */
+ public String getInstructions() {
+ return instructions;
+ }
+ /**
+ * @param instructions The instructions to set.
+ */
+ public void setInstructions(String instructions) {
+ this.instructions = instructions;
+ }
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return Returns the toolContentId.
+ */
+ public String getToolContentId() {
+ return toolContentId;
+ }
+ /**
+ * @param toolContentId The toolContentId to set.
+ */
+ public void setToolContentId(String toolContentId) {
+ this.toolContentId = toolContentId;
+ }
+ /**
+ * @return Returns the offlineInstructions.
+ */
+ public String getOfflineInstructions() {
+ return offlineInstructions;
+ }
+ /**
+ * @param offlineInstructions The offlineInstructions to set.
+ */
+ public void setOfflineInstructions(String offlineInstructions) {
+ this.offlineInstructions = offlineInstructions;
+ }
+ /**
+ * @return Returns the onlineInstructions.
+ */
+ public String getOnlineInstructions() {
+ return onlineInstructions;
+ }
+ /**
+ * @param onlineInstructions The onlineInstructions to set.
+ */
+ public void setOnlineInstructions(String onlineInstructions) {
+ this.onlineInstructions = onlineInstructions;
+ }
+
+ /**
+ * @return Returns the syncInMonitor.
+ */
+ public String getSynchInMonitor() {
+ return synchInMonitor;
+ }
+ /**
+ * @param syncInMonitor The syncInMonitor to set.
+ */
+ public void setSynchInMonitor(String synchInMonitor) {
+ this.synchInMonitor = synchInMonitor;
+ }
+
+ /**
+ * @return Returns the choiceAdvanced.
+ */
+ public String getChoiceAdvanced() {
+ return choiceAdvanced;
+ }
+ /**
+ * @param choiceAdvanced The choiceAdvanced to set.
+ */
+ public void setChoiceAdvanced(String choiceAdvanced) {
+ this.choiceAdvanced = choiceAdvanced;
+ }
+ /**
+ * @return Returns the choiceBasic.
+ */
+ public String getChoiceBasic() {
+ return choiceBasic;
+ }
+ /**
+ * @param choiceBasic The choiceBasic to set.
+ */
+ public void setChoiceBasic(String choiceBasic) {
+ this.choiceBasic = choiceBasic;
+ }
+ /**
+ * @return Returns the choiceInstructions.
+ */
+ public String getChoiceInstructions() {
+ return choiceInstructions;
+ }
+ /**
+ * @param choiceInstructions The choiceInstructions to set.
+ */
+ public void setChoiceInstructions(String choiceInstructions) {
+ this.choiceInstructions = choiceInstructions;
+ }
+ /**
+ * @return Returns the choice.
+ */
+ public String getChoice() {
+ return choice;
+ }
+ /**
+ * @param choice The choice to set.
+ */
+ public void setChoice(String choice) {
+ this.choice = choice;
+ }
+ /**
+ * @return Returns the reportTitle.
+ */
+ public String getReportTitle() {
+ return reportTitle;
+ }
+ /**
+ * @param reportTitle The reportTitle to set.
+ */
+ public void setReportTitle(String reportTitle) {
+ this.reportTitle = reportTitle;
+ }
+ /**
+ * @return Returns the usernameVisible.
+ */
+ public String getUsernameVisible() {
+ return usernameVisible;
+ }
+ /**
+ * @param usernameVisible The usernameVisible to set.
+ */
+ public void setUsernameVisible(String usernameVisible) {
+ this.usernameVisible = usernameVisible;
+ }
+ /**
+ * @return Returns the submitTabDone.
+ */
+ public String getSubmitTabDone() {
+ return submitTabDone;
+ }
+ /**
+ * @param submitTabDone The submitTabDone to set.
+ */
+ public void setSubmitTabDone(String submitTabDone) {
+ this.submitTabDone = submitTabDone;
+ }
+
+ /**
+ * @return Returns the questionsSequenced.
+ */
+ public String getQuestionsSequenced() {
+ return questionsSequenced;
+ }
+ /**
+ * @param questionsSequenced The questionsSequenced to set.
+ */
+ public void setQuestionsSequenced(String questionsSequenced) {
+ this.questionsSequenced = questionsSequenced;
+ }
+ /**
+ * @return Returns the endLearningMessage.
+ */
+ public String getEndLearningMessage() {
+ return endLearningMessage;
+ }
+ /**
+ * @param endLearningMessage The endLearningMessage to set.
+ */
+ public void setEndLearningMessage(String endLearningMessage) {
+ this.endLearningMessage = endLearningMessage;
+ }
+ /**
+ * @return Returns the monitoringReportTitle.
+ */
+ public String getMonitoringReportTitle() {
+ return monitoringReportTitle;
+ }
+ /**
+ * @param monitoringReportTitle The monitoringReportTitle to set.
+ */
+ public void setMonitoringReportTitle(String monitoringReportTitle) {
+ this.monitoringReportTitle = monitoringReportTitle;
+ }
+ /**
+ * @return Returns the editActivityMonitoring.
+ */
+ public String getEditActivityMonitoring() {
+ return editActivityMonitoring;
+ }
+ /**
+ * @param editActivityMonitoring The editActivityMonitoring to set.
+ */
+ public void setEditActivityMonitoring(String editActivityMonitoring) {
+ this.editActivityMonitoring = editActivityMonitoring;
+ }
+ /**
+ * @return Returns the instructionsMonitoring.
+ */
+ public String getInstructionsMonitoring() {
+ return instructionsMonitoring;
+ }
+ /**
+ * @param instructionsMonitoring The instructionsMonitoring to set.
+ */
+ public void setInstructionsMonitoring(String instructionsMonitoring) {
+ this.instructionsMonitoring = instructionsMonitoring;
+ }
+ /**
+ * @return Returns the statsMonitoring.
+ */
+ public String getStatsMonitoring() {
+ return statsMonitoring;
+ }
+ /**
+ * @param statsMonitoring The statsMonitoring to set.
+ */
+ public void setStatsMonitoring(String statsMonitoring) {
+ this.statsMonitoring = statsMonitoring;
+ }
+ /**
+ * @return Returns the summaryMonitoring.
+ */
+ public String getSummaryMonitoring() {
+ return summaryMonitoring;
+ }
+ /**
+ * @param summaryMonitoring The summaryMonitoring to set.
+ */
+ public void setSummaryMonitoring(String summaryMonitoring) {
+ this.summaryMonitoring = summaryMonitoring;
+ }
+ /**
+ * @return Returns the edit.
+ */
+ public String getEdit() {
+ return edit;
+ }
+ /**
+ * @param edit The edit to set.
+ */
+ public void setEdit(String edit) {
+ this.edit = edit;
+ }
+
+ /**
+ * @return Returns the submitOfflineFile.
+ */
+ public String getSubmitOfflineFile() {
+ return submitOfflineFile;
+ }
+ /**
+ * @param submitOfflineFile The submitOfflineFile to set.
+ */
+ public void setSubmitOfflineFile(String submitOfflineFile) {
+ this.submitOfflineFile = submitOfflineFile;
+ }
+ /**
+ * @param theOfflineFile The theOfflineFile to set.
+ */
+ public void setTheOfflineFile(FormFile theOfflineFile) {
+ this.theOfflineFile = theOfflineFile;
+ }
+ /**
+ * @param theOnlineFile The theOnlineFile to set.
+ */
+ public void setTheOnlineFile(FormFile theOnlineFile) {
+ this.theOnlineFile = theOnlineFile;
+ }
+ /**
+ * @return Returns the theOfflineFile.
+ */
+ public FormFile getTheOfflineFile() {
+ return theOfflineFile;
+ }
+ /**
+ * @return Returns the theOnlineFile.
+ */
+ public FormFile getTheOnlineFile() {
+ return theOnlineFile;
+ }
+ /**
+ * @return Returns the submitOnlineFile.
+ */
+ public String getSubmitOnlineFile() {
+ return submitOnlineFile;
+ }
+ /**
+ * @param submitOnlineFile The submitOnlineFile to set.
+ */
+ public void setSubmitOnlineFile(String submitOnlineFile) {
+ this.submitOnlineFile = submitOnlineFile;
+ }
+ /**
+ * @return Returns the richTextOfflineInstructions.
+ */
+ public String getRichTextOfflineInstructions() {
+ return richTextOfflineInstructions;
+ }
+ /**
+ * @param richTextOfflineInstructions The richTextOfflineInstructions to set.
+ */
+ public void setRichTextOfflineInstructions(
+ String richTextOfflineInstructions) {
+ this.richTextOfflineInstructions = richTextOfflineInstructions;
+ }
+ /**
+ * @return Returns the richTextOnlineInstructions.
+ */
+ public String getRichTextOnlineInstructions() {
+ return richTextOnlineInstructions;
+ }
+ /**
+ * @param richTextOnlineInstructions The richTextOnlineInstructions to set.
+ */
+ public void setRichTextOnlineInstructions(String richTextOnlineInstructions) {
+ this.richTextOnlineInstructions = richTextOnlineInstructions;
+ }
+ /**
+ * @return Returns the editDefaultQuestion.
+ */
+ public String getEditDefaultQuestion() {
+ return editDefaultQuestion;
+ }
+ /**
+ * @param editDefaultQuestion The editDefaultQuestion to set.
+ */
+ public void setEditDefaultQuestion(String editDefaultQuestion) {
+ this.editDefaultQuestion = editDefaultQuestion;
+ }
+ /**
+ * @return Returns the addOptionContent.
+ */
+ public String getAddOptionContent() {
+ return addOptionContent;
+ }
+ /**
+ * @param addOptionContent The addOptionContent to set.
+ */
+ public void setAddOptionContent(String addOptionContent) {
+ this.addOptionContent = addOptionContent;
+ }
+ /**
+ * @return Returns the removeOptionContent.
+ */
+ public String getRemoveOptionContent() {
+ return removeOptionContent;
+ }
+ /**
+ * @param removeOptionContent The removeOptionContent to set.
+ */
+ public void setRemoveOptionContent(String removeOptionContent) {
+ this.removeOptionContent = removeOptionContent;
+ }
+ /**
+ * @return Returns the optionIndex.
+ */
+ public String getOptionIndex() {
+ return optionIndex;
+ }
+ /**
+ * @param optionIndex The optionIndex to set.
+ */
+ public void setOptionIndex(String optionIndex) {
+ this.optionIndex = optionIndex;
+ }
+ /**
+ * @return Returns the retries.
+ */
+ public String getRetries() {
+ return retries;
+ }
+ /**
+ * @param retries The retries to set.
+ */
+ public void setRetries(String retries) {
+ this.retries = retries;
+ }
+ /**
+ * @return Returns the showFeedback.
+ */
+ public String getShowFeedback() {
+ return showFeedback;
+ }
+ /**
+ * @param showFeedback The showFeedback to set.
+ */
+ public void setShowFeedback(String showFeedback) {
+ this.showFeedback = showFeedback;
+ }
+ /**
+ * @return Returns the passmark.
+ */
+ public String getPassmark() {
+ return passmark;
+ }
+ /**
+ * @param passmark The passmark to set.
+ */
+ public void setPassmark(String passmark) {
+ this.passmark = passmark;
+ }
+ /**
+ * @return Returns the selectedIndex.
+ */
+ public String getSelectedIndex() {
+ return selectedIndex;
+ }
+ /**
+ * @param selectedIndex The selectedIndex to set.
+ */
+ public void setSelectedIndex(String selectedIndex) {
+ this.selectedIndex = selectedIndex;
+ }
+ /**
+ * @return Returns the deletableOptionIndex.
+ */
+ public String getDeletableOptionIndex() {
+ return deletableOptionIndex;
+ }
+ /**
+ * @param deletableOptionIndex The deletableOptionIndex to set.
+ */
+ public void setDeletableOptionIndex(String deletableOptionIndex) {
+ this.deletableOptionIndex = deletableOptionIndex;
+ }
+ /**
+ * @return Returns the sln.
+ */
+ public String getSln() {
+ return sln;
+ }
+ /**
+ * @param sln The sln to set.
+ */
+ public void setSln(String sln) {
+ this.sln = sln;
+ }
+ /**
+ * @return Returns the fileItem.
+ */
+ public String getFileItem() {
+ return fileItem;
+ }
+ /**
+ * @param fileItem The fileItem to set.
+ */
+ public void setFileItem(String fileItem) {
+ this.fileItem = fileItem;
+ }
+ /**
+ * @return Returns the receivedFile.
+ */
+ public FormFile getReceivedFile() {
+ return receivedFile;
+ }
+ /**
+ * @param receivedFile The receivedFile to set.
+ */
+ public void setReceivedFile(FormFile receivedFile) {
+ this.receivedFile = receivedFile;
+ }
+
+ public String getDispatch() {
+ return dispatch;
+ }
+
+ public void setDispatch(String buttonValue) {
+ this.dispatch = buttonValue;
+ }
+
+ /**
+ * @return Returns the offlineFile.
+ */
+ public String getOfflineFile() {
+ return offlineFile;
+ }
+ /**
+ * @param offlineFile The offlineFile to set.
+ */
+ public void setOfflineFile(String offlineFile) {
+ this.offlineFile = offlineFile;
+ }
+ /**
+ * @return Returns the uuid.
+ */
+ public String getUuid() {
+ return uuid;
+ }
+ /**
+ * @param uuid The uuid to set.
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+ /**
+ * @return Returns the currentTab.
+ */
+ public String getCurrentTab() {
+ return currentTab;
+ }
+ /**
+ * @param currentTab The currentTab to set.
+ */
+ public void setCurrentTab(String currentTab) {
+ this.currentTab = currentTab;
+ }
+ /**
+ * @return Returns the toolContentID.
+ */
+ public String getToolContentID() {
+ return toolContentID;
+ }
+ /**
+ * @param toolContentID The toolContentID to set.
+ */
+ public void setToolContentID(String toolContentID) {
+ this.toolContentID = toolContentID;
+ }
+
+ /**
+ * @return Returns the submit.
+ */
+ public String getSubmit() {
+ return submit;
+ }
+ /**
+ * @param submit The submit to set.
+ */
+ public void setSubmit(String submit) {
+ this.submit = submit;
+ }
+
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * McDLStarterAction activates the Define Later module.
+ * It reuses majority of the functionality from existing authoring module.
+ *
+
+*/
+package org.lamsfoundation.lams.tool.vote.web;
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+
+
+public class VoteDLStarterAction extends Action implements VoteAppConstants {
+ static Logger logger = Logger.getLogger(VoteDLStarterAction.class.getName());
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, VoteApplicationException {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ return null;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,313 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteSession;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+import org.lamsfoundation.lams.tool.vote.service.IVoteService;
+import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy;
+import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * enables the learner and teacher to export the contents of the voting tool.
+ */
+
+public class VoteExportAction extends LamsDispatchAction implements VoteAppConstants{
+
+ static Logger logger = Logger.getLogger(VoteExportAction.class.getName());
+
+ public ActionForward unspecified(
+ ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ return mapping.findForward(EXPORT_PORTFOLIO);
+ }
+
+
+ /**
+ * provides export portfolio functionality for learner
+ * learner(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return ActionForward
+ */
+ public ActionForward learner(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ logger.debug("dispatching export portfolio for learner...");
+ VoteUtils.cleanUpSessionAbsolute(request);
+
+ IVoteService mcService = VoteUtils.getToolService(request);
+ logger.debug("retrieving mcService from session: " + mcService);
+ if (mcService == null)
+ {
+ mcService = VoteServiceProxy.getMcService(getServlet().getServletContext());
+ logger.debug("retrieving mcService from proxy: " + mcService);
+ request.getSession().setAttribute(TOOL_SERVICE, mcService);
+ }
+
+ VoteExportForm exportForm = (VoteExportForm)form;
+
+ /* required parameters are toolSessionId and userId */
+ boolean parametersCorrect=validateLearnerExportParameters(form, request);
+ logger.debug("learner parametersCorrect: " + parametersCorrect);
+ if (parametersCorrect == false)
+ {
+ logger.debug("learner parameters are not properly passed: " + parametersCorrect);
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ Long toolSessionId =(Long)request.getSession().getAttribute(TOOL_SESSION_ID);
+ logger.debug("toolSessionId: " + toolSessionId);
+
+ VoteSession mcSession=mcService.findMcSessionById(toolSessionId);
+ logger.debug("mcSession: " + mcSession);
+ if (mcSession == null)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ persistError(request, "error.toolSession.doesNoExist");
+ request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString());
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ Long toolSessionUid= mcSession.getUid();
+ logger.debug("mcSession is identified by : " + toolSessionUid);
+
+ Long exportUserId =(Long)request.getSession().getAttribute(EXPORT_USER_ID);
+ logger.debug("exportUserId : " + exportUserId);
+
+ VoteQueUsr mcQueUsr=mcService.getMcUserBySession(exportUserId, toolSessionUid);
+ logger.debug("existing tool user mcQueUsr : " + mcQueUsr);
+ if (mcQueUsr == null)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_LEARNER_REQUIRED, new Boolean(true).toString());
+ persistError(request, "error.learner.user.doesNoExist");
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ logger.debug("getting mcContent based on toolSessionId : " + toolSessionId);
+ VoteContent mcContent=mcService.retrieveMcBySessionId(toolSessionId);
+ logger.debug("mcContent : " + mcContent);
+ if (mcContent == null)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ persistError(request, "error.content.doesNotExist");
+ request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString());
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ exportForm.populateForm(mcContent);
+ logger.debug("ppulated from with mcContent : " + mcContent.getTitle() + " and " + mcContent.getContent());
+ return mapping.findForward(EXPORT_PORTFOLIO);
+ }
+
+
+ /**
+ * provides export portfolio functionality for teacher
+ * teacher(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return ActionForward
+ */
+ public ActionForward teacher(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ //given the toolcontentId as a parameter
+ logger.debug("dispatching export portfolio for teacher...");
+ VoteUtils.cleanUpSessionAbsolute(request);
+
+ IVoteService mcService = VoteUtils.getToolService(request);
+ logger.debug("retrieving mcService from session: " + mcService);
+ if (mcService == null)
+ {
+ mcService = VoteServiceProxy.getMcService(getServlet().getServletContext());
+ logger.debug("retrieving mcService from proxy: " + mcService);
+ request.getSession().setAttribute(TOOL_SERVICE, mcService);
+ }
+
+ VoteExportForm exportForm = (VoteExportForm)form;
+
+ /* required parameters are toolSessionId and userId */
+ boolean parametersCorrect=validateTeacherExportParameters(form, request);
+ logger.debug("learner parametersCorrect: " + parametersCorrect);
+ if (parametersCorrect == false)
+ {
+ logger.debug("teacher parameters are not properly passed: " + parametersCorrect);
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ Long toolContentId =(Long)request.getSession().getAttribute(TOOL_CONTENT_ID);
+ logger.debug("toolContentId: " + toolContentId);
+ VoteContent mcContent=mcService.retrieveMc(toolContentId);
+ logger.debug("mcContent:" + mcContent);
+
+ if (mcContent == null)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ persistError(request, "error.content.doesNotExist");
+ request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString());
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ exportForm.populateForm(mcContent);
+
+ return mapping.findForward(EXPORT_PORTFOLIO);
+ }
+
+
+
+ /**
+ * validates learner export portfolio parameters
+ * validateLearnerExportParameters(ActionForm form, HttpServletRequest request)
+ *
+ * @param form
+ * @param request
+ * @return boolean
+ */
+ protected boolean validateLearnerExportParameters(ActionForm form, HttpServletRequest request)
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ String strToolSessionId=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
+
+ if ((strToolSessionId == null) || (strToolSessionId.length() == 0))
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true).toString());
+ persistError(request, "error.toolSessionId.required");
+ return false;
+ }
+ else
+ {
+ try
+ {
+ long testToolSessionId=new Long(strToolSessionId).longValue();
+ request.getSession().setAttribute(TOOL_SESSION_ID,new Long(strToolSessionId));
+ }
+ catch(NumberFormatException e)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString());
+ persistError(request, "error.sessionId.numberFormatException");
+ logger.debug("add error.sessionId.numberFormatException to ActionMessages.");
+ return false;
+ }
+ }
+
+ /*USER_ID should be added to AttributeNames*/
+ String userId=request.getParameter(USER_ID);
+ logger.debug("userId: " + userId);
+ if ((userId == null) || (userId.length() == 0))
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ persistError(request, "error.learner.userId.required");
+ request.getSession().setAttribute(USER_EXCEPTION_USER_DOESNOTEXIST, new Boolean(true).toString());
+ return false;
+ }
+ request.getSession().setAttribute(EXPORT_USER_ID,new Long(userId));
+
+ return true;
+ }
+
+
+ /**
+ * validates teacher export portfolio parameters
+ * validateTeacherExportParameters(ActionForm form, HttpServletRequest request)
+ *
+ * @param form
+ * @param request
+ * @return boolean
+ */
+ protected boolean validateTeacherExportParameters(ActionForm form, HttpServletRequest request)
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ String strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ logger.debug("strToolContentId: " + strToolContentId);
+
+ if ((strToolContentId == null) || (strToolContentId.length() == 0))
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ persistError(request, "error.contentId.required");
+ request.getSession().setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true).toString());
+ return false;
+ }
+ else
+ {
+ try
+ {
+ long toolContentId=new Long(strToolContentId).longValue();
+ logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId));
+ request.getSession().setAttribute(TOOL_CONTENT_ID,new Long(toolContentId));
+ }
+ catch(NumberFormatException e)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString());
+ persistError(request, "error.numberFormatException");
+ logger.debug("add error.contentId.numberFormatException to ActionMessages.");
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportForm.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportForm.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportForm.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,150 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.ActionForm;
+import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
+
+/**
+ * @author Ozgur Demirtas
+ */
+
+public class VoteExportForm extends ActionForm {
+
+ static Logger logger = Logger.getLogger(VoteExportForm.class.getName());
+
+ private String title;
+ private String content;
+
+ private String toolContentID;
+ private String toolSessionID;
+ private String userID;
+ private String mode;
+
+ /**
+ * @return Returns the logger.
+ */
+ public static Logger getLogger() {
+ return logger;
+ }
+ /**
+ * @return Returns the content.
+ */
+ public String getContent() {
+ return content;
+ }
+ /**
+ * @param content The content to set.
+ */
+ public void setContent(String content) {
+ this.content = content;
+ }
+ /**
+ * @return Returns the mode.
+ */
+ public String getMode() {
+ return mode;
+ }
+ /**
+ * @param mode The mode to set.
+ */
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return Returns the toolContentId.
+ */
+ public String getToolContentID() {
+ return toolContentID;
+ }
+ /**
+ * @param toolContentId The toolContentId to set.
+ */
+ public void setToolContentID(String toolContentId) {
+ this.toolContentID = toolContentId;
+ }
+ /**
+ * @return Returns the toolSessionId.
+ */
+ public String getToolSessionID() {
+ return toolSessionID;
+ }
+ /**
+ * @param toolSessionId The toolSessionId to set.
+ */
+ public void setToolSessionID(String toolSessionId) {
+ this.toolSessionID = toolSessionId;
+ }
+ /**
+ * @return Returns the userId.
+ */
+ public String getUserID() {
+ return userID;
+ }
+ /**
+ * @param userId The userId to set.
+ */
+ public void setUserID(String userId) {
+ this.userID = userId;
+ }
+
+ public void reset()
+ {
+ this.mode = null;
+ this.title = null;
+ this.content = null;
+ this.toolContentID = null;
+ this.toolSessionID = null;
+ this.userID = null;
+ }
+
+ public void populateForm(VoteContent content)
+ {
+ String strTitle=null;
+ if (content.getTitle() == null)
+ strTitle="";
+ else
+ strTitle=content.getTitle();
+ setTitle(strTitle);
+
+
+ String strContent=null;
+ if (content.getContent() == null)
+ strContent="";
+ else
+ strContent=content.getContent();
+ setContent(strContent);
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportServlet.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportServlet.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteExportServlet.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote.web;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.lamsfoundation.lams.tool.ToolAccessMode;
+import org.lamsfoundation.lams.util.WebUtil;
+import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ */
+public class VoteExportServlet extends AbstractExportPortfolioServlet {
+
+ private final String FILENAME = "voting_main.html";
+
+ public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
+ {
+
+ String mode = WebUtil.readStrParam(request, AttributeNames.PARAM_MODE);
+ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
+
+ String url = basePath + "/exportPortfolio.do";
+ String urlWithParameters = null;
+
+ if (mode.equals(ToolAccessMode.LEARNER.toString()))
+ {
+ urlWithParameters = appendParametersToLearnerExportURL(request, url);
+
+ }
+ else if (mode.equals(ToolAccessMode.TEACHER.toString()))
+ {
+ urlWithParameters = appendParametersToTeacherExportURL(request, url);
+ }
+
+ writeResponseToFile(urlWithParameters, directoryName, FILENAME, cookies);
+
+ return FILENAME;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,125 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.tool.vote.service.IVoteService;
+import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+
+/**
+ * * @author Ozgur Demirtas
+ *
+ * Action class that controls the logic of tool behavior.
+ *
+ * Note that Struts action class only has the responsibility to navigate
+ * page flow. All database operation should go to service layer and data
+ * transformation from domain model to struts form bean should go to form
+ * bean class. This ensure clean and maintainable code.
+ *
+ *
+ * SystemException
is thrown whenever an known error condition is
+ * identified. No system exception error handling code should appear in the
+ * Struts action class as all of them are handled in
+ * CustomStrutsExceptionHandler.
+ *
+
+ *
+*/
+public class VoteLearningAction extends LamsDispatchAction implements VoteAppConstants
+{
+ static Logger logger = Logger.getLogger(VoteLearningAction.class.getName());
+
+ /**
+ * Default struts dispatch method.
+ *
+ * It is assuming that progress engine should pass in the tool access
+ * mode and the tool session id as http parameters.
+ *
+ * @param mapping An ActionMapping class that will be used by the Action class to tell
+ * the ActionServlet where to send the end-user.
+ *
+ * @param form The ActionForm class that will contain any data submitted
+ * by the end-user via a form.
+ * @param request A standard Servlet HttpServletRequest class.
+ * @param response A standard Servlet HttpServletResponse class.
+ * @return An ActionForward class that will be returned to the ActionServlet indicating where
+ * the user is to go next.
+ * @throws IOException
+ * @throws ServletException
+ * @throws VoteApplicationException the known runtime exception
+ *
+ * unspecified(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException
+
+ * main content/question content management and workflow logic
+ *
+ * if the passed toolContentId exists in the db, we need to get the relevant data into the Map
+ * if not, create the default Map
+ */
+ public ActionForward unspecified(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ VoteAuthoringForm mcAuthoringForm = (VoteAuthoringForm) form;
+ IVoteService mcService =VoteUtils.getToolService(request);
+ AuthoringUtil.readData(request, mcAuthoringForm);
+ mcAuthoringForm.resetUserAction();
+ return null;
+ }
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+
+}
+
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,258 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import org.apache.struts.action.ActionForm;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * ActionForm for the Learning environment
+ */
+public class VoteLearningForm extends ActionForm implements VoteAppConstants {
+ protected String optionCheckBoxSelected;
+ protected String questionIndex;
+ protected String optionIndex;
+ protected String optionValue;
+ protected String checked;
+
+ protected String continueOptions;
+ protected String nextOptions;
+ protected String continueOptionsCombined;
+ protected String redoQuestions;
+ protected String viewSummary;
+ protected String viewAnswers;
+ protected String learnerFinished;
+ protected String redoQuestionsOk;
+ protected String donePreview;
+ protected String doneLearnerProgress;
+
+
+
+
+ public void resetCommands()
+ {
+ this.setContinueOptions(null);
+ this.setNextOptions(null);
+ this.setContinueOptionsCombined(null);
+ this.setRedoQuestions( null);
+ this.setViewSummary(null);
+ this.setViewAnswers(null);
+ this.setRedoQuestionsOk(null);
+ this.setLearnerFinished(null);
+ this.setDonePreview(null);
+ this.setDoneLearnerProgress(null);
+ }
+
+ public void resetParameters()
+ {
+ this.setOptionCheckBoxSelected(null);
+ this.setQuestionIndex(null);
+ this.setOptionIndex(null);
+ this.setChecked(null);
+ this.setOptionValue(null);
+ }
+
+
+ /**
+ * @return Returns the continueOptions.
+ */
+ public String getContinueOptions() {
+ return continueOptions;
+ }
+ /**
+ * @param continueOptions The continueOptions to set.
+ */
+ public void setContinueOptions(String continueOptions) {
+ this.continueOptions = continueOptions;
+ }
+ /**
+ * @return Returns the checked.
+ */
+ public String getChecked() {
+ return checked;
+ }
+ /**
+ * @param checked The checked to set.
+ */
+ public void setChecked(String checked) {
+ this.checked = checked;
+ }
+ /**
+ * @return Returns the optionCheckBoxSelected.
+ */
+ public String getOptionCheckBoxSelected() {
+ return optionCheckBoxSelected;
+ }
+ /**
+ * @param optionCheckBoxSelected The optionCheckBoxSelected to set.
+ */
+ public void setOptionCheckBoxSelected(String optionCheckBoxSelected) {
+ this.optionCheckBoxSelected = optionCheckBoxSelected;
+ }
+ /**
+ * @return Returns the optionIndex.
+ */
+ public String getOptionIndex() {
+ return optionIndex;
+ }
+ /**
+ * @param optionIndex The optionIndex to set.
+ */
+ public void setOptionIndex(String optionIndex) {
+ this.optionIndex = optionIndex;
+ }
+ /**
+ * @return Returns the questionIndex.
+ */
+ public String getQuestionIndex() {
+ return questionIndex;
+ }
+ /**
+ * @param questionIndex The questionIndex to set.
+ */
+ public void setQuestionIndex(String questionIndex) {
+ this.questionIndex = questionIndex;
+ }
+
+ /**
+ * @return Returns the viewSummary.
+ */
+ public String getViewSummary() {
+ return viewSummary;
+ }
+ /**
+ * @param viewSummary The viewSummary to set.
+ */
+ public void setViewSummary(String viewSummary) {
+ this.viewSummary = viewSummary;
+ }
+ /**
+ * @return Returns the continueOptionsCombined.
+ */
+ public String getContinueOptionsCombined() {
+ return continueOptionsCombined;
+ }
+ /**
+ * @param continueOptionsCombined The continueOptionsCombined to set.
+ */
+ public void setContinueOptionsCombined(String continueOptionsCombined) {
+ this.continueOptionsCombined = continueOptionsCombined;
+ }
+ /**
+ * @return Returns the redoQuestions.
+ */
+ public String getRedoQuestions() {
+ return redoQuestions;
+ }
+ /**
+ * @param redoQuestions The redoQuestions to set.
+ */
+ public void setRedoQuestions(String redoQuestions) {
+ this.redoQuestions = redoQuestions;
+ }
+ /**
+ * @return Returns the optionValue.
+ */
+ public String getOptionValue() {
+ return optionValue;
+ }
+ /**
+ * @param optionValue The optionValue to set.
+ */
+ public void setOptionValue(String optionValue) {
+ this.optionValue = optionValue;
+ }
+ /**
+ * @return Returns the viewAnswers.
+ */
+ public String getViewAnswers() {
+ return viewAnswers;
+ }
+ /**
+ * @param viewAnswers The viewAnswers to set.
+ */
+ public void setViewAnswers(String viewAnswers) {
+ this.viewAnswers = viewAnswers;
+ }
+ /**
+ * @return Returns the redoQuestionsOk.
+ */
+ public String getRedoQuestionsOk() {
+ return redoQuestionsOk;
+ }
+ /**
+ * @param redoQuestionsOk The redoQuestionsOk to set.
+ */
+ public void setRedoQuestionsOk(String redoQuestionsOk) {
+ this.redoQuestionsOk = redoQuestionsOk;
+ }
+ /**
+ * @return Returns the nextOptions.
+ */
+ public String getNextOptions() {
+ return nextOptions;
+ }
+ /**
+ * @param nextOptions The nextOptions to set.
+ */
+ public void setNextOptions(String nextOptions) {
+ this.nextOptions = nextOptions;
+ }
+ /**
+ * @return Returns the learnerFinished.
+ */
+ public String getLearnerFinished() {
+ return learnerFinished;
+ }
+ /**
+ * @param learnerFinished The learnerFinished to set.
+ */
+ public void setLearnerFinished(String learnerFinished) {
+ this.learnerFinished = learnerFinished;
+ }
+ /**
+ * @return Returns the donePreview.
+ */
+ public String getDonePreview() {
+ return donePreview;
+ }
+ /**
+ * @param donePreview The donePreview to set.
+ */
+ public void setDonePreview(String donePreview) {
+ this.donePreview = donePreview;
+ }
+ /**
+ * @return Returns the doneLearnerProgress.
+ */
+ public String getDoneLearnerProgress() {
+ return doneLearnerProgress;
+ }
+ /**
+ * @param doneLearnerProgress The doneLearnerProgress to set.
+ */
+ public void setDoneLearnerProgress(String doneLearnerProgress) {
+ this.doneLearnerProgress = doneLearnerProgress;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,194 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+import org.lamsfoundation.lams.web.session.SessionManager;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+
+
+/**
+ *
+ * @author Ozgur Demirtas
+ *
+ * /&userId=&toolSessionId=123&mode=teacher
+
+ * Tool Session:
+ *
+ * A tool session is the concept by which which the tool and the LAMS core manage a set of learners interacting with the tool.
+ * The tool session id (toolSessionId) is generated by the LAMS core and given to the tool.
+ * A tool session represents the use of a tool for a particulate activity for a group of learners.
+ * So if an activity is ungrouped, then one tool session exist for for a tool activity in a learning design.
+ *
+ * More details on the tool session id are covered under monitoring.
+ * When thinking about the tool content id and the tool session id, it might be helpful to think about the tool content id
+ * relating to the definition of an activity, whereas the tool session id relates to the runtime participation in the activity.
+
+ *
+ * Learner URL:
+ * The learner url display the screen(s) that the learner uses to participate in the activity.
+ * When the learner accessed this user, it will have a tool access mode ToolAccessMode.LEARNER.
+ *
+ * It is the responsibility of the tool to record the progress of the user.
+ * If the tool is a multistage tool, for example asking a series of questions, the tool must keep track of what the learner has already done.
+ * If the user logs out and comes back to the tool later, then the tool should resume from where the learner stopped.
+ * When the user is completed with tool, then the tool notifies the progress engine by calling
+ * org.lamsfoundation.lams.learning.service.completeToolSession(Long toolSessionId, User learner).
+ *
+ * If the tool's content DefineLater flag is set to true, then the learner should see a "Please wait for the teacher to define this part...."
+ * style message.
+ * If the tool's content RunOffline flag is set to true, then the learner should see a "This activity is not being done on the computer.
+ * Please see your instructor for details."
+ *
+ * ?? Would it be better to define a run offline message in the tool? We have instructions for the teacher but not the learner. ??
+ * If the tool has a LockOnFinish flag, then the tool should lock learner's entries once they have completed the activity.
+ * If they return to the activity (e.g. via the progress bar) then the entries should be read only.
+ *
+ */
+
+/**
+ *
+ * Note: Because of MCQ's learning reporting structure, Show Learner Report is always ON even if in authoring it is set to false.
+ */
+
+public class VoteLearningStarterAction extends Action implements VoteAppConstants {
+ static Logger logger = Logger.getLogger(VoteLearningStarterAction.class.getName());
+ /* Since the toolSessionId is passed, we will derive toolContentId from the toolSessionId
+ * This class is used to load the default content and initialize the presentation Map for Learner mode
+ */
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, VoteApplicationException {
+
+ return null;
+ }
+
+
+ protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping)
+ {
+ /*
+ * obtain and setup the current user's data
+ */
+
+ String userID = "";
+ HttpSession ss = SessionManager.getSession();
+ logger.debug("ss: " + ss);
+
+ if (ss != null)
+ {
+ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
+ if ((user != null) && (user.getUserID() != null))
+ {
+ userID = user.getUserID().toString();
+ logger.debug("retrieved userId: " + userID);
+ request.getSession().setAttribute(USER_ID, userID);
+ }
+ }
+
+
+ /*
+ * process incoming tool session id and later derive toolContentId from it.
+ */
+ String strToolSessionId=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
+ long toolSessionId=0;
+ if ((strToolSessionId == null) || (strToolSessionId.length() == 0))
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true).toString());
+ persistError(request, "error.toolSessionId.required");
+ return (mapping.findForward(ERROR_LIST));
+ }
+ else
+ {
+ try
+ {
+ toolSessionId=new Long(strToolSessionId).longValue();
+ logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId));
+ request.getSession().setAttribute(TOOL_SESSION_ID,new Long(toolSessionId));
+ }
+ catch(NumberFormatException e)
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString());
+ persistError(request, "error.sessionId.numberFormatException");
+ logger.debug("add error.sessionId.numberFormatException to ActionMessages.");
+ return (mapping.findForward(ERROR_LIST));
+ }
+ }
+
+ /*mode can be learner, teacher or author */
+ String mode=request.getParameter(MODE);
+ logger.debug("mode: " + mode);
+
+ if ((mode == null) || (mode.length() == 0))
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_MODE_REQUIRED, new Boolean(true).toString());
+ persistError(request, "error.mode.required");
+ return (mapping.findForward(ERROR_LIST));
+ }
+
+ if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author")))
+ {
+ VoteUtils.cleanUpSessionAbsolute(request);
+ request.getSession().setAttribute(USER_EXCEPTION_MODE_INVALID, new Boolean(true).toString());
+ persistError(request, "error.mode.invalid");
+ return (mapping.findForward(ERROR_LIST));
+ }
+ logger.debug("session LEARNING_MODE set to:" + mode);
+ request.getSession().setAttribute(LEARNING_MODE, mode);
+
+ return null;
+ }
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,119 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+
+/**
+ * * @author Ozgur Demirtas
+ *
+ * Action class that controls the logic of tool behavior.
+ *
+ * Note that Struts action class only has the responsibility to navigate
+ * page flow. All database operation should go to service layer and data
+ * transformation from domain model to struts form bean should go to form
+ * bean class. This ensure clean and maintainable code.
+ *
+ *
+ * SystemException
is thrown whenever an known error condition is
+ * identified. No system exception error handling code should appear in the
+ * Struts action class as all of them are handled in
+ * CustomStrutsExceptionHandler.
+ *
+*/
+public class VoteMonitoringAction extends LamsDispatchAction implements VoteAppConstants
+{
+ static Logger logger = Logger.getLogger(VoteMonitoringAction.class.getName());
+
+ /**
+ * Default struts dispatch method.
+ *
+ * It is assuming that progress engine should pass in the tool access
+ * mode and the tool session id as http parameters.
+ *
+ * @param mapping An ActionMapping class that will be used by the Action class to tell
+ * the ActionServlet where to send the end-user.
+ *
+ * @param form The ActionForm class that will contain any data submitted
+ * by the end-user via a form.
+ * @param request A standard Servlet HttpServletRequest class.
+ * @param response A standard Servlet HttpServletResponse class.
+ * @return An ActionForward class that will be returned to the ActionServlet indicating where
+ * the user is to go next.
+ * @throws IOException
+ * @throws ServletException
+ * @throws VoteApplicationException the known runtime exception
+ *
+ * unspecified(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException
+
+ * main content/question content management and workflow logic
+ *
+ */
+ public ActionForward unspecified(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException
+ {
+ VoteUtils.cleanUpUserExceptions(request);
+ logger.debug("dispatching unspecified...");
+ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString());
+ VoteMonitoringForm mcMonitoringForm = (VoteMonitoringForm) form;
+ return null;
+ }
+
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
+
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringForm.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * ActionForm for the Monitoring environment
+ */
+public class VoteMonitoringForm extends VoteAuthoringForm implements VoteAppConstants {
+ // controls which method is called by the Lookup map */
+ protected String method;
+
+ protected String selectedToolSessionId;
+
+ protected String isToolSessionChanged;
+
+ /**
+ * @return Returns the isToolSessionChanged.
+ */
+ public String getIsToolSessionChanged() {
+ return isToolSessionChanged;
+ }
+ /**
+ * @param isToolSessionChanged The isToolSessionChanged to set.
+ */
+ public void setIsToolSessionChanged(String isToolSessionChanged) {
+ this.isToolSessionChanged = isToolSessionChanged;
+ }
+ /**
+ * @return Returns the selectedToolSessionId.
+ */
+ public String getSelectedToolSessionId() {
+ return selectedToolSessionId;
+ }
+ /**
+ * @param selectedToolSessionId The selectedToolSessionId to set.
+ */
+ public void setSelectedToolSessionId(String selectedToolSessionId) {
+ this.selectedToolSessionId = selectedToolSessionId;
+ }
+
+ /**
+ * @return Returns the method.
+ */
+ public String getMethod() {
+ return method;
+ }
+ /**
+ * @param method The method to set.
+ */
+ public void setMethod(String method) {
+ this.method = method;
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+package org.lamsfoundation.lams.tool.vote.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+
+
+/**
+ *
+ * @author Ozgur Demirtas
+ * starts up the monitoring module
+ */
+
+public class VoteMonitoringStarterAction extends Action implements VoteAppConstants {
+ static Logger logger = Logger.getLogger(VoteMonitoringStarterAction.class.getName());
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, VoteApplicationException
+ {
+
+ return null;
+ }
+
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java
===================================================================
diff -u
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (revision 0)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,251 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * VoteStarterAction loads the default content and initializes the presentation Map.
+ * Initializes the tool's authoring mode
+ * Requests can come either from authoring environment or from the monitoring environment for Edit Activity screen.
+ *
+ *
+ *
+ * Authoring URL
+ *
+ * The tool must supply an authoring module, which will be called to create new content or edit existing content. It will be called by an authoring URL using the following format:
+
+ * /&toolContentID=123
+
+
+ * The initial data displayed on the authoring screen for a new tool content id may be the default tool content.
+ *
+ * Authoring UI data consists of general Activity data fields and the Tool specific data fields.
+ * The authoring interface will have three tabs. The mandatory (and suggested) fields are given.
+ * Each tool will have its own fields which it will add on any of the three tabs, as appropriate to the tabs' function.
+
+ * Basic: Displays the basic set of fields that are needed for the tool, and it could be expected that a new LAMS user would use.
+ * Mandatory fields: Title, Instructions.
+ *
+ * Advanced: Displays the extra fields that would be used by experienced LAMS users. Optional fields: Lock On Finish, Make Responses Anonymous
+ * Instructions: Displays the "instructions" fields for teachers. Mandatory fields: Online instructions, Offline instructions, Document upload.
+ * See Instructions. The standard LAMS tools will use a DHTML layout for the Authoring tabs. For consistency of look and feel,
+ * we prefer all tools to use the DHTML, or at least make the tabs look and behave like the DHTML layout. The javascript for the tabs is
+ * available as "/include/javascript/tabcontroller.js" from the central web app (e.g. http://blah.org/lams/include/javascript/tabcontroller.js).
+ *
+ * The "Define Later" and "Run Offline" options are set on the Flash authoring part, and not on the tool's authoring screens.
+ * Preview The tool must be able to show the specified content as if it was running in a lesson. It will be the learner url with tool access
+ * mode set to ToolAccessMode.AUTHOR.
+ *
+ * Export The tool must be able to export its tool content for part of the overall learning design export.
+ * The format of the serialization for export is XML. Tool will define extra namespace inside the element to add a new data element (type).
+ * Inside the data element, it can further define more structures and types as it seems fit.
+
+ * The data elements must be "version" aware. The data elements must be "type" aware if they are to be shared between Tools.
+ * LAMS Xpress (Ernie, could you put something in here. You explain it better than I do!)
+ *
+ * Data Exchange At present, there is no data exchange format between tools. Therefore if..
+ *
+ *
+ * Tool path The URL path for the tool should be /tool/$TOOL_SIG.
+ *
+
+ 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.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
+import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+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;
+
+
+public class VoteStarterAction extends Action implements VoteAppConstants {
+ /*
+ * This class is reused by defineLater and monitoring modules as well.
+ */
+ static Logger logger = Logger.getLogger(VoteStarterAction.class.getName());
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, VoteApplicationException {
+
+ return null;
+ }
+
+ /**
+ * 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.
+ * if all the default content has been setup properly the method persists DEFAULT_CONTENT_ID in the session.
+ *
+ * readSignature(HttpServletRequest request, ActionMapping mapping)
+ * @param request
+ * @param mapping
+ * @return ActionForward
+ */
+ public ActionForward readSignature(HttpServletRequest request, ActionMapping mapping)
+ {
+ IVoteService mcService =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);
+ logger.debug("retrieved tool default contentId: " + contentId);
+ if (contentId == 0)
+ {
+ 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));
+ }
+ }
+ catch(Exception e)
+ {
+ 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));
+ }
+
+ /* retrieve uid of the content based on default content id determined above */
+ long contentUID=0;
+ 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)
+ {
+ 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();
+ }
+ catch(Exception e)
+ {
+ 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));
+ }
+
+
+ /* retrieve uid of the default question content */
+ long queContentUID=0;
+ 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)
+ {
+ 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();
+ request.getSession().setAttribute(DEFAULT_QUESTION_UID, new Long(queContentUID));
+ logger.debug("DEFAULT_QUESTION_UID: " + queContentUID);
+ }
+ catch(Exception e)
+ {
+ 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));
+ }
+
+
+ /* retrieve default options content */
+ try
+ {
+ logger.debug("retrieve the default options content based on default question content UID: " + queContentUID);
+ List list=mcService.findMcOptionsContentByQueId(new Long(queContentUID));
+ logger.debug("using options list: " + list);
+ if (list == 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));
+ }
+
+ }
+ catch(Exception e)
+ {
+ 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("Voting tool has the default content id: " + contentId);
+ request.getSession().setAttribute(DEFAULT_CONTENT_ID, new Long(contentId).toString());
+ return null;
+ }
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/AbstractMcTestCase.java
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/AbstractMcTestCase.java (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/AbstractMcTestCase.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+import junit.framework.TestCase;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+
+/**
+ * @author ozgurd
+ *
+ */
+public abstract class AbstractMcTestCase extends TestCase
+{
+ protected ApplicationContext context;
+ protected final long TEST_LESSON_ID=1;
+ /**
+ * @param name
+ */
+ public AbstractMcTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ System.out.println("AbstractMcTestCase: done with abstract super setup");
+ context = new ClassPathXmlApplicationContext(getContextConfigLocation());
+ System.out.println("AbstractMcTestCase: context" + context);
+ }
+
+ protected abstract String[] getContextConfigLocation();
+ /**
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+}
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/McDataAccessTestCase.java
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/McDataAccessTestCase.java (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/McDataAccessTestCase.java (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * 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
+ * ***********************************************************************/
+
+package org.lamsfoundation.lams.tool.vote;
+
+import org.lamsfoundation.lams.test.AbstractLamsTestCase;
+
+/**
+ * @author Ozgur Demirtas
+ */
+public class McDataAccessTestCase extends AbstractLamsTestCase
+{
+ //These both refer to the same entry in the db.
+ protected final Long DEFAULT_CONTENT_ID = new Long(10);
+ protected final Long TEST_CONTENT_ID = new Long(2);
+ protected final Long TEST_CONTENT_ID_OTHER = new Long(3);
+
+ protected final Long TEST_SESSION_ID = new Long(20);
+ protected final Long TEST_SESSION_ID_OTHER = new Long(21);
+
+ protected final Long TEST_QUE_ID1 = new Long(1);
+ protected final Long TEST_QUE_OPTION_ID1 = new Long(1);
+ protected final Long TEST_QUE_OPTION_ID2 = new Long(2);
+ protected final Long TEST_QUE_OPTION_ID3 = new Long(3);
+
+ protected final Long TEST_NEW_USER_ID = new Long(100);
+ protected final Long TEST_MY_USER_ID = new Long(77);
+
+ protected final long ONE_DAY = 60 * 60 * 1000 * 24;
+
+ public final String NOT_ATTEMPTED = "NOT_ATTEMPTED";
+ public final String INCOMPLETE = "INCOMPLETE";
+ public static String COMPLETED = "COMPLETED";
+
+
+ public McDataAccessTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ }
+
+ protected String[] getContextConfigLocation()
+ {
+ return new String[] {"/org/lamsfoundation/lams/tool/vote/testmcApplicationContext.xml" };
+ }
+
+ protected String getHibernateSessionFactoryName()
+ {
+ return "mcSessionFactory";
+ }
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+}
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/dbConnection.properties
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/dbConnection.properties (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/dbConnection.properties (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,20 @@
+# Properties file with Hibernate-related settings.
+# Applied by PropertyPlaceholderConfigurer from "dbConnection.xml".
+# Targetted at system administrators, to avoid touching the context XML files.
+
+#jdbc configuration
+jdbc.driverClassName=org.gjt.mm.mysql.Driver
+jdbc.url=jdbc:mysql://localhost/lams?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
+
+jdbc.username=lams
+jdbc.password=lamsdemo
+
+#Hibernate configuration
+hibernate.show_sql=true
+hibernate.dialect=org.hibernate.dialect.MySQLDialect
+
+#Connection Pooling configuration
+hibernate.c3p0.minPoolSize=5
+hibernate.c3p0.maxPoolSize=20
+hibernate.c3p0.timeout=1800
+hibernate.c3p0.max_statement=50
\ No newline at end of file
Index: lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/testmcApplicationContext.xml
===================================================================
diff -u
--- lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/testmcApplicationContext.xml (revision 0)
+++ lams_tool_vote/test/java/org/lamsfoundation/lams/tool/vote/testmcApplicationContext.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteQueContent.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteOptsContent.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteSession.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteQueUsr.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteUsrAttempt.hbm.xml
+ /org/lamsfoundation/lams/tool/vote/VoteUploadedFile.hbm.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED, -VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,readOnly,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+ PROPAGATION_REQUIRED,-VoteApplicationException
+
+
+
+
+
Index: lams_tool_vote/test/web/WEB-INF/tiles/tiles-defs.xml
===================================================================
diff -u
--- lams_tool_vote/test/web/WEB-INF/tiles/tiles-defs.xml (revision 0)
+++ lams_tool_vote/test/web/WEB-INF/tiles/tiles-defs.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_vote/test/web/WEB-INF/web.xml
===================================================================
diff -u
--- lams_tool_vote/test/web/WEB-INF/web.xml (revision 0)
+++ lams_tool_vote/test/web/WEB-INF/web.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+ javax.servlet.jsp.jstl.fmt.localizationContext
+ org.lamsfoundation.lams.tool.vote.web.VoteResources
+
+
+ contextConfigLocation
+
+ classpath:/org/lamsfoundation/lams/applicationContext.xml
+ classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/tool/toolApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml
+ classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+ hibernateFilter
+
+ org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
+
+
+ sessionFactoryBeanName
+ mcSessionFactory
+
+
+
+
+ SystemSessionFilter
+
+ org.lamsfoundation.lams.web.session.SystemSessionFilter
+
+
+
+
+ hibernateFilter
+ *.do
+
+
+ SystemSessionFilter
+ /*
+
+
+
+ context
+ org.springframework.web.context.ContextLoaderServlet
+ 1
+
+
+ action
+ org.apache.struts.action.ActionServlet
+
+ config
+ /WEB-INF/struts-config.xml
+
+
+ debug
+ 999
+
+
+ detail
+ 2
+
+
+ validate
+ true
+
+ 2
+
+
+
+ Connector
+ com.fredck.FCKeditor.connector.ConnectorServlet
+
+ baseDir
+ /UserFiles/
+
+
+ debug
+ false
+
+ 1
+
+
+
+ action
+ *.do
+
+
+
+ Connector
+ /editor/filemanager/browser/default/connectors/jsp/connector
+
+
+
+
+ 120
+
+
+
+ 403
+ /403.html
+
+
+
+
+
+ fck-editor
+ /WEB-INF/fckeditor/tlds/FCKeditor.tld
+
+
+
+
+
+ Secure Content
+ /*
+
+
+ LEARNER
+ TEACHER
+ STAFF
+ AUTHOR
+ ADMIN
+ SYSADMIN
+
+
+
+
+
+
+ Secure Content
+ /*
+
+
+ LEARNER
+ TEACHER
+ STAFF
+ AUTHOR
+ ADMIN
+ SYSADMIN
+
+
+
+
+
+ Authoring Update
+ /authoringStarter.do
+ /authoring.do
+
+
+ AUTHOR
+
+
+
+
+
+
+ Staff Content
+ /monitoringStarter.do
+ /monitoring.do
+
+
+ STAFF
+
+
+
+
+
+
+
+ Download Files
+ /download/
+
+
+ AUTHOR
+ STAFF
+ ADMIN
+ SYSADMIN
+
+
+
+
+
+
+ FORM
+ LAMS
+
+ /login.jsp
+
+
+
+
Index: lams_tool_vote/web/BaseContent.jsp
===================================================================
diff -u
--- lams_tool_vote/web/BaseContent.jsp (revision 0)
+++ lams_tool_vote/web/BaseContent.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,30 @@
+<%--
+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" %>
+Base Content
Index: lams_tool_vote/web/Footer.jsp
===================================================================
diff -u
--- lams_tool_vote/web/Footer.jsp (revision 0)
+++ lams_tool_vote/web/Footer.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,28 @@
+<%--
+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-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/Header.jsp
===================================================================
diff -u
--- lams_tool_vote/web/Header.jsp (revision 0)
+++ lams_tool_vote/web/Header.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,30 @@
+<%--
+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 contentType="text/html; charset=iso-8859-1" language="java" %>
Index: lams_tool_vote/web/META-INF/MANIFEST.MF
===================================================================
diff -u
--- lams_tool_vote/web/META-INF/MANIFEST.MF (revision 0)
+++ lams_tool_vote/web/META-INF/MANIFEST.MF (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +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
+
Index: lams_tool_vote/web/SystemErrorContent.jsp
===================================================================
diff -u
--- lams_tool_vote/web/SystemErrorContent.jsp (revision 0)
+++ lams_tool_vote/web/SystemErrorContent.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,41 @@
+
+
+<%@ taglib uri="tags-bean" prefix="bean"%>
+<%@ taglib uri="tags-html" prefix="html"%>
+<%@ taglib uri="tags-logic" prefix="logic" %>
+<%@ 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/Template.jsp
===================================================================
diff -u
--- lams_tool_vote/web/Template.jsp (revision 0)
+++ lams_tool_vote/web/Template.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,51 @@
+<%--
+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/VoteErrorBox.jsp
===================================================================
diff -u
--- lams_tool_vote/web/VoteErrorBox.jsp (revision 0)
+++ lams_tool_vote/web/VoteErrorBox.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,204 @@
+<%--
+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/WEB-INF/fckeditor/tlds/FCKeditor.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/fckeditor/tlds/FCKeditor.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/fckeditor/tlds/FCKeditor.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,214 @@
+
+
+
+
+ 2.3
+ 1.1
+ FCKeditor
+ http://fckeditor.net/tags-fckeditor
+ FCKeditor taglib
+
+ editor
+ com.fredck.FCKeditor.tags.FCKeditorTag
+ JSP
+
+ id
+ true
+
+
+ basePath
+ false
+ true
+
+
+ toolbarSet
+ false
+ true
+
+
+ width
+ false
+ true
+
+
+ height
+ false
+ true
+
+
+ customConfigurationsPath
+ false
+ true
+
+
+ editorAreaCSS
+ false
+ true
+
+
+ baseHref
+ false
+ true
+
+
+ skinPath
+ false
+ true
+
+
+ pluginsPath
+ false
+ true
+
+
+ fullPage
+ false
+ true
+
+
+ debug
+ false
+ true
+
+
+ autoDetectLanguage
+ false
+ true
+
+
+ defaultLanguage
+ false
+ true
+
+
+ contentLangDirection
+ false
+ true
+
+
+ enableXHTML
+ false
+ true
+
+
+ enableSourceXHTML
+ false
+ true
+
+
+ fillEmptyBlocks
+ false
+ true
+
+
+ formatSource
+ false
+ true
+
+
+ formatOutput
+ false
+ true
+
+
+ formatIndentator
+ false
+ true
+
+
+ geckoUseSPAN
+ false
+ true
+
+
+ startupFocus
+ false
+ true
+
+
+ forcePasteAsPlainText
+ false
+ true
+
+
+ forceSimpleAmpersand
+ false
+ true
+
+
+ tabSpaces
+ false
+ true
+
+
+ useBROnCarriageReturn
+ false
+ true
+
+
+ toolbarStartExpanded
+ false
+ true
+
+
+ toolbarCanCollapse
+ false
+ true
+
+
+ fontColors
+ false
+ true
+
+
+ fontNames
+ false
+ true
+
+
+ fontSizes
+ false
+ true
+
+
+ fontFormats
+ false
+ true
+
+
+ stylesXmlPath
+ false
+ true
+
+
+ linkBrowserURL
+ false
+ true
+
+
+ imageBrowserURL
+ false
+ true
+
+
+ flashBrowserURL
+ false
+ true
+
+
+ linkUploadURL
+ false
+ true
+
+
+ imageUploadURL
+ false
+ true
+
+
+ flashUploadURL
+ false
+ true
+
+
+
\ No newline at end of file
Index: lams_tool_vote/web/WEB-INF/jstl/tlds/c.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/jstl/tlds/c.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/jstl/tlds/c.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,563 @@
+
+
+
+
+ JSTL 1.1 core library
+ JSTL core
+ 1.1
+ c
+ http://java.sun.com/jsp/jstl/core
+
+
+
+ Provides core validation features for JSTL tags.
+
+
+ org.apache.taglibs.standard.tlv.JstlCoreTLV
+
+
+
+
+
+ Catches any Throwable that occurs in its body and optionally
+ exposes it.
+
+ catch
+ org.apache.taglibs.standard.tag.common.core.CatchTag
+ JSP
+
+
+Name of the exported scoped variable for the
+exception thrown from a nested action. The type of the
+scoped variable is the type of the exception thrown.
+
+ var
+ false
+ false
+
+
+
+
+
+ Simple conditional tag that establishes a context for
+ mutually exclusive conditional operations, marked by
+ <when> and <otherwise>
+
+ choose
+ org.apache.taglibs.standard.tag.common.core.ChooseTag
+ JSP
+
+
+
+
+ Simple conditional tag, which evalutes its body if the
+ supplied condition is true and optionally exposes a Boolean
+ scripting variable representing the evaluation of this condition
+
+ if
+ org.apache.taglibs.standard.tag.rt.core.IfTag
+ JSP
+
+
+The test condition that determines whether or
+not the body content should be processed.
+
+ test
+ true
+ true
+ boolean
+
+
+
+Name of the exported scoped variable for the
+resulting value of the test condition. The type
+of the scoped variable is Boolean.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Retrieves an absolute or relative URL and exposes its contents
+ to either the page, a String in 'var', or a Reader in 'varReader'.
+
+ import
+ org.apache.taglibs.standard.tag.rt.core.ImportTag
+ org.apache.taglibs.standard.tei.ImportTEI
+ JSP
+
+
+The URL of the resource to import.
+
+ url
+ true
+ true
+
+
+
+Name of the exported scoped variable for the
+resource's content. The type of the scoped
+variable is String.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+Name of the exported scoped variable for the
+resource's content. The type of the scoped
+variable is Reader.
+
+ varReader
+ false
+ false
+
+
+
+Name of the context when accessing a relative
+URL resource that belongs to a foreign
+context.
+
+ context
+ false
+ true
+
+
+
+Character encoding of the content at the input
+resource.
+
+ charEncoding
+ false
+ true
+
+
+
+
+
+ The basic iteration tag, accepting many different
+ collection types and supporting subsetting and other
+ functionality
+
+ forEach
+ org.apache.taglibs.standard.tag.rt.core.ForEachTag
+ org.apache.taglibs.standard.tei.ForEachTEI
+ JSP
+
+
+Collection of items to iterate over.
+
+ items
+ false
+ true
+ java.lang.Object
+
+
+
+If items specified:
+Iteration begins at the item located at the
+specified index. First item of the collection has
+index 0.
+If items not specified:
+Iteration begins with index set at the value
+specified.
+
+ begin
+ false
+ true
+ int
+
+
+
+If items specified:
+Iteration ends at the item located at the
+specified index (inclusive).
+If items not specified:
+Iteration ends when index reaches the value
+specified.
+
+ end
+ false
+ true
+ int
+
+
+
+Iteration will only process every step items of
+the collection, starting with the first one.
+
+ step
+ false
+ true
+ int
+
+
+
+Name of the exported scoped variable for the
+current item of the iteration. This scoped
+variable has nested visibility. Its type depends
+on the object of the underlying collection.
+
+ var
+ false
+ false
+
+
+
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of type
+javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested
+visibility.
+
+ varStatus
+ false
+ false
+
+
+
+
+
+ Iterates over tokens, separated by the supplied delimeters
+
+ forTokens
+ org.apache.taglibs.standard.tag.rt.core.ForTokensTag
+ JSP
+
+
+String of tokens to iterate over.
+
+ items
+ true
+ true
+ java.lang.String
+
+
+
+The set of delimiters (the characters that
+separate the tokens in the string).
+
+ delims
+ true
+ true
+ java.lang.String
+
+
+
+Iteration begins at the token located at the
+specified index. First token has index 0.
+
+ begin
+ false
+ true
+ int
+
+
+
+Iteration ends at the token located at the
+specified index (inclusive).
+
+ end
+ false
+ true
+ int
+
+
+
+Iteration will only process every step tokens
+of the string, starting with the first one.
+
+ step
+ false
+ true
+ int
+
+
+
+Name of the exported scoped variable for the
+current item of the iteration. This scoped
+variable has nested visibility.
+
+ var
+ false
+ false
+
+
+
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of
+type
+javax.servlet.jsp.jstl.core.LoopTag
+Status. This scoped variable has nested
+visibility.
+
+ varStatus
+ false
+ false
+
+
+
+
+
+ Like <%= ... >, but for expressions.
+
+ out
+ org.apache.taglibs.standard.tag.rt.core.OutTag
+ JSP
+
+
+Expression to be evaluated.
+
+ value
+ true
+ true
+
+
+
+Default value if the resulting value is null.
+
+ default
+ false
+ true
+
+
+
+Determines whether characters <,>,&,'," in the
+resulting string should be converted to their
+corresponding character entity codes. Default value is
+true.
+
+ escapeXml
+ false
+ true
+
+
+
+
+
+
+ Subtag of <choose> that follows <when> tags
+ and runs only if all of the prior conditions evaluated to
+ 'false'
+
+ otherwise
+ org.apache.taglibs.standard.tag.common.core.OtherwiseTag
+ JSP
+
+
+
+
+ Adds a parameter to a containing 'import' tag's URL.
+
+ param
+ org.apache.taglibs.standard.tag.rt.core.ParamTag
+ JSP
+
+
+Name of the query string parameter.
+
+ name
+ true
+ true
+
+
+
+Value of the parameter.
+
+ value
+ false
+ true
+
+
+
+
+
+ Redirects to a new URL.
+
+ redirect
+ org.apache.taglibs.standard.tag.rt.core.RedirectTag
+ JSP
+
+
+The URL of the resource to redirect to.
+
+ url
+ false
+ true
+
+
+
+Name of the context when redirecting to a relative URL
+resource that belongs to a foreign context.
+
+ context
+ false
+ true
+
+
+
+
+
+ Removes a scoped variable (from a particular scope, if specified).
+
+ remove
+ org.apache.taglibs.standard.tag.common.core.RemoveTag
+ empty
+
+
+Name of the scoped variable to be removed.
+
+ var
+ true
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Sets the result of an expression evaluation in a 'scope'
+
+ set
+ org.apache.taglibs.standard.tag.rt.core.SetTag
+ JSP
+
+
+Name of the exported scoped variable to hold the value
+specified in the action. The type of the scoped variable is
+whatever type the value expression evaluates to.
+
+ var
+ false
+ false
+
+
+
+Expression to be evaluated.
+
+ value
+ false
+ true
+
+
+
+Target object whose property will be set. Must evaluate to
+a JavaBeans object with setter property property, or to a
+java.util.Map object.
+
+ target
+ false
+ true
+
+
+
+Name of the property to be set in the target object.
+
+ property
+ false
+ true
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Creates a URL with optional query parameters.
+
+ url
+ org.apache.taglibs.standard.tag.rt.core.UrlTag
+ JSP
+
+
+Name of the exported scoped variable for the
+processed url. The type of the scoped variable is
+String.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+URL to be processed.
+
+ value
+ false
+ true
+
+
+
+Name of the context when specifying a relative URL
+resource that belongs to a foreign context.
+
+ context
+ false
+ true
+
+
+
+
+
+ Subtag of <choose> that includes its body if its
+ condition evalutes to 'true'
+
+ when
+ org.apache.taglibs.standard.tag.rt.core.WhenTag
+ JSP
+
+
+The test condition that determines whether or not the
+body content should be processed.
+
+ test
+ true
+ true
+ boolean
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/jstl/tlds/fmt.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/jstl/tlds/fmt.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/jstl/tlds/fmt.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,671 @@
+
+
+
+
+ JSTL 1.1 i18n-capable formatting library
+ JSTL fmt
+ 1.1
+ fmt
+ http://java.sun.com/jsp/jstl/fmt
+
+
+
+ Provides core validation features for JSTL tags.
+
+
+ org.apache.taglibs.standard.tlv.JstlFmtTLV
+
+
+
+
+
+ Sets the request character encoding
+
+ requestEncoding
+ org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag
+ empty
+
+
+Name of character encoding to be applied when
+decoding request parameters.
+
+ value
+ false
+ true
+
+
+
+
+
+ Stores the given locale in the locale configuration variable
+
+ setLocale
+ org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag
+ empty
+
+
+A String value is interpreted as the
+printable representation of a locale, which
+must contain a two-letter (lower-case)
+language code (as defined by ISO-639),
+and may contain a two-letter (upper-case)
+country code (as defined by ISO-3166).
+Language and country codes must be
+separated by hyphen (-) or underscore
+(_).
+
+ value
+ true
+ true
+
+
+
+Vendor- or browser-specific variant.
+See the java.util.Locale javadocs for
+more information on variants.
+
+ variant
+ false
+ true
+
+
+
+Scope of the locale configuration variable.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Specifies the time zone for any time formatting or parsing actions
+ nested in its body
+
+ timeZone
+ org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag
+ JSP
+
+
+The time zone. A String value is interpreted as
+a time zone ID. This may be one of the time zone
+IDs supported by the Java platform (such as
+"America/Los_Angeles") or a custom time zone
+ID (such as "GMT-8"). See
+java.util.TimeZone for more information on
+supported time zone formats.
+
+ value
+ true
+ true
+
+
+
+
+
+ Stores the given time zone in the time zone configuration variable
+
+ setTimeZone
+ org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag
+ empty
+
+
+The time zone. A String value is interpreted as
+a time zone ID. This may be one of the time zone
+IDs supported by the Java platform (such as
+"America/Los_Angeles") or a custom time zone
+ID (such as "GMT-8"). See java.util.TimeZone for
+more information on supported time zone
+formats.
+
+ value
+ true
+ true
+
+
+
+Name of the exported scoped variable which
+stores the time zone of type
+java.util.TimeZone.
+
+ var
+ false
+ false
+
+
+
+Scope of var or the time zone configuration
+variable.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Loads a resource bundle to be used by its tag body
+
+ bundle
+ org.apache.taglibs.standard.tag.rt.fmt.BundleTag
+ JSP
+
+
+Resource bundle base name. This is the bundle's
+fully-qualified resource name, which has the same
+form as a fully-qualified class name, that is, it uses
+"." as the package component separator and does not
+have any file type (such as ".class" or ".properties")
+suffix.
+
+ basename
+ true
+ true
+
+
+
+Prefix to be prepended to the value of the message
+key of any nested <fmt:message> action.
+
+ prefix
+ false
+ true
+
+
+
+
+
+ Loads a resource bundle and stores it in the named scoped variable or
+ the bundle configuration variable
+
+ setBundle
+ org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag
+ empty
+
+
+Resource bundle base name. This is the bundle's
+fully-qualified resource name, which has the same
+form as a fully-qualified class name, that is, it uses
+"." as the package component separator and does not
+have any file type (such as ".class" or ".properties")
+suffix.
+
+ basename
+ true
+ true
+
+
+
+Name of the exported scoped variable which stores
+the i18n localization context of type
+javax.servlet.jsp.jstl.fmt.LocalizationC
+ontext.
+
+ var
+ false
+ false
+
+
+
+Scope of var or the localization context
+configuration variable.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Maps key to localized message and performs parametric replacement
+
+ message
+ org.apache.taglibs.standard.tag.rt.fmt.MessageTag
+ JSP
+
+
+Message key to be looked up.
+
+ key
+ false
+ true
+
+
+
+Localization context in whose resource
+bundle the message key is looked up.
+
+ bundle
+ false
+ true
+
+
+
+Name of the exported scoped variable
+which stores the localized message.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Supplies an argument for parametric replacement to a containing
+ <message> tag
+
+ param
+ org.apache.taglibs.standard.tag.rt.fmt.ParamTag
+ JSP
+
+
+Argument used for parametric replacement.
+
+ value
+ false
+ true
+
+
+
+
+
+ Formats a numeric value as a number, currency, or percentage
+
+ formatNumber
+ org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag
+ JSP
+
+
+Numeric value to be formatted.
+
+ value
+ false
+ true
+
+
+
+Specifies whether the value is to be
+formatted as number, currency, or
+percentage.
+
+ type
+ false
+ true
+
+
+
+Custom formatting pattern.
+
+ pattern
+ false
+ true
+
+
+
+ISO 4217 currency code. Applied only
+when formatting currencies (i.e. if type is
+equal to "currency"); ignored otherwise.
+
+ currencyCode
+ false
+ true
+
+
+
+Currency symbol. Applied only when
+formatting currencies (i.e. if type is equal
+to "currency"); ignored otherwise.
+
+ currencySymbol
+ false
+ true
+
+
+
+Specifies whether the formatted output
+will contain any grouping separators.
+
+ groupingUsed
+ false
+ true
+
+
+
+Maximum number of digits in the integer
+portion of the formatted output.
+
+ maxIntegerDigits
+ false
+ true
+
+
+
+Minimum number of digits in the integer
+portion of the formatted output.
+
+ minIntegerDigits
+ false
+ true
+
+
+
+Maximum number of digits in the
+fractional portion of the formatted output.
+
+ maxFractionDigits
+ false
+ true
+
+
+
+Minimum number of digits in the
+fractional portion of the formatted output.
+
+ minFractionDigits
+ false
+ true
+
+
+
+Name of the exported scoped variable
+which stores the formatted result as a
+String.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Parses the string representation of a number, currency, or percentage
+
+ parseNumber
+ org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag
+ JSP
+
+
+String to be parsed.
+
+ value
+ false
+ true
+
+
+
+Specifies whether the string in the value
+attribute should be parsed as a number,
+currency, or percentage.
+
+ type
+ false
+ true
+
+
+
+Custom formatting pattern that determines
+how the string in the value attribute is to be
+parsed.
+
+ pattern
+ false
+ true
+
+
+
+Locale whose default formatting pattern (for
+numbers, currencies, or percentages,
+respectively) is to be used during the parse
+operation, or to which the pattern specified
+via the pattern attribute (if present) is
+applied.
+
+ parseLocale
+ false
+ true
+
+
+
+Specifies whether just the integer portion of
+the given value should be parsed.
+
+ integerOnly
+ false
+ true
+
+
+
+Name of the exported scoped variable which
+stores the parsed result (of type
+java.lang.Number).
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Formats a date and/or time using the supplied styles and pattern
+
+ formatDate
+ org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag
+ empty
+
+
+Date and/or time to be formatted.
+
+ value
+ true
+ true
+
+
+
+Specifies whether the time, the date, or both
+the time and date components of the given
+date are to be formatted.
+
+ type
+ false
+ true
+
+
+
+Predefined formatting style for dates. Follows
+the semantics defined in class
+java.text.DateFormat. Applied only
+when formatting a date or both a date and
+time (i.e. if type is missing or is equal to
+"date" or "both"); ignored otherwise.
+
+ dateStyle
+ false
+ true
+
+
+
+Predefined formatting style for times. Follows
+the semantics defined in class
+java.text.DateFormat. Applied only
+when formatting a time or both a date and
+time (i.e. if type is equal to "time" or "both");
+ignored otherwise.
+
+ timeStyle
+ false
+ true
+
+
+
+Custom formatting style for dates and times.
+
+ pattern
+ false
+ true
+
+
+
+Time zone in which to represent the formatted
+time.
+
+ timeZone
+ false
+ true
+
+
+
+Name of the exported scoped variable which
+stores the formatted result as a String.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Parses the string representation of a date and/or time
+
+ parseDate
+ org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag
+ JSP
+
+
+Date string to be parsed.
+
+ value
+ false
+ true
+
+
+
+Specifies whether the date string in the
+value attribute is supposed to contain a
+time, a date, or both.
+
+ type
+ false
+ true
+
+
+
+Predefined formatting style for days
+which determines how the date
+component of the date string is to be
+parsed. Applied only when formatting a
+date or both a date and time (i.e. if type
+is missing or is equal to "date" or "both");
+ignored otherwise.
+
+ dateStyle
+ false
+ true
+
+
+
+Predefined formatting styles for times
+which determines how the time
+component in the date string is to be
+parsed. Applied only when formatting a
+time or both a date and time (i.e. if type
+is equal to "time" or "both"); ignored
+otherwise.
+
+ timeStyle
+ false
+ true
+
+
+
+Custom formatting pattern which
+determines how the date string is to be
+parsed.
+
+ pattern
+ false
+ true
+
+
+
+Time zone in which to interpret any time
+information in the date string.
+
+ timeZone
+ false
+ true
+
+
+
+Locale whose predefined formatting styles
+for dates and times are to be used during
+the parse operation, or to which the
+pattern specified via the pattern
+attribute (if present) is applied.
+
+ parseLocale
+ false
+ true
+
+
+
+Name of the exported scoped variable in
+which the parsing result (of type
+java.util.Date) is stored.
+
+ var
+ false
+ false
+
+
+
+Scope of var.
+
+ scope
+ false
+ false
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/jstl/tlds/fn.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/jstl/tlds/fn.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/jstl/tlds/fn.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,207 @@
+
+
+
+
+ JSTL 1.1 functions library
+ JSTL functions
+ 1.1
+ fn
+ http://java.sun.com/jsp/jstl/functions
+
+
+
+ Tests if an input string contains the specified substring.
+
+ contains
+ org.apache.taglibs.standard.functions.Functions
+ boolean contains(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:contains(name, searchString)}">
+
+
+
+
+
+ Tests if an input string contains the specified substring in a case insensitive way.
+
+ containsIgnoreCase
+ org.apache.taglibs.standard.functions.Functions
+ boolean containsIgnoreCase(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:containsIgnoreCase(name, searchString)}">
+
+
+
+
+
+ Tests if an input string ends with the specified suffix.
+
+ endsWith
+ org.apache.taglibs.standard.functions.Functions
+ boolean endsWith(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:endsWith(filename, ".txt")}">
+
+
+
+
+
+ Escapes characters that could be interpreted as XML markup.
+
+ escapeXml
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String escapeXml(java.lang.String)
+
+ ${fn:escapeXml(param:info)}
+
+
+
+
+
+ Returns the index withing a string of the first occurrence of a specified substring.
+
+ indexOf
+ org.apache.taglibs.standard.functions.Functions
+ int indexOf(java.lang.String, java.lang.String)
+
+ ${fn:indexOf(name, "-")}
+
+
+
+
+
+ Joins all elements of an array into a string.
+
+ join
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String join(java.lang.String[], java.lang.String)
+
+ ${fn:join(array, ";")}
+
+
+
+
+
+ Returns the number of items in a collection, or the number of characters in a string.
+
+ length
+ org.apache.taglibs.standard.functions.Functions
+ int length(java.lang.Object)
+
+ You have ${fn:length(shoppingCart.products)} in your shopping cart.
+
+
+
+
+
+ Returns a string resulting from replacing in an input string all occurrences
+ of a "before" string into an "after" substring.
+
+ replace
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String replace(java.lang.String, java.lang.String, java.lang.String)
+
+ ${fn:replace(text, "-", "")}
+
+
+
+
+
+ Splits a string into an array of substrings.
+
+ split
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String[] split(java.lang.String, java.lang.String)
+
+ ${fn:split(customerNames, ";")}
+
+
+
+
+
+ Tests if an input string starts with the specified prefix.
+
+ startsWith
+ org.apache.taglibs.standard.functions.Functions
+ boolean startsWith(java.lang.String, java.lang.String)
+
+ <c:if test="${fn:startsWith(product.id, "100-")}">
+
+
+
+
+
+ Returns a subset of a string.
+
+ substring
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String substring(java.lang.String, int, int)
+
+ P.O. Box: ${fn:substring(zip, 6, -1)}
+
+
+
+
+
+ Returns a subset of a string following a specific substring.
+
+ substringAfter
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String substringAfter(java.lang.String, java.lang.String)
+
+ P.O. Box: ${fn:substringAfter(zip, "-")}
+
+
+
+
+
+ Returns a subset of a string before a specific substring.
+
+ substringBefore
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String substringBefore(java.lang.String, java.lang.String)
+
+ Zip (without P.O. Box): ${fn:substringBefore(zip, "-")}
+
+
+
+
+
+ Converts all of the characters of a string to lower case.
+
+ toLowerCase
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String toLowerCase(java.lang.String)
+
+ Product name: ${fn.toLowerCase(product.name)}
+
+
+
+
+
+ Converts all of the characters of a string to upper case.
+
+ toUpperCase
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String toUpperCase(java.lang.String)
+
+ Product name: ${fn.UpperCase(product.name)}
+
+
+
+
+
+ Removes white spaces from both ends of a string.
+
+ trim
+ org.apache.taglibs.standard.functions.Functions
+ java.lang.String trim(java.lang.String)
+
+ Name: ${fn.trim(name)}
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/jstl/tlds/permittedTaglibs.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/jstl/tlds/permittedTaglibs.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/jstl/tlds/permittedTaglibs.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,34 @@
+
+
+
+
+ Restricts JSP pages to the JSTL tag libraries
+
+ permittedTaglibs
+ 1.1
+ permittedTaglibs
+ http://jakarta.apache.org/taglibs/standard/permittedTaglibs
+
+
+
+ javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV
+
+
+
+ Whitespace-separated list of taglib URIs to permit. This example
+ TLD for the Standard Taglib allows only JSTL 'el' taglibs to be
+ imported.
+
+ permittedTaglibs
+
+ http://java.sun.com/jsp/jstl/core
+ http://java.sun.com/jsp/jstl/fmt
+ http://java.sun.com/jsp/jstl/sql
+ http://java.sun.com/jsp/jstl/xml
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/jstl/tlds/scriptfree.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/jstl/tlds/scriptfree.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/jstl/tlds/scriptfree.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,51 @@
+
+
+
+
+ Validates JSP pages to prohibit use of scripting elements.
+
+ 1.1
+ scriptfree
+ http://jakarta.apache.org/taglibs/standard/scriptfree
+
+
+
+ Validates prohibitions against scripting elements.
+
+
+ javax.servlet.jsp.jstl.tlv.ScriptFreeTLV
+
+
+
+ Controls whether or not declarations are considered valid.
+
+ allowDeclarations
+ false
+
+
+
+ Controls whether or not scriptlets are considered valid.
+
+ allowScriptlets
+ false
+
+
+
+ Controls whether or not top-level expressions are considered valid.
+
+ allowExpressions
+ false
+
+
+
+ Controls whether or not expressions used to supply request-time
+ attribute values are considered valid.
+
+ allowRTExpressions
+ false
+
+
+
Index: lams_tool_vote/web/WEB-INF/jstl/tlds/x.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/jstl/tlds/x.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/jstl/tlds/x.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,448 @@
+
+
+
+
+ JSTL 1.1 XML library
+ JSTL XML
+ 1.1
+ x
+ http://java.sun.com/jsp/jstl/xml
+
+
+
+ Provides validation features for JSTL XML tags.
+
+
+ org.apache.taglibs.standard.tlv.JstlXmlTLV
+
+
+
+
+
+ Simple conditional tag that establishes a context for
+ mutually exclusive conditional operations, marked by
+ <when> and <otherwise>
+
+ choose
+ org.apache.taglibs.standard.tag.common.core.ChooseTag
+ JSP
+
+
+
+
+ Like <%= ... >, but for XPath expressions.
+
+ out
+ org.apache.taglibs.standard.tag.rt.xml.ExprTag
+ empty
+
+
+XPath expression to be evaluated.
+
+ select
+ true
+ false
+
+
+
+Determines whether characters <,>,&,'," in the
+resulting string should be converted to their
+corresponding character entity codes. Default
+value is true.
+
+ escapeXml
+ false
+ true
+
+
+
+
+
+ XML conditional tag, which evalutes its body if the
+ supplied XPath expression evalutes to 'true' as a boolean
+
+ if
+ org.apache.taglibs.standard.tag.common.xml.IfTag
+ JSP
+
+
+The test condition that tells whether or not the
+body content should be processed.
+
+ select
+ true
+ false
+
+
+
+Name of the exported scoped variable for the
+resulting value of the test condition. The type
+of the scoped variable is Boolean.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ XML iteration tag.
+
+ forEach
+ org.apache.taglibs.standard.tag.common.xml.ForEachTag
+ JSP
+
+
+Name of the exported scoped variable for the
+current item of the iteration. This scoped variable
+has nested visibility. Its type depends on the
+result of the XPath expression in the select
+attribute.
+
+ var
+ false
+ false
+
+
+
+XPath expression to be evaluated.
+
+ select
+ true
+ false
+
+
+
+Iteration begins at the item located at the
+specified index. First item of the collection has
+index 0.
+
+ begin
+ false
+ true
+ int
+
+
+
+Iteration ends at the item located at the specified
+index (inclusive).
+
+ end
+ false
+ true
+ int
+
+
+
+Iteration will only process every step items of
+the collection, starting with the first one.
+
+ step
+ false
+ true
+ int
+
+
+
+Name of the exported scoped variable for the
+status of the iteration. Object exported is of type
+javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.
+
+ varStatus
+ false
+ false
+
+
+
+
+
+ Subtag of <choose> that follows <when> tags
+ and runs only if all of the prior conditions evaluated to
+ 'false'
+
+ otherwise
+ org.apache.taglibs.standard.tag.common.core.OtherwiseTag
+ JSP
+
+
+
+
+ Adds a parameter to a containing 'transform' tag's Transformer
+
+ param
+ org.apache.taglibs.standard.tag.rt.xml.ParamTag
+ JSP
+
+
+Name of the transformation parameter.
+
+ name
+ true
+ true
+
+
+
+Value of the parameter.
+
+ value
+ false
+ true
+
+
+
+
+
+ Parses XML content from 'source' attribute or 'body'
+
+ parse
+ org.apache.taglibs.standard.tag.rt.xml.ParseTag
+ org.apache.taglibs.standard.tei.XmlParseTEI
+ JSP
+
+
+Name of the exported scoped variable for
+the parsed XML document. The type of the
+scoped variable is implementation
+dependent.
+
+ var
+ false
+ false
+
+
+
+Name of the exported scoped variable for
+the parsed XML document. The type of the
+scoped variable is
+org.w3c.dom.Document.
+
+ varDom
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+Scope for varDom.
+
+ scopeDom
+ false
+ false
+
+
+
+Deprecated. Use attribute 'doc' instead.
+
+ xml
+ false
+ true
+
+
+
+Source XML document to be parsed.
+
+ doc
+ false
+ true
+
+
+
+The system identifier (URI) for parsing the
+XML document.
+
+ systemId
+ false
+ true
+
+
+
+Filter to be applied to the source
+document.
+
+ filter
+ false
+ true
+
+
+
+
+
+ Saves the result of an XPath expression evaluation in a 'scope'
+
+ set
+ org.apache.taglibs.standard.tag.common.xml.SetTag
+ empty
+
+
+Name of the exported scoped variable to hold
+the value specified in the action. The type of the
+scoped variable is whatever type the select
+expression evaluates to.
+
+ var
+ true
+ false
+
+
+
+XPath expression to be evaluated.
+
+ select
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+
+
+ Conducts a transformation given a source XML document
+ and an XSLT stylesheet
+
+ transform
+ org.apache.taglibs.standard.tag.rt.xml.TransformTag
+ org.apache.taglibs.standard.tei.XmlTransformTEI
+ JSP
+
+
+Name of the exported
+scoped variable for the
+transformed XML
+document. The type of the
+scoped variable is
+org.w3c.dom.Document.
+
+ var
+ false
+ false
+
+
+
+Scope for var.
+
+ scope
+ false
+ false
+
+
+
+Result
+Object that captures or
+processes the transformation
+result.
+
+ result
+ false
+ true
+
+
+
+Deprecated. Use attribute
+'doc' instead.
+
+ xml
+ false
+ true
+
+
+
+Source XML document to be
+transformed. (If exported by
+<x:set>, it must correspond
+to a well-formed XML
+document, not a partial
+document.)
+
+ doc
+ false
+ true
+
+
+
+Deprecated. Use attribute
+'docSystemId' instead.
+
+ xmlSystemId
+ false
+ true
+
+
+
+The system identifier (URI)
+for parsing the XML
+document.
+
+ docSystemId
+ false
+ true
+
+
+
+javax.xml.transform.Source
+Transformation stylesheet as
+a String, Reader, or
+Source object.
+
+ xslt
+ false
+ true
+
+
+
+The system identifier (URI)
+for parsing the XSLT
+stylesheet.
+
+ xsltSystemId
+ false
+ true
+
+
+
+
+
+ Subtag of <choose> that includes its body if its
+ expression evalutes to 'true'
+
+ when
+ org.apache.taglibs.standard.tag.common.xml.WhenTag
+ JSP
+
+
+The test condition that tells whether or
+not the body content should be
+processed
+
+ select
+ true
+ false
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/lams.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/lams.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/lams.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,276 @@
+
+
+
+
+ 1.0
+ lams
+
+ LAMSTags
+
+
+
+
+ Output the Server URL as defined in the lams.xml configuration file.
+ LAMS URL
+
+
+ LAMSURL
+ org.lamsfoundation.lams.web.tag.LAMSURLTag
+ empty
+
+
+
+
+ Output details from the shared session UserDTO object
+ user details
+
+
+ user
+ org.lamsfoundation.lams.web.tag.UserTag
+ empty
+
+
+ property
+ true
+
+ true
+
+
+
+
+
+
+ Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/
+ Base URL for the current web app
+
+
+ WebAppURL
+ org.lamsfoundation.lams.web.tag.WebAppURLTag
+ empty
+
+
+
+
+ Output stylesheet based on the user preferences.
+ User's chosen stylesheet
+
+
+ css
+ org.lamsfoundation.lams.web.tag.CssTag
+ empty
+
+
+ localLink
+ false
+
+ true
+
+
+
+
+
+
+ STRUTS-textarea
+ org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag
+ empty
+
+ accesskey
+ false
+ true
+
+
+ alt
+ false
+ true
+
+
+ altKey
+ false
+ true
+
+
+ bundle
+ false
+ true
+
+
+ cols
+ false
+ true
+
+
+ disabled
+ false
+ true
+
+
+ errorKey
+ false
+ true
+
+
+ errorStyle
+ false
+ true
+
+
+ errorStyleClass
+ false
+ true
+
+
+ errorStyleId
+ false
+ true
+
+
+ indexed
+ false
+ true
+
+
+ name
+ false
+ true
+
+
+ onblur
+ false
+ true
+
+
+ onchange
+ false
+ true
+
+
+ onclick
+ false
+ true
+
+
+ ondblclick
+ false
+ true
+
+
+ onfocus
+ false
+ true
+
+
+ onkeydown
+ false
+ true
+
+
+ onkeypress
+ false
+ true
+
+
+ onkeyup
+ false
+ true
+
+
+ onmousedown
+ false
+ true
+
+
+ onmousemove
+ false
+ true
+
+
+ onmouseout
+ false
+ true
+
+
+ onmouseover
+ false
+ true
+
+
+ onmouseup
+ false
+ true
+
+
+ property
+ true
+ true
+
+
+ readonly
+ false
+ true
+
+
+ rows
+ false
+ true
+
+
+ style
+ false
+ true
+
+
+ styleClass
+ false
+ true
+
+
+ styleId
+ false
+ true
+
+
+ tabindex
+ false
+ true
+
+
+ title
+ false
+ true
+
+
+ titleKey
+ false
+ true
+
+
+ value
+ false
+ true
+
+
+
+ Tab
+ /WEB-INF/tags/Tab.tag
+
+
+ Tabs
+ /WEB-INF/tags/Tabs.tag
+
+
+ TabBody
+ /WEB-INF/tags/TabBody.tag
+
+
+ HTMLEditor
+ /WEB-INF/tags/HTMLEditor.tag
+
+
+ SetEditor
+ /WEB-INF/tags/SetEditor.tag
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts-config.xml
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts-config.xml (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts-config.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts-config_1_2.dtd
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts-config_1_2.dtd (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts-config_1_2.dtd (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,686 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/c.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/c.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/c.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,416 @@
+
+
+
+ 1.0
+ 1.2
+ c
+ http://java.sun.com/jstl/core
+ JSTL core
+ JSTL 1.0 core library
+
+
+
+ org.apache.taglibs.standard.tlv.JstlCoreTLV
+
+
+ expressionAttributes
+
+ out:value
+ out:default
+ out:escapeXml
+ if:test
+ import:url
+ import:context
+ import:charEncoding
+ forEach:items
+ forEach:begin
+ forEach:end
+ forEach:step
+ forTokens:items
+ forTokens:begin
+ forTokens:end
+ forTokens:step
+ param:encode
+ param:name
+ param:value
+ redirect:context
+ redirect:url
+ set:property
+ set:target
+ set:value
+ url:context
+ url:value
+ when:test
+
+
+ Whitespace-separated list of colon-separated token pairs
+ describing tag:attribute combinations that accept expressions.
+ The validator uses this information to determine which
+ attributes need their syntax validated.
+
+
+
+
+
+ catch
+ org.apache.taglibs.standard.tag.common.core.CatchTag
+ JSP
+
+ Catches any Throwable that occurs in its body and optionally
+ exposes it.
+
+
+ var
+ false
+ false
+
+
+
+
+ choose
+ org.apache.taglibs.standard.tag.common.core.ChooseTag
+ JSP
+
+ Simple conditional tag that establishes a context for
+ mutually exclusive conditional operations, marked by
+ <when> and <otherwise>
+
+
+
+
+ out
+ org.apache.taglibs.standard.tag.el.core.OutTag
+ JSP
+
+ Like <%= ... >, but for expressions.
+
+
+ value
+ true
+ false
+
+
+ default
+ false
+ false
+
+
+ escapeXml
+ false
+ false
+
+
+
+
+ if
+ org.apache.taglibs.standard.tag.el.core.IfTag
+ JSP
+
+ Simple conditional tag, which evalutes its body if the
+ supplied condition is true and optionally exposes a Boolean
+ scripting variable representing the evaluation of this condition
+
+
+ test
+ true
+ false
+
+
+ var
+ false
+ false
+
+
+ scope
+ false
+ false
+
+
+
+
+ import
+ org.apache.taglibs.standard.tag.el.core.ImportTag
+ org.apache.taglibs.standard.tei.ImportTEI
+ JSP
+
+ Retrieves an absolute or relative URL and exposes its contents
+ to either the page, a String in 'var', or a Reader in 'varReader'.
+
+
+ url
+ true
+ false
+
+
+ var
+ false
+ false
+
+
+ scope
+ false
+ false
+
+
+ varReader
+ false
+ false
+
+
+ context
+ false
+ false
+
+
+ charEncoding
+ false
+ false
+
+
+
+
+ forEach
+ org.apache.taglibs.standard.tag.el.core.ForEachTag
+ org.apache.taglibs.standard.tei.ForEachTEI
+ JSP
+
+ The basic iteration tag, accepting many different
+ collection types and supporting subsetting and other
+ functionality
+
+
+ items
+ false
+ false
+
+
+ begin
+ false
+ false
+
+
+ end
+ false
+ false
+
+
+ step
+ false
+ false
+
+
+ var
+ false
+ false
+
+
+ varStatus
+ false
+ false
+
+
+
+
+ forTokens
+ org.apache.taglibs.standard.tag.el.core.ForTokensTag
+ JSP
+
+ Iterates over tokens, separated by the supplied delimeters
+
+
+ items
+ true
+ false
+
+
+ delims
+ true
+ false
+
+
+ begin
+ false
+ false
+
+
+ end
+ false
+ false
+
+
+ step
+ false
+ false
+
+
+ var
+ false
+ false
+
+
+ varStatus
+ false
+ false
+
+
+
+
+ otherwise
+ org.apache.taglibs.standard.tag.common.core.OtherwiseTag
+ JSP
+
+ Subtag of <choose> that follows <when> tags
+ and runs only if all of the prior conditions evaluated to
+ 'false'
+
+
+
+
+ param
+ org.apache.taglibs.standard.tag.el.core.ParamTag
+ JSP
+
+ Adds a parameter to a containing 'import' tag's URL.
+
+
+ name
+ true
+ false
+
+
+ value
+ false
+ false
+
+
+
+
+ redirect
+ org.apache.taglibs.standard.tag.el.core.RedirectTag
+ JSP
+
+ Redirects to a new URL.
+
+
+ var
+ false
+ false
+
+
+ scope
+ false
+ false
+
+
+ url
+ true
+ false
+
+
+ context
+ false
+ false
+
+
+
+
+ remove
+ org.apache.taglibs.standard.tag.common.core.RemoveTag
+ empty
+
+ Removes a scoped variable (from a particular scope, if specified).
+
+
+ var
+ true
+ false
+
+
+ scope
+ false
+ false
+
+
+
+
+ set
+ org.apache.taglibs.standard.tag.el.core.SetTag
+ JSP
+
+ Sets the result of an expression evaluation in a 'scope'
+
+
+ var
+ false
+ false
+
+
+ value
+ false
+ false
+
+
+ target
+ false
+ false
+
+
+ property
+ false
+ false
+
+
+ scope
+ false
+ false
+
+
+
+
+ url
+ org.apache.taglibs.standard.tag.el.core.UrlTag
+ JSP
+
+ Prints or exposes a URL with optional query parameters
+ (via the c:param tag).
+
+
+ var
+ false
+ false
+
+
+ scope
+ false
+ false
+
+
+ value
+ true
+ false
+
+
+ context
+ false
+ false
+
+
+
+
+ when
+ org.apache.taglibs.standard.tag.el.core.WhenTag
+ JSP
+
+ Subtag of <choose> that includes its body if its
+ condition evalutes to 'true'
+
+
+ test
+ true
+ false
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/struts-bean.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/struts-bean.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/struts-bean.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+bean
+http://struts.apache.org/tags-bean
+
+cookie
+org.apache.struts.taglib.bean.CookieTag
+org.apache.struts.taglib.bean.CookieTei
+empty
+
+id
+true
+false
+
+
+multiple
+false
+true
+
+
+name
+true
+true
+
+
+value
+false
+true
+
+
+
+define
+org.apache.struts.taglib.bean.DefineTag
+org.apache.struts.taglib.bean.DefineTei
+JSP
+
+id
+true
+false
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+toScope
+false
+true
+
+
+type
+false
+true
+
+
+value
+false
+true
+
+
+
+header
+org.apache.struts.taglib.bean.HeaderTag
+org.apache.struts.taglib.bean.HeaderTei
+empty
+
+id
+true
+false
+
+
+multiple
+false
+true
+
+
+name
+true
+true
+
+
+value
+false
+true
+
+
+
+include
+org.apache.struts.taglib.bean.IncludeTag
+org.apache.struts.taglib.bean.IncludeTei
+empty
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+id
+true
+false
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+transaction
+false
+true
+
+
+
+message
+org.apache.struts.taglib.bean.MessageTag
+empty
+
+arg0
+false
+true
+
+
+arg1
+false
+true
+
+
+arg2
+false
+true
+
+
+arg3
+false
+true
+
+
+arg4
+false
+true
+
+
+bundle
+false
+true
+
+
+key
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+page
+org.apache.struts.taglib.bean.PageTag
+org.apache.struts.taglib.bean.PageTei
+empty
+
+id
+true
+false
+
+
+property
+true
+true
+
+
+
+parameter
+org.apache.struts.taglib.bean.ParameterTag
+org.apache.struts.taglib.bean.ParameterTei
+empty
+
+id
+true
+false
+
+
+multiple
+false
+true
+
+
+name
+true
+true
+
+
+value
+false
+true
+
+
+
+resource
+org.apache.struts.taglib.bean.ResourceTag
+org.apache.struts.taglib.bean.ResourceTei
+empty
+
+id
+true
+false
+
+
+input
+false
+true
+
+
+name
+true
+true
+
+
+
+size
+org.apache.struts.taglib.bean.SizeTag
+org.apache.struts.taglib.bean.SizeTei
+empty
+
+collection
+false
+true
+
+
+id
+true
+false
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+struts
+org.apache.struts.taglib.bean.StrutsTag
+org.apache.struts.taglib.bean.StrutsTei
+empty
+
+id
+true
+false
+
+
+formBean
+false
+true
+
+
+forward
+false
+true
+
+
+mapping
+false
+true
+
+
+
+write
+org.apache.struts.taglib.bean.WriteTag
+empty
+
+bundle
+false
+true
+
+
+filter
+false
+true
+
+
+format
+false
+true
+
+
+formatKey
+false
+true
+
+
+ignore
+false
+true
+
+
+locale
+false
+true
+
+
+name
+true
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/struts-html.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/struts-html.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/struts-html.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,3302 @@
+
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+html
+http://struts.apache.org/tags-html
+
+base
+org.apache.struts.taglib.html.BaseTag
+empty
+
+target
+false
+true
+
+
+server
+false
+true
+
+
+
+button
+org.apache.struts.taglib.html.ButtonTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+cancel
+org.apache.struts.taglib.html.CancelTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+checkbox
+org.apache.struts.taglib.html.CheckboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+errors
+org.apache.struts.taglib.html.ErrorsTag
+empty
+
+bundle
+false
+true
+
+
+footer
+false
+true
+
+
+header
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+prefix
+false
+true
+
+
+property
+false
+true
+
+
+suffix
+false
+true
+
+
+
+file
+org.apache.struts.taglib.html.FileTag
+
+accesskey
+false
+true
+
+
+accept
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+form
+org.apache.struts.taglib.html.FormTag
+JSP
+
+action
+true
+true
+
+
+acceptCharset
+false
+true
+
+
+disabled
+false
+true
+
+
+enctype
+false
+true
+
+
+focus
+false
+true
+
+
+focusIndex
+false
+true
+
+
+method
+false
+true
+
+
+onreset
+false
+true
+
+
+onsubmit
+false
+true
+
+
+readonly
+false
+true
+
+
+scriptLanguage
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+target
+false
+true
+
+
+
+frame
+org.apache.struts.taglib.html.FrameTag
+
+bundle
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+frameborder
+false
+true
+
+
+frameName
+false
+true
+
+
+href
+false
+true
+
+
+longdesc
+false
+true
+
+
+marginheight
+false
+true
+
+
+marginwidth
+false
+true
+
+
+name
+false
+true
+
+
+noresize
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+scrolling
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+transaction
+false
+true
+
+
+
+hidden
+org.apache.struts.taglib.html.HiddenTag
+empty
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+write
+false
+true
+
+
+
+html
+org.apache.struts.taglib.html.HtmlTag
+JSP
+
+lang
+false
+true
+
+
+locale
+false
+true
+
+
+xhtml
+false
+true
+
+
+
+image
+org.apache.struts.taglib.html.ImageTag
+
+accesskey
+false
+true
+
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+locale
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+property
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+img
+org.apache.struts.taglib.html.ImgTag
+empty
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+contextRelative
+false
+true
+
+
+height
+false
+true
+
+
+hspace
+false
+true
+
+
+imageName
+false
+true
+
+
+ismap
+false
+true
+
+
+locale
+false
+true
+
+
+lowsrc
+false
+true
+
+
+name
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+paramId
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+usemap
+false
+true
+
+
+vspace
+false
+true
+
+
+width
+false
+true
+
+
+
+javascript
+org.apache.struts.taglib.html.JavascriptValidatorTag
+empty
+
+cdata
+false
+true
+
+
+dynamicJavascript
+false
+false
+
+
+formName
+false
+true
+
+
+method
+false
+true
+
+
+page
+false
+true
+
+
+scriptLanguage
+false
+true
+
+
+src
+false
+true
+
+
+staticJavascript
+false
+false
+
+
+htmlComment
+false
+true
+
+
+bundle
+false
+true
+
+
+
+link
+org.apache.struts.taglib.html.LinkTag
+
+accesskey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+indexed
+false
+true
+
+
+indexId
+false
+true
+
+
+bundle
+false
+true
+
+
+linkName
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+target
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+messages
+org.apache.struts.taglib.html.MessagesTag
+org.apache.struts.taglib.html.MessagesTei
+JSP
+
+id
+true
+false
+
+
+bundle
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+header
+false
+true
+
+
+footer
+false
+true
+
+
+message
+false
+true
+
+
+
+multibox
+org.apache.struts.taglib.html.MultiboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+option
+org.apache.struts.taglib.html.OptionTag
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+key
+false
+true
+
+
+locale
+false
+true
+
+
+style
+false
+true
+
+
+styleId
+false
+true
+
+
+styleClass
+false
+true
+
+
+value
+true
+true
+
+
+
+options
+org.apache.struts.taglib.html.OptionsTag
+empty
+
+collection
+false
+true
+
+
+filter
+false
+true
+
+
+labelName
+false
+true
+
+
+labelProperty
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+
+optionsCollection
+org.apache.struts.taglib.html.OptionsCollectionTag
+empty
+
+filter
+false
+true
+
+
+label
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+value
+false
+true
+
+
+
+password
+org.apache.struts.taglib.html.PasswordTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+redisplay
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+size
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+radio
+org.apache.struts.taglib.html.RadioTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+property
+true
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+true
+true
+
+
+idName
+false
+true
+
+
+
+reset
+org.apache.struts.taglib.html.ResetTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+rewrite
+org.apache.struts.taglib.html.RewriteTag
+empty
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+select
+org.apache.struts.taglib.html.SelectTag
+JSP
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+multiple
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+size
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+submit
+org.apache.struts.taglib.html.SubmitTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+text
+org.apache.struts.taglib.html.TextTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+textarea
+org.apache.struts.taglib.html.TextareaTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+cols
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+rows
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+xhtml
+org.apache.struts.taglib.html.XhtmlTag
+empty
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/struts-logic-el.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/struts-logic-el.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/struts-logic-el.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+logic
+http://struts.apache.org/tags-logic-el
+
+forward
+org.apache.strutsel.taglib.logic.ELForwardTag
+empty
+
+name
+true
+true
+
+
+
+iterate
+org.apache.strutsel.taglib.logic.ELIterateTag
+org.apache.struts.taglib.logic.IterateTei
+JSP
+
+collection
+false
+true
+
+
+id
+true
+false
+
+
+indexId
+false
+false
+
+
+length
+false
+true
+
+
+name
+false
+true
+
+
+offset
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+type
+false
+true
+
+
+
+match
+org.apache.strutsel.taglib.logic.ELMatchTag
+JSP
+
+cookie
+false
+true
+
+
+expr
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+messagesNotPresent
+org.apache.strutsel.taglib.logic.ELMessagesNotPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+messagesPresent
+org.apache.strutsel.taglib.logic.ELMessagesPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+notMatch
+org.apache.strutsel.taglib.logic.ELNotMatchTag
+JSP
+
+cookie
+false
+true
+
+
+expr
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notPresent
+org.apache.strutsel.taglib.logic.ELNotPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+present
+org.apache.strutsel.taglib.logic.ELPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+redirect
+org.apache.strutsel.taglib.logic.ELRedirectTag
+
+action
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/struts-logic.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/struts-logic.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/struts-logic.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,652 @@
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+logic
+http://struts.apache.org/tags-logic
+
+empty
+org.apache.struts.taglib.logic.EmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+equal
+org.apache.struts.taglib.logic.EqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+forward
+org.apache.struts.taglib.logic.ForwardTag
+empty
+
+name
+true
+true
+
+
+
+greaterEqual
+org.apache.struts.taglib.logic.GreaterEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+greaterThan
+org.apache.struts.taglib.logic.GreaterThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+iterate
+org.apache.struts.taglib.logic.IterateTag
+org.apache.struts.taglib.logic.IterateTei
+JSP
+
+collection
+false
+true
+
+
+id
+true
+false
+
+
+indexId
+false
+false
+
+
+length
+false
+true
+
+
+name
+false
+true
+
+
+offset
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+type
+false
+true
+
+
+
+lessEqual
+org.apache.struts.taglib.logic.LessEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+lessThan
+org.apache.struts.taglib.logic.LessThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+match
+org.apache.struts.taglib.logic.MatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+messagesNotPresent
+org.apache.struts.taglib.logic.MessagesNotPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+messagesPresent
+org.apache.struts.taglib.logic.MessagesPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+notEmpty
+org.apache.struts.taglib.logic.NotEmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+notEqual
+org.apache.struts.taglib.logic.NotEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notMatch
+org.apache.struts.taglib.logic.NotMatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notPresent
+org.apache.struts.taglib.logic.NotPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+present
+org.apache.struts.taglib.logic.PresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+redirect
+org.apache.struts.taglib.logic.RedirectTag
+
+action
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+name
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/struts-nested.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/struts-nested.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/struts-nested.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,3171 @@
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+nested
+http://struts.apache.org/tags-nested
+
+nest
+org.apache.struts.taglib.nested.NestedPropertyTag
+JSP
+
+property
+false
+true
+
+
+
+writeNesting
+org.apache.struts.taglib.nested.NestedWriteNestingTag
+org.apache.struts.taglib.nested.NestedWriteNestingTei
+JSP
+
+property
+false
+true
+
+
+id
+false
+true
+
+
+filter
+false
+true
+
+
+
+root
+org.apache.struts.taglib.nested.NestedRootTag
+JSP
+
+name
+false
+true
+
+
+
+define
+org.apache.struts.taglib.nested.bean.NestedDefineTag
+org.apache.struts.taglib.nested.bean.NestedDefineTei
+empty
+
+id
+true
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+toScope
+false
+true
+
+
+type
+false
+true
+
+
+value
+false
+true
+
+
+
+message
+org.apache.struts.taglib.nested.bean.NestedMessageTag
+empty
+
+arg0
+false
+true
+
+
+arg1
+false
+true
+
+
+arg2
+false
+true
+
+
+arg3
+false
+true
+
+
+arg4
+false
+true
+
+
+bundle
+false
+true
+
+
+key
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+size
+org.apache.struts.taglib.nested.bean.NestedSizeTag
+org.apache.struts.taglib.bean.SizeTei
+empty
+
+collection
+false
+true
+
+
+id
+true
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+write
+org.apache.struts.taglib.nested.bean.NestedWriteTag
+empty
+
+bundle
+false
+true
+
+
+filter
+false
+true
+
+
+format
+false
+true
+
+
+formatKey
+false
+true
+
+
+ignore
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+checkbox
+org.apache.struts.taglib.nested.html.NestedCheckboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+errors
+org.apache.struts.taglib.nested.html.NestedErrorsTag
+empty
+
+bundle
+false
+true
+
+
+footer
+false
+true
+
+
+header
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+prefix
+false
+true
+
+
+property
+false
+true
+
+
+suffix
+false
+true
+
+
+
+file
+org.apache.struts.taglib.nested.html.NestedFileTag
+
+accesskey
+false
+true
+
+
+accept
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+form
+org.apache.struts.taglib.nested.html.NestedFormTag
+JSP
+
+action
+true
+true
+
+
+acceptCharset
+false
+true
+
+
+disabled
+false
+true
+
+
+enctype
+false
+true
+
+
+focus
+false
+true
+
+
+focusIndex
+false
+true
+
+
+method
+false
+true
+
+
+onreset
+false
+true
+
+
+onsubmit
+false
+true
+
+
+readonly
+false
+true
+
+
+scriptLanguage
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+target
+false
+true
+
+
+
+hidden
+org.apache.struts.taglib.nested.html.NestedHiddenTag
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+property
+true
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+value
+false
+true
+
+
+write
+false
+true
+
+
+
+image
+org.apache.struts.taglib.nested.html.NestedImageTag
+
+accesskey
+false
+true
+
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+locale
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+property
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+img
+org.apache.struts.taglib.nested.html.NestedImgTag
+empty
+
+accesskey
+false
+true
+
+
+align
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+border
+false
+true
+
+
+bundle
+false
+true
+
+
+height
+false
+true
+
+
+hspace
+false
+true
+
+
+imageName
+false
+true
+
+
+ismap
+false
+true
+
+
+locale
+false
+true
+
+
+lowsrc
+false
+true
+
+
+name
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+paramId
+false
+true
+
+
+page
+false
+true
+
+
+pageKey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+src
+false
+true
+
+
+srcKey
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+usemap
+false
+true
+
+
+vspace
+false
+true
+
+
+width
+false
+true
+
+
+
+link
+org.apache.struts.taglib.nested.html.NestedLinkTag
+
+accesskey
+false
+true
+
+
+action
+false
+true
+
+
+module
+false
+true
+
+
+anchor
+false
+true
+
+
+forward
+false
+true
+
+
+href
+false
+true
+
+
+indexed
+false
+true
+
+
+indexId
+false
+true
+
+
+bundle
+false
+true
+
+
+linkName
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+page
+false
+true
+
+
+paramId
+false
+true
+
+
+paramName
+false
+true
+
+
+paramProperty
+false
+true
+
+
+paramScope
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+target
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+transaction
+false
+true
+
+
+useLocalEncoding
+false
+true
+
+
+
+messages
+org.apache.struts.taglib.nested.html.NestedMessagesTag
+org.apache.struts.taglib.html.MessagesTei
+JSP
+
+id
+true
+true
+
+
+bundle
+false
+true
+
+
+locale
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+header
+false
+true
+
+
+footer
+false
+true
+
+
+message
+false
+true
+
+
+
+multibox
+org.apache.struts.taglib.nested.html.NestedMultiboxTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+options
+org.apache.struts.taglib.nested.html.NestedOptionsTag
+empty
+
+collection
+false
+true
+
+
+filter
+false
+true
+
+
+labelName
+false
+true
+
+
+labelProperty
+false
+true
+
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+
+optionsCollection
+org.apache.struts.taglib.nested.html.NestedOptionsCollectionTag
+empty
+
+filter
+false
+true
+
+
+label
+false
+true
+
+
+name
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+value
+false
+true
+
+
+
+password
+org.apache.struts.taglib.nested.html.NestedPasswordTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+redisplay
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+size
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+radio
+org.apache.struts.taglib.nested.html.NestedRadioTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+property
+true
+true
+
+
+onmousedown
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+true
+true
+
+
+idName
+false
+true
+
+
+
+select
+org.apache.struts.taglib.nested.html.NestedSelectTag
+JSP
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+multiple
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+size
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+submit
+org.apache.struts.taglib.nested.html.NestedSubmitTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+indexed
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+text
+org.apache.struts.taglib.nested.html.NestedTextTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+maxlength
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+size
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+textarea
+org.apache.struts.taglib.nested.html.NestedTextareaTag
+
+accesskey
+false
+true
+
+
+alt
+false
+true
+
+
+altKey
+false
+true
+
+
+bundle
+false
+true
+
+
+cols
+false
+true
+
+
+disabled
+false
+true
+
+
+errorKey
+false
+true
+
+
+errorStyle
+false
+true
+
+
+errorStyleClass
+false
+true
+
+
+errorStyleId
+false
+true
+
+
+indexed
+false
+true
+
+
+name
+false
+true
+
+
+onblur
+false
+true
+
+
+onchange
+false
+true
+
+
+onclick
+false
+true
+
+
+ondblclick
+false
+true
+
+
+onfocus
+false
+true
+
+
+onkeydown
+false
+true
+
+
+onkeypress
+false
+true
+
+
+onkeyup
+false
+true
+
+
+onmousedown
+false
+true
+
+
+onmousemove
+false
+true
+
+
+onmouseout
+false
+true
+
+
+onmouseover
+false
+true
+
+
+onmouseup
+false
+true
+
+
+property
+true
+true
+
+
+readonly
+false
+true
+
+
+rows
+false
+true
+
+
+style
+false
+true
+
+
+styleClass
+false
+true
+
+
+styleId
+false
+true
+
+
+tabindex
+false
+true
+
+
+title
+false
+true
+
+
+titleKey
+false
+true
+
+
+value
+false
+true
+
+
+
+empty
+org.apache.struts.taglib.nested.logic.NestedEmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+equal
+org.apache.struts.taglib.nested.logic.NestedEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+greaterEqual
+org.apache.struts.taglib.nested.logic.NestedGreaterEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+greaterThan
+org.apache.struts.taglib.nested.logic.NestedGreaterThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+iterate
+org.apache.struts.taglib.nested.logic.NestedIterateTag
+org.apache.struts.taglib.nested.logic.NestedIterateTei
+JSP
+
+collection
+false
+true
+
+
+id
+false
+true
+
+
+indexId
+false
+true
+
+
+length
+false
+true
+
+
+name
+false
+true
+
+
+offset
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+type
+false
+true
+
+
+
+lessEqual
+org.apache.struts.taglib.nested.logic.NestedLessEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+lessThan
+org.apache.struts.taglib.nested.logic.NestedLessThanTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+match
+org.apache.struts.taglib.nested.logic.NestedMatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+messagesNotPresent
+org.apache.struts.taglib.nested.logic.NestedMessagesNotPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+messagesPresent
+org.apache.struts.taglib.nested.logic.NestedMessagesPresentTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+message
+false
+true
+
+
+
+notEmpty
+org.apache.struts.taglib.nested.logic.NestedNotEmptyTag
+JSP
+
+name
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+
+notEqual
+org.apache.struts.taglib.nested.logic.NestedNotEqualTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notMatch
+org.apache.struts.taglib.nested.logic.NestedNotMatchTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+location
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+scope
+false
+true
+
+
+value
+true
+true
+
+
+
+notPresent
+org.apache.struts.taglib.nested.logic.NestedNotPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+present
+org.apache.struts.taglib.nested.logic.NestedPresentTag
+JSP
+
+cookie
+false
+true
+
+
+header
+false
+true
+
+
+name
+false
+true
+
+
+parameter
+false
+true
+
+
+property
+false
+true
+
+
+role
+false
+true
+
+
+scope
+false
+true
+
+
+user
+false
+true
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/struts/tlds/struts-tiles.tld
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/struts/tlds/struts-tiles.tld (revision 0)
+++ lams_tool_vote/web/WEB-INF/struts/tlds/struts-tiles.tld (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+
+
+
+
+1.2
+1.1
+tiles
+http://struts.apache.org/tags-tiles
+
+insert
+org.apache.struts.taglib.tiles.InsertTag
+JSP
+
+template
+false
+true
+
+
+component
+false
+true
+
+
+page
+false
+true
+
+
+definition
+false
+true
+
+
+attribute
+false
+false
+
+
+name
+false
+true
+
+
+beanName
+false
+true
+
+
+beanProperty
+false
+true
+
+
+beanScope
+false
+false
+
+
+flush
+false
+false
+
+
+ignore
+false
+true
+
+
+role
+false
+true
+
+
+controllerUrl
+false
+true
+
+
+controllerClass
+false
+true
+
+
+
+definition
+org.apache.struts.taglib.tiles.DefinitionTag
+JSP
+
+id
+true
+false
+
+
+scope
+false
+false
+
+
+template
+false
+true
+
+
+page
+false
+true
+
+
+role
+false
+true
+
+
+extends
+false
+true
+
+
+
+put
+org.apache.struts.taglib.tiles.PutTag
+JSP
+
+name
+false
+false
+
+
+value
+false
+true
+
+
+content
+false
+true
+
+
+direct
+false
+false
+
+
+type
+false
+false
+
+
+beanName
+false
+true
+
+
+beanProperty
+false
+true
+
+
+beanScope
+false
+false
+
+
+role
+false
+true
+
+
+
+putList
+org.apache.struts.taglib.tiles.PutListTag
+JSP
+
+name
+true
+false
+
+
+
+add
+org.apache.struts.taglib.tiles.AddTag
+JSP
+
+value
+false
+false
+
+
+content
+false
+true
+
+
+direct
+false
+false
+
+
+type
+false
+false
+
+
+beanName
+false
+true
+
+
+beanProperty
+false
+true
+
+
+beanScope
+false
+false
+
+
+role
+false
+true
+
+
+
+get
+org.apache.struts.taglib.tiles.GetTag
+empty
+
+name
+true
+true
+
+
+ignore
+false
+true
+
+
+flush
+false
+false
+
+
+role
+false
+true
+
+
+
+getAsString
+org.apache.struts.taglib.tiles.GetAttributeTag
+empty
+
+name
+true
+true
+
+
+ignore
+false
+true
+
+
+role
+false
+true
+
+
+
+useAttribute
+org.apache.struts.taglib.tiles.UseAttributeTag
+org.apache.struts.taglib.tiles.UseAttributeTei
+empty
+
+id
+false
+false
+
+
+classname
+false
+false
+
+
+scope
+false
+false
+
+
+name
+true
+true
+
+
+ignore
+false
+true
+
+
+
+importAttribute
+org.apache.struts.taglib.tiles.ImportAttributeTag
+empty
+
+name
+false
+true
+
+
+scope
+false
+false
+
+
+ignore
+false
+true
+
+
+
+initComponentDefinitions
+org.apache.struts.taglib.tiles.InitDefinitionsTag
+empty
+
+file
+true
+false
+
+
+classname
+false
+false
+
+
+
+
+
+
Index: lams_tool_vote/web/WEB-INF/tiles/tiles-defs.xml
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/tiles/tiles-defs.xml (revision 0)
+++ lams_tool_vote/web/WEB-INF/tiles/tiles-defs.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_vote/web/WEB-INF/web.xml
===================================================================
diff -u
--- lams_tool_vote/web/WEB-INF/web.xml (revision 0)
+++ lams_tool_vote/web/WEB-INF/web.xml (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,260 @@
+
+
+
+
+
+ javax.servlet.jsp.jstl.fmt.localizationContext
+ org.lamsfoundation.lams.tool.vote.web.VoteResources
+
+
+
+ contextConfigLocation
+
+ classpath:/org/lamsfoundation/lams/applicationContext.xml
+ classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/tool/toolApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml
+ classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml
+ classpath:/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml
+
+
+
+
+ SystemSessionFilter
+
+ org.lamsfoundation.lams.web.session.SystemSessionFilter
+
+
+
+
+ hibernateFilter
+
+ org.lamsfoundation.lams.util.CustomizedOpenSessionInViewFilter
+
+
+ sessionFactoryBeanName
+ mcSessionFactory
+
+
+
+
+ LocaleFilter
+
+ org.lamsfoundation.lams.web.filter.LocaleFilter
+
+
+
+
+ SystemSessionFilter
+ /*
+
+
+
+ hibernateFilter
+ /*
+
+
+
+ LocaleFilter
+ /*
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+
+ org.lamsfoundation.lams.web.SessionListener
+
+
+
+
+ context
+ org.springframework.web.context.ContextLoaderServlet
+ 1
+
+
+
+ action
+ org.apache.struts.action.ActionServlet
+
+ config
+ /WEB-INF/struts-config.xml
+
+
+ debug
+ 999
+
+
+ detail
+ 2
+
+
+ validate
+ true
+
+ 2
+
+
+
+ download
+ org.lamsfoundation.lams.contentrepository.client.ToolDownload
+
+ toolContentHandlerBeanName
+ mcToolContentHandler
+
+ 3
+
+
+
+ exportPortfolio
+ org.lamsfoundation.lams.tool.vote.web.VoteExportServlet
+
+
+
+
+ Connector
+ com.fredck.FCKeditor.connector.ConnectorServlet
+
+ baseDir
+ /UserFiles/
+
+
+ debug
+ false
+
+ 1
+
+
+
+ action
+ *.do
+
+
+
+ download
+ /download/*
+
+
+
+ exportPortfolio
+ /portfolioExport
+
+
+
+ Connector
+ /fckeditor/editor/filemanager/browser/default/connectors/jsp/connector
+
+
+
+ 120
+
+
+
+ 403
+ /403.html
+
+
+
+
+
+
+
+
+
+
+
+ tags-bean
+ /WEB-INF/struts/tlds/struts-bean.tld
+
+
+ tags-html
+ /WEB-INF/struts/tlds/struts-html.tld
+
+
+ tags-logic
+ /WEB-INF/struts/tlds/struts-logic.tld
+
+
+ tags-logic-el
+ /WEB-INF/struts/tlds/struts-logic-el.tld
+
+
+ tags-tiles
+ /WEB-INF/struts/tlds/struts-tiles.tld
+
+
+
+
+
+ tags-fmt
+ /WEB-INF/jstl/tlds/fmt.tld
+
+
+ tags-core
+ /WEB-INF/jstl/tlds/c.tld
+
+
+ tags-function
+ /WEB-INF/jstl/tlds/fn.tld
+
+
+ tags-xml
+ /WEB-INF/jstl/tlds/x.tld
+
+
+
+
+
+ tags-permittedTaglibs
+ /WEB-INF/jstl/tlds/permittedTaglibs.tld
+
+
+ tags-scriptfree
+ /WEB-INF/jstl/tlds/scriptfree.tld
+
+
+
+
+
+ fck-editor
+ /WEB-INF/fckeditor/tlds/FCKeditor.tld
+
+
+ tags-lams
+ /WEB-INF/lams.tld
+
+
+
Index: lams_tool_vote/web/author_page/css/aqua.css
===================================================================
diff -u
--- lams_tool_vote/web/author_page/css/aqua.css (revision 0)
+++ lams_tool_vote/web/author_page/css/aqua.css (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,150 @@
+/*This is a theme CSS file. Which one will be loaded into the JSP depends on a variable passed in from FLASH.*/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ background-color: #A2BCF9;
+
+}
+
+h1 {
+ font-size: large;
+ background-color: #B4C8FE;
+ border-top-width: 1px;
+ border-top-style: solid;
+ border-top-color: #999999;
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-left-color: #999999;
+}
+h2 {
+ font-size: small;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-color: #666666;
+ margin-bottom: 1px;
+
+
+}
+
+th {
+ font-size: small;
+ color: #FFFFFF;
+ background-color: #075A8B;
+ text-align: left;
+}
+
+.formtablecontainer{
+ text-align:center;
+}
+
+.datatablecontainer{
+ width:100%;
+}
+
+.buttoncontainer {
+
+}
+
+
+input, select, textarea {
+ font-family: 'Verdana', 'Arial', 'Helvetica', sans-serif;
+ font-size: small;
+}
+
+.forms {
+ border: 1px solid #999999;
+ font-size: small;
+ font-style: normal;
+ width: 100%;
+}
+
+.formlabel {
+ font-size: small;
+ font-style: normal;
+ text-align: right;
+ width: 20%;
+}
+
+.formcontrol {
+ font-size: small;
+ font-style: normal;
+ text-align: left;
+}
+
+/********* tab styles **********/
+/*tab styles*/
+.tab{
+ text-align:center;
+}
+
+.tab a{
+ font-size: 11px;
+ color: #000000;
+ text-decoration:none;
+}
+.tab a:hover{
+ font-size: 11px;
+ color: #000000;
+ text-decoration:underline
+}
+.tabcentre{
+ background-image:url(../images/aqua_tab_centre.gif);
+ background-repeat:repeat-x;
+}
+
+.tabcentre_selected{
+ background-image:url(../images/aqua_tab_s_centre.gif);
+ background-repeat:repeat-x;
+}
+
+.tabcentre_inactive{
+ background-image:url(../images/aqua_tab_i_centre.gif);
+ background-repeat:repeat-x;
+}
+
+/** Non Selected tab style **/
+.tableft td{
+ background: url(../images/aqua_tab_left.gif) no-repeat;
+}
+.tabright td{
+ background: url(../images/aqua_tab_right.gif) no-repeat;
+}
+
+/** Selected tab style **/
+.tableft_selected td{
+ background: url(../images/aqua_tab_s_left.gif) no-repeat;
+}
+
+.tableft_inactive td{
+ background: url(../images/aqua_tab_i_left.gif) no-repeat;
+}
+
+.tabright_selected td{
+ background: url(../images/aqua_tab_s_right.gif) no-repeat;
+}
+
+.tabright_inactive td{
+ background: url(../images/aqua_tab_i_right.gif) no-repeat;
+}
+
+/*Tab content containers*/
+.tabbody{
+ width: 98%;
+
+ background-color : #D9E8FF;
+ float:left;
+
+ margin : 0px 0px 0px 0px;
+ border-right-width: 1px;
+ border-left-width: 1px;
+ border-right-style: solid;
+ border-left-style: solid;
+ border-right-color: #0D3F59;
+ border-left-color: #0D3F59;
+
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: #0D3F59;
+ padding:5px;
+
+}
\ No newline at end of file
Index: lams_tool_vote/web/author_page/css/base.css
===================================================================
diff -u
--- lams_tool_vote/web/author_page/css/base.css (revision 0)
+++ lams_tool_vote/web/author_page/css/base.css (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,3 @@
+/*
+This is the Base CSS, it will define the location of images etc and other core, non user configurable items. (Admin configurable)
+*/
\ No newline at end of file
Index: lams_tool_vote/web/author_page/css/fckeditor_style.css
===================================================================
diff -u
--- lams_tool_vote/web/author_page/css/fckeditor_style.css (revision 0)
+++ lams_tool_vote/web/author_page/css/fckeditor_style.css (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,55 @@
+.previewPanel{
+ width: 700px;
+ height: 220px;
+ border-style: none;
+ border-width: 1px;
+ padding: 5px;
+
+ overflow: auto;
+}
+
+.textareaPanel{
+ width: 700px;
+ height: 220px;
+}
+
+
+.smallPreviewPanel{
+ width: 700px;
+ height: 120px;
+ border-style: none;
+ border-width: 1px;
+ padding: 5px;
+}
+
+.smallTextareaPanel{
+ width: 700px;
+ height: 120px;
+}
+
+#wyswygEditor{
+ /*position the wyswygEditor in the centre*/
+ position: absolute;
+ /*top: 15%;
+ left: 50%;
+ margin-left: -400px;
+ margin-top: -260px;*/
+
+ width: 100%;
+ height: 100%;
+
+
+ /*border-style: solid;
+ border-width: 3px;*/
+}
+
+#wyswygEditorScreen{
+ position: absolute;
+
+ width: 700px;
+ height: 220px;
+
+ padding: 0px;
+ margin: 0px;
+}
+
Index: lams_tool_vote/web/author_page/css/tool_custom.css
===================================================================
diff -u
--- lams_tool_vote/web/author_page/css/tool_custom.css (revision 0)
+++ lams_tool_vote/web/author_page/css/tool_custom.css (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,59 @@
+.button{
+ float:right;
+ font-size: 12px;
+ color: #000000;
+ text-decoration:none;
+ text-align: center;
+ background-color:#B4C8FE;
+ margin: 2px 5px 2px 5px;
+ padding:3px;
+ width: 80px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: #FFFFFF;
+ border-right-color: #0D3F59;
+ border-bottom-color: #0D3F59;
+ border-left-color: #FFFFFF;
+}
+
+.button:link{
+ color: #000000;
+ text-decoration:none;
+ background-color:#B4C8FE;
+}
+
+.button:visited{
+ color: #000000;
+ text-decoration:none;
+ background-color:#B4C8FE;
+}
+
+
+
+.button:hover{
+ text-decoration:none;
+ background-color:#FFFFFF;
+}
+
+.button:active{
+ text-decoration:none;
+ background-color:#CCCCCC;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-bottom-color: #FFFFFF;
+ border-left-color: #0D3F59;
+ border-top-color: #0D3F59;
+ border-right-color: #FFFFFF;
+}
\ No newline at end of file
Index: lams_tool_vote/web/author_page/css/xp.css
===================================================================
diff -u
--- lams_tool_vote/web/author_page/css/xp.css (revision 0)
+++ lams_tool_vote/web/author_page/css/xp.css (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,3 @@
+/*
+Another theme CSS, would have diufferent colours and layout techniques
+*/
\ No newline at end of file
Index: lams_tool_vote/web/author_page/images/Thumbs.db
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_centre.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_i_centre.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_i_left.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_i_right.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_left.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_right.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_s_centre.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_s_left.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/images/aqua_tab_s_right.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/author_page/js/fckcontroller.js
===================================================================
diff -u
--- lams_tool_vote/web/author_page/js/fckcontroller.js (revision 0)
+++ lams_tool_vote/web/author_page/js/fckcontroller.js (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,212 @@
+var activeEditorIndex = 0;
+var oFCKeditor;
+
+//whether to initialise the editor in textarea mode or preview mode
+function initEditor(index){
+ var textareaElement = document.getElementById("tx" + index + ".textarea")
+ if(textareaElement == null)
+ return;
+ var text = textareaElement.value;
+
+ if(containsHTML(text)){
+ var previewTextElement = document.getElementById("preview" + index + ".text");
+ var previewText = document.getElementById("tx" + index + ".textarea").value;
+ previewTextElement.innerHTML = previewText;
+
+ hideElementById("tx"+index);
+ showElementById("preview"+index);
+ }
+ else{
+ hideElementById("preview"+index);
+ showElementById("tx"+index);
+ }
+}
+
+// FCKeditor_OnComplete is a special function that is called when an editor
+// instance is loaded ad available to the API. It must be named exactly in
+// this way.
+function FCKeditor_OnComplete( editorInstance )
+{
+ //hideElementById("wyswygEditorScreen");
+}
+
+
+function SetContents(content)
+{
+ // Get the editor instance that we want to interact with.
+ var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+
+ // Set the editor contents (replace the actual one).
+ oEditor.SetHTML(content) ;
+}
+
+
+function doWYSWYGEdit(index, size){
+
+ var oEditor;
+ try {
+ oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+ }
+ catch(error) {
+ //browsers like opera can't resolve the FCKeditorAPI classes
+ alert("The browser you are using doesn't support Rich Text Editor, Please use a supported browser instead.");
+ return;
+ }
+
+ if(activeEditorIndex != index && activeEditorIndex != 0){
+ saveWYSWYGEdittedText(activeEditorIndex); //save the existing content
+ doPreview(activeEditorIndex); //update preview panel
+ }
+
+ activeEditorIndex = index;
+
+ //hide html editor
+ doPreview(index);
+
+ var previewElement = document.getElementById("preview" + index + ".text");
+ var posX = findPosX(previewElement);
+ var posY = findPosY(previewElement);
+
+ var text = document.getElementById("tx" + index + ".textarea").value;
+
+ oEditor.SetHTML(text) ;
+
+ wyswygEditorScreenElement = document.getElementById("wyswygEditorScreen");
+ wyswygEditorScreenElement.style.top = posY + "px";
+ wyswygEditorScreenElement.style.left = posX + "px";
+
+ //resize the fck editor
+ fckFrameElement = document.getElementById("FCKeditor1___Frame");
+ if (size == "small") {
+ fckFrameElement.style.height = "100px";
+ wyswygEditorScreenElement.style.height = "120px";
+ } else {
+ fckFrameElement.style.height = "200px";
+ wyswygEditorScreenElement.style.height = "220px";
+ }
+
+ showElementById("wyswygEditorScreen");
+
+
+ showElementById("wyswygEditorScreen");
+}
+
+//convert the text to HTML first,
+function doTextToHTML(index){
+ var textareaElement = document.getElementById("tx" + index + ".textarea");
+ var text = covertTextToHTML(textareaElement.value);
+ textareaElement.value = text;
+}
+
+function saveWYSWYGEdittedText(index){
+ var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+ var text = oEditor.GetXHTML( true )
+
+
+ var htmlEditorElement = document.getElementById("tx" + index + ".textarea");
+ htmlEditorElement.value = text;
+
+}
+
+function doEdit(index){
+ hideElementById("wyswygEditorScreen");
+ hideElementById("preview"+index);
+ showElementById("tx"+index);
+}
+
+function doPreview(index){
+ var previewTextElement = document.getElementById("preview" + index + ".text");
+ var previewText = document.getElementById("tx" + index + ".textarea").value;
+ previewTextElement.innerHTML = previewText;
+
+ hideElementById("wyswygEditorScreen");
+ hideElementById("tx"+index);
+ showElementById("preview"+index);
+}
+
+
+/*** show/hide Elements ***/
+function showElement(element) {
+ element.style.visibility = 'visible';
+ element.style.display = "block";
+}
+function hideElement(element) {
+ element.style.visibility = 'hidden';
+ element.style.display = "none";
+}
+
+function showElementById(id) {
+ var element = document.getElementById(id);
+ showElement(element);
+}
+
+function hideElementById(id) {
+ var element = document.getElementById(id);
+ hideElement(element);
+}
+
+
+/*** findPosX and findPoxY functions are use to locate the x,y location of an element ***/
+function findPosX(obj) {
+ var curleft = 0;
+ if(obj.offsetParent)
+ while(1)
+ {
+ curleft += obj.offsetLeft;
+ if(!obj.offsetParent)
+ break;
+ obj = obj.offsetParent;
+ }
+ else if(obj.x)
+ curleft += obj.x;
+ return curleft;
+}
+
+function findPosY(obj) {
+ var curtop = 0;
+ if(obj.offsetParent)
+ while(1)
+ {
+ curtop += obj.offsetTop;
+ if(!obj.offsetParent)
+ break;
+ obj = obj.offsetParent;
+ }
+ else if(obj.y)
+ curtop += obj.y;
+ return curtop;
+}
+
+/**** Using the regular expressions defined below to convert Text to HTML ****/
+var NEWLINE = "
";
+var GREATER = ">";
+var LESSER = "<";
+//var SPACE = " ";
+
+var RE_ESCAPE_NEWLINE = new RegExp("\n", "g");
+var RE_ESCAPE_GREATER = new RegExp(">", "g");
+var RE_ESCAPE_LESSER = new RegExp("<", "g");
+//var RE_ESCAPE_SPACE = new RegExp(" ", "g");
+
+var RE_HTML_TAG = new RegExp("<.*>|" + LESSER + "|" + GREATER);
+
+function covertTextToHTML(str){
+ return str.replace(RE_ESCAPE_GREATER, GREATER)
+ .replace(RE_ESCAPE_LESSER, LESSER)
+ .replace(RE_ESCAPE_NEWLINE, NEWLINE);
+
+ //.replace(RE_ESCAPE_SPACE, SPACE)
+}
+
+/**** Detect whether HTML was used */
+function containsHTML(str){
+ return (str.match(RE_HTML_TAG) != null)? true:false;
+}
+
+
+
+/*** implement the event onSelectTab() which gets trigger when tabs is changed ***/
+function onSelectTab(tabID){
+ //hide all active editors
+ doPreview(activeEditorIndex);
+}
\ No newline at end of file
Index: lams_tool_vote/web/author_page/js/tabcontroller.js
===================================================================
diff -u
--- lams_tool_vote/web/author_page/js/tabcontroller.js (revision 0)
+++ lams_tool_vote/web/author_page/js/tabcontroller.js (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,52 @@
+var tabSize = 0;
+var selectedTabID = 0;
+
+/* Initialise the number of tabs in the page */
+function initTabSize(size){
+ tabSize = size;
+}
+
+function selectTab(tabID) {
+
+ if(selectedTabID == tabID)
+ return;
+
+ if(selectedTabID == 0)
+ selectedTabID = tabID;
+
+ //change the old tab's class
+ document.getElementById("tab" + selectedTabID).className = "tab tabcentre";
+ //swap images of side parts
+ var tl = document.getElementById("tableft_"+selectedTabID);
+ tl.src= imgRoot + themeName + "_tab_left.gif";
+ tl.height = 22;
+ var tr = document.getElementById("tabright_"+selectedTabID);
+ tr.src= imgRoot + themeName + "_tab_right.gif";
+ tr.height = 22;
+
+ //change the new tab's class
+ document.getElementById("tab" + tabID).className = "tab tabcentre_selected";
+ var tl = document.getElementById("tableft_"+tabID);
+ tl.src= imgRoot + themeName + "_tab_s_left.gif";
+ tl.height = 25;
+ var tr = document.getElementById("tabright_"+tabID);
+ tr.src= imgRoot + themeName + "_tab_s_right.gif";
+ tr.height = 25;
+
+ //save tabID as selectedTabID
+ selectedTabID = tabID;
+
+ //switch the the selected tab on
+ for(i = 1; i <= tabSize; i++) {
+ document.getElementById("tabbody" + i).style.display = (i == tabID) ? 'block':'none';
+ }
+
+
+ try{
+ //trigger the custom event listener onSelectTab()
+ onSelectTab(tabID);
+ }
+ catch (error){
+ //catch reference error when onSelectTab() is not defined
+ }
+}
\ No newline at end of file
Index: lams_tool_vote/web/css/tool_custom.css
===================================================================
diff -u
--- lams_tool_vote/web/css/tool_custom.css (revision 0)
+++ lams_tool_vote/web/css/tool_custom.css (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,105 @@
+.button{
+ float:right;
+ font-size: 10px;
+ color: #000000;
+ text-decoration:none;
+ text-align: center;
+ background-color:#B4C8FE;
+ margin: 2px 5px 2px 5px;
+ padding:3px;
+ width: 60px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: #FFFFFF;
+ border-right-color: #0D3F59;
+ border-bottom-color: #0D3F59;
+ border-left-color: #FFFFFF;
+}
+
+.buttonLeft{
+ float:left;
+ font-size: 10px;
+ color: #000000;
+ text-decoration:none;
+ text-align: center;
+ background-color:#B4C8FE;
+ margin: 2px 5px 2px 5px;
+ padding:3px;
+ width: 60px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: #FFFFFF;
+ border-right-color: #0D3F59;
+ border-bottom-color: #0D3F59;
+ border-left-color: #FFFFFF;
+}
+.longButton{
+ float:right;
+ font-size: 10px;
+ color: #000000;
+ text-decoration:none;
+ text-align: center;
+ background-color:#B4C8FE;
+ margin: 2px 5px 2px 5px;
+ padding:3px;
+ width: 120px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: #FFFFFF;
+ border-right-color: #0D3F59;
+ border-bottom-color: #0D3F59;
+ border-left-color: #FFFFFF;
+}
+
+.button:link{
+ color: #000000;
+ text-decoration:none;
+ background-color:#B4C8FE;
+}
+
+.button:visited{
+ color: #000000;
+ text-decoration:none;
+ background-color:#B4C8FE;
+}
+
+
+.button:hover{
+ text-decoration:none;
+ background-color:#FFFFFF;
+}
+
+.button:active{
+ text-decoration:none;
+ background-color:#CCCCCC;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-bottom-color: #FFFFFF;
+ border-left-color: #0D3F59;
+ border-top-color: #0D3F59;
+ border-right-color: #FFFFFF;
+}
\ No newline at end of file
Index: lams_tool_vote/web/exportPortfolio.jsp
===================================================================
diff -u
--- lams_tool_vote/web/exportPortfolio.jsp (revision 0)
+++ lams_tool_vote/web/exportPortfolio.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,63 @@
+<%--
+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/images/Thumbs.db
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/cross.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/delete.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/dot.jpg
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/down.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/edit.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/error.jpg
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/icon_mcq.swf
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/success.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/tick.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/images/up.gif
===================================================================
diff -u
Binary files differ
Index: lams_tool_vote/web/includes/javascript/fckcontroller.js
===================================================================
diff -u
--- lams_tool_vote/web/includes/javascript/fckcontroller.js (revision 0)
+++ lams_tool_vote/web/includes/javascript/fckcontroller.js (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,212 @@
+var activeEditorIndex = 0;
+var oFCKeditor;
+
+//whether to initialise the editor in textarea mode or preview mode
+function initEditor(index){
+ var textareaElement = document.getElementById("tx" + index + ".textarea")
+ if(textareaElement == null)
+ return;
+ var text = textareaElement.value;
+
+ if(containsHTML(text)){
+ var previewTextElement = document.getElementById("preview" + index + ".text");
+ var previewText = document.getElementById("tx" + index + ".textarea").value;
+ previewTextElement.innerHTML = previewText;
+
+ hideElementById("tx"+index);
+ showElementById("preview"+index);
+ }
+ else{
+ hideElementById("preview"+index);
+ showElementById("tx"+index);
+ }
+}
+
+// FCKeditor_OnComplete is a special function that is called when an editor
+// instance is loaded ad available to the API. It must be named exactly in
+// this way.
+function FCKeditor_OnComplete( editorInstance )
+{
+ //hideElementById("wyswygEditorScreen");
+}
+
+
+function SetContents(content)
+{
+ // Get the editor instance that we want to interact with.
+ var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+
+ // Set the editor contents (replace the actual one).
+ oEditor.SetHTML(content) ;
+}
+
+
+function doWYSWYGEdit(index, size){
+
+ var oEditor;
+ try {
+ oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+ }
+ catch(error) {
+ //browsers like opera can't resolve the FCKeditorAPI classes
+ alert("The browser you are using doesn't support Rich Text Editor, Please use a supported browser instead.");
+ return;
+ }
+
+ if(activeEditorIndex != index && activeEditorIndex != 0){
+ saveWYSWYGEdittedText(activeEditorIndex); //save the existing content
+ doPreview(activeEditorIndex); //update preview panel
+ }
+
+ activeEditorIndex = index;
+
+ //hide html editor
+ doPreview(index);
+
+ var previewElement = document.getElementById("preview" + index + ".text");
+ var posX = findPosX(previewElement);
+ var posY = findPosY(previewElement);
+
+ var text = document.getElementById("tx" + index + ".textarea").value;
+
+ oEditor.SetHTML(text) ;
+
+ wyswygEditorScreenElement = document.getElementById("wyswygEditorScreen");
+ wyswygEditorScreenElement.style.top = posY + "px";
+ wyswygEditorScreenElement.style.left = posX + "px";
+
+ //resize the fck editor
+ fckFrameElement = document.getElementById("FCKeditor1___Frame");
+ if (size == "small") {
+ fckFrameElement.style.height = "100px";
+ wyswygEditorScreenElement.style.height = "120px";
+ } else {
+ fckFrameElement.style.height = "200px";
+ wyswygEditorScreenElement.style.height = "220px";
+ }
+
+ showElementById("wyswygEditorScreen");
+
+
+ showElementById("wyswygEditorScreen");
+}
+
+//convert the text to HTML first,
+function doTextToHTML(index){
+ var textareaElement = document.getElementById("tx" + index + ".textarea");
+ var text = covertTextToHTML(textareaElement.value);
+ textareaElement.value = text;
+}
+
+function saveWYSWYGEdittedText(index){
+ var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+ var text = oEditor.GetXHTML( true )
+
+
+ var htmlEditorElement = document.getElementById("tx" + index + ".textarea");
+ htmlEditorElement.value = text;
+
+}
+
+function doEdit(index){
+ hideElementById("wyswygEditorScreen");
+ hideElementById("preview"+index);
+ showElementById("tx"+index);
+}
+
+function doPreview(index){
+ var previewTextElement = document.getElementById("preview" + index + ".text");
+ var previewText = document.getElementById("tx" + index + ".textarea").value;
+ previewTextElement.innerHTML = previewText;
+
+ hideElementById("wyswygEditorScreen");
+ hideElementById("tx"+index);
+ showElementById("preview"+index);
+}
+
+
+/*** show/hide Elements ***/
+function showElement(element) {
+ element.style.visibility = 'visible';
+ element.style.display = "block";
+}
+function hideElement(element) {
+ element.style.visibility = 'hidden';
+ element.style.display = "none";
+}
+
+function showElementById(id) {
+ var element = document.getElementById(id);
+ showElement(element);
+}
+
+function hideElementById(id) {
+ var element = document.getElementById(id);
+ hideElement(element);
+}
+
+
+/*** findPosX and findPoxY functions are use to locate the x,y location of an element ***/
+function findPosX(obj) {
+ var curleft = 0;
+ if(obj.offsetParent)
+ while(1)
+ {
+ curleft += obj.offsetLeft;
+ if(!obj.offsetParent)
+ break;
+ obj = obj.offsetParent;
+ }
+ else if(obj.x)
+ curleft += obj.x;
+ return curleft;
+}
+
+function findPosY(obj) {
+ var curtop = 0;
+ if(obj.offsetParent)
+ while(1)
+ {
+ curtop += obj.offsetTop;
+ if(!obj.offsetParent)
+ break;
+ obj = obj.offsetParent;
+ }
+ else if(obj.y)
+ curtop += obj.y;
+ return curtop;
+}
+
+/**** Using the regular expressions defined below to convert Text to HTML ****/
+var NEWLINE = "
";
+var GREATER = ">";
+var LESSER = "<";
+//var SPACE = " ";
+
+var RE_ESCAPE_NEWLINE = new RegExp("\n", "g");
+var RE_ESCAPE_GREATER = new RegExp(">", "g");
+var RE_ESCAPE_LESSER = new RegExp("<", "g");
+//var RE_ESCAPE_SPACE = new RegExp(" ", "g");
+
+var RE_HTML_TAG = new RegExp("<.*>|" + LESSER + "|" + GREATER);
+
+function covertTextToHTML(str){
+ return str.replace(RE_ESCAPE_GREATER, GREATER)
+ .replace(RE_ESCAPE_LESSER, LESSER)
+ .replace(RE_ESCAPE_NEWLINE, NEWLINE);
+
+ //.replace(RE_ESCAPE_SPACE, SPACE)
+}
+
+/**** Detect whether HTML was used */
+function containsHTML(str){
+ return (str.match(RE_HTML_TAG) != null)? true:false;
+}
+
+
+
+/*** implement the event onSelectTab() which gets trigger when tabs is changed ***/
+function onSelectTab(tabID){
+ //hide all active editors
+ doPreview(activeEditorIndex);
+}
\ No newline at end of file
Index: lams_tool_vote/web/includes/javascript/tabcontroller.js
===================================================================
diff -u
--- lams_tool_vote/web/includes/javascript/tabcontroller.js (revision 0)
+++ lams_tool_vote/web/includes/javascript/tabcontroller.js (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,52 @@
+var tabSize = 0;
+var selectedTabID = 0;
+
+/* Initialise the number of tabs in the page */
+function initTabSize(size){
+ tabSize = size;
+}
+
+function selectTab(tabID) {
+
+ if(selectedTabID == tabID)
+ return;
+
+ if(selectedTabID == 0)
+ selectedTabID = tabID;
+
+ //change the old tab's class
+ document.getElementById("tab" + selectedTabID).className = "tab tabcentre";
+ //swap images of side parts
+ var tl = document.getElementById("tableft_"+selectedTabID);
+ tl.src= imgRoot + themeName + "_tab_left.gif";
+ tl.height = 22;
+ var tr = document.getElementById("tabright_"+selectedTabID);
+ tr.src= imgRoot + themeName + "_tab_right.gif";
+ tr.height = 22;
+
+ //change the new tab's class
+ document.getElementById("tab" + tabID).className = "tab tabcentre_selected";
+ var tl = document.getElementById("tableft_"+tabID);
+ tl.src= imgRoot + themeName + "_tab_s_left.gif";
+ tl.height = 25;
+ var tr = document.getElementById("tabright_"+tabID);
+ tr.src= imgRoot + themeName + "_tab_s_right.gif";
+ tr.height = 25;
+
+ //save tabID as selectedTabID
+ selectedTabID = tabID;
+
+ //switch the the selected tab on
+ for(i = 1; i <= tabSize; i++) {
+ document.getElementById("tabbody" + i).style.display = (i == tabID) ? 'block':'none';
+ }
+
+
+ try{
+ //trigger the custom event listener onSelectTab()
+ onSelectTab(tabID);
+ }
+ catch (error){
+ //catch reference error when onSelectTab() is not defined
+ }
+}
\ No newline at end of file
Index: lams_tool_vote/web/includes/javascript/xmlrequest.js
===================================================================
diff -u
--- lams_tool_vote/web/includes/javascript/xmlrequest.js (revision 0)
+++ lams_tool_vote/web/includes/javascript/xmlrequest.js (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,61 @@
+// global request and XML document objects
+var req;
+
+// retrieve XML document (reusable generic function);
+// parameter is URL string (relative or complete) to
+// an .xml file whose Content-Type is a valid XML
+// type, such as text/xml; XML source must be from
+// same domain as HTML file
+function loadXMLDoc(url,target) {
+ // branch for native XMLHttpRequest object
+ if (window.XMLHttpRequest) {
+ req = new XMLHttpRequest();
+ req.onreadystatechange = function(){
+ processReqChange(target);
+ }
+ req.open("GET", url, true);
+ req.send(null);
+ // branch for IE/Windows ActiveX version
+ } else if (window.ActiveXObject) {
+ req = new ActiveXObject("Microsoft.XMLHTTP");
+ if (req) {
+ req.onreadystatechange = function(){
+ processReqChange(target);
+ }
+ req.open("GET", url, true);
+ req.send();
+ }
+ }
+}
+
+
+// handle onreadystatechange event of req object
+function processReqChange(target) {
+ // only if req shows "loaded"
+ if (req.readyState == 4) {
+ // only if "OK"
+ if (req.status == 200) {
+ var select;
+ if(typeof target.id != "undefined")
+ select = target;
+ else
+ select = document.getElementById(target);
+
+ select.innerHTML = req.responseText;
+ } else {
+ alert("There was a problem retrieving the XML data:\n" +
+ req.statusText);
+ }
+ }
+}
+//main function, will call loadXMLDoc() directly, but catch any exception and alert.
+function loadDoc(url,target) {
+ try {
+ loadXMLDoc(url, target);
+ }
+ catch(e) {
+ var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
+ alert("Unable to get XML data:\n" + msg);
+ return;
+ }
+}
\ No newline at end of file
Index: lams_tool_vote/web/index.jsp
===================================================================
diff -u
--- lams_tool_vote/web/index.jsp (revision 0)
+++ lams_tool_vote/web/index.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,95 @@
+<%--
+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" %>
+
+
+<%
+ String toolContentId="1234";
+ String hardCodedCopiedToolContentId="9876";
+ String toolUrl="/authoringStarter?toolContentID=" + toolContentId;
+ String copiedToolUrl="/authoringStarter?toolContentID=" + hardCodedCopiedToolContentId;
+
+ String strCopyToolContent="/authoringStarter?toolContentID=" + toolContentId + "©ToolContent=1";
+ String strRemoveToolContent="/authoringStarter?toolContentID=" + toolContentId + "&removeToolContent=1";
+ String strRemoveCopiedToolContent="/authoringStarter?toolContentID=" + hardCodedCopiedToolContentId + "&removeToolContent=1";
+ String strDefineLater="/defineLaterStarter?toolContentID=" + hardCodedCopiedToolContentId;
+
+ String strSetDefineLater="/authoringStarter?toolContentID=" + hardCodedCopiedToolContentId + "&setDefineLater=1";
+ String strSetRunoffline="/authoringStarter?toolContentID=" + hardCodedCopiedToolContentId + "&strSetRunoffline=1";
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/web/learningIndex.jsp
===================================================================
diff -u
--- lams_tool_vote/web/learningIndex.jsp (revision 0)
+++ lams_tool_vote/web/learningIndex.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,147 @@
+<%--
+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" %>
+
+<%
+ String toolSessionID="88888888";
+ String toolUrl="/learningStarter?toolSessionID=" + toolSessionID + "&mode=learner";
+
+
+ String toolSessionID2="55555555";
+ String toolUrl2="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=learner";
+
+ String toolUrlTeacher="/learningStarter?toolSessionID=" + toolSessionID + "&mode=teacher";
+
+ String strCreateToolSession="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=learner" + "&createToolSession=1";
+ String strCreateToolSession2="/learningStarter?toolSessionID=" + toolSessionID + "&mode=learner" + "&createToolSession=1";
+ String strRemoveToolSession="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=learner" + "&removeToolSession=1";
+ String strLeaveToolSession="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=learner" + "&leaveToolSession=1" + "&learnerId=4";
+
+ String strPreview="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=author";
+ String strLearnerProgress="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=teacher" + "&userID=4";
+ String strLearnerProgress2="/learningStarter?toolSessionID=" + toolSessionID2 + "&mode=teacher" + "&userID=1";
+ String strLearnerProgress3="/learningStarter?toolSessionID=" + toolSessionID + "&mode=teacher" + "&userID=4";
+ String strLearnerProgress4="/learningStarter?toolSessionID=" + toolSessionID + "&mode=teacher" + "&userID=1";
+
+ String exportPortfolioStudent8 = "/exportPortfolio.do?mode=learner&toolSessionID=88888888&userID=4";
+ String exportPortfolioStudent5 = "/exportPortfolio.do?mode=learner&toolSessionID=55555555&userID=4";
+
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_vote/web/login.jsp
===================================================================
diff -u
--- lams_tool_vote/web/login.jsp (revision 0)
+++ lams_tool_vote/web/login.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,25 @@
+
+
+<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
+<%
+String path = request.getContextPath();
+String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+
+
+
+
+
+ System logon required
+
+
+
+
+
+ You need login here.
+
+
+
Index: lams_tool_vote/web/monitoringIndex.jsp
===================================================================
diff -u
--- lams_tool_vote/web/monitoringIndex.jsp (revision 0)
+++ lams_tool_vote/web/monitoringIndex.jsp (revision 402985c35e80fbce6960c7d7598b0262292398eb)
@@ -0,0 +1,47 @@
+<%--
+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" %>
+
+
+<%
+ String toolContentID="9876";
+ String toolUrl="/monitoringStarter?toolContentID=" + toolContentID;
+
+%>
+
+
+
+
+
+
+
+
+
+