Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java
===================================================================
diff -u -rdef2dd6db95cbaa6ae8116e6a63e948db2c403f5 -r5d587b470e038e789d179856f8359e9ad8a221a1
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision def2dd6db95cbaa6ae8116e6a63e948db2c403f5)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 5d587b470e038e789d179856f8359e9ad8a221a1)
@@ -798,6 +798,7 @@
public static int getLearnerMarkAtLeast(Integer passMark, Map mapQuestionWeights)
{
+ logger.debug("doing getLearnerMarkAtLeast");
logger.debug("passMark:" + passMark);
logger.debug("mapQuestionWeights:" + mapQuestionWeights);
@@ -818,19 +819,27 @@
public static int calculateMinimumQuestionCountToPass(Integer passMark, Map mapQuestionWeights)
{
+ logger.debug("calculating minimumQuestionCountToPass: mapQuestionWeights: " + mapQuestionWeights + " passmark: " + passMark);
logger.debug("passMark: " + passMark);
logger.debug("original mapQuestionWeights: " + mapQuestionWeights);
int minimumQuestionCount=0;
int totalHighestWeights=0;
while (totalHighestWeights <= passMark.intValue())
{
+ logger.debug("totalHighestWeights versus passMark: " + totalHighestWeights + " versus" + passMark);
int highestWeight=getHighestWeight(mapQuestionWeights);
+ logger.debug("highestWeight: " + highestWeight);
totalHighestWeights=totalHighestWeights + highestWeight;
logger.debug("totalHighestWeights: " + totalHighestWeights);
mapQuestionWeights=rebuildWeightsMapExcludeHighestWeight(mapQuestionWeights, highestWeight);
logger.debug("mapQuestionWeights: " + mapQuestionWeights);
++minimumQuestionCount;
+ if (mapQuestionWeights.size() == 0)
+ {
+ logger.debug("no more weights: ");
+ break;
+ }
}
logger.debug("returning minimumQuestionCount: " + minimumQuestionCount);
return minimumQuestionCount;
@@ -839,6 +848,15 @@
public static int getHighestWeight(Map mapQuestionWeights)
{
+
+ if (mapQuestionWeights.size() == 1)
+ {
+ logger.debug("using map with 1 question only");
+ /*the only alternative is 100*/
+ return 100;
+ }
+
+ logger.debug("using map with > 1 questions");
Iterator itMap = mapQuestionWeights.entrySet().iterator();
int highestWeight=0;
while (itMap.hasNext())
@@ -856,6 +874,9 @@
public static Map rebuildWeightsMapExcludeHighestWeight(Map mapQuestionWeights, int highestWeight)
{
+ logger.debug("doing rebuildWeightsMapExcludeHighestWeight: " + mapQuestionWeights);
+ logger.debug("doing highestWeight: " + highestWeight);
+
Map mapWeightsExcludeHighestWeight= new TreeMap(new McComparator());
Iterator itMap = mapQuestionWeights.entrySet().iterator();
@@ -865,6 +886,8 @@
Map.Entry pair = (Map.Entry)itMap.next();
String weight=pair.getValue().toString();
int intWeight=new Integer(weight).intValue();
+ logger.debug("intWeight: " + intWeight);
+ logger.debug("intWeight versus highestWeight:" + intWeight + " versus" + highestWeight);
if (intWeight != highestWeight)
{
mapWeightsExcludeHighestWeight.put(mapIndex.toString(),weight);
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java
===================================================================
diff -u -r8d0b1de3acd411878ccc28b222e49c4fe4641aa7 -r5d587b470e038e789d179856f8359e9ad8a221a1
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 8d0b1de3acd411878ccc28b222e49c4fe4641aa7)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 5d587b470e038e789d179856f8359e9ad8a221a1)
@@ -441,6 +441,9 @@
logger.debug("updated highestAttemptOrder:" + intHighestAttemptOrder);
request.getSession().setAttribute(LEARNER_LAST_ATTEMPT_ORDER, new Integer(intHighestAttemptOrder).toString());
+ logger.debug("before getLearnerMarkAtLeast: passMark" + passMark);
+ logger.debug("before getLearnerMarkAtLeast: mapQuestionWeights" + mapQuestionWeights);
+
int learnerMarkAtLeast=LearningUtil.getLearnerMarkAtLeast(passMark,mapQuestionWeights);
logger.debug("learnerMarkAtLeast:" + learnerMarkAtLeast);
request.getSession().setAttribute(LEARNER_MARK_ATLEAST, new Integer(learnerMarkAtLeast).toString());
Index: lams_tool_lamc/web/WEB-INF/struts-config.xml
===================================================================
diff -u -r84d364960525ae0d69e5ab5af327e2a3ce99a7c9 -r5d587b470e038e789d179856f8359e9ad8a221a1
--- lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 84d364960525ae0d69e5ab5af327e2a3ce99a7c9)
+++ lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5d587b470e038e789d179856f8359e9ad8a221a1)
@@ -54,43 +54,43 @@
@@ -122,31 +122,31 @@
@@ -177,19 +177,19 @@
@@ -199,7 +199,7 @@
type="org.lamsfoundation.lams.tool.mc.web.McLearningStarterAction"
name="McLearningForm"
scope="session"
- validate="true"
+ validate="false"
unknown="false"
input="/learningIndex.jsp">
@@ -265,7 +265,7 @@
input="/learning/AnswersContent.jsp"
parameter="method"
unknown="false"
- validate="true">
+ validate="false">
@@ -398,7 +398,7 @@
input="/monitoring/MonitoringMaincontent.jsp"
parameter="method"
unknown="false"
- validate="true">
+ validate="false">
Index: lams_tool_lamc/web/learning/IndividualLearnerResults.jsp
===================================================================
diff -u -red40abcc81d077dd1c01791195ac0f0cff0a6dbe -r5d587b470e038e789d179856f8359e9ad8a221a1
--- lams_tool_lamc/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision ed40abcc81d077dd1c01791195ac0f0cff0a6dbe)
+++ lams_tool_lamc/web/learning/IndividualLearnerResults.jsp (.../IndividualLearnerResults.jsp) (revision 5d587b470e038e789d179856f8359e9ad8a221a1)
@@ -187,10 +187,10 @@
-
-
-
-
+
+
+
+
Index: lams_tool_lamc/web/learning/Preview.jsp
===================================================================
diff -u -ra819720ed4933e91d93b0eb4a8a9801d31a6cb45 -r5d587b470e038e789d179856f8359e9ad8a221a1
--- lams_tool_lamc/web/learning/Preview.jsp (.../Preview.jsp) (revision a819720ed4933e91d93b0eb4a8a9801d31a6cb45)
+++ lams_tool_lamc/web/learning/Preview.jsp (.../Preview.jsp) (revision 5d587b470e038e789d179856f8359e9ad8a221a1)
@@ -166,15 +166,6 @@
-
-
-
-
-
-
-
- |
-