Index: lams_tool_vote/build.properties
===================================================================
diff -u -r1a5446e3a1f962f1bb831c1bbaef14acf9d3635c -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/build.properties (.../build.properties) (revision 1a5446e3a1f962f1bb831c1bbaef14acf9d3635c)
+++ lams_tool_vote/build.properties (.../build.properties) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -4,7 +4,7 @@
signature=lavote11
#project version
-tool.version=20090726
+tool.version=20100309
# hide tool option
hideTool=false
Index: lams_tool_vote/build.xml
===================================================================
diff -u -r558ead6c7d0ae923be08b6e6cd60ea44839ecfdc -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/build.xml (.../build.xml) (revision 558ead6c7d0ae923be08b6e6cd60ea44839ecfdc)
+++ lams_tool_vote/build.xml (.../build.xml) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -537,5 +537,21 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml
===================================================================
diff -u -r25187e73d76504fc9d29a21440750230e35f00fb -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision 25187e73d76504fc9d29a21440750230e35f00fb)
+++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml (.../VoteContent.hbm.xml) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -150,6 +150,14 @@
column="maxNominationCount"
length="5"
/>
+
+
voteDisplayOrderIds = voteLearningForm.votesAsCollection();
logger.debug("Checkbox votes " + voteDisplayOrderIds);
@@ -968,6 +983,10 @@
String maxNominationCount = request.getParameter(MAX_NOMINATION_COUNT);
logger.debug("maxNominationCount: " + maxNominationCount);
voteLearningForm.setMaxNominationCount(maxNominationCount);
+
+ String minNominationCount = request.getParameter(MIN_NOMINATION_COUNT);
+ logger.debug("minNominationCount: " + minNominationCount);
+ voteLearningForm.setMinNominationCount(minNominationCount);
String allowTextEntry = request.getParameter(ALLOW_TEXT_ENTRY);
logger.debug("allowTextEntry: " + allowTextEntry);
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java
===================================================================
diff -u -r7e4c0870acdbc0f8835aae86d648796392d0e62c -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision 7e4c0870acdbc0f8835aae86d648796392d0e62c)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -52,6 +52,7 @@
protected String toolContentID;
protected String maxNominationCount;
+ protected String minNominationCount;
protected String allowTextEntry;
protected String showResults;
protected String lockOnFinish;
@@ -90,6 +91,7 @@
protected String nominationsSubmited;
protected String revisitingUser;
protected String maxNominationCountReached;
+ protected String minNominationCountReached;
protected int castVoteCount;
protected Map mapGeneralCheckedOptionsContent;
@@ -577,6 +579,18 @@
public void setMaxNominationCount(String maxNominationCount) {
this.maxNominationCount = maxNominationCount;
}
+ /**
+ * @return Returns the minNominationCount.
+ */
+ public String getMinNominationCount() {
+ return minNominationCount;
+ }
+ /**
+ * @param minNominationCount The minNominationCount to set.
+ */
+ public void setMinNominationCount(String minNominationCount) {
+ this.minNominationCount = minNominationCount;
+ }
/**
* @return Returns the nominationsSubmited.
@@ -641,6 +655,18 @@
public void setMaxNominationCountReached(String maxNominationCountReached) {
this.maxNominationCountReached = maxNominationCountReached;
}
+ /**
+ * @return Returns the minNominationCountReached.
+ */
+ public String getMinNominationCountReached() {
+ return minNominationCountReached;
+ }
+ /**
+ * @param minNominationCountReached The minNominationCountReached to set.
+ */
+ public void setMinNominationCountReached(String minNominationCountReached) {
+ this.minNominationCountReached = minNominationCountReached;
+ }
/**
* @return Returns the sbmtSuccess.
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java
===================================================================
diff -u -r61e7bbf20d65e2ecb5e50f3154e52264003defa1 -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 61e7bbf20d65e2ecb5e50f3154e52264003defa1)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -633,6 +633,7 @@
voteLearningForm.setActivityInstructions(voteContent.getInstructions());
voteLearningForm.setActivityRunOffline(new Boolean(voteContent.isRunOffline()).toString());
voteLearningForm.setMaxNominationCount(voteContent.getMaxNominationCount());
+ voteLearningForm.setMinNominationCount(voteContent.getMinNominationCount());
voteLearningForm.setAllowTextEntry(new Boolean(voteContent.isAllowText()).toString());
voteLearningForm.setShowResults(new Boolean(voteContent.isShowResults()).toString());
voteLearningForm.setLockOnFinish(new Boolean(voteContent.isLockOnFinish()).toString());
@@ -641,6 +642,7 @@
voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions());
voteGeneralLearnerFlowDTO.setActivityRunOffline(new Boolean(voteContent.isRunOffline()).toString());
voteGeneralLearnerFlowDTO.setMaxNominationCount(voteContent.getMaxNominationCount());
+ voteGeneralLearnerFlowDTO.setMinNominationCount(voteContent.getMinNominationCount());
voteGeneralLearnerFlowDTO.setAllowTextEntry(new Boolean(voteContent.isAllowText()).toString());
voteGeneralLearnerFlowDTO.setLockOnFinish(new Boolean(voteContent.isLockOnFinish()).toString());
voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle());
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java
===================================================================
diff -u -r8f54a472bd700cccad1486d7f180ead2eae480aa -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 8f54a472bd700cccad1486d7f180ead2eae480aa)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -389,6 +389,7 @@
request.setAttribute("lockOnFinish", voteContent.isLockOnFinish());
request.setAttribute("allowText", voteContent.isAllowText());
request.setAttribute("maxNominationCount", voteContent.getMaxNominationCount());
+ request.setAttribute("minNominationCount", voteContent.getMinNominationCount());
request.setAttribute("showResults", voteContent.isShowResults());
request.setAttribute("reflect", voteContent.isReflect());
request.setAttribute("reflectionSubject", voteContent.getReflectionSubject());
Index: lams_tool_vote/web/authoring/AdvancedContent.jsp
===================================================================
diff -u -r1a5446e3a1f962f1bb831c1bbaef14acf9d3635c -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/web/authoring/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision 1a5446e3a1f962f1bb831c1bbaef14acf9d3635c)
+++ lams_tool_vote/web/authoring/AdvancedContent.jsp (.../AdvancedContent.jsp) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -37,34 +37,25 @@
-
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
-
-
-
-
- ${index}
-
-
-
-
-
@@ -73,7 +64,6 @@
-
Index: lams_tool_vote/web/authoring/AuthoringMaincontent.jsp
===================================================================
diff -u -r1a5446e3a1f962f1bb831c1bbaef14acf9d3635c -r618abc7cca98f08ef288878ab371a3693492d835
--- lams_tool_vote/web/authoring/AuthoringMaincontent.jsp (.../AuthoringMaincontent.jsp) (revision 1a5446e3a1f962f1bb831c1bbaef14acf9d3635c)
+++ lams_tool_vote/web/authoring/AuthoringMaincontent.jsp (.../AuthoringMaincontent.jsp) (revision 618abc7cca98f08ef288878ab371a3693492d835)
@@ -79,28 +79,67 @@
var tag = document.getElementById("currentTab");
tag.value = tabId;
selectTab(tabId);
+
+ //for advanceTab
+ if(tabId == 2) {
+ changeMinMaxVotes(-1, -1);
+ }
}
+
+ function changeMinMaxVotes(maxNominationCount, minNominationCount) {
+ processSelect("maxNominationCount", maxNominationCount);
+ processSelect("minNominationCount", minNominationCount);
+ }
+
+ function processSelect(id, initSelectedItem) {
+ var table = document.getElementById("itemTable");
+ var trs = table.getElementsByTagName("tr");
+ var select = document.getElementById(id);
+ var options = select.options;
+ var numberOptions = select.length;
+
+ //when first enter, it should get value from VoteContent
+ var selectedItem = (initSelectedItem < 0) ? -1 : initSelectedItem;
+ for (var i = 0; i < numberOptions; i++) {
+ if(options[0].selected && selectedItem == -1 ){
+ selectedItem = options[0].value;
+ }
+ select.removeChild(options[0]);
+ }
+
+ var isTextAllowed = document.getElementById("allowText").checked ? 1 : 0;
+ for(var i = 1; i <= (trs.length+isTextAllowed); i++){
+ var opt = document.createElement("option");
+ var optT = document.createTextNode(i);
+ opt.value = i;
+ //get back user choosen value
+ if(selectedItem > 0 && selectedItem == i){
+ opt.selected = true;
+ } else {
+ opt.selected = false;
+ }
+ opt.appendChild(optT);
+ select.appendChild(opt);
+ }
+ }
function doSubmit(method) {
document.VoteAuthoringForm.dispatch.value=method;
document.VoteAuthoringForm.submit();
}
-
function submitModifyNomination(optionIndexValue, actionMethod)
{
document.VoteAuthoringForm.optIndex.value=optionIndexValue;
submitMethod(actionMethod);
}
-
function submitModifyAuthoringNomination(questionIndexValue, actionMethod)
{
document.VoteAuthoringForm.questionIndex.value=questionIndexValue;
submitMethod(actionMethod);
}
-
function submitMethod(actionMethod)
{
document.VoteAuthoringForm.dispatch.value=actionMethod;
@@ -140,6 +179,7 @@
+
@@ -166,7 +206,6 @@
-
@@ -186,10 +225,13 @@
-
-
+