Index: lams_tool_lamc/build.xml
===================================================================
diff -u -r284785a0cc2d61ac8a129a69888b3442141904ab -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/build.xml (.../build.xml) (revision 284785a0cc2d61ac8a129a69888b3442141904ab)
+++ lams_tool_lamc/build.xml (.../build.xml) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -41,6 +41,7 @@
+
@@ -83,381 +84,417 @@
in the ${basedir}/config/database/xxx.xml file accordingly.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
- Deploying the Question and Answer tool
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deploying the Question and Answer tool
+
+
+
+
+
-
-
-
-
-
-
+
+
-
\ No newline at end of file
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java
===================================================================
diff -u -r64c79423986902d74a3b2eb5a009c8f24228f65d -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 64c79423986902d74a3b2eb5a009c8f24228f65d)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java (.../McAppConstants.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -125,6 +125,7 @@
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_WEIGHTS ="mapWeights";
public static final String SELECTED_QUESTION_CONTENT_UID ="selectedQuestionContentUid";
public static final String SELECTED_QUESTION ="selectedQuestion";
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties
===================================================================
diff -u -r64c79423986902d74a3b2eb5a009c8f24228f65d -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision 64c79423986902d74a3b2eb5a009c8f24228f65d)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McResources.properties (.../McResources.properties) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -67,6 +67,9 @@
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.passMark.empty =Pass Mark can not be empty.
+error.passmark.notInteger =Pass Mark can only be an integer.
+
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.inUse =The modification of the content is not allowed since one or more students has attempted the activity.
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -187,6 +187,11 @@
mcAuthoringForm.setInstructions(defaultMcContent.getInstructions());
mcAuthoringForm.setOfflineInstructions (defaultMcContent.getOfflineInstructions());
mcAuthoringForm.setOnlineInstructions (defaultMcContent.getOnlineInstructions());
+
+ if (defaultMcContent.getPassMark() != null)
+ mcAuthoringForm.setPassmark((defaultMcContent.getPassMark()).toString());
+ else
+ mcAuthoringForm.setPassmark(new Integer(0).toString());
}
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java
===================================================================
diff -u -rdef7c02eeb52a92c47c04b3f21fe337350aef897 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java (.../IMcQueContentDAO.java) (revision def7c02eeb52a92c47c04b3f21fe337350aef897)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcQueContentDAO.java (.../IMcQueContentDAO.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -40,6 +40,8 @@
public McQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid);
+ public List getAllQuestionEntries(final long mcContentId);
+
public List refreshQuestionContent(final Long mcContentId);
public void cleanAllQuestions(final Long mcContentUid);
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java
===================================================================
diff -u -rdef7c02eeb52a92c47c04b3f21fe337350aef897 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision def7c02eeb52a92c47c04b3f21fe337350aef897)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -44,15 +44,13 @@
public class McQueContentDAO extends HibernateDaoSupport implements IMcQueContentDAO {
static Logger logger = Logger.getLogger(McQueContentDAO.class.getName());
- private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId";
+ private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId orderby displayOrder";
private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId and mcQueContent.disabled=true";
private static final String REFRESH_QUESTION_CONTENT = "from mcQueContent in class McQueContent where mcQueContent.mcContentId=:mcContentId and mcQueContent.disabled=false";
-
- private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from mcQueContent in class McQueContent where mcQueContent.question=:question and mcQueContent.mcContentId=:mcContentUid";
-
+ private static final String LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT = "from mcQueContent in class McQueContent where mcQueContent.question=:question and mcQueContent.mcContentId=:mcContentUid orderby displayOrder";
public McQueContent getMcQueContentByUID(Long uid)
@@ -76,6 +74,16 @@
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();
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -89,6 +89,8 @@
public McQueContent getQuestionContentByQuestionText(final String question, final Long mcContentUid);
+ public List getAllQuestionEntries(final Long mcContentId) throws McApplicationException;
+
public McSession retrieveMcSession(Long mcSessionId) throws McApplicationException;
public McContent retrieveMcBySessionId(Long mcSessionId) throws McApplicationException;
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -331,6 +331,21 @@
e);
}
}
+
+
+ public List getAllQuestionEntries(final Long uid) throws McApplicationException
+ {
+ try
+ {
+ return mcQueContentDAO.getAllQuestionEntries(uid.longValue());
+ }
+ catch (DataAccessException e)
+ {
+ throw new McApplicationException("Exception occured when lams is getting by uid mc question content: "
+ + e.getMessage(),
+ e);
+ }
+ }
public List refreshQuestionContent(final Long mcContentId) throws McApplicationException
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -58,7 +58,36 @@
return mapQuestionsContent;
}
+ public Map rebuildWeightsMapfromDB(HttpServletRequest request, Long toolContentId)
+ {
+ Map mapWeightsContent= new TreeMap(new McComparator());
+
+ IMcService mcService =McUtils.getToolService(request);
+ logger.debug("toolContentId:" + toolContentId);
+
+ McContent mcContent=mcService.retrieveMc(toolContentId);
+ logger.debug("mcContent:" + mcContent);
+
+ List list=mcService.refreshQuestionContent(mcContent.getUid());
+ logger.debug("refreshed list:" + list);
+
+ Iterator listIterator=list.iterator();
+ Long mapIndex=new Long(1);
+ while (listIterator.hasNext())
+ {
+ McQueContent mcQueContent=(McQueContent)listIterator.next();
+ logger.debug("mcQueContent:" + mcQueContent);
+ mapWeightsContent.put(mapIndex.toString(),mcQueContent.getWeight());
+ mapIndex=new Long(mapIndex.longValue()+1);
+ }
+
+ logger.debug("refreshed Map:" + mapWeightsContent);
+ return mapWeightsContent;
+ }
+
+
+
public void simulatePropertyInspector_RunOffline(HttpServletRequest request)
{
IMcService qaService =McUtils.getToolService(request);
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -44,6 +44,7 @@
import org.apache.struts.action.ActionMessages;
import org.apache.struts.actions.DispatchAction;
import org.lamsfoundation.lams.tool.mc.McAppConstants;
+import org.lamsfoundation.lams.tool.mc.McApplicationException;
import org.lamsfoundation.lams.tool.mc.McComparator;
import org.lamsfoundation.lams.tool.mc.McContent;
import org.lamsfoundation.lams.tool.mc.McOptsContent;
@@ -323,8 +324,11 @@
logger.debug("mapQuestionsContent after shrinking: " + mapQuestionsContent);
logger.debug("mapQuestionsContent size after shrinking: " + mapQuestionsContent.size());
request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent);
-
- String questionIndex =mcAuthoringForm.getQuestionIndex();
+
+ removeRedundantQuestionEntries(request, mapQuestionsContent);
+ logger.debug("finished removeRedundantQuestionEntries");
+
+ String questionIndex =mcAuthoringForm.getQuestionIndex();
logger.debug("questionIndex:" + questionIndex);
String editableQuestionEntry=(String)mapQuestionsContent.get(questionIndex);
@@ -661,7 +665,30 @@
logger.debug("passmark: " + mcAuthoringForm.getPassmark());
if ((mcAuthoringForm.getPassmark() != null) && (mcAuthoringForm.getPassmark().length() > 0))
passmark= new Integer(mcAuthoringForm.getPassmark()).intValue();
+ else
+ {
+ errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY,new ActionMessage("error.passMark.empty"));
+ logger.debug("add error.passMark.empty to ActionMessages");
+ saveErrors(request,errors);
+ mcAuthoringForm.resetUserAction();
+ logger.debug("return to LOAD_QUESTIONS to fix error.");
+ return (mapping.findForward(LOAD_QUESTIONS));
+ }
+
+ try
+ {
+ passmark= new Integer(mcAuthoringForm.getPassmark()).intValue();
+
+ }
+ catch(Exception e)
+ {
+ logger.debug("Exception occured: passmark not integer");
+ persistError(request,"error.passmark.notInteger");
+ return (mapping.findForward(LOAD_QUESTIONS));
+ }
+
logger.debug("isShowFeedback: " + mcAuthoringForm.getShowFeedback());
if (mcAuthoringForm.getShowFeedback().equalsIgnoreCase(ON))
isShowFeedback=true;
@@ -1071,9 +1098,11 @@
McContent mcContent=mcService.retrieveMc(toolContentId);
logger.debug("mcContent:" + mcContent);
- List list=mcService.refreshQuestionContent(mcContent.getUid());
- logger.debug("refreshed list:" + list);
+ //List list=mcService.refreshQuestionContent(mcContent.getUid());
+ List list=mcService.getAllQuestionEntries(mcContent.getUid());
+ logger.debug("list:" + list);
+
Iterator listIterator=list.iterator();
Long mapIndex=new Long(1);
while (listIterator.hasNext())
@@ -1088,6 +1117,51 @@
return mapQuestionsContent;
}
+
+ protected void removeRedundantQuestionEntries(HttpServletRequest request, Map mapQuestionsContent)
+ {
+ IMcService mcService =McUtils.getToolService(request);
+
+ logger.debug("main Map mapQuestionsContent:" + mapQuestionsContent);
+
+ Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID);
+ logger.debug("toolContentId:" + toolContentId);
+
+ McContent mcContent=mcService.retrieveMc(toolContentId);
+ logger.debug("mcContent:" + mcContent);
+
+ List allQuestions=mcService.getAllQuestionEntries(mcContent.getUid());
+ logger.debug("allQuestions:" + allQuestions);
+
+ Iterator listIterator=allQuestions.iterator();
+
+ while (listIterator.hasNext())
+ {
+ McQueContent mcQueContent=(McQueContent)listIterator.next();
+ logger.debug("mcQueContent:" + mcQueContent);
+
+ Iterator itQuestionsMap = mapQuestionsContent.entrySet().iterator();
+ boolean matchFound=false;
+ while (itQuestionsMap.hasNext()) {
+ Map.Entry pairs = (Map.Entry)itQuestionsMap.next();
+ logger.debug("comparing the pair: " + pairs.getKey() + " = " + pairs.getValue());
+
+ if (pairs.getValue().toString().equals(mcQueContent.getQuestion()))
+ {
+ logger.debug("match found the pair: " + pairs.getValue().toString());
+ matchFound=true;
+ }
+ }
+
+ if (matchFound == false)
+ {
+ mcService.removeMcQueContent(mcQueContent);
+ logger.debug("removed mcQueContent: " + mcQueContent);
+ }
+ }
+
+ }
+
/**
* persists error messages to request scope
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -113,6 +113,9 @@
Map mapDisabledQuestions= new TreeMap(new McComparator());
request.getSession().setAttribute(MAP_DISABLED_QUESTIONS, mapDisabledQuestions);
+
+ Map mapWeights= new TreeMap(new McComparator());
+ request.getSession().setAttribute(MAP_WEIGHTS, mapWeights);
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
mcAuthoringForm.resetRadioBoxes();
@@ -319,10 +322,12 @@
request.getSession().setAttribute(RETRIES, new Boolean(mcContent.isRetries()));
request.getSession().setAttribute(PASSMARK, mcContent.getPassMark()); //Integer
request.getSession().setAttribute(SHOW_FEEDBACK, new Boolean(mcContent.isShowFeedback()));
+
-
McUtils.setDefaultSessionAttributes(request, mcContent, mcAuthoringForm);
+ logger.debug("PASSMARK:" + request.getSession().getAttribute(PASSMARK));
+
logger.debug("RICHTEXT_TITLE:" + request.getSession().getAttribute(RICHTEXT_TITLE));
logger.debug("getting default content");
/**
@@ -376,6 +381,17 @@
request.getSession().setAttribute(MAP_DEFAULTOPTIONS_CONTENT, mapDefaultOptionsContent);
logger.debug("starter initialized the Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT));
logger.debug("starter initialized the Default Options Map: " + request.getSession().getAttribute(MAP_DEFAULTOPTIONS_CONTENT));
+
+ /** reset all the weights to 0*/
+ long mapCounter=0;
+ for (long i=1; i <= MAX_QUESTION_COUNT ; i++)
+ {
+ mapCounter++;
+ mapWeights.put(new Long(mapCounter).toString(), new Integer(0));
+ }
+ request.getSession().setAttribute(MAP_WEIGHTS, mapWeights);
+ System.out.print("MAP_WEIGHTS:" + request.getSession().getAttribute(MAP_WEIGHTS));
+
}
else
{
@@ -405,6 +421,9 @@
McUtils.setDefaultSessionAttributes(request, mcContent, mcAuthoringForm);
logger.debug("RICHTEXT_TITLE:" + request.getSession().getAttribute(RICHTEXT_TITLE));
+ mcAuthoringForm.setPassmark((mcContent.getPassMark()).toString());
+ logger.debug("PASSMARK:" + mcAuthoringForm.getPassmark());
+
if (mcContent.isUsernameVisible())
{
mcAuthoringForm.setUsernameVisible(ON);
@@ -466,8 +485,26 @@
mapQuestionsContent=authoringUtil.rebuildQuestionMapfromDB(request, new Long(toolContentId));
System.out.print("mapQuestionsContent:" + mapQuestionsContent);
- request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent);
+ request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent);
logger.debug("starter initialized the existing Questions Map: " + request.getSession().getAttribute(MAP_QUESTIONS_CONTENT));
+
+ mapWeights=authoringUtil.rebuildWeightsMapfromDB(request, new Long(toolContentId));
+ System.out.print("mapWeights:" + mapWeights);
+
+ /** set the mapWeights */
+ Iterator itWeightsMap = mapWeights.entrySet().iterator();
+ long mapWeightsCounter=0;
+ while (itWeightsMap.hasNext()) {
+ Map.Entry pairs = (Map.Entry)itWeightsMap.next();
+ if (pairs.getValue() != null)
+ {
+ System.out.print("the weight is:" + pairs.getValue());
+ mapWeightsCounter++;
+ mapWeights.put(new Long(mapWeightsCounter).toString(), new Integer(pairs.getValue().toString()));
+ }
+ }
+ request.getSession().setAttribute(MAP_WEIGHTS, mapWeights);
+ System.out.print("MAP_WEIGHTS:" + request.getSession().getAttribute(MAP_WEIGHTS));
}
Index: lams_tool_lamc/test/java/org/lamsfoundation/lams/tool/mc/TestMcQueContent.java
===================================================================
diff -u -r4336aafba788b801aa78c2dc27f8d07a2f932be7 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/test/java/org/lamsfoundation/lams/tool/mc/TestMcQueContent.java (.../TestMcQueContent.java) (revision 4336aafba788b801aa78c2dc27f8d07a2f932be7)
+++ lams_tool_lamc/test/java/org/lamsfoundation/lams/tool/mc/TestMcQueContent.java (.../TestMcQueContent.java) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -91,14 +91,21 @@
}
*/
-
+ /*
public void testGetToolDefaultQuestionContent()
{
McQueContent mcQueContent = mcQueContentDAO.getToolDefaultQuestionContent(new Long(1).longValue());
System.out.print("mcQueContent:" + mcQueContent);
}
+ */
+ public void testRemoveQuestionContentByMcUid()
+ {
+ mcQueContentDAO.removeQuestionContentByMcUid(new Long(2));
+
+ }
+
/*
public void testCreateSampleQuestionContent()
{
Index: lams_tool_lamc/web/authoringMaincontent.jsp
===================================================================
diff -u -r306bd64453644ecb765fde5814bbcc308aa911a1 -r735c5db341aaba22874662bf7e44ec91a24424c7
--- lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision 306bd64453644ecb765fde5814bbcc308aa911a1)
+++ lams_tool_lamc/web/authoringMaincontent.jsp (.../authoringMaincontent.jsp) (revision 735c5db341aaba22874662bf7e44ec91a24424c7)
@@ -99,7 +99,7 @@