Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java
===================================================================
diff -u -r9b05990189b80a007b0fbb4f03f99c19f40ee2d7 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 9b05990189b80a007b0fbb4f03f99c19f40ee2d7)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -53,16 +53,12 @@
*/
public abstract class McUtils implements McAppConstants {
- static Logger logger = Logger.getLogger(McUtils.class.getName());
-
public static String replaceNewLines(String text)
{
- logger.debug("using text: " + text);
String newText = "";
if (text != null)
{
newText = text.replaceAll("\n","
");
- logger.debug("newText: " + newText);
}
return newText;
@@ -72,16 +68,13 @@
/**
*
- * getGMTDateTime(HttpServletRequest request)
- *
* @param request
* @return
*/
/* fix this */
public static Date getGMTDateTime()
{
Date date=new Date(System.currentTimeMillis());
- logger.debug("date: " + date);
return date;
}
@@ -92,7 +85,6 @@
HttpSession ss = SessionManager.getSession();
/* get back login user DTO */
UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
- logger.debug("retrieving toolUser: " + toolUser);
return toolUser;
}
@@ -101,7 +93,6 @@
{
UserDTO toolUser=getToolUser();
long userId=toolUser.getUserID().longValue();
- logger.debug("userId: " + userId);
return new Long(userId);
}
@@ -110,22 +101,18 @@
/* 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));
}
@@ -142,27 +129,22 @@
*/
public static Map generateOptionsMap(List listMcOptions)
{
- logger.debug("incoming listMcOptions" + listMcOptions);
Map mapOptionsContent= new TreeMap(new McStringComparator());
Iterator listIterator=listMcOptions.iterator();
Long mapIndex=new Long(1);
while (listIterator.hasNext())
{
McOptsContent mcOptionsContent = (McOptsContent)listIterator.next();
- logger.debug("mcOptionsContent:" + mcOptionsContent);
mapOptionsContent.put(mapIndex.toString(),mcOptionsContent.getMcQueOptionText());
mapIndex=new Long(mapIndex.longValue()+1);
}
- logger.debug("generated mcOptionsContent: " + mapOptionsContent);
return mapOptionsContent;
}
public static void configureContentRepository(HttpServletRequest request, IMcService mcService)
{
- logger.debug("attempt configureContentRepository");
mcService.configureContentRepository();
- logger.debug("configureContentRepository ran successfully");
}
/**
@@ -198,7 +180,6 @@
{
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
- logger.debug(logger + " " + "McUtils" + " Current user is: " + user + " with id: " + user.getUserID());
return user.getUserID().intValue();
}
@@ -213,84 +194,46 @@
user.setUserId(userId);
return user;
}
-
- /**
- * temporary function
- * @return
- */
- public static boolean getDefineLaterStatus()
- {
- return false;
- }
/**
* 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(McContent 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(McContent 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(McContent mcContent)
{
- logger.debug("is run offline: " + mcContent.isRunOffline());
return mcContent.isRunOffline();
}
-
-
- 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)
@@ -455,12 +398,10 @@
request.getSession().removeAttribute(ACTIVITY_TITLE);
request.getSession().removeAttribute(ACTIVITY_INSTRUCTIONS);
request.getSession().removeAttribute(SUMMARY_TOOL_SESSIONS_ID);
- logger.debug("completely cleaned the session.");
}
/**
- * String getDestination(String sourceMcStarter, String requestedModule)
*
* determines the struts level location to return
*
@@ -470,29 +411,26 @@
*/
public static String getDestination(String sourceMcStarter, String requestedModule)
{
- logger.debug("sourceMcStarter: " + sourceMcStarter + " and requestedModule:" + requestedModule);
if (requestedModule.equals(DEFINE_LATER))
{
- logger.debug("request is from define Later url. return to: " + LOAD_VIEW_ONLY);
+ //request is from define Later url. return to LOAD_VIEW_ONLY
return LOAD_VIEW_ONLY;
}
else if (requestedModule.equals(AUTHORING))
{
- logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS);
+ //request is from authoring url. return to LOAD_QUESTIONS
return LOAD_QUESTIONS;
}
else
{
- logger.debug("request is from an unknown source. return null");
+ //request is from an unknown source. return null
return null;
}
}
/**
- * populateAuthoringDTO(HttpServletRequest request, McContent defaultMcContent,
- McGeneralAuthoringDTO mcGeneralAuthoringDTO)
*
* @param request
* @param defaultMcContent
@@ -510,32 +448,23 @@
/**
- * setDefineLater(HttpServletRequest request, boolean value, String toolContentID)
* @param request
* @param value
* @param toolContentID
*/
public static void setDefineLater(HttpServletRequest request, boolean value, String strToolContentID, IMcService mcService)
{
- logger.debug("mcService: " + mcService);
- logger.debug("value:" + value);
- logger.debug("strToolContentID:" + strToolContentID);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent:" + mcContent);
if (mcContent != null)
{
mcContent.setDefineLater(value);
- logger.debug("defineLater has been set to:" + value);
mcService.updateMc(mcContent);
}
}
/**
- * setFormProperties(HttpServletRequest request, IMcService mcService,
- McAuthoringForm mcAuthoringForm, McGeneralAuthoringDTO mcGeneralAuthoringDTO, String strToolContentID, String defaultContentIdStr,
- String activeModule, SessionMap sessionMap, String httpSessionID)
*
* @param request
* @param mcService
@@ -551,11 +480,6 @@
McAuthoringForm mcAuthoringForm, McGeneralAuthoringDTO mcGeneralAuthoringDTO, String strToolContentID, String defaultContentIdStr,
String activeModule, SessionMap sessionMap, String httpSessionID)
{
- logger.debug("setFormProperties: ");
- logger.debug("using strToolContentID: " + strToolContentID);
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
- logger.debug("using activeModule: " + activeModule);
- logger.debug("using httpSessionID: " + httpSessionID);
mcAuthoringForm.setHttpSessionID(httpSessionID);
mcGeneralAuthoringDTO.setHttpSessionID(httpSessionID);
@@ -573,63 +497,49 @@
mcGeneralAuthoringDTO.setActiveModule(activeModule);
String sln=request.getParameter("sln");
- logger.debug("sln: " + sln);
mcAuthoringForm.setSln(sln);
mcGeneralAuthoringDTO.setSln(sln);
String questionsSequenced=request.getParameter("questionsSequenced");
- logger.debug("questionsSequenced: " + questionsSequenced);
mcAuthoringForm.setQuestionsSequenced(questionsSequenced);
mcGeneralAuthoringDTO.setQuestionsSequenced(questionsSequenced);
String randomize=request.getParameter("randomize");
- logger.debug("randomize: " + randomize);
mcAuthoringForm.setRandomize(randomize);
mcGeneralAuthoringDTO.setRandomize(randomize);
String showMarks=request.getParameter("showMarks");
- logger.debug("showMarks: " + questionsSequenced);
mcAuthoringForm.setShowMarks(showMarks);
mcGeneralAuthoringDTO.setShowMarks(showMarks);
String retries=request.getParameter("retries");
- logger.debug("retries: " + retries);
mcAuthoringForm.setRetries(retries);
mcGeneralAuthoringDTO.setRetries(retries);
String offlineInstructions=request.getParameter(OFFLINE_INSTRUCTIONS);
- logger.debug("offlineInstructions: " + offlineInstructions);
mcAuthoringForm.setOfflineInstructions(offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
String onlineInstructions=request.getParameter(ONLINE_INSTRUCTIONS);
- logger.debug("onlineInstructions: " + onlineInstructions);
mcAuthoringForm.setOnlineInstructions(onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String reflect=request.getParameter(REFLECT);
- logger.debug("reflect: " + reflect);
mcAuthoringForm.setReflect(reflect);
mcGeneralAuthoringDTO.setReflect(reflect);
String reflectionSubject=request.getParameter(REFLECTION_SUBJECT);
- logger.debug("reflectionSubject: " + reflectionSubject);
mcAuthoringForm.setReflectionSubject(reflectionSubject);
mcGeneralAuthoringDTO.setReflectionSubject(reflectionSubject);
String passmark= request.getParameter("passmark");
- logger.debug("passmark: " + passmark);
mcGeneralAuthoringDTO.setPassMarkValue(passmark);
-
-
- logger.debug("ending setFormProperties with mcAuthoringForm: " + mcAuthoringForm);
- logger.debug("ending setFormProperties with mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McContentDAO.java
===================================================================
diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McContentDAO.java (.../McContentDAO.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McContentDAO.java (.../McContentDAO.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -39,9 +39,7 @@
* @author Ozgur Demirtas
*
Hibernate implementation for database access to McContent for the mc tool.
*/ - public class McContentDAO extends HibernateDaoSupport implements IMcContentDAO { - static Logger logger = Logger.getLogger(McContentDAO.class.getName()); private static final String FIND_MC_CONTENT = "from " + McContent.class.getName() + " as mc where content_id=?"; @@ -55,17 +53,13 @@ public McContent findMcContentById(Long mcContentId) { - logger.debug("doing findMcContentById" + mcContentId); String query = "from McContent as mc where mc.mcContentId = ?"; - logger.debug("query: " + query); HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(FIND_MC_CONTENT) .setLong(0,mcContentId.longValue()) .list(); - logger.debug("list: " + list); - if(list != null && list.size() > 0){ McContent mc = (McContent) list.get(0); return mc; @@ -93,9 +87,7 @@ public void saveMcContent(McContent mcContent) { this.getSession().setFlushMode(FlushMode.AUTO); - logger.debug("before saveOrUpdate"); this.getHibernateTemplate().saveOrUpdate(mcContent); - logger.debug("after saveOrUpdate"); } public void updateMcContent(McContent mcContent) @@ -107,7 +99,6 @@ public void saveOrUpdateMc(McContent mc) { this.getSession().setFlushMode(FlushMode.AUTO); - logger.debug("before saveOrUpdateMc: " + mc); this.getHibernateTemplate().saveOrUpdate(mc); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java =================================================================== diff -u -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McQueContentDAO.java (.../McQueContentDAO.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -39,7 +39,6 @@ *Hibernate implementation for database access to McQueContent for the mc tool.
*/ 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 order by mcQueContent.displayOrder"; @@ -205,7 +204,6 @@ { McQueContent mcQueContent=(McQueContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - logger.debug("deleting mcQueContent: " + mcQueContent); templ.delete(mcQueContent); } } @@ -225,7 +223,6 @@ { McQueContent mcQueContent=(McQueContent)listIterator.next(); this.getSession().setFlushMode(FlushMode.AUTO); - logger.debug("deleting mcQueContent: " + mcQueContent); templ.delete(mcQueContent); } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java =================================================================== diff -u -r51190e07e3d8dfaee600d9912e0a3d723363570a -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java (.../McUsrAttemptDAO.java) (revision 51190e07e3d8dfaee600d9912e0a3d723363570a) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUsrAttemptDAO.java (.../McUsrAttemptDAO.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -41,7 +41,6 @@ * must also be checked. */ public class McUsrAttemptDAO extends HibernateDaoSupport implements IMcUsrAttemptDAO { - static Logger logger = Logger.getLogger(McUsrAttemptDAO.class.getName()); private static final String LOAD_ATTEMPT_BY_USER_SESSION = "from mcUsrAttempt in class McUsrAttempt where mcUsrAttempt.queUsrId=:queUsrUid"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McContent.java =================================================================== diff -u -r3e5b36454b17cee648f9d02e0656e8e99c46e00e -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McContent.java (.../McContent.java) (revision 3e5b36454b17cee648f9d02e0656e8e99c46e00e) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McContent.java (.../McContent.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -46,7 +46,6 @@ * @author Ozgur Demirtas */ public class McContent implements Serializable { - static Logger logger = Logger.getLogger(McContent.class.getName()); /** identifier field */ private Long uid; @@ -126,7 +125,6 @@ Integer passMark, boolean showReport, boolean randomize, boolean displayAnswers, boolean showMarks, boolean retries, boolean reflect, String reflectionSubject, Set mcQueContents, Set mcSessions, Set mcAttachments) { - logger.debug("copying properties"); this.mcContentId = mcContentId; this.content=content; this.title = title; @@ -475,20 +473,8 @@ */ public void setReflectionSubject(String reflectionSubject) { this.reflectionSubject = reflectionSubject; - } - /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return logger; } /** - * @param logger The logger to set. - */ - public static void setLogger(Logger logger) { - McContent.logger = logger; - } - /** * @return Returns the showMarks. */ public boolean isShowMarks() { @@ -551,7 +537,6 @@ Integer mark=mcQueContent.getMark(); totalMarksPossible += (mark!=null ? mark.intValue() : 0); } - logger.debug("totalMarksPossible: " + totalMarksPossible); return new Integer(totalMarksPossible); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java =================================================================== diff -u -r027758c2ee944683de01e4cd689fe3244d031920 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java (.../McOptsContent.java) (revision 027758c2ee944683de01e4cd689fe3244d031920) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McOptsContent.java (.../McOptsContent.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -40,7 +40,6 @@ * @author Ozgur Demirtas */ public class McOptsContent implements Serializable, Comparable { - static Logger logger = Logger.getLogger(McOptsContent.class.getName()); /** identifier field */ private Long uid; @@ -197,18 +196,6 @@ return (int) (mcQueOptionId.longValue() - optContent.mcQueOptionId.longValue()); } /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return logger; - } - /** - * @param logger The logger to set. - */ - public static void setLogger(Logger logger) { - McOptsContent.logger = logger; - } - /** * @return Returns the displayOrder. */ public Integer getDisplayOrder() { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java =================================================================== diff -u -r51190e07e3d8dfaee600d9912e0a3d723363570a -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java (.../McQueContent.java) (revision 51190e07e3d8dfaee600d9912e0a3d723363570a) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McQueContent.java (.../McQueContent.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -41,7 +41,6 @@ * @author Ozgur Demirtas */ public class McQueContent implements Serializable, Comparable { - static Logger logger = Logger.getLogger(McQueContent.class.getName()); /** identifier field */ private Long uid; @@ -174,7 +173,6 @@ McContent newMcContent) { - logger.debug("deep copying queContent: " + queContent); McQueContent newQueContent = new McQueContent(queContent.getQuestion(), queContent.getDisplayOrder(), queContent.getMark(), @@ -297,20 +295,7 @@ public void setMcContentId(Long mcContentId) { this.mcContentId = mcContentId; } - /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return logger; - } - /** - * @param logger The logger to set. - */ - public static void setLogger(Logger logger) { - McQueContent.logger = logger; - } - /** * @return Returns the feedback. */ public String getFeedback() { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUploadedFile.java =================================================================== diff -u -r6469a3c8ad3e545e2f1929947d3c46b040896632 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUploadedFile.java (.../McUploadedFile.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUploadedFile.java (.../McUploadedFile.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -53,7 +53,6 @@ public class McUploadedFile implements Serializable, Comparable { - static Logger logger = Logger.getLogger(McUploadedFile.class.getName()); /** identifier field */ private Long submissionId; @@ -108,7 +107,6 @@ String fileName, McContent mcContent) { - logger.debug("constructor gets called."); this.uuid = uuid; this.fileOnline = fileOnline; this.fileName = fileName; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/MCOutputFactory.java =================================================================== diff -u -r61e7bbf20d65e2ecb5e50f3154e52264003defa1 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/MCOutputFactory.java (.../MCOutputFactory.java) (revision 61e7bbf20d65e2ecb5e50f3154e52264003defa1) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/MCOutputFactory.java (.../MCOutputFactory.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -59,8 +59,7 @@ .getTotalMarksPossible().longValue()), true); definitionMap.put(OUTPUT_NAME_LEARNER_MARK, definition); } else { - log - .error("Unable to build content based output definitions for Multiple Choice as no tool content object supplied. Only including the definitions that do not need any content."); + log.error("Unable to build content based output definitions for Multiple Choice as no tool content object supplied. Only including the definitions that do not need any content."); } return definitionMap; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java =================================================================== diff -u -rf0450cb2776a8eba5e274ec3e72f83a333f5d229 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision f0450cb2776a8eba5e274ec3e72f83a333f5d229) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java (.../McServicePOJO.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -136,14 +136,10 @@ } public void configureContentRepository() throws McApplicationException { - McServicePOJO.logger.debug("retrieved repService: " + repositoryService); cred = new SimpleCredentials(repositoryUser, repositoryId); - McServicePOJO.logger.debug("retrieved cred: " + cred); try { repositoryService.createCredentials(cred); - McServicePOJO.logger.debug("created credentails."); repositoryService.addWorkspace(cred, repositoryWorkspace); - McServicePOJO.logger.debug("created workspace."); } catch (ItemExistsException ie) { McServicePOJO.logger.warn("Tried to configure repository but it " + " appears to be already configured. Exception thrown by repository being ignored. ", ie); @@ -157,7 +153,6 @@ public void createMc(McContent mcContent) throws McApplicationException { try { - McServicePOJO.logger.debug("using mcContent defineLater:" + mcContent.isDefineLater()); mcContentDAO.saveMcContent(mcContent); } catch (DataAccessException e) { throw new McApplicationException("Exception occured when lams is creating mc content: " + e.getMessage(), e); @@ -579,7 +574,6 @@ * @return top mark, lowest mark, average mark in that order */ public Integer[] getMarkStatistics(McSession mcSession) { - McServicePOJO.logger.debug("getting mark statistics on mcSession: " + mcSession.getUid()); return mcUserDAO.getMarkStatisticsForSession(mcSession.getUid()); } @@ -722,7 +716,6 @@ public User getCurrentUserData(String username) throws McApplicationException { try { - McServicePOJO.logger.debug("getCurrentUserData: " + username); /** * this will return null if the username not found */ @@ -773,14 +766,12 @@ McQueContent mcQueContent = (McQueContent) questionIterator.next(); Iterator attemptsIterator = mcQueContent.getMcUsrAttempts().iterator(); while (attemptsIterator.hasNext()) { - McServicePOJO.logger.debug("there is at least one attempt"); /** * proved the fact that there is at least one attempt for this content. */ return true; } } - McServicePOJO.logger.debug("there is no response for this content"); return false; } @@ -821,12 +812,9 @@ * */ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { - McServicePOJO.logger.debug("start of copyToolContent with ids: " + fromContentId + " and " + toContentId); if (fromContentId == null) { - McServicePOJO.logger.error("fromContentId is null."); - McServicePOJO.logger.debug("attempt retrieving tool's default content id with signatute : " - + McAppConstants.MY_SIGNATURE); + McServicePOJO.logger.warn("fromContentId is null."); long defaultContentId = 0; try { defaultContentId = getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE); @@ -843,15 +831,12 @@ McServicePOJO.logger.error("throwing ToolException: toContentId is null"); throw new ToolException("toContentId is missing"); } - McServicePOJO.logger.debug("final - copyToolContent using ids: " + fromContentId + " and " + toContentId); try { McContent fromContent = mcContentDAO.findMcContentById(fromContentId); if (fromContent == null) { - McServicePOJO.logger.error("fromContent is null."); - McServicePOJO.logger.error("attempt retrieving tool's default content id with signatute : " - + McAppConstants.MY_SIGNATURE); + McServicePOJO.logger.warn("fromContent is null."); long defaultContentId = 0; try { defaultContentId = getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE); @@ -864,25 +849,16 @@ } fromContent = mcContentDAO.findMcContentById(fromContentId); - McServicePOJO.logger.debug("using fromContent: " + fromContent); } - - McServicePOJO.logger.debug("final - retrieved fromContent: " + fromContent); - McServicePOJO.logger.debug("final - before new instance using " + fromContent + " and " + toContentId); - McServicePOJO.logger.debug("final - before new instance using mcToolContentHandler: " - + mcToolContentHandler); - + try { McContent toContent = McContent.newInstance(mcToolContentHandler, fromContent, toContentId); if (toContent == null) { - McServicePOJO.logger.debug("throwing ToolException: WARNING!, retrieved toContent is null."); + McServicePOJO.logger.error("throwing ToolException: WARNING!, retrieved toContent is null."); throw new ToolException("WARNING! Fail to create toContent. Can't continue!"); } else { - McServicePOJO.logger.debug("retrieved toContent: " + toContent); mcContentDAO.saveMcContent(toContent); - McServicePOJO.logger.debug("toContent has been saved successfully: " + toContent); } - McServicePOJO.logger.debug("end of copyToolContent with ids: " + fromContentId + " and " + toContentId); } catch (ItemNotFoundException e) { McServicePOJO.logger.error("exception occurred: " + e); @@ -907,23 +883,18 @@ */ public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { - McServicePOJO.logger.debug("start of removeToolContent with toolContentId: " + toolContentId - + "removeSessionData: " + removeSessionData); if (toolContentId == null) { McServicePOJO.logger.error("toolContentId is null"); throw new ToolException("toolContentId is missing"); } McContent mcContent = mcContentDAO.findMcContentById(toolContentId); - McServicePOJO.logger.debug("retrieving mcContent: " + mcContent); if (mcContent != null) { - McServicePOJO.logger.error("start deleting any uploaded file for this content from the content repository"); Iterator filesIterator = mcContent.getMcAttachments().iterator(); while (filesIterator.hasNext()) { McUploadedFile mcUploadedFile = (McUploadedFile) filesIterator.next(); - McServicePOJO.logger.debug("iterated mcUploadedFile : " + mcUploadedFile); String filesUuid = mcUploadedFile.getUuid(); if (filesUuid != null && filesUuid.length() > 0) { try { @@ -934,36 +905,27 @@ } } } - McServicePOJO.logger.debug("end deleting any uploaded files for this content."); Iterator sessionIterator = mcContent.getMcSessions().iterator(); while (sessionIterator.hasNext()) { if (removeSessionData == false) { - McServicePOJO.logger.debug("removeSessionData is false, throwing SessionDataExistsException."); throw new SessionDataExistsException(); } McSession mcSession = (McSession) sessionIterator.next(); - McServicePOJO.logger.debug("iterated mcSession : " + mcSession); Iterator sessionUsersIterator = mcSession.getMcQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { McQueUsr mcQueUsr = (McQueUsr) sessionUsersIterator.next(); - McServicePOJO.logger.debug("iterated mcQueUsr : " + mcQueUsr); Iterator sessionUsersAttemptsIterator = mcQueUsr.getMcUsrAttempts().iterator(); while (sessionUsersAttemptsIterator.hasNext()) { McUsrAttempt mcUsrAttempt = (McUsrAttempt) sessionUsersAttemptsIterator.next(); - McServicePOJO.logger.debug("iterated mcUsrAttempt : " + mcUsrAttempt); removeAttempt(mcUsrAttempt); - McServicePOJO.logger.debug("removed mcUsrAttempt : " + mcUsrAttempt); } } } - McServicePOJO.logger.debug("removed all existing responses of toolContent with toolContentId:" - + toolContentId); mcContentDAO.removeMcById(toolContentId); - McServicePOJO.logger.debug("removed mcContent:" + mcContent); } else { McServicePOJO.logger.error("Warning!!!, We should have not come here. mcContent is null."); throw new ToolException("toolContentId is missing"); @@ -996,35 +958,25 @@ McQueUsr mcQueUsr = retrieveMcQueUsr(userId); if (mcQueUsr != null) { - McServicePOJO.logger.error("retrieved mcQueUsr : " + mcQueUsr); - McServicePOJO.logger.error("retrieved mcQueUsr has the tool session : " + mcQueUsr.getMcSession()); McSession mcSession = mcQueUsr.getMcSession(); if (mcSession != null) { Long usersToolSessionId = mcSession.getMcSessionId(); - McServicePOJO.logger.debug("retrieved tool session has tool session id : " + usersToolSessionId); mcSession = retrieveMcSession(usersToolSessionId); - McServicePOJO.logger.debug("retrieved mcSession is : " + mcSession); mcSession.setSessionStatus(McSession.COMPLETED); - McServicePOJO.logger.debug("updated mcSession to COMPLETED : "); updateMcSession(mcSession); - McServicePOJO.logger.debug("updated mcSession to COMPLETED in the db : "); McContent mcContent = mcSession.getMcContent(); - McServicePOJO.logger.debug("mcSession uses mcContent : " + mcContent); - McServicePOJO.logger.debug("mcSession uses mcContentId : " + mcContent.getMcContentId()); /** * if all the sessions of this content is COMPLETED, unlock the content * */ int countIncompleteSession = countIncompleteSession(mcContent); - McServicePOJO.logger.debug("mcSession countIncompleteSession : " + countIncompleteSession); if (countIncompleteSession == 0) { mcContent.setContentInUse(false); updateMc(mcContent); - McServicePOJO.logger.debug("mcContent has been updated for contentInUse" + mcContent); } } else { McServicePOJO.logger.error("WARNING!: retrieved mcSession is null."); @@ -1184,14 +1136,7 @@ */ public boolean existsSession(Long toolSessionId) { McSession mcSession = retrieveMcSession(toolSessionId); - - if (mcSession == null) { - McServicePOJO.logger.error("mcSession does not exist yet: " + toolSessionId); - return false; - } else { - McServicePOJO.logger.debug("retrieving an existing mcSession: " + mcSession + " " + toolSessionId); - } - return true; + return mcSession != null; } /** @@ -1209,8 +1154,6 @@ * */ public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { - McServicePOJO.logger.debug("start of createToolSession with ids: " + toolSessionId + " and " + toolContentId); - McServicePOJO.logger.debug("toolSessionName: " + toolSessionName); if (toolSessionId == null) { McServicePOJO.logger.error("toolSessionId is null"); @@ -1219,35 +1162,25 @@ long defaultContentId = 0; if (toolContentId == null) { - McServicePOJO.logger.error("toolContentId is null."); - McServicePOJO.logger.error("attempt retrieving tool's default content id with signatute : " - + McAppConstants.MY_SIGNATURE); try { defaultContentId = getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE); toolContentId = new Long(defaultContentId); - McServicePOJO.logger.debug("updated toolContentId to: " + toolContentId); } catch (Exception e) { McServicePOJO.logger.error("default content id has not been setup for signature: " + McAppConstants.MY_SIGNATURE); throw new ToolException("WARNING! default content has not been setup for signature" + McAppConstants.MY_SIGNATURE + " Can't continue!"); } } - McServicePOJO.logger.debug("final toolSessionId and toolContentId: " + toolSessionId + " " + toolContentId); McContent mcContent = mcContentDAO.findMcContentById(toolContentId); - McServicePOJO.logger.debug("retrieved mcContent: " + mcContent); if (mcContent == null) { - McServicePOJO.logger.error("mcContent is null."); - McServicePOJO.logger.error("attempt retrieving tool's default content id with signatute : " - + McAppConstants.MY_SIGNATURE); try { defaultContentId = getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE); toolContentId = new Long(defaultContentId); - McServicePOJO.logger.debug("updated toolContentId to: " + toolContentId); } catch (Exception e) { McServicePOJO.logger.error("default content id has not been setup for signature: " + McAppConstants.MY_SIGNATURE); @@ -1257,7 +1190,6 @@ mcContent = mcContentDAO.findMcContentById(toolContentId); } - McServicePOJO.logger.debug("final - retrieved mcContent: " + mcContent); /* * create a new a new tool session if it does not already exist in the tool session table @@ -1267,9 +1199,7 @@ McSession mcSession = new McSession(toolSessionId, new Date(System.currentTimeMillis()), McSession.INCOMPLETE, toolSessionName, mcContent, new TreeSet()); - McServicePOJO.logger.debug("created mcSession: " + mcSession); mcSessionDAO.saveMcSession(mcSession); - McServicePOJO.logger.debug("created mcSession in the db: " + mcSession); } catch (Exception e) { McServicePOJO.logger.error("Error creating new toolsession in the db"); @@ -1288,7 +1218,6 @@ * @throws ToolException */ public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException { - McServicePOJO.logger.debug("start of removeToolSession with id: " + toolSessionId); if (toolSessionId == null) { McServicePOJO.logger.error("toolSessionId is null"); throw new DataMissingException("toolSessionId is missing"); @@ -1297,7 +1226,6 @@ McSession mcSession = null; try { mcSession = retrieveMcSession(toolSessionId); - McServicePOJO.logger.debug("retrieved mcSession: " + mcSession); } catch (McApplicationException e) { throw new DataMissingException("error retrieving mcSession: " + e); } catch (Exception e) { @@ -1328,9 +1256,6 @@ * */ public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException { - McServicePOJO.logger.debug("start of leaveToolSession with toolSessionId:" + toolSessionId + " and learnerId:" - + learnerId); - McServicePOJO.logger.debug("make sure learnerService is available. Is it?" + learnerService); if (learnerService == null) { return "dummyNextUrl"; @@ -1349,18 +1274,15 @@ McSession mcSession = null; try { mcSession = retrieveMcSession(toolSessionId); - McServicePOJO.logger.debug("retrieved mcSession: " + mcSession); } catch (McApplicationException e) { throw new DataMissingException("error retrieving mcSession: " + e); } catch (Exception e) { throw new ToolException("error retrieving mcSession: " + e); } mcSession.setSessionStatus(McAppConstants.COMPLETED); mcSessionDAO.updateMcSession(mcSession); - McServicePOJO.logger.debug("updated mcSession to COMPLETED" + mcSession); String nextUrl = learnerService.completeToolSession(toolSessionId, learnerId); - McServicePOJO.logger.debug("nextUrl: " + nextUrl); if (nextUrl == null) { McServicePOJO.logger.error("nextUrl is null"); throw new ToolException("nextUrl is null"); @@ -1414,22 +1336,18 @@ } public IToolVO getToolBySignature(String toolSignature) throws McApplicationException { - McServicePOJO.logger.debug("attempt retrieving tool with signature : " + toolSignature); IToolVO tool = toolService.getToolBySignature(toolSignature); - McServicePOJO.logger.debug("retrieved tool: " + tool); return tool; } public long getToolDefaultContentIdBySignature(String toolSignature) throws McApplicationException { long contentId = 0; contentId = toolService.getToolDefaultContentIdBySignature(toolSignature); - McServicePOJO.logger.debug("tool default contentId : " + contentId); return contentId; } public McQueContent getToolDefaultQuestionContent(long contentId) throws McApplicationException { McQueContent mcQueContent = mcQueContentDAO.getToolDefaultQuestionContent(contentId); - McServicePOJO.logger.debug("retrieved mcQueContent : " + mcQueContent); return mcQueContent; } @@ -1468,7 +1386,6 @@ ICredentials credentials = new SimpleCredentials(repositoryUser, repositoryId); try { ITicket ticket = repositoryService.login(credentials, repositoryWorkspace); - McServicePOJO.logger.debug("retrieved ticket: " + ticket); return ticket; } catch (AccessDeniedException e) { throw new McApplicationException("Access Denied to repository." + e.getMessage()); @@ -1491,10 +1408,8 @@ */ public void deleteFromRepository(Long uuid, Long versionID) throws McApplicationException { ITicket ticket = getRepositoryLoginTicket(); - McServicePOJO.logger.debug("retrieved ticket: " + ticket); try { String files[] = repositoryService.deleteVersion(ticket, uuid, versionID); - McServicePOJO.logger.debug("retrieved files: " + files); } catch (Exception e) { throw new McApplicationException("Exception occured while deleting files from" + " the repository " + e.getMessage()); @@ -1516,13 +1431,10 @@ * @throws SubmitFilesException */ public NodeKey uploadFileToRepository(InputStream stream, String fileName) throws McApplicationException { - McServicePOJO.logger.debug("attempt getting the ticket"); ITicket ticket = getRepositoryLoginTicket(); - McServicePOJO.logger.debug("retrieved ticket: " + ticket); try { NodeKey nodeKey = repositoryService.addFileItem(ticket, stream, fileName, null, null); - McServicePOJO.logger.debug("retrieved nodeKey from repository service: " + nodeKey); return nodeKey; } catch (Exception e) { throw new McApplicationException("Exception occured while trying to" + " upload file into the repository" @@ -1534,7 +1446,6 @@ ITicket ticket = getRepositoryLoginTicket(); try { IVersionedNode node = repositoryService.getFileItem(ticket, uuid, null); - McServicePOJO.logger.debug("retrieved node: " + node); return node.getFile(); } catch (AccessDeniedException e) { throw new McApplicationException("AccessDeniedException occured while trying to download file " @@ -1553,34 +1464,15 @@ public void persistFile(String uuid, boolean isOnlineFile, String fileName, McContent mcContent) throws McApplicationException { - McServicePOJO.logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName - + " " + mcContent); McUploadedFile mcUploadedFile = new McUploadedFile(uuid, isOnlineFile, fileName, mcContent); - McServicePOJO.logger.debug("created mcUploadedFile: " + mcUploadedFile); mcUploadedFileDAO.saveUploadFile(mcUploadedFile); - McServicePOJO.logger.debug("persisted mcUploadedFile: " + mcUploadedFile); } public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return McServicePOJO.logger; - } - - /** - * @param logger - * The logger to set. - */ - public static void setLogger(Logger logger) { - McServicePOJO.logger = logger; - } - - /** * @return Returns the cred. */ public ICredentials getCred() { @@ -1952,25 +1844,20 @@ * adds a new entry to the uploaded files table */ public void persistFile(McContent content, McUploadedFile file) throws McApplicationException { - McServicePOJO.logger.debug("in persistFile: " + file); - McServicePOJO.logger.debug("in persistFile, content: " + content); content.getMcAttachments().add(file); file.setMcContent(content); mcContentDAO.saveOrUpdateMc(content); - McServicePOJO.logger.debug("persisted mcUploadedFile: " + file); } /** * removes an entry from the uploaded files table */ public void removeFile(Long submissionId) throws McApplicationException { mcUploadedFileDAO.removeUploadFile(submissionId); - McServicePOJO.logger.debug("removed mcUploadedFile: " + submissionId); } public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry) { - McServicePOJO.logger.debug("coreNotebookService: " + coreNotebookService); return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -r65ed4da382b320542dcd88cb1375662dcfac8769 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 65ed4da382b320542dcd88cb1375662dcfac8769) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -86,7 +86,6 @@ Iterator itMap = map.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if ((pairs.getValue() != null) && (pairs.getValue().toString().length() == 0)) { return false; @@ -109,47 +108,35 @@ */ public static void cleanupRedundantQuestions(HttpServletRequest request, List existingQuestions, Map mapQuestionsContent, McContent mcContent, IMcService mcService) { - AuthoringUtil.logger.debug("doing cleanupRedundantQuestions..."); - AuthoringUtil.logger.debug("using existingQuestions: " + existingQuestions); - AuthoringUtil.logger.debug("using mapQuestionsContent: " + mapQuestionsContent); - AuthoringUtil.logger.debug("using mcContent: " + mcContent); /*remove ununsed question entries from the db */ boolean questionFound = false; Iterator itExistingQuestions = existingQuestions.iterator(); while (itExistingQuestions.hasNext()) { McQueContent mcQueContent = (McQueContent) itExistingQuestions.next(); - AuthoringUtil.logger.debug("mcQueContent:" + mcQueContent); Iterator itNewQuestionsMap = mapQuestionsContent.entrySet().iterator(); questionFound = false; while (itNewQuestionsMap.hasNext()) { Map.Entry pairs = (Map.Entry) itNewQuestionsMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); - AuthoringUtil.logger.debug("mcQueContent.getQuestion(): " + mcQueContent.getQuestion() + "--" - + pairs.getValue()); if (mcQueContent.getQuestion().equals(pairs.getValue().toString())) { - AuthoringUtil.logger.debug("equals mcQueContent.getQuestion(): " + mcQueContent.getQuestion() - + "--" + pairs.getValue()); questionFound = true; break; } } if (questionFound == false) { String deletableQuestion = mcQueContent.getQuestion(); - AuthoringUtil.logger.debug("found is false, delete this question " + deletableQuestion); + //found is false, delete this question mcQueContent = mcService.getQuestionContentByQuestionText(deletableQuestion, mcContent.getUid()); - AuthoringUtil.logger.debug("found is false, delete this question " + mcQueContent); if (mcQueContent != null) { - AuthoringUtil.logger.debug("first removing from collection " + mcQueContent); + //first removing from collection mcContent.getMcQueContents().remove(mcQueContent); - AuthoringUtil.logger.debug("removed from collection "); mcService.removeMcQueContent(mcQueContent); - AuthoringUtil.logger.debug("removed mcQueContent from the db: " + mcQueContent); + //removed mcQueContent from the db } } } @@ -173,11 +160,8 @@ Long mapIndex = new Long(1); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); String currentQuestionUid = pairs.getValue().toString(); - AuthoringUtil.logger.debug("currentQuestionUid: " + currentQuestionUid); List listQuestionOptions = mcService.findMcOptionsContentByQueId(new Long(currentQuestionUid)); - AuthoringUtil.logger.debug("listQuestionOptions: " + listQuestionOptions); Map mapQuestionOptions = AuthoringUtil.generateOptionsMap(listQuestionOptions); mapStartupGeneralOptionsContent.put(mapIndex.toString(), mapQuestionOptions); mapIndex = new Long(mapIndex.longValue() + 1); @@ -191,11 +175,9 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO: " + mcCandidateAnswersDTO); if (mcCandidateAnswersDTO != null) { String ca = mcCandidateAnswersDTO.getCandidateAnswer(); - AuthoringUtil.logger.debug("ca: " + ca); if ((ca != null) && (ca.length() > 0)) { newList.add(mcCandidateAnswersDTO); @@ -222,42 +204,13 @@ Long mapIndex = new Long(1); while (listIterator.hasNext()) { McOptsContent mcOptsContent = (McOptsContent) listIterator.next(); - AuthoringUtil.logger.debug("mcOptsContent: " + mcOptsContent); mapOptsContent.put(mapIndex.toString(), mcOptsContent.getMcQueOptionText()); mapIndex = new Long(mapIndex.longValue() + 1); } return mapOptsContent; } /** - * updates existing questions while persisting the questions - * - * updateExistingQuestionContent(HttpServletRequest request, Map mapFeedbackIncorrect, Map mapFeedbackCorrect, - * McQueContent mcQueContent, String displayOrder) - * - * @param request - * @param mapFeedbackIncorrect - * @param mapFeedbackCorrect - * @param mcQueContent - * @param displayOrder - */ - public static void updateExistingQuestionContent(HttpServletRequest request, Map mapFeedbackIncorrect, - Map mapFeedbackCorrect, McQueContent mcQueContent, String displayOrder, IMcService mcService) { - AuthoringUtil.logger.debug("doing updateExistingQuestionContent..."); - AuthoringUtil.logger.debug("using displayOrder: " + displayOrder); - - String incorrectFeedback = (String) mapFeedbackIncorrect.get(displayOrder); - AuthoringUtil.logger.debug("new incorrectFeedback will be :" + incorrectFeedback); - String correctFeedback = (String) mapFeedbackCorrect.get(displayOrder); - AuthoringUtil.logger.debug("new correctFeedback will be :" + correctFeedback); - - mcQueContent.setDisplayOrder(new Integer(displayOrder)); - - mcService.saveOrUpdateMcQueContent(mcQueContent); - AuthoringUtil.logger.debug("updated mcQueContent in the db: " + mcQueContent); - } - - /** * builds a map to hold question texts rebuildQuestionMapfromDB(HttpServletRequest request, Long toolContentId) * * @param request @@ -266,51 +219,40 @@ */ public static Map rebuildQuestionMapfromDB(HttpServletRequest request, Long toolContentId, IMcService mcService) { Map mapQuestionsContent = new TreeMap(new McComparator()); - AuthoringUtil.logger.debug("toolContentId:" + toolContentId); McContent mcContent = mcService.retrieveMc(toolContentId); - AuthoringUtil.logger.debug("mcContent:" + mcContent); List list = mcService.refreshQuestionContent(mcContent.getUid()); - AuthoringUtil.logger.debug("refreshed list:" + list); Iterator listIterator = list.iterator(); Long mapIndex = new Long(1); while (listIterator.hasNext()) { McQueContent mcQueContent = (McQueContent) listIterator.next(); - AuthoringUtil.logger.debug("mcQueContent:" + mcQueContent); mapQuestionsContent.put(mapIndex.toString(), mcQueContent.getQuestion()); mapIndex = new Long(mapIndex.longValue() + 1); } - AuthoringUtil.logger.debug("refreshed Map:" + mapQuestionsContent); return mapQuestionsContent; } public static Map rebuildFeedbackMapfromDB(HttpServletRequest request, Long toolContentId, IMcService mcService) { Map map = new TreeMap(new McComparator()); - AuthoringUtil.logger.debug("toolContentId:" + toolContentId); McContent mcContent = mcService.retrieveMc(toolContentId); - AuthoringUtil.logger.debug("mcContent:" + mcContent); List list = mcService.refreshQuestionContent(mcContent.getUid()); - AuthoringUtil.logger.debug("refreshed list:" + list); Iterator listIterator = list.iterator(); Long mapIndex = new Long(1); while (listIterator.hasNext()) { McQueContent mcQueContent = (McQueContent) listIterator.next(); - AuthoringUtil.logger.debug("mcQueContent:" + mcQueContent); String feedback = mcQueContent.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); map.put(mapIndex.toString(), feedback); mapIndex = new Long(mapIndex.longValue() + 1); } - AuthoringUtil.logger.debug("refreshed Map:" + map); return map; } @@ -324,26 +266,21 @@ */ public static Map rebuildQuestionUidMapfromDB(HttpServletRequest request, Long toolContentId, IMcService mcService) { Map mapQuestionsContent = new TreeMap(new McComparator()); - AuthoringUtil.logger.debug("toolContentId:" + toolContentId); McContent mcContent = mcService.retrieveMc(toolContentId); - AuthoringUtil.logger.debug("mcContent:" + mcContent); if (mcContent != null) { List list = mcService.refreshQuestionContent(mcContent.getUid()); - AuthoringUtil.logger.debug("refreshed list:" + list); Iterator listIterator = list.iterator(); Long mapIndex = new Long(1); while (listIterator.hasNext()) { McQueContent mcQueContent = (McQueContent) listIterator.next(); - AuthoringUtil.logger.debug("mcQueContent:" + mcQueContent); mapQuestionsContent.put(mapIndex.toString(), mcQueContent.getUid()); mapIndex = new Long(mapIndex.longValue() + 1); } } - AuthoringUtil.logger.debug("refreshed Map:" + mapQuestionsContent); return mapQuestionsContent; } @@ -358,15 +295,11 @@ */ public static boolean isOptionSelected(Map mapGeneralSelectedOptionsContent, String optionText, String questionIndex) { Iterator itGSOMap = mapGeneralSelectedOptionsContent.entrySet().iterator(); - AuthoringUtil.logger.debug("questionIndex: " + questionIndex); - AuthoringUtil.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(); - AuthoringUtil.logger.debug("currentOptionsMap: " + currentOptionsMap); boolean isOptionSelectedInMap = AuthoringUtil.isOptionSelectedInMap(optionText, currentOptionsMap); - AuthoringUtil.logger.debug("isOptionSelectedInMap: " + isOptionSelectedInMap); return isOptionSelectedInMap; } } @@ -382,12 +315,10 @@ * @return */ public static boolean isOptionSelectedInMap(String optionText, Map currentOptionsMap) { - AuthoringUtil.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)) { - AuthoringUtil.logger.debug("option text found in the map: " + optionText); return true; } } @@ -405,37 +336,25 @@ * @return */ protected static List swapNodes(List listQuestionContentDTO, String questionIndex, String direction) { - AuthoringUtil.logger.debug("swapNodes:"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); - AuthoringUtil.logger.debug("questionIndex:" + questionIndex); - AuthoringUtil.logger.debug("direction:" + direction); int intQuestionIndex = new Integer(questionIndex).intValue(); int intOriginalQuestionIndex = intQuestionIndex; - AuthoringUtil.logger.debug("intQuestionIndex:" + intQuestionIndex); int replacedNodeIndex = 0; if (direction.equals("down")) { - AuthoringUtil.logger.debug("direction down:"); replacedNodeIndex = ++intQuestionIndex; } else { - AuthoringUtil.logger.debug("direction up:"); replacedNodeIndex = --intQuestionIndex; } - AuthoringUtil.logger.debug("replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("replacing nodes:" + intOriginalQuestionIndex + " and " + replacedNodeIndex); McQuestionContentDTO mainNode = AuthoringUtil.extractNodeAtDisplayOrder(listQuestionContentDTO, intOriginalQuestionIndex); - AuthoringUtil.logger.debug("mainNode:" + mainNode); McQuestionContentDTO replacedNode = AuthoringUtil.extractNodeAtDisplayOrder(listQuestionContentDTO, replacedNodeIndex); - AuthoringUtil.logger.debug("replacedNode:" + replacedNode); if ((mainNode == null) || (replacedNode == null)) { - AuthoringUtil.logger.debug("mainNode/replacedNode is null"); return listQuestionContentDTO; } @@ -444,7 +363,6 @@ listFinalQuestionContentDTO = AuthoringUtil.reorderSwappedListQuestionContentDTO(listQuestionContentDTO, intOriginalQuestionIndex, replacedNodeIndex, mainNode, replacedNode); - AuthoringUtil.logger.debug("listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } @@ -462,26 +380,19 @@ protected static List reorderSwappedListQuestionContentDTO(List listQuestionContentDTO, int intOriginalQuestionIndex, int replacedNodeIndex, McQuestionContentDTO mainNode, McQuestionContentDTO replacedNode) { - AuthoringUtil.logger.debug("reorderSwappedListQuestionContentDTO: intOriginalQuestionIndex:" - + intOriginalQuestionIndex); - AuthoringUtil.logger.debug("reorderSwappedListQuestionContentDTO: replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("mainNode: " + mainNode); - AuthoringUtil.logger.debug("replacedNode: " + replacedNode); List listFinalQuestionContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion()); queIndex++; McQuestionContentDTO tempNode = new McQuestionContentDTO(); if ((!mcQuestionContentDTO.getDisplayOrder().equals(new Integer(intOriginalQuestionIndex).toString())) && !mcQuestionContentDTO.getDisplayOrder().equals(new Integer(replacedNodeIndex).toString())) { - AuthoringUtil.logger.debug("normal copy "); + //normal cop tempNode.setQuestion(mcQuestionContentDTO.getQuestion()); tempNode.setDisplayOrder(mcQuestionContentDTO.getDisplayOrder()); tempNode.setFeedback(mcQuestionContentDTO.getFeedback()); @@ -490,15 +401,15 @@ tempNode.setMark(mcQuestionContentDTO.getMark()); } else if (mcQuestionContentDTO.getDisplayOrder().equals(new Integer(intOriginalQuestionIndex).toString())) { - AuthoringUtil.logger.debug("move type 1 "); + //move type 1 tempNode.setQuestion(replacedNode.getQuestion()); tempNode.setDisplayOrder(replacedNode.getDisplayOrder()); tempNode.setFeedback(replacedNode.getFeedback()); tempNode.setListCandidateAnswersDTO(replacedNode.getListCandidateAnswersDTO()); tempNode.setCaCount(replacedNode.getCaCount()); tempNode.setMark(replacedNode.getMark()); } else if (mcQuestionContentDTO.getDisplayOrder().equals(new Integer(replacedNodeIndex).toString())) { - AuthoringUtil.logger.debug("move type 2 "); + //move type 2 tempNode.setQuestion(mainNode.getQuestion()); tempNode.setDisplayOrder(mainNode.getDisplayOrder()); tempNode.setFeedback(mainNode.getFeedback()); @@ -510,7 +421,6 @@ listFinalQuestionContentDTO.add(tempNode); } - AuthoringUtil.logger.debug("final listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } @@ -526,36 +436,24 @@ * @return */ protected static List swapCandidateNodes(List listCandidates, String candidateIndex, String direction) { - AuthoringUtil.logger.debug("swapCandidateNodes:"); - AuthoringUtil.logger.debug("listCandidates:" + listCandidates); - AuthoringUtil.logger.debug("candidateIndex:" + candidateIndex); - AuthoringUtil.logger.debug("direction:" + direction); int intCandidateIndex = new Integer(candidateIndex).intValue(); int intOriginalCandidateIndex = intCandidateIndex; - AuthoringUtil.logger.debug("intCandidateIndex:" + intCandidateIndex); int replacedNodeIndex = 0; if (direction.equals("down")) { - AuthoringUtil.logger.debug("direction down:"); replacedNodeIndex = ++intCandidateIndex; } else { - AuthoringUtil.logger.debug("direction up:"); replacedNodeIndex = --intCandidateIndex; } - AuthoringUtil.logger.debug("replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("replacing nodes:" + intOriginalCandidateIndex + " and " + replacedNodeIndex); McCandidateAnswersDTO mainNode = AuthoringUtil.extractCandidateAtOrder(listCandidates, intOriginalCandidateIndex); - AuthoringUtil.logger.debug("mainNode:" + mainNode); McCandidateAnswersDTO replacedNode = AuthoringUtil.extractCandidateAtOrder(listCandidates, replacedNodeIndex); - AuthoringUtil.logger.debug("replacedNode:" + replacedNode); if ((mainNode == null) || (replacedNode == null)) { - AuthoringUtil.logger.debug("mainNode/replacedNode is null"); return listCandidates; } @@ -564,7 +462,6 @@ listFinalCandidateDTO = AuthoringUtil.reorderSwappedListCandidateDTO(listCandidates, intOriginalCandidateIndex, replacedNodeIndex, mainNode, replacedNode); - AuthoringUtil.logger.debug("listFinalCandidateDTO:" + listFinalCandidateDTO); return listFinalCandidateDTO; } @@ -582,44 +479,35 @@ */ protected static List reorderSwappedListCandidateDTO(List listCandidates, int intOriginalCandidateIndex, int replacedNodeIndex, McCandidateAnswersDTO mainNode, McCandidateAnswersDTO replacedNode) { - AuthoringUtil.logger.debug("reorderSwappedListCandidateDTO: intOriginalQuestionIndex:" - + intOriginalCandidateIndex); - AuthoringUtil.logger.debug("reorderSwappedListCandidateDTO: replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("mainNode: " + mainNode); - AuthoringUtil.logger.debug("replacedNode: " + replacedNode); List listFinalCandidatesDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listCandidates.iterator(); while (listIterator.hasNext()) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO candidateAnswer:" - + mcCandidateAnswersDTO.getCandidateAnswer()); queIndex++; McCandidateAnswersDTO tempNode = new McCandidateAnswersDTO(); if ((!new Integer(queIndex).toString().equals(new Integer(intOriginalCandidateIndex).toString())) && !new Integer(queIndex).toString().equals(new Integer(replacedNodeIndex).toString())) { - AuthoringUtil.logger.debug("normal copy "); + //normal copy tempNode.setCandidateAnswer(mcCandidateAnswersDTO.getCandidateAnswer()); tempNode.setCorrect(mcCandidateAnswersDTO.getCorrect()); } else if (new Integer(queIndex).toString().equals(new Integer(intOriginalCandidateIndex).toString())) { - AuthoringUtil.logger.debug("move type 1 "); + //move type 1 tempNode.setCandidateAnswer(replacedNode.getCandidateAnswer()); tempNode.setCorrect(replacedNode.getCorrect()); } else if (new Integer(queIndex).toString().equals(new Integer(replacedNodeIndex).toString())) { - AuthoringUtil.logger.debug("move type 2 "); + //move type 2 tempNode.setCandidateAnswer(mainNode.getCandidateAnswer()); tempNode.setCorrect(mainNode.getCorrect()); } listFinalCandidatesDTO.add(tempNode); } - AuthoringUtil.logger.debug("final listFinalCandidatesDTO:" + listFinalCandidatesDTO); return listFinalCandidatesDTO; } @@ -634,20 +522,12 @@ */ protected static McQuestionContentDTO extractNodeAtDisplayOrder(List listQuestionContentDTO, int intOriginalQuestionIndex) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); - AuthoringUtil.logger.debug("intOriginalQuestionIndex:" + intOriginalQuestionIndex); Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion()); - AuthoringUtil.logger.debug("intOriginalQuestionIndex versus displayOrder:" - + new Integer(intOriginalQuestionIndex).toString() + " versus " - + mcQuestionContentDTO.getDisplayOrder()); if (new Integer(intOriginalQuestionIndex).toString().equals(mcQuestionContentDTO.getDisplayOrder())) { - AuthoringUtil.logger.debug("node found:" + mcQuestionContentDTO); return mcQuestionContentDTO; } } @@ -662,50 +542,38 @@ * @return */ protected static McCandidateAnswersDTO extractCandidateAtOrder(List listCandidates, int intOriginalCandidateIndex) { - AuthoringUtil.logger.debug("listCandidates:" + listCandidates); - AuthoringUtil.logger.debug("intOriginalCandidateIndex:" + intOriginalCandidateIndex); int counter = 0; Iterator listIterator = listCandidates.iterator(); while (listIterator.hasNext()) { ++counter; McCandidateAnswersDTO mcCandidateAnswerDTO = (McCandidateAnswersDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcCandidateAnswerDTO:" + mcCandidateAnswerDTO); - AuthoringUtil.logger.debug("counter:" + counter); - if (new Integer(intOriginalCandidateIndex).toString().equals(new Integer(counter).toString())) { - AuthoringUtil.logger.debug("node found:" + mcCandidateAnswerDTO); return mcCandidateAnswerDTO; } } return null; } protected static String getTotalMark(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("starting getTotalMark:" + listQuestionContentDTO); Map mapMarks = AuthoringUtil.extractMapMarks(listQuestionContentDTO); int intTotalMark = 0; Iterator itMap = mapMarks.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); String mark = (String) pairs.getValue(); - AuthoringUtil.logger.debug("mark: " + mark); if (mark != null) { int intMark = new Integer(mark).intValue(); intTotalMark += intMark; - AuthoringUtil.logger.debug("current intTotalMark: " + intTotalMark); } } - AuthoringUtil.logger.debug("final intTotalMark: " + intTotalMark); String strFinalTotalMark = new Integer(intTotalMark).toString(); - AuthoringUtil.logger.debug("final strFinalTotalMark: " + strFinalTotalMark); return strFinalTotalMark; } @@ -716,21 +584,16 @@ * @return */ protected static Map extractMapQuestionContent(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapQuestionContent = new TreeMap(new McComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapQuestionContent.put(new Integer(queIndex).toString(), mcQuestionContentDTO.getQuestion()); } - AuthoringUtil.logger.debug("mapQuestionContent:" + mapQuestionContent); return mapQuestionContent; } @@ -741,23 +604,17 @@ * @return */ protected static List reorderListCandidatesDTO(List candidates) { - AuthoringUtil.logger.debug("reorderListCandidatesDTO"); - AuthoringUtil.logger.debug("reorderListCandidatesDTO:" + candidates); List listFinalCandidatesDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = candidates.iterator(); while (listIterator.hasNext()) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO answer:" + mcCandidateAnswersDTO.getCandidateAnswer()); String answer = mcCandidateAnswersDTO.getCandidateAnswer(); - AuthoringUtil.logger.debug("answer:" + answer); String correct = mcCandidateAnswersDTO.getCorrect(); - AuthoringUtil.logger.debug("correct:" + correct); if ((answer != null) && (!answer.equals(""))) { mcCandidateAnswersDTO.setCandidateAnswer(answer); @@ -768,7 +625,6 @@ } } - AuthoringUtil.logger.debug("final listFinalCandidatesDTO:" + listFinalCandidatesDTO); return listFinalCandidatesDTO; } @@ -780,49 +636,33 @@ * @return */ protected static List reorderListQuestionContentDTO(List listQuestionContentDTO, String excludeQuestionIndex) { - AuthoringUtil.logger.debug("reorderListQuestionContentDTO"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); - AuthoringUtil.logger.debug("excludeQuestionIndex:" + excludeQuestionIndex); List listFinalQuestionContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion()); String question = mcQuestionContentDTO.getQuestion(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = mcQuestionContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = mcQuestionContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); String caCount = mcQuestionContentDTO.getCaCount(); - AuthoringUtil.logger.debug("caCount:" + caCount); List caList = mcQuestionContentDTO.getListCandidateAnswersDTO(); - AuthoringUtil.logger.debug("caList:" + caList); - AuthoringUtil.logger.debug("displayOrder versus excludeQuestionIndex :" + displayOrder + " versus " - + excludeQuestionIndex); - if ((question != null) && (!question.equals(""))) { if (!displayOrder.equals(excludeQuestionIndex)) { ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); mcQuestionContentDTO.setQuestion(question); mcQuestionContentDTO.setDisplayOrder(new Integer(queIndex).toString()); mcQuestionContentDTO.setFeedback(feedback); mcQuestionContentDTO.setListCandidateAnswersDTO(caList); - AuthoringUtil.logger.debug("caList size:" - + mcQuestionContentDTO.getListCandidateAnswersDTO().size()); mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO() .size()).toString()); @@ -831,7 +671,6 @@ } } - AuthoringUtil.logger.debug("final listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } @@ -842,38 +681,27 @@ * @return */ protected static List reorderSimpleListQuestionContentDTO(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("reorderListQuestionContentDTO"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); List listFinalQuestionContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion()); String question = mcQuestionContentDTO.getQuestion(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = mcQuestionContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = mcQuestionContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); List caList = mcQuestionContentDTO.getListCandidateAnswersDTO(); - AuthoringUtil.logger.debug("caList:" + caList); String caCount = mcQuestionContentDTO.getCaCount(); - AuthoringUtil.logger.debug("caCount:" + caCount); String mark = mcQuestionContentDTO.getMark(); - AuthoringUtil.logger.debug("mark:" + mark); if ((question != null) && (!question.equals(""))) { ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); mcQuestionContentDTO.setQuestion(question); mcQuestionContentDTO.setDisplayOrder(new Integer(queIndex).toString()); @@ -885,7 +713,6 @@ } } - AuthoringUtil.logger.debug("final listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } @@ -900,42 +727,28 @@ */ protected static List reorderUpdateListQuestionContentDTO(List listQuestionContentDTO, McQuestionContentDTO mcQuestionContentDTONew, String editableQuestionIndex) { - AuthoringUtil.logger.debug("reorderUpdateListQuestionContentDTO"); - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTONew:" + mcQuestionContentDTONew); - AuthoringUtil.logger.debug("editableQuestionIndex:" + editableQuestionIndex); List listFinalQuestionContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listQuestionContentDTO.iterator(); while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion()); ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); String question = mcQuestionContentDTO.getQuestion(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = mcQuestionContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = mcQuestionContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); String mark = mcQuestionContentDTO.getMark(); - AuthoringUtil.logger.debug("mark:" + mark); List caList = mcQuestionContentDTO.getListCandidateAnswersDTO(); - AuthoringUtil.logger.debug("caList:" + caList); String caCount = mcQuestionContentDTO.getCaCount(); - AuthoringUtil.logger.debug("caCount:" + caCount); if (displayOrder.equals(editableQuestionIndex)) { - AuthoringUtil.logger.debug("displayOrder equals editableQuestionIndex:" + editableQuestionIndex); mcQuestionContentDTO.setQuestion(mcQuestionContentDTONew.getQuestion()); mcQuestionContentDTO.setDisplayOrder(mcQuestionContentDTONew.getDisplayOrder()); mcQuestionContentDTO.setFeedback(mcQuestionContentDTONew.getFeedback()); @@ -945,8 +758,6 @@ listFinalQuestionContentDTO.add(mcQuestionContentDTO); } else { - AuthoringUtil.logger - .debug("displayOrder does not equal editableQuestionIndex:" + editableQuestionIndex); mcQuestionContentDTO.setQuestion(question); mcQuestionContentDTO.setDisplayOrder(displayOrder); mcQuestionContentDTO.setFeedback(feedback); @@ -959,7 +770,6 @@ } - AuthoringUtil.logger.debug("listFinalQuestionContentDTO:" + listFinalQuestionContentDTO); return listFinalQuestionContentDTO; } @@ -976,31 +786,21 @@ */ public void reOrganizeDisplayOrder(Map mapQuestionContent, IMcService mcService, McAuthoringForm mcAuthoringForm, McContent mcContent) { - AuthoringUtil.logger.debug("mcContent: " + mcContent); if (mcContent != null) { - AuthoringUtil.logger.debug("content uid: " + mcContent.getUid()); List sortedQuestions = mcService.getAllQuestionEntriesSorted(mcContent.getUid().longValue()); - AuthoringUtil.logger.debug("sortedQuestions: " + sortedQuestions); Iterator listIterator = sortedQuestions.iterator(); int displayOrder = 1; while (listIterator.hasNext()) { McQueContent queContent = (McQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); - AuthoringUtil.logger.debug("queContent: " + queContent.getQuestion() + " " - + queContent.getDisplayOrder()); McQueContent existingMcQueContent = mcService.getQuestionContentByQuestionText( queContent.getQuestion(), mcContent.getUid()); - AuthoringUtil.logger.debug("existingMcQueContent: " + existingMcQueContent); existingMcQueContent.setDisplayOrder(new Integer(displayOrder)); - AuthoringUtil.logger.debug("updating the existing question content for displayOrder: " - + existingMcQueContent); mcService.updateMcQueContent(existingMcQueContent); displayOrder++; } } - AuthoringUtil.logger.debug("done with reOrganizeDisplayOrder..."); } /** @@ -1013,20 +813,15 @@ * @return */ public static boolean checkDuplicateQuestions(List listQuestionContentDTO, String newQuestion) { - AuthoringUtil.logger.debug("checkDuplicateQuestions: " + listQuestionContentDTO); - AuthoringUtil.logger.debug("newQuestion: " + newQuestion); Map mapQuestionContent = AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); Iterator itMap = mapQuestionContent.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); if ((pairs.getValue() != null) && (!pairs.getValue().equals(""))) { - AuthoringUtil.logger.debug("checking the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().equals(newQuestion)) { - AuthoringUtil.logger.debug("entry found: " + newQuestion); return true; } } @@ -1044,49 +839,31 @@ */ public void removeRedundantQuestions(Map mapQuestionContent, IMcService mcService, McAuthoringForm mcAuthoringForm, HttpServletRequest request, String toolContentID) { - AuthoringUtil.logger.debug("removing unused entries... "); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); - AuthoringUtil.logger.debug("toolContentID: " + toolContentID); McContent mcContent = mcService.retrieveMc(new Long(toolContentID)); - AuthoringUtil.logger.debug("mcContent: " + mcContent); if (mcContent != null) { - AuthoringUtil.logger.debug("mcContent uid: " + mcContent.getUid()); List allQuestions = mcService.getAllQuestionEntries(mcContent.getUid()); - AuthoringUtil.logger.debug("allQuestions: " + allQuestions); Iterator listIterator = allQuestions.iterator(); int mapIndex = 0; boolean entryUsed = false; while (listIterator.hasNext()) { ++mapIndex; - AuthoringUtil.logger.debug("current mapIndex: " + mapIndex); McQueContent queContent = (McQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); - AuthoringUtil.logger.debug("queContent: " + queContent.getQuestion() + " " - + queContent.getDisplayOrder()); entryUsed = false; Iterator itMap = mapQuestionContent.entrySet().iterator(); int displayOrder = 0; while (itMap.hasNext()) { ++displayOrder; - AuthoringUtil.logger.debug("current displayOrder: " + displayOrder); entryUsed = false; Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("text from map:" + pairs.getValue().toString()); - AuthoringUtil.logger.debug("text from db:" + queContent.getQuestion()); - AuthoringUtil.logger.debug("mapIndex versus displayOrder:" + mapIndex + " versus " - + displayOrder); if (mapIndex == displayOrder) { - // logger.debug("used entry in db:" + queContent.getQuestion()); - AuthoringUtil.logger.debug("used displayOrder position:" + displayOrder); entryUsed = true; break; } @@ -1095,16 +872,13 @@ } if (entryUsed == false) { - AuthoringUtil.logger.debug("removing unused entry in db:" + queContent.getQuestion()); + //removing unused entry in db McQueContent removeableMcQueContent = mcService.getQuestionContentByQuestionText( queContent.getQuestion(), mcContent.getUid()); - AuthoringUtil.logger.debug("removeableMcQueContent" + removeableMcQueContent); if (removeableMcQueContent != null) { // mcContent.getMcQueContents().remove(removeableMcQueContent); mcService.removeMcQueContent(removeableMcQueContent); - AuthoringUtil.logger.debug("removed removeableMcQueContent from the db: " - + removeableMcQueContent); } } @@ -1120,21 +894,16 @@ * @return */ protected static Map extractMapFeedback(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapFeedbackContent = new TreeMap(new McComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO feedback:" + mcQuestionContentDTO.getFeedback()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapFeedbackContent.put(new Integer(queIndex).toString(), mcQuestionContentDTO.getFeedback()); } - AuthoringUtil.logger.debug("mapFeedbackContent:" + mapFeedbackContent); return mapFeedbackContent; } @@ -1145,21 +914,16 @@ * @return */ protected static Map extractMapWeights(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapWeights = new TreeMap(new McComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO weight:" + mcQuestionContentDTO.getWeight()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapWeights.put(new Integer(queIndex).toString(), mcQuestionContentDTO.getWeight()); } - AuthoringUtil.logger.debug("mapWeights:" + mapWeights); return mapWeights; } @@ -1170,21 +934,16 @@ * @return */ protected static Map extractMapMarks(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapMarks = new TreeMap(new McComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO weight:" + mcQuestionContentDTO.getMark()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapMarks.put(new Integer(queIndex).toString(), mcQuestionContentDTO.getMark()); } - AuthoringUtil.logger.debug("mapMarks:" + mapMarks); return mapMarks; } @@ -1195,22 +954,16 @@ * @return */ protected static Map extractMapCandidatesList(List listQuestionContentDTO) { - AuthoringUtil.logger.debug("listQuestionContentDTO:" + listQuestionContentDTO); Map mapCandidatesList = new TreeMap(new McComparator()); Iterator listIterator = listQuestionContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO); - AuthoringUtil.logger.debug("mcQuestionContentDTO candidates list:" - + mcQuestionContentDTO.getListCandidateAnswersDTO()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapCandidatesList.put(new Integer(queIndex).toString(), mcQuestionContentDTO.getListCandidateAnswersDTO()); } - AuthoringUtil.logger.debug("mapCandidatesList:" + mapCandidatesList); return mapCandidatesList; } @@ -1236,51 +989,37 @@ public McContent saveOrUpdateMcContent(Map mapQuestionContent, Map mapFeedback, Map mapWeights, Map mapMarks, Map mapCandidatesList, IMcService mcService, McAuthoringForm mcAuthoringForm, HttpServletRequest request, McContent mcContent, String strToolContentID) { - AuthoringUtil.logger.debug("doing saveOrUpdateMcContent, mapCandidatesList: " + mapCandidatesList); UserDTO toolUser = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); String richTextTitle = request.getParameter(McAppConstants.TITLE); String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS); - AuthoringUtil.logger.debug("richTextTitle: " + richTextTitle); - AuthoringUtil.logger.debug("richTextInstructions: " + richTextInstructions); - String sln = request.getParameter("sln"); - AuthoringUtil.logger.debug("sln: " + sln); String questionsSequenced = request.getParameter("questionsSequenced"); - AuthoringUtil.logger.debug("questionsSequenced: " + questionsSequenced); String randomize = request.getParameter("randomize"); - AuthoringUtil.logger.debug("randomize: " + randomize); String displayAnswers = request.getParameter("displayAnswers"); - AuthoringUtil.logger.debug("displayAnswers: " + displayAnswers); String showMarks = request.getParameter("showMarks"); - AuthoringUtil.logger.debug("showMarks: " + showMarks); String retries = request.getParameter("retries"); - AuthoringUtil.logger.debug("retries: " + retries); String reflect = request.getParameter(McAppConstants.REFLECT); - AuthoringUtil.logger.debug("reflect: " + reflect); String richTextOfflineInstructions = request.getParameter(McAppConstants.OFFLINE_INSTRUCTIONS); String richTextOnlineInstructions = request.getParameter(McAppConstants.ONLINE_INSTRUCTIONS); String reflectionSubject = request.getParameter(McAppConstants.REFLECTION_SUBJECT); - AuthoringUtil.logger.debug("reflectionSubject: " + reflectionSubject); String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE); - AuthoringUtil.logger.debug("activeModule: " + activeModule); boolean setCommonContent = true; if ((sln == null) || (questionsSequenced == null) || (retries == null) || (reflect == null) || (showMarks == null) || (randomize == null)) { setCommonContent = false; } - AuthoringUtil.logger.debug("setCommonContent: " + setCommonContent); boolean questionsSequencedBoolean = false; boolean randomizeBoolean = false; @@ -1318,48 +1057,35 @@ reflectBoolean = true; } - AuthoringUtil.logger.debug("questionsSequencedBoolean: " + questionsSequencedBoolean); - AuthoringUtil.logger.debug("slnBoolean: " + slnBoolean); - AuthoringUtil.logger.debug("retriesBoolean: " + retriesBoolean); - AuthoringUtil.logger.debug("reflectBoolean: " + reflectBoolean); - long userId = 0; if (toolUser != null) { userId = toolUser.getUserID().longValue(); } else { HttpSession ss = SessionManager.getSession(); - AuthoringUtil.logger.debug("ss: " + ss); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - AuthoringUtil.logger.debug("user" + user); if (user != null) { userId = user.getUserID().longValue(); } else { - AuthoringUtil.logger.debug("should not reach here"); + //should not reach here userId = 0; } } - AuthoringUtil.logger.debug("userId: " + userId); - AuthoringUtil.logger.debug("mcContent: " + mcContent); boolean newContent = false; if (mcContent == null) { mcContent = new McContent(); newContent = true; } - AuthoringUtil.logger.debug("setting common content values..." + richTextTitle + " " + richTextInstructions); mcContent.setMcContentId(new Long(strToolContentID)); mcContent.setTitle(richTextTitle); mcContent.setInstructions(richTextInstructions); mcContent.setUpdateDate(new Date(System.currentTimeMillis())); /** keep updating this one */ - AuthoringUtil.logger.debug("userId: " + userId); mcContent.setCreatedBy(userId); /** make sure we are setting the userId from the User object above */ - AuthoringUtil.logger.debug("end of setting common content values..."); String passmark = request.getParameter("passmark"); - AuthoringUtil.logger.debug("passmark: " + passmark); if (passmark == null) { passmark = "0"; @@ -1373,7 +1099,7 @@ AuthoringUtil.logger.debug("activeModule:" + activeModule); if (activeModule.equals(McAppConstants.AUTHORING)) { - AuthoringUtil.logger.debug("setting other content values..."); + //setting other content values mcContent.setOnlineInstructions(richTextOnlineInstructions); mcContent.setOfflineInstructions(richTextOfflineInstructions); mcContent.setQuestionsSequenced(questionsSequencedBoolean); @@ -1385,20 +1111,16 @@ mcContent.setReflect(reflectBoolean); mcContent.setReflectionSubject(reflectionSubject); - AuthoringUtil.logger.debug("setting passmark..."); mcContent.setPassMark(new Integer(passmark)); } if (newContent) { - AuthoringUtil.logger.debug("will create: " + mcContent); mcService.createMc(mcContent); } else { - AuthoringUtil.logger.debug("will update: " + mcContent); mcService.updateMc(mcContent); } mcContent = mcService.retrieveMc(new Long(strToolContentID)); - AuthoringUtil.logger.debug("mcContent: " + mcContent); mcContent = createQuestionContent(mapQuestionContent, mapFeedback, mapWeights, mapMarks, mapCandidatesList, mcService, mcContent); @@ -1424,89 +1146,61 @@ */ protected McContent createQuestionContent(Map mapQuestionContent, Map mapFeedback, Map mapWeights, Map mapMarks, Map mapCandidatesList, IMcService mcService, McContent mcContent) { - AuthoringUtil.logger.debug("createQuestionContent, mapCandidatesList: " + mapCandidatesList); - AuthoringUtil.logger.debug("content uid is: " + mcContent.getUid()); List questions = mcService.retrieveMcQueContentsByToolContentId(mcContent.getUid().longValue()); - AuthoringUtil.logger.debug("questions: " + questions); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); - AuthoringUtil.logger.debug("mapFeedback: " + mapFeedback); - AuthoringUtil.logger.debug("mapMarks: " + mapMarks); - Iterator itMap = mapQuestionContent.entrySet().iterator(); int displayOrder = 0; while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("starting createQuestionContent: pairs.getValue().toString():" - + pairs.getValue().toString()); - AuthoringUtil.logger.debug("starting createQuestionContent: mcContent: " + mcContent); ++displayOrder; - AuthoringUtil.logger.debug("starting createQuestionContent: displayOrder: " + displayOrder); String currentFeedback = (String) mapFeedback.get(new Integer(displayOrder).toString()); - AuthoringUtil.logger.debug("currentFeedback: " + currentFeedback); String currentMark = (String) mapMarks.get(new Integer(displayOrder).toString()); - AuthoringUtil.logger.debug("currentMark: " + currentMark); /*set the default mark in case it is not provided*/ if (currentMark == null) { currentMark = "1"; } List caList = (List) mapCandidatesList.get(new Integer(displayOrder).toString()); - AuthoringUtil.logger.debug("caList: " + caList); McQueContent queContent = new McQueContent(pairs.getValue().toString(), new Integer(displayOrder), new Integer(currentMark), currentFeedback, mcContent, null, null); - AuthoringUtil.logger.debug("queContent: " + queContent); /* checks if the question is already recorded*/ - AuthoringUtil.logger.debug("question text is: " + pairs.getValue().toString()); - AuthoringUtil.logger.debug("content uid is: " + mcContent.getUid()); - AuthoringUtil.logger.debug("question display order is: " + displayOrder); McQueContent existingMcQueContent = mcService.getQuestionContentByDisplayOrder(new Long(displayOrder), mcContent.getUid()); - AuthoringUtil.logger.debug("existingMcQueContent: " + existingMcQueContent); if (existingMcQueContent == null) { /*make sure a question with the same question text is not already saved*/ McQueContent duplicateMcQueContent = mcService.getQuestionContentByQuestionText(pairs.getValue() .toString(), mcContent.getUid()); - AuthoringUtil.logger.debug("duplicateMcQueContent: " + duplicateMcQueContent); - AuthoringUtil.logger.debug("adding a new question to content: " + queContent); + //adding a new question to content mcContent.getMcQueContents().add(queContent); queContent.setMcContent(mcContent); mcService.createMcQue(queContent); - AuthoringUtil.logger.debug("start persisting candidate answers: " + queContent); + //start persisting candidate answers persistCandidates(caList, queContent, mcService); } else { String existingQuestion = existingMcQueContent.getQuestion(); - AuthoringUtil.logger.debug("existingQuestion: " + existingQuestion); - AuthoringUtil.logger.debug("map question versus existingQuestion: " + pairs.getValue().toString() - + " versus db question value: " + existingQuestion); - existingMcQueContent.setQuestion(pairs.getValue().toString()); existingMcQueContent.setFeedback(currentFeedback); existingMcQueContent.setDisplayOrder(new Integer(displayOrder)); existingMcQueContent.setMark(new Integer(currentMark)); - AuthoringUtil.logger.debug("updating the existing question content: " + existingMcQueContent); + //updating the existing question content mcService.updateMcQueContent(existingMcQueContent); - AuthoringUtil.logger.debug("questionUid " + existingMcQueContent.getUid()); - - AuthoringUtil.logger.debug("will be removing redundant candidates, questionUid: " - + existingMcQueContent.getUid()); + //will be removing redundant candidates mcService.removeMcOptionsContentByQueId(existingMcQueContent.getUid()); - AuthoringUtil.logger.debug("start persisting candidates " + existingMcQueContent.getUid()); + //start persisting candidates persistCandidates(caList, existingMcQueContent, mcService); } @@ -1516,29 +1210,22 @@ } protected Map buildDynamicPassMarkMap(List listQuestionContentDTO, boolean initialScreen) { - AuthoringUtil.logger.debug("starting buildDynamicPassMarkMap: " + listQuestionContentDTO); - AuthoringUtil.logger.debug("initialScreen: " + initialScreen); Map map = new TreeMap(new McComparator()); String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO); - AuthoringUtil.logger.debug("totalMark: " + totalMark); int intTotalMark = 0; if ((totalMark != null) && (totalMark.length() > 0)) { intTotalMark = new Integer(totalMark).intValue(); } - AuthoringUtil.logger.debug("intTotalMark: " + intTotalMark); Map passMarksMap = buildPassMarkMap(intTotalMark, false); - AuthoringUtil.logger.debug("passMarksMap: " + passMarksMap); return passMarksMap; } protected Map buildPassMarkMap(int intTotalMark, boolean initialScreen) { - AuthoringUtil.logger.debug("building buildMarksMap: " + intTotalMark); - AuthoringUtil.logger.debug("initialScreen: " + initialScreen); Map map = new TreeMap(new McComparator()); @@ -1549,7 +1236,6 @@ for (int i = 1; i <= intTotalMark; i++) { map.put(new Integer(i).toString(), new Integer(i).toString()); } - AuthoringUtil.logger.debug("return passmarks Map: " + map); return map; } @@ -1564,7 +1250,6 @@ for (int i = 1; i <= 10; i++) { map.put(new Integer(i).toString(), new Integer(i).toString()); } - AuthoringUtil.logger.debug("return marks Map: " + map); return map; } @@ -1576,7 +1261,6 @@ protected Map buildCorrectMap() { Map map = new TreeMap(new McComparator()); map.put(new Integer(2).toString(), "Correct"); - AuthoringUtil.logger.debug("return marks Map: " + map); return map; } @@ -1588,34 +1272,26 @@ * @return */ protected List repopulateCandidateAnswersBox(HttpServletRequest request, boolean addBlankCa) { - AuthoringUtil.logger.debug("doing repopulateCandidateAnswersBox, addBlankCa: " + addBlankCa); String correct = request.getParameter("correct"); - AuthoringUtil.logger.debug("correct: " + correct); /* check this logic again*/ int intCorrect = 0; - if (correct == null) { - AuthoringUtil.logger.debug("correct is null: "); - } else { + if (correct != null) { intCorrect = new Integer(correct).intValue(); } - AuthoringUtil.logger.debug("intCorrect: " + intCorrect); List listFinalCandidatesDTO = new LinkedList(); for (int i = 0; i < McAppConstants.MAX_OPTION_COUNT; i++) { String candidate = request.getParameter("ca" + i); - AuthoringUtil.logger.debug("candidate: " + candidate); String isCorrect = "Incorrect"; - AuthoringUtil.logger.debug("i versus intCorrect: " + i + " versus " + intCorrect); if (i == intCorrect) { isCorrect = "Correct"; } - AuthoringUtil.logger.debug("isCorrect: " + isCorrect); if (candidate != null) { McCandidateAnswersDTO mcCandidateAnswersDTO = new McCandidateAnswersDTO(); @@ -1632,36 +1308,22 @@ listFinalCandidatesDTO.add(mcCandidateAnswersDTO); } - AuthoringUtil.logger.debug("returning listFinalCandidatesDTO: " + listFinalCandidatesDTO); return listFinalCandidatesDTO; } protected boolean validateCandidateAnswersNotBlank(HttpServletRequest request) { for (int i = 0; i < McAppConstants.MAX_OPTION_COUNT; i++) { String candidate = request.getParameter("ca" + i); - AuthoringUtil.logger.debug("candidate: " + candidate); if ((candidate != null) && (candidate.length() == 0)) { - AuthoringUtil.logger.debug("there is at least 1 blank candidate"); + //there is at least 1 blank candidate return false; } } return true; } - protected List repopulateCandidateAnswersRadioBox(HttpServletRequest request, boolean addBlankCa) { - AuthoringUtil.logger.debug("doing repopulateCandidateAnswersRadioBox, addBlankCa: " + addBlankCa); - - String correct = request.getParameter("correct"); - AuthoringUtil.logger.debug("correct: " + correct); - - List listFinalCandidatesDTO = new LinkedList(); - - AuthoringUtil.logger.debug("returning listFinalCandidatesDTO: " + listFinalCandidatesDTO); - return listFinalCandidatesDTO; - } - /** * boolean validateSingleCorrectCandidate(List caList) * @@ -1674,14 +1336,12 @@ Iterator itCaList = caList.iterator(); while (itCaList.hasNext()) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) itCaList.next(); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO); String candidateAnswer = mcCandidateAnswersDTO.getCandidateAnswer(); String correct = mcCandidateAnswersDTO.getCorrect(); - AuthoringUtil.logger.debug("correct:" + correct); if (correct.equals("Correct")) { - AuthoringUtil.logger.debug("there is at least one Correct candidate, it is good."); + //there is at least one Correct candidate, it is good. return true; } } @@ -1695,18 +1355,15 @@ Iterator itCaList = caList.iterator(); while (itCaList.hasNext()) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) itCaList.next(); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO); String candidateAnswer = mcCandidateAnswersDTO.getCandidateAnswer(); String correct = mcCandidateAnswersDTO.getCorrect(); - AuthoringUtil.logger.debug("correct:" + correct); if (correct.equals("Correct")) { - AuthoringUtil.logger.debug("there is at leat one Correct candidate, it is good."); + //there is at leat one Correct candidate, it is good. ++correctCandidatesCount; } } - AuthoringUtil.logger.debug("correctCandidatesCount: " + correctCandidatesCount); if (correctCandidatesCount > 1) { return false; // not good @@ -1725,13 +1382,11 @@ * @return */ protected List buildDefaultQuestionContent(McContent mcContent, IMcService mcService) { - AuthoringUtil.logger.debug("starting buildDefaultQuestionContent, mcContent: " + mcContent); List listQuestionContentDTO = new LinkedList(); /* * get the existing question content */ - AuthoringUtil.logger.debug("setting content data from the db"); Iterator queIterator = mcContent.getMcQueContents().iterator(); Long mapIndex = new Long(1); @@ -1740,20 +1395,14 @@ McQueContent mcQueContent = (McQueContent) queIterator.next(); if (mcQueContent != null) { - AuthoringUtil.logger.debug("question: " + mcQueContent.getQuestion()); - AuthoringUtil.logger.debug("displayorder: " + mcQueContent.getDisplayOrder().toString()); - AuthoringUtil.logger.debug("mark: " + mcQueContent.getMark().toString()); - AuthoringUtil.logger.debug("feedback: " + mcQueContent.getFeedback()); String feedback = ""; if (mcQueContent.getFeedback() != null) { feedback = mcQueContent.getFeedback(); } - AuthoringUtil.logger.debug("feedback now: " + mcQueContent.getFeedback()); String question = mcQueContent.getQuestion(); - AuthoringUtil.logger.debug("question: " + question); mcQuestionContentDTO.setQuestion(question); mcQuestionContentDTO.setDisplayOrder(mcQueContent.getDisplayOrder().toString()); @@ -1762,10 +1411,8 @@ /* get candidates, from here.. */ List list = mcService.findMcOptionsContentByQueId(mcQueContent.getUid()); - AuthoringUtil.logger.debug("candidiate answers list for mapQuestionContent:" + list); int caCount = list.size(); - AuthoringUtil.logger.debug("caCount:" + caCount); mcQuestionContentDTO.setCaCount(new Integer(caCount).toString()); List listCandidates = new LinkedList(); @@ -1774,37 +1421,25 @@ McOptsContent mcOptsContent = (McOptsContent) listIterator.next(); McCandidateAnswersDTO mcCandidateAnswersDTO = new McCandidateAnswersDTO(); - AuthoringUtil.logger.debug("mcOptsContent:" + mcOptsContent); - AuthoringUtil.logger.debug("option text:" + mcOptsContent.getMcQueOptionText()); - AuthoringUtil.logger.debug("option text:" + mcOptsContent.isCorrectOption()); - mcCandidateAnswersDTO.setCandidateAnswer(mcOptsContent.getMcQueOptionText()); if (mcOptsContent.isCorrectOption()) { - AuthoringUtil.logger.debug("mcOptsContent.getMcQueOptionText() is set to true"); mcCandidateAnswersDTO.setCorrect("Correct"); } else { - AuthoringUtil.logger.debug("mcOptsContent.getMcQueOptionText() is set to true"); mcCandidateAnswersDTO.setCorrect("Incorrect"); } - AuthoringUtil.logger.debug("current mcCandidateAnswersDTO:" + mcCandidateAnswersDTO); listCandidates.add(mcCandidateAnswersDTO); - AuthoringUtil.logger.debug("current listCandidates:" + listCandidates); } - AuthoringUtil.logger.debug("final listCandidates for mcQueContent:" + listCandidates); /* get candidates, till here.. */ mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates); - AuthoringUtil.logger.debug("current mcQuestionContentDTO:" + mcQuestionContentDTO); listQuestionContentDTO.add(mcQuestionContentDTO); - AuthoringUtil.logger.debug("current listQuestionContentDTO:" + listQuestionContentDTO); mapIndex = new Long(mapIndex.longValue() + 1); } } - AuthoringUtil.logger.debug("final listQuestionContentDTO:" + listQuestionContentDTO); return listQuestionContentDTO; } @@ -1816,14 +1451,11 @@ * @param mcService */ protected void persistCandidates(List caList, McQueContent mcQueContent, IMcService mcService) { - AuthoringUtil.logger.debug("doing persistCandidates:" + caList); - AuthoringUtil.logger.debug("mcQueContent:" + mcQueContent); int displayOrder = 0; Iterator itCaList = caList.iterator(); while (itCaList.hasNext()) { McCandidateAnswersDTO mcCandidateAnswersDTO = (McCandidateAnswersDTO) itCaList.next(); - AuthoringUtil.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO); String candidateAnswer = mcCandidateAnswersDTO.getCandidateAnswer(); String correct = mcCandidateAnswersDTO.getCorrect(); @@ -1836,16 +1468,13 @@ } ++displayOrder; - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); // McOptsContent mcOptsContent = new McOptsContent(correctOption, candidateAnswer, mcQueContent, new // TreeSet()); McOptsContent mcOptsContent = new McOptsContent(new Integer(displayOrder), correctOption, candidateAnswer, mcQueContent, new TreeSet()); - AuthoringUtil.logger.debug("mcOptsContent: " + mcOptsContent); mcService.saveMcOptionsContent(mcOptsContent); - AuthoringUtil.logger.debug("persisted mcOptsContent: " + mcOptsContent); } } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java =================================================================== diff -u -rdf91db7838416bb48e59d2582549cc7d1e1ce8e6 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java (.../ExportServlet.java) (revision df91db7838416bb48e59d2582549cc7d1e1ce8e6) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java (.../ExportServlet.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -61,9 +61,7 @@ public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - logger.debug("dispathcing doExport"); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); - logger.debug("basePath:" + basePath); if (StringUtils.equals(mode,ToolAccessMode.LEARNER.toString())){ learner(request,response,directoryName,cookies); @@ -108,13 +106,8 @@ */ public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - logger.debug("starting learner mode..."); IMcService mcService = McServiceProxy.getMcService(getServletContext()); - logger.debug("mcService:" + mcService); - - logger.debug("userID:" + userID); - logger.debug("toolSessionID:" + toolSessionID); if (userID == null || toolSessionID == null) { @@ -128,11 +121,8 @@ // If the learner hasn't selected any options yet, then they won't exist in the session. // Yet we might be asked for their page, as the activity has been commenced. So need to do a "blank" page in that case McQueUsr learner = mcService.getMcUserBySession(userID,mcSession.getUid()); - logger.debug("learner: " + learner); McContent content=mcSession.getMcContent(); - logger.debug("content: " + content); - logger.debug("content id: " + content.getMcContentId()); if (content == null) { @@ -147,7 +137,6 @@ McMonitoringAction mcMonitoringAction= new McMonitoringAction(); List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionDataForExportLearner(request, content, mcService, mcSession, learner ); request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); - logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); request.getSession().setAttribute(LEARNER_MARK,learner.getLastAttemptTotalMark()); request.getSession().setAttribute(LEARNER_NAME,learner.getFullname() ); @@ -156,7 +145,6 @@ mcMonitoringAction.prepareReflectionData(request, content, mcService, userID.toString(), true); } - logger.debug("ending learner mode: "); } @@ -171,7 +159,6 @@ */ public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - logger.debug("starting teacher mode..."); IMcService mcService = McServiceProxy.getMcService(getServletContext()); @@ -183,7 +170,6 @@ } McContent content=mcService.retrieveMc(toolContentID); - logger.debug("content: " + content); if (content == null) { @@ -192,26 +178,21 @@ throw new McApplicationException(error); } - logger.debug("starting teacher mode: "); McMonitoringAction mcMonitoringAction= new McMonitoringAction(); List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionData(request, content, mcService); request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO); - logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO)); List listMonitoredMarksContainerDTO=MonitoringUtil.buildGroupsMarkData(request, content, mcService); request.getSession().setAttribute(LIST_MONITORED_MARKS_CONTAINER_DTO, listMonitoredMarksContainerDTO); - logger.debug("LIST_MONITORED_MARKS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_MARKS_CONTAINER_DTO)); request.getSession().setAttribute(PASSMARK,content.getPassMark().toString()); request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); mcMonitoringAction.prepareReflectionData(request, content, mcService, null, true); writeOutSessionData(request, response, content, mcService, directoryName); - - logger.debug("ending teacher mode: "); } /** Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java =================================================================== diff -u -r31bfed6e9de7f7e92b1976ca98dbacd13d9cee0c -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 31bfed6e9de7f7e92b1976ca98dbacd13d9cee0c) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d) @@ -69,40 +69,29 @@ */ public static void saveFormRequestData(HttpServletRequest request, McLearningForm mcLearningForm, boolean prepareViewAnswersDataMode) { - LearningUtil.logger.debug("starting saveFormRequestData:"); String httpSessionID = request.getParameter("httpSessionID"); - LearningUtil.logger.debug("httpSessionID: " + httpSessionID); mcLearningForm.setHttpSessionID(httpSessionID); String userID = request.getParameter("userID"); - LearningUtil.logger.debug("userID: " + userID); mcLearningForm.setUserID(userID); String passMarkApplicable = request.getParameter("passMarkApplicable"); - LearningUtil.logger.debug("passMarkApplicable: " + passMarkApplicable); mcLearningForm.setPassMarkApplicable(passMarkApplicable); String userOverPassMark = request.getParameter("userOverPassMark"); - LearningUtil.logger.debug("userOverPassMark: " + userOverPassMark); mcLearningForm.setUserOverPassMark(userOverPassMark); if (prepareViewAnswersDataMode == false) { String learnerProgress = request.getParameter("learnerProgress"); - LearningUtil.logger.debug("learnerProgress: " + learnerProgress); mcLearningForm.setLearnerProgress(learnerProgress); - LearningUtil.logger.debug("form is populated with learnerProgress"); String learnerProgressUserId = request.getParameter("learnerProgressUserId"); - LearningUtil.logger.debug("learnerProgressUserId: " + learnerProgressUserId); mcLearningForm.setLearnerProgressUserId(learnerProgressUserId); } String questionListingMode = request.getParameter("questionListingMode"); - LearningUtil.logger.debug("questionListingMode: " + questionListingMode); mcLearningForm.setQuestionListingMode(questionListingMode); - - LearningUtil.logger.debug("ending saveFormRequestData:"); } /** @@ -115,10 +104,6 @@ */ public static boolean isQuestionCorrect(Collection- * 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.
- *
* @author Ozgur Demirtas
*
*
- * 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 McApplicationException
- * the known runtime exception
- *
- */
public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
/**
*
- * ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- * HttpServletResponse response) throws IOException, ServletException
- *
* submits content into the tool database
*
* @param mapping
@@ -167,92 +126,69 @@
public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispathcing submitAllContent :" + form);
-
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
Map mapQuestionContent = AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO);
- McAction.logger.debug("extracted mapQuestionContent: " + mapQuestionContent);
Map mapFeedback = AuthoringUtil.extractMapFeedback(listQuestionContentDTO);
- McAction.logger.debug("extracted mapFeedback: " + mapFeedback);
Map mapWeights = new TreeMap(new McComparator());
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
Map mapMarks = AuthoringUtil.extractMapMarks(listQuestionContentDTO);
- McAction.logger.debug("extracted mapMarks: " + mapMarks);
Map mapCandidatesList = AuthoringUtil.extractMapCandidatesList(listQuestionContentDTO);
- McAction.logger.debug("extracted mapCandidatesList: " + mapCandidatesList);
ActionMessages errors = new ActionMessages();
- McAction.logger.debug("mapQuestionContent size: " + mapQuestionContent.size());
if (mapQuestionContent.size() == 0) {
ActionMessage error = new ActionMessage("questions.none.submitted");
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
- McAction.logger.debug("errors: " + errors);
AuthoringUtil authoringUtil = new AuthoringUtil();
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
List attachmentListBackup = new ArrayList();
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
attachmentListBackup = attachmentList;
List deletedAttachmentListBackup = new ArrayList();
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
deletedAttachmentListBackup = deletedAttachmentList;
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOfflineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
@@ -263,9 +199,6 @@
String richTextTitle = request.getParameter(McAppConstants.TITLE);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
-
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -275,82 +208,67 @@
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
mcGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
- McAction.logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
- McAction.logger.debug("there are no issues with input, continue and submit data");
+ //there are no issues with input, continue and submit data
McContent mcContentTest = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContentTest: " + mcContentTest);
- McAction.logger.debug("errors: " + errors);
if (!errors.isEmpty()) {
saveErrors(request, errors);
McAction.logger.debug("errors saved: " + errors);
}
McContent mcContent = mcContentTest;
if (errors.isEmpty()) {
- McAction.logger.debug("errors is empty: " + errors);
authoringUtil.removeRedundantQuestions(mapQuestionContent, mcService, mcAuthoringForm, request,
strToolContentID);
- McAction.logger.debug("end of removing unused entries... ");
+ //end of removing unused entries
mcContent = authoringUtil.saveOrUpdateMcContent(mapQuestionContent, mapFeedback, mapWeights, mapMarks,
mapCandidatesList, mcService, mcAuthoringForm, request, mcContentTest, strToolContentID);
- McAction.logger.debug("mcContent: " + mcContent);
long defaultContentID = 0;
- McAction.logger.debug("attempt retrieving tool with signatute : " + McAppConstants.MY_SIGNATURE);
+ //attempt retrieving tool with signatute McAppConstants.MY_SIGNATURE
defaultContentID = mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE);
- McAction.logger.debug("retrieved tool default contentId: " + defaultContentID);
if (mcContent != null) {
mcGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
}
- McAction.logger.debug("updated mcGeneralAuthoringDTO to: " + mcGeneralAuthoringDTO);
authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, mcService, mcAuthoringForm, mcContent);
- McAction.logger.debug("post reOrganizeDisplayOrder: " + mcContent);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
List attachments = saveAttachments(mcContent, attachmentList, deletedAttachmentList, mapping, request);
- McAction.logger.debug("attachments: " + attachments);
}
- McAction.logger.debug("strToolContentID: " + strToolContentID);
McUtils.setDefineLater(request, false, strToolContentID, mcService);
- McAction.logger.debug("define later set to false");
+ //define later set to false
McUtils.setFormProperties(request, mcService, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID,
defaultContentIdStr, activeModule, sessionMap, httpSessionID);
if (activeModule.equals(McAppConstants.AUTHORING)) {
- McAction.logger.debug("standard authoring close");
+ //standard authoring close
request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
} else {
- McAction.logger.debug("go back to view only screen");
+ //go back to view only screen
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
}
} else {
- McAction.logger.debug("errors is not empty: " + errors);
+ //errors is not empty
if (mcContent != null) {
long defaultContentID = 0;
- McAction.logger.debug("attempt retrieving tool with signatute : " + McAppConstants.MY_SIGNATURE);
defaultContentID = mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE);
- McAction.logger.debug("retrieved tool default contentId: " + defaultContentID);
if (mcContent != null) {
mcGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
@@ -368,11 +286,9 @@
mcGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
@@ -381,17 +297,14 @@
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
+ //generating dyn pass map using listQuestionContentDTO
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setToolContentID(strToolContentID);
@@ -405,81 +318,49 @@
mcAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
mcAuthoringForm.setCurrentTab("1");
- McAction.logger.debug("forwarding to :" + McAppConstants.LOAD_QUESTIONS);
return mapping.findForward(McAppConstants.LOAD_QUESTIONS);
}
- /**
- *
- * saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- * @throws IOException
- * @throws ServletException
- */
public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispathcing saveSingleQuestion");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
String passmark = request.getParameter("passmark");
- McAction.logger.debug("passmark: " + passmark);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank = authoringUtil.validateCandidateAnswersNotBlank(request);
- McAction.logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
caList = AuthoringUtil.removeBlankEntries(caList);
- McAction.logger.debug("caList after removing blank entries: " + caList);
boolean validateSingleCorrectCandidate = authoringUtil.validateSingleCorrectCandidate(caList);
- McAction.logger.debug("validateSingleCorrectCandidate: " + validateSingleCorrectCandidate);
boolean validateOnlyOneCorrectCandidate = authoringUtil.validateOnlyOneCorrectCandidate(caList);
- McAction.logger.debug("validateOnlyOneCorrectCandidate: " + validateOnlyOneCorrectCandidate);
ActionMessages errors = new ActionMessages();
@@ -498,60 +379,44 @@
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
- McAction.logger.debug("errors: " + errors);
-
if (!errors.isEmpty()) {
saveErrors(request, errors);
McAction.logger.debug("errors saved: " + errors);
}
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
-
- McAction.logger.debug("entry using mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
mcGeneralAuthoringDTO.setPassMarkValue(passmark);
if (errors.isEmpty()) {
- McAction.logger.debug("errors is empty: " + errors);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
String editableQuestionIndex = request.getParameter("editableQuestionIndex");
- McAction.logger.debug("editableQuestionIndex: " + editableQuestionIndex);
mcAuthoringForm.setQuestionIndex(editableQuestionIndex);
if ((newQuestion != null) && (newQuestion.length() > 0)) {
if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false"))) {
- McAction.logger.debug("request for add and save");
+ //request for add and save
boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- McAction.logger.debug("duplicates: " + duplicates);
if (!duplicates) {
McQuestionContentDTO mcQuestionContentDTO = null;
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger
- .debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
- McAction.logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(editableQuestionIndex)) {
@@ -560,38 +425,31 @@
}
}
- McAction.logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
mcQuestionContentDTO.setQuestion(newQuestion);
mcQuestionContentDTO.setFeedback(feedback);
mcQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
mcQuestionContentDTO.setMark(mark);
- McAction.logger
- .debug("caList size:" + mcQuestionContentDTO.getListCandidateAnswersDTO().size());
mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO()
.size()).toString());
listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(
listQuestionContentDTO, mcQuestionContentDTO, editableQuestionIndex);
- McAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: "
- + listQuestionContentDTO);
+ //post reorderUpdateListQuestionContentDTO listQuestionContentDTO
} else {
- McAction.logger.debug("duplicate question entry, not adding");
+ //duplicate question entry, not adding
}
} else {
- McAction.logger.debug("request for edit and save.");
+ //request for edit and save
McQuestionContentDTO mcQuestionContentDTO = null;
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
- McAction.logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(editableQuestionIndex)) {
@@ -600,67 +458,55 @@
}
}
- McAction.logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
mcQuestionContentDTO.setQuestion(newQuestion);
mcQuestionContentDTO.setFeedback(feedback);
mcQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
mcQuestionContentDTO.setMark(mark);
- McAction.logger.debug("caList size:" + mcQuestionContentDTO.getListCandidateAnswersDTO().size());
mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO()
.size()).toString());
listQuestionContentDTO = AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO,
mcQuestionContentDTO, editableQuestionIndex);
- McAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: "
- + listQuestionContentDTO);
}
} else {
- McAction.logger.debug("entry blank, not adding");
+ //entry blank, not adding
}
- McAction.logger.debug("entryusing mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID, listQuestionContentDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
} else {
- McAction.logger.debug("errors is not empty: " + errors);
+ //errors is not empty
commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID, listQuestionContentDTO);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
+ //generating dyn pass map using listQuestionContentDTO
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString());
- McAction.logger.debug("forwarding using newEditableQuestionBox");
return newEditableQuestionBox(mapping, form, request, response);
}
@@ -783,30 +629,12 @@
return (mapping.findForward(McAppConstants.LOAD));
}
- /**
- * commonSaveCode(HttpServletRequest request, McGeneralAuthoringDTO mcGeneralAuthoringDTO, McAuthoringForm
- * mcAuthoringForm, SessionMap sessionMap, String activeModule, String strToolContentID, String defaultContentIdStr,
- * IMcService mcService, String httpSessionID, List listQuestionContentDTO)
- *
- * @param request
- * @param mcGeneralAuthoringDTO
- * @param mcAuthoringForm
- * @param sessionMap
- * @param activeModule
- * @param strToolContentID
- * @param defaultContentIdStr
- * @param mcService
- * @param httpSessionID
- * @param listQuestionContentDTO
- */
protected void commonSaveCode(HttpServletRequest request, McGeneralAuthoringDTO mcGeneralAuthoringDTO,
McAuthoringForm mcAuthoringForm, SessionMap sessionMap, String activeModule, String strToolContentID,
String defaultContentIdStr, IMcService mcService, String httpSessionID, List listQuestionContentDTO) {
String richTextTitle = request.getParameter(McAppConstants.TITLE);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -815,29 +643,22 @@
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOfflineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
@@ -866,132 +687,83 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
- McAction.logger.debug("httpSessionID: " + httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
-
request.getSession().setAttribute(httpSessionID, sessionMap);
- McAction.logger.debug("mcGeneralAuthoringDTO.getMapQuestionContent(); "
- + mcGeneralAuthoringDTO.getMapQuestionContent());
}
- /**
- * addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- * @throws IOException
- * @throws ServletException
- */
public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispathcing addSingleQuestion");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
AuthoringUtil authoringUtil = new AuthoringUtil();
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
List listAddableQuestionContentDTO = (List) sessionMap.get(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY);
- McAction.logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
McQuestionContentDTO mcQuestionContentDTONew = null;
int listSize = listQuestionContentDTO.size();
- McAction.logger.debug("listSize: " + listSize);
- McAction.logger.debug("listAddableQuestionContentDTO now: " + listAddableQuestionContentDTO);
request.setAttribute(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
String passmark = request.getParameter("passmark");
- McAction.logger.debug("passmark: " + passmark);
mcGeneralAuthoringDTO.setPassMarkValue(passmark);
boolean validateCandidateAnswersNotBlank = authoringUtil.validateCandidateAnswersNotBlank(request);
- McAction.logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
caList = AuthoringUtil.removeBlankEntries(caList);
- McAction.logger.debug("caList after removing blank entries: " + caList);
boolean validateSingleCorrectCandidate = authoringUtil.validateSingleCorrectCandidate(caList);
- McAction.logger.debug("validateSingleCorrectCandidate: " + validateSingleCorrectCandidate);
boolean validateOnlyOneCorrectCandidate = authoringUtil.validateOnlyOneCorrectCandidate(caList);
- McAction.logger.debug("validateOnlyOneCorrectCandidate: " + validateOnlyOneCorrectCandidate);
ActionMessages errors = new ActionMessages();
@@ -1010,19 +782,14 @@
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
- McAction.logger.debug("errors: " + errors);
-
if (!errors.isEmpty()) {
saveErrors(request, errors);
McAction.logger.debug("errors saved: " + errors);
}
- McAction.logger.debug("errors saved: " + errors);
-
if (errors.isEmpty()) {
if ((newQuestion != null) && (newQuestion.length() > 0)) {
boolean duplicates = AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- McAction.logger.debug("duplicates: " + duplicates);
if (!duplicates) {
McQuestionContentDTO mcQuestionContentDTO = new McQuestionContentDTO();
@@ -1032,90 +799,64 @@
mcQuestionContentDTO.setMark(mark);
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
- McAction.logger.debug("caList size:" + mcQuestionContentDTO.getListCandidateAnswersDTO().size());
mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO()
.size()).toString());
listQuestionContentDTO.add(mcQuestionContentDTO);
- McAction.logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO);
} else {
- McAction.logger.debug("entry duplicate, not adding");
+ //entry duplicate, not adding
}
} else {
- McAction.logger.debug("entry blank, not adding");
+ //entry blank, not adding
}
} else {
- McAction.logger.debug("errors, not adding");
+ //errors, not adding
- McAction.logger.debug("errors is not empty: " + errors);
-
commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID, listQuestionContentDTO);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
- McAction.logger.debug("forwarding using newQuestionBox");
return newQuestionBox(mapping, form, request, response);
}
- McAction.logger.debug("entry using mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
-
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
-
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
commonSaveCode(request, mcGeneralAuthoringDTO, mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID, listQuestionContentDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("before forwarding mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
-
- McAction.logger.debug("fwd LOAD_QUESTIONS");
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
/**
- * newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* opens up an new screen within the current page for adding a new question
*
* newQuestionBox
@@ -1130,49 +871,32 @@
*/
public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispathcing newQuestionBox");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
-
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
/* create default mcContent object*/
McContent mcContent = mcService.retrieveMc(new Long(defaultContentIdStr));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
-
- McAction.logger.debug("richTextTitle: " + richTextTitle);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -1181,12 +905,9 @@
McUtils.setFormProperties(request, mcService, mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID,
defaultContentIdStr, activeModule, sessionMap, httpSessionID);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -1195,64 +916,47 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
String requestType = request.getParameter("requestType");
- McAction.logger.debug("requestType: " + requestType);
List listAddableQuestionContentDTO = (List) sessionMap.get(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY);
- McAction.logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
if ((requestType != null) && (requestType.equals("direct"))) {
- McAction.logger.debug("requestType is direct");
+ //requestType is direct
listAddableQuestionContentDTO = authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- McAction.logger.debug("listAddableQuestionContentDTO from db: " + listAddableQuestionContentDTO);
}
request.setAttribute(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- McAction.logger.debug("final listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
mcGeneralAuthoringDTO.setToolContentID(strToolContentID);
@@ -1265,14 +969,10 @@
mcAuthoringForm.setActiveModule(activeModule);
mcAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- McAction.logger.debug("fwd ing to newQuestionBox: ");
return (mapping.findForward("newQuestionBox"));
}
/**
- * newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
* opens up an new screen within the current page for editing a question
*
* @param mapping
@@ -1285,40 +985,31 @@
*/
public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispathcing newEditableQuestionBox");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
request.setAttribute(McAppConstants.CURRENT_EDITABLE_QUESTION_INDEX, questionIndex);
mcAuthoringForm.setEditableQuestionIndex(questionIndex);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
String editableQuestion = "";
String editableFeedback = "";
String editableMark = "";
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
@@ -1327,56 +1018,37 @@
editableFeedback = mcQuestionContentDTO.getFeedback();
editableQuestion = mcQuestionContentDTO.getQuestion();
editableMark = mcQuestionContentDTO.getMark();
- McAction.logger.debug("editableFeedback found :" + editableFeedback);
List candidates = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidates found :" + candidates);
break;
}
}
}
- McAction.logger.debug("editableFeedback found :" + editableFeedback);
- McAction.logger.debug("editableQuestion found :" + editableQuestion);
- McAction.logger.debug("editableMark found :" + editableMark);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
-
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) request
.getAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO);
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
if (mcGeneralAuthoringDTO == null) {
mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
}
mcGeneralAuthoringDTO.setMarkValue(editableMark);
-
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
-
- McAction.logger.debug("richTextTitle: " + richTextTitle);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -1393,46 +1065,33 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- McAction.logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
String requestNewEditableQuestionBox = (String) request.getAttribute("requestNewEditableQuestionBox");
- McAction.logger.debug("requestNewEditableQuestionBox: " + requestNewEditableQuestionBox);
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
// if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false")))
if ((requestNewEditableQuestionBox != null) && requestNewEditableQuestionBox.equals("true")) {
@@ -1441,14 +1100,10 @@
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
}
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
- McAction.logger.debug("final listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
mcGeneralAuthoringDTO.setToolContentID(strToolContentID);
@@ -1460,15 +1115,10 @@
mcAuthoringForm.setHttpSessionID(httpSessionID);
mcAuthoringForm.setActiveModule(activeModule);
mcAuthoringForm.setDefaultContentIdStr(defaultContentIdStr);
- McAction.logger.debug("fwd ing to editQuestionBox: ");
return (mapping.findForward("editQuestionBox"));
}
/**
- *
- * ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- * HttpServletResponse response) throws IOException, ServletException
- *
* removes a question from the questions map
*
* @param mapping
@@ -1481,38 +1131,28 @@
*/
public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching removeQuestion");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
McQuestionContentDTO mcQuestionContentDTO = null;
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
- McAction.logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(questionIndex)) {
@@ -1522,79 +1162,54 @@
}
}
- McAction.logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
mcQuestionContentDTO.setQuestion("");
- McAction.logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO);
listQuestionContentDTO = AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex);
- McAction.logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
-
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
if (mcContent == null) {
- McAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
mcContent = mcService.retrieveMc(new Long(defaultContentIdStr));
}
- McAction.logger.debug("final mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -1619,42 +1234,29 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO now: " + mcQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
/**
- * moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
* moves a question down in the list
*
* moveQuestionDown
@@ -1669,94 +1271,69 @@
*/
public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching moveQuestionDown");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down");
- McAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -1781,141 +1358,88 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
-
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
- /**
- * moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
- * moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- * *
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- * @throws IOException
- * @throws ServletException
- */
- public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching moveQuestionUp");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
listQuestionContentDTO = AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up");
- McAction.logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
listQuestionContentDTO = AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
-
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -1940,42 +1464,31 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
/**
*
- * ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response) throws IOException, ServletException
- *
* adds a new file to content repository
*
* @param mapping
@@ -1988,55 +1501,40 @@
*/
public ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispathching addNewFile");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String onlineInstructions = request.getParameter(McAppConstants.ONLINE_INSTRUCTIONS);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
String offlineInstructions = request.getParameter(McAppConstants.OFFLINE_INSTRUCTIONS);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
sessionMap.put(McAppConstants.ONLINE_INSTRUCTIONS_KEY, onlineInstructions);
sessionMap.put(McAppConstants.OFFLINE_INSTRUCTIONS, offlineInstructions);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
@@ -2047,8 +1545,6 @@
String richTextTitle = request.getParameter(McAppConstants.TITLE);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -2058,14 +1554,10 @@
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
addFileToContentRepository(request, mcAuthoringForm, attachmentList, deletedAttachmentList, sessionMap,
mcGeneralAuthoringDTO);
- McAction.logger.debug("post addFileToContentRepository, attachmentList: " + attachmentList);
- McAction.logger.debug("post addFileToContentRepository, deletedAttachmentList: " + deletedAttachmentList);
sessionMap.put(McAppConstants.ATTACHMENT_LIST_KEY, attachmentList);
sessionMap.put(McAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList);
@@ -2089,46 +1581,34 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
mcAuthoringForm.resetUserAction();
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
/**
*
- * ActionForward deleteFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response) throws IOException, ServletException
- *
* deletes a file from the content repository
*
* @param mapping
@@ -2141,46 +1621,33 @@
*/
public ActionForward deleteFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching deleteFile");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
@@ -2189,10 +1656,8 @@
defaultContentIdStr, activeModule, sessionMap, httpSessionID);
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
@@ -2201,9 +1666,6 @@
String richTextTitle = (String) sessionMap.get(McAppConstants.ACTIVITY_TITLE_KEY);
String richTextInstructions = (String) sessionMap.get(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY);
-
- McAction.logger.debug("richTextTitle: " + richTextTitle);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -2212,14 +1674,12 @@
long uuid = WebUtil.readLongParam(request, McAppConstants.UUID);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
if (attachmentList == null) {
attachmentList = new ArrayList();
}
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
if (deletedAttachmentList == null) {
deletedAttachmentList = new ArrayList();
@@ -2249,35 +1709,27 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
mcAuthoringForm.resetUserAction();
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
/**
- * persistError(HttpServletRequest request, String message)
*
* persists error messages to request scope
*
@@ -2287,7 +1739,6 @@
public void persistError(HttpServletRequest request, String message) {
ActionMessages errors = new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- McAction.logger.debug("add " + message + " to ActionMessages:");
saveErrors(request, errors);
}
@@ -2301,11 +1752,7 @@
public void addFileToContentRepository(HttpServletRequest request, McAuthoringForm mcAuthoringForm,
List attachmentList, List deletedAttachmentList, SessionMap sessionMap,
McGeneralAuthoringDTO mcGeneralAuthoringDTO) {
- McAction.logger.debug("attempt addFileToContentRepository");
- McAction.logger.debug("attachmentList: " + attachmentList);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
if (attachmentList == null) {
attachmentList = new ArrayList();
@@ -2319,15 +1766,13 @@
boolean isOnlineFile = false;
String fileType = null;
if ((mcAuthoringForm.getTheOfflineFile() != null) && (mcAuthoringForm.getTheOfflineFile().getFileSize() > 0)) {
- McAction.logger.debug("theOfflineFile is available: ");
+ //theOfflineFile is available
uploadedFile = mcAuthoringForm.getTheOfflineFile();
- McAction.logger.debug("uploadedFile: " + uploadedFile);
fileType = IToolContentHandler.TYPE_OFFLINE;
} else if ((mcAuthoringForm.getTheOnlineFile() != null)
&& (mcAuthoringForm.getTheOnlineFile().getFileSize() > 0)) {
- McAction.logger.debug("theOnlineFile is available: ");
+ //theOnlineFile is available
uploadedFile = mcAuthoringForm.getTheOnlineFile();
- McAction.logger.debug("uploadedFile: " + uploadedFile);
isOnlineFile = true;
fileType = IToolContentHandler.TYPE_ONLINE;
} else {
@@ -2343,12 +1788,9 @@
return;
}
- McAction.logger.debug("uploadedFile.getFileName(): " + uploadedFile.getFileName());
-
/* if a file with the same name already exists then move the old one to deleted */
deletedAttachmentList = McUtils.moveToDelete(uploadedFile.getFileName(), isOnlineFile, attachmentList,
deletedAttachmentList);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
try {
/* This is a new file and so is saved to the content repository. Add it to the
@@ -2358,12 +1800,9 @@
uploadedFile.getFileName(), uploadedFile.getContentType(), fileType);
McUploadedFile file = new McUploadedFile();
String fileName = uploadedFile.getFileName();
- McAction.logger.debug("fileName: " + fileName);
- McAction.logger.debug("fileName length: " + fileName.length());
if ((fileName != null) && (fileName.length() > 30)) {
fileName = fileName.substring(0, 31);
- McAction.logger.debug("shortened fileName: " + fileName);
}
file.setFileName(fileName);
@@ -2389,11 +1828,6 @@
}
}
- /**
- * McToolContentHandler getToolContentHandler()
- *
- * @return
- */
private McToolContentHandler getToolContentHandler() {
if (toolContentHandler == null) {
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet()
@@ -2419,43 +1853,31 @@
private List saveAttachments(McContent mcContent, List attachmentList, List deletedAttachmentList,
ActionMapping mapping, HttpServletRequest request) {
- McAction.logger.debug("start saveAttachments, mcContent " + mcContent);
- McAction.logger.debug("start saveAttachments, attachmentList " + attachmentList);
- McAction.logger.debug("start deletedAttachmentList, deletedAttachmentList " + deletedAttachmentList);
-
if ((attachmentList == null) || (deletedAttachmentList == null)) {
return null;
}
IMcService voteService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("voteService: " + voteService);
if (deletedAttachmentList != null) {
- McAction.logger.debug("deletedAttachmentList is iterated...");
Iterator iter = deletedAttachmentList.iterator();
while (iter.hasNext()) {
McUploadedFile attachment = (McUploadedFile) iter.next();
- McAction.logger.debug("attachment: " + attachment);
if (attachment.getSubmissionId() != null) {
voteService.removeFile(attachment.getSubmissionId());
}
}
deletedAttachmentList.clear();
- McAction.logger.error("cleared attachment list.");
}
if (attachmentList != null) {
- McAction.logger.debug("attachmentList is iterated...");
Iterator iter = attachmentList.iterator();
while (iter.hasNext()) {
McUploadedFile attachment = (McUploadedFile) iter.next();
- McAction.logger.debug("attachment: " + attachment);
- McAction.logger.debug("attachment submission id: " + attachment.getSubmissionId());
if (attachment.getSubmissionId() == null) {
/* add entry to tool table - file already in content repository */
- McAction.logger.debug("calling persistFile with attachment: " + attachment);
voteService.persistFile(mcContent, attachment);
}
}
@@ -2466,15 +1888,11 @@
public ActionForward editActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching proxy editActivity...");
return null;
}
/**
*
- * ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- * HttpServletResponse response) throws IOException, ServletException, ToolException
- *
* generates Edit Activity screen
*
* @param mapping
@@ -2488,48 +1906,32 @@
*/
public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException, ToolException {
- McAction.logger.debug("dispatching editActivityQuestions...");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
- McAction.logger.debug("mcAuthoringForm: " + mcAuthoringForm);
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
- McAction.logger.debug("title: " + mcContent.getTitle());
- McAction.logger.debug("instructions: " + mcContent.getInstructions());
-
mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle());
mcAuthoringForm.setTitle(mcContent.getTitle());
@@ -2540,23 +1942,20 @@
/* determine whether the request is from Monitoring url Edit Activity*/
String sourceMcStarter = (String) request.getAttribute(McAppConstants.SOURCE_MC_STARTER);
- McAction.logger.debug("sourceMcStarter: " + sourceMcStarter);
mcAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString());
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
boolean isContentInUse = McUtils.isContentInUse(mcContent);
- McAction.logger.debug("isContentInUse:" + isContentInUse);
mcGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
if (isContentInUse == true) {
- McAction.logger.debug("monitoring url does not allow editActivity since the content is in use.");
+ //monitoring url does not allow editActivity since the content is in use
persistError(request, "error.content.inUse");
mcGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
EditActivityDTO editActivityDTO = new EditActivityDTO();
- McAction.logger.debug("isContentInUse:" + isContentInUse);
if (isContentInUse == true) {
editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
@@ -2577,65 +1976,32 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
List listQuestionContentDTO = authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
request.getSession().setAttribute(httpSessionID, sessionMap);
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- McAction.logger.debug("before fwding to jsp, mcAuthoringForm: " + mcAuthoringForm);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
- McAction.logger.debug("forwarding to : " + McAppConstants.LOAD_QUESTIONS);
return mapping.findForward(McAppConstants.LOAD_QUESTIONS);
}
/**
- *
- * newEditableCaBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- * @throws IOException
- * @throws ServletException
- */
- public ActionForward newEditableCaBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching newEditableCaBox");
- return null;
- }
-
- /**
- * moveCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
* moves a candidate dwn in the list
*
* @param mapping
@@ -2648,33 +2014,25 @@
*/
public ActionForward moveCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching moveCandidateDown");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank = authoringUtil.validateCandidateAnswersNotBlank(request);
- McAction.logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
ActionMessages errors = new ActionMessages();
@@ -2685,14 +2043,11 @@
if (!errors.isEmpty()) {
saveErrors(request, errors);
- McAction.logger.debug("errors saved: " + errors);
}
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
if (errors.isEmpty()) {
List candidates = new LinkedList();
@@ -2701,23 +2056,19 @@
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(questionIndex)) {
- McAction.logger.debug("displayOrder equals questionIndex :" + questionIndex);
editableQuestion = mcQuestionContentDTO.getQuestion();
candidates = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidates found :" + candidates);
- McAction.logger.debug("but we are using the repopulated caList here: " + caList);
+ //candidates found
+ //but we are using the repopulated caList here
listCandidates = AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "down");
- McAction.logger.debug("swapped candidates :" + listCandidates);
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
@@ -2726,72 +2077,52 @@
}
}
- McAction.logger.debug("candidates found :" + candidates);
- McAction.logger.debug("swapped candidates is :" + listCandidates);
}
- McAction.logger.debug("listQuestionContentDTO after swapped candidates :" + listQuestionContentDTO);
-
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -2814,55 +2145,42 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString());
return newEditableQuestionBox(mapping, form, request, response);
}
/**
- * moveCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* moves a candidate up in the list
*
* @param mapping
@@ -2875,33 +2193,25 @@
*/
public ActionForward moveCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching moveCandidateUp");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank = authoringUtil.validateCandidateAnswersNotBlank(request);
- McAction.logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
ActionMessages errors = new ActionMessages();
@@ -2912,14 +2222,11 @@
if (!errors.isEmpty()) {
saveErrors(request, errors);
- McAction.logger.debug("errors saved: " + errors);
}
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
if (errors.isEmpty()) {
List candidates = new LinkedList();
@@ -2928,24 +2235,17 @@
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(questionIndex)) {
- McAction.logger.debug("displayOrder equals questionIndex :" + questionIndex);
editableQuestion = mcQuestionContentDTO.getQuestion();
candidates = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidates found :" + candidates);
- McAction.logger.debug("using repopulated caList:" + caList);
-
listCandidates = AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "up");
- McAction.logger.debug("swapped candidates :" + listCandidates);
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
mcQuestionContentDTO.setCaCount(new Integer(listCandidates.size()).toString());
@@ -2955,73 +2255,51 @@
}
}
-
- McAction.logger.debug("candidates found :" + candidates);
- McAction.logger.debug("swapped candidates is :" + listCandidates);
}
- McAction.logger.debug("listQuestionContentDTO after swapped candidates :" + listQuestionContentDTO);
-
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -3044,55 +2322,42 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString());
return newEditableQuestionBox(mapping, form, request, response);
}
/**
- * removeCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* removes a candidate from the list
*
* @param mapping
@@ -3105,46 +2370,34 @@
*/
public ActionForward removeCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching removeCandidate");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
McQuestionContentDTO mcQuestionContentDTO = null;
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question = mcQuestionContentDTO.getQuestion();
String displayOrder = mcQuestionContentDTO.getDisplayOrder();
- McAction.logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(questionIndex)) {
@@ -3154,106 +2407,77 @@
}
}
- McAction.logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
- McAction.logger.debug("setting caList for the content:");
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
List candidateAnswers = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidateAnswers:" + candidateAnswers);
McCandidateAnswersDTO mcCandidateAnswersDTO = null;
Iterator listCaIterator = candidateAnswers.iterator();
int caIndex = 0;
while (listCaIterator.hasNext()) {
caIndex++;
- McAction.logger.debug("caIndex:" + caIndex);
mcCandidateAnswersDTO = (McCandidateAnswersDTO) listCaIterator.next();
- McAction.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO);
- McAction.logger.debug("mcCandidateAnswersDTO question:" + mcCandidateAnswersDTO.getCandidateAnswer());
if (caIndex == new Integer(candidateIndex).intValue()) {
- McAction.logger.debug("candidateIndex found");
mcCandidateAnswersDTO.setCandidateAnswer("");
break;
}
}
- McAction.logger.debug("candidateAnswers after resetting answer" + candidateAnswers);
candidateAnswers = AuthoringUtil.reorderListCandidatesDTO(candidateAnswers);
- McAction.logger.debug("candidateAnswers after reordering candidate nodes" + candidateAnswers);
mcQuestionContentDTO.setListCandidateAnswersDTO(candidateAnswers);
mcQuestionContentDTO.setCaCount(new Integer(candidateAnswers.size()).toString());
- McAction.logger.debug("listQuestionContentDTO after remove: " + listQuestionContentDTO);
-
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
if (mcContent == null) {
- McAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
mcContent = mcService.retrieveMc(new Long(defaultContentIdStr));
}
- McAction.logger.debug("final mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -3276,56 +2500,42 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTO now: " + mcQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString());
return newEditableQuestionBox(mapping, form, request, response);
}
/**
- * newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* enables adding a new candidate answer
*
* @param mapping
@@ -3338,67 +2548,48 @@
*/
public ActionForward newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching newCandidateBox");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList = authoringUtil.repopulateCandidateAnswersBox(request, true);
- McAction.logger.debug("repopulated caList: " + caList);
int caCount = caList.size();
- McAction.logger.debug("caCount: " + caCount);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
String passmark = request.getParameter("passmark");
- McAction.logger.debug("passmark: " + passmark);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
int currentQuestionCount = listQuestionContentDTO.size();
- McAction.logger.debug("currentQuestionCount: " + currentQuestionCount);
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
McQuestionContentDTO mcQuestionContentDTOLocal = null;
Iterator listIterator = listQuestionContentDTO.iterator();
while (listIterator.hasNext()) {
mcQuestionContentDTOLocal = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTOLocal:" + mcQuestionContentDTOLocal);
- McAction.logger.debug("mcQuestionContentDTOLocal question:" + mcQuestionContentDTOLocal.getQuestion());
String question = mcQuestionContentDTOLocal.getQuestion();
String displayOrder = mcQuestionContentDTOLocal.getDisplayOrder();
- McAction.logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals(""))) {
if (displayOrder.equals(questionIndex)) {
@@ -3408,71 +2599,52 @@
}
}
- McAction.logger.debug("mcQuestionContentDTOLocal found:" + mcQuestionContentDTOLocal);
-
if (mcQuestionContentDTOLocal != null) {
mcQuestionContentDTOLocal.setListCandidateAnswersDTO(caList);
mcQuestionContentDTOLocal.setCaCount(new Integer(caList.size()).toString());
}
- McAction.logger.debug("listQuestionContentDTO after repopulating data: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -3495,133 +2667,97 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("mcQuestionContentDTOLocal now: " + mcQuestionContentDTOLocal);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
request.setAttribute("requestNewEditableQuestionBox", new Boolean(true).toString());
return newEditableQuestionBox(mapping, form, request, response);
}
public ActionForward updateMarksList(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching updateMarksList");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String questionIndex = request.getParameter("questionIndex");
- McAction.logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -3646,62 +2782,47 @@
mcAuthoringForm.setCurrentTab("2");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + McAppConstants.LOAD_QUESTIONS);
return (mapping.findForward(McAppConstants.LOAD_QUESTIONS));
}
public ActionForward moveAddedCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching moveAddedCandidateUp");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank = authoringUtil.validateCandidateAnswersNotBlank(request);
- McAction.logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
ActionMessages errors = new ActionMessages();
@@ -3712,19 +2833,15 @@
if (!errors.isEmpty()) {
saveErrors(request, errors);
- McAction.logger.debug("errors saved: " + errors);
}
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
List listAddableQuestionContentDTO = (List) sessionMap.get(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY);
- McAction.logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
if (errors.isEmpty()) {
List candidates = new LinkedList();
@@ -3734,82 +2851,60 @@
/*there is only 1 question dto*/
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
candidates = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidates found :" + candidates);
- McAction.logger.debug("but we are using the repopulated caList here: " + caList);
listCandidates = AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "up");
- McAction.logger.debug("swapped candidates :" + listCandidates);
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
}
}
- McAction.logger.debug("listAddableQuestionContentDTO after swapping (up) candidates: "
- + listAddableQuestionContentDTO);
request.setAttribute(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -3832,77 +2927,59 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
return newQuestionBox(mapping, form, request, response);
}
public ActionForward moveAddedCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching moveAddedCandidateDown");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank = authoringUtil.validateCandidateAnswersNotBlank(request);
- McAction.logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
ActionMessages errors = new ActionMessages();
@@ -3913,18 +2990,14 @@
if (!errors.isEmpty()) {
saveErrors(request, errors);
- McAction.logger.debug("errors saved: " + errors);
}
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
List listAddableQuestionContentDTO = (List) sessionMap.get(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY);
- McAction.logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
if (errors.isEmpty()) {
List candidates = new LinkedList();
@@ -3934,81 +3007,60 @@
/*there is only 1 question dto*/
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
candidates = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidates found :" + candidates);
- McAction.logger.debug("but we are using the repopulated caList here: " + caList);
listCandidates = AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "down");
- McAction.logger.debug("swapped candidates :" + listCandidates);
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
}
}
- McAction.logger.debug("listAddableQuestionContentDTO after moving down candidates: ");
request.setAttribute(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -4031,82 +3083,62 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
return newQuestionBox(mapping, form, request, response);
}
public ActionForward removeAddedCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching removeAddedCandidate");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList = authoringUtil.repopulateCandidateAnswersBox(request, false);
- McAction.logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
List listAddableQuestionContentDTO = (List) sessionMap.get(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY);
- McAction.logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
List candidates = new LinkedList();
List listCandidates = new LinkedList();
@@ -4115,114 +3147,81 @@
/*there is only 1 question dto*/
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
candidates = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidates found :" + candidates);
-
- McAction.logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
- McAction.logger.debug("setting caList for the content:");
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
List candidateAnswers = mcQuestionContentDTO.getListCandidateAnswersDTO();
- McAction.logger.debug("candidateAnswers:" + candidateAnswers);
McCandidateAnswersDTO mcCandidateAnswersDTO = null;
Iterator listCaIterator = candidateAnswers.iterator();
int caIndex = 0;
while (listCaIterator.hasNext()) {
caIndex++;
- McAction.logger.debug("caIndex:" + caIndex);
mcCandidateAnswersDTO = (McCandidateAnswersDTO) listCaIterator.next();
- McAction.logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO);
- McAction.logger.debug("mcCandidateAnswersDTO question:" + mcCandidateAnswersDTO.getCandidateAnswer());
if (caIndex == new Integer(candidateIndex).intValue()) {
- McAction.logger.debug("candidateIndex found");
mcCandidateAnswersDTO.setCandidateAnswer("");
break;
}
}
- McAction.logger.debug("candidateAnswers after resetting answer" + candidateAnswers);
candidateAnswers = AuthoringUtil.reorderListCandidatesDTO(candidateAnswers);
- McAction.logger.debug("candidateAnswers after reordering candidate nodes" + candidateAnswers);
mcQuestionContentDTO.setListCandidateAnswersDTO(candidateAnswers);
mcQuestionContentDTO.setCaCount(new Integer(candidateAnswers.size()).toString());
-
- McAction.logger.debug("listQuestionContentDTO after remove: " + listQuestionContentDTO);
}
- McAction.logger.debug("listAddableQuestionContentDTO : " + listAddableQuestionContentDTO);
request.setAttribute(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent = mcService.retrieveMc(new Long(strToolContentID));
- McAction.logger.debug("mcContent: " + mcContent);
if (mcContent == null) {
- McAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
mcContent = mcService.retrieveMc(new Long(defaultContentIdStr));
}
- McAction.logger.debug("final mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -4245,103 +3244,76 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
return newQuestionBox(mapping, form, request, response);
}
public ActionForward newAddedCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McAction.logger.debug("dispatching newAddedCandidateBox");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McAction.logger.debug("mcService: " + mcService);
String httpSessionID = mcAuthoringForm.getHttpSessionID();
- McAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McAction.logger.debug("sessionMap: " + sessionMap);
String candidateIndex = request.getParameter("candidateIndex");
- McAction.logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks = request.getParameter("totalMarks");
- McAction.logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO = (List) sessionMap.get(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY);
- McAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList = authoringUtil.repopulateCandidateAnswersBox(request, true);
- McAction.logger.debug("repopulated caList: " + caList);
int caCount = caList.size();
- McAction.logger.debug("caCount: " + caCount);
String newQuestion = request.getParameter("newQuestion");
- McAction.logger.debug("newQuestion: " + newQuestion);
String mark = request.getParameter("mark");
- McAction.logger.debug("mark: " + mark);
String passmark = request.getParameter("passmark");
- McAction.logger.debug("passmark: " + passmark);
String feedback = request.getParameter("feedback");
- McAction.logger.debug("feedback: " + feedback);
int currentQuestionCount = listQuestionContentDTO.size();
- McAction.logger.debug("currentQuestionCount: " + currentQuestionCount);
String editQuestionBoxRequest = request.getParameter("editQuestionBoxRequest");
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
List listAddableQuestionContentDTO = (List) sessionMap.get(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY);
- McAction.logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
List candidates = new LinkedList();
List listCandidates = new LinkedList();
@@ -4350,76 +3322,56 @@
/*there is only 1 question dto*/
while (listIterator.hasNext()) {
McQuestionContentDTO mcQuestionContentDTO = (McQuestionContentDTO) listIterator.next();
- McAction.logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- McAction.logger.debug("caList:" + caList);
- McAction.logger.debug("caList size:" + caList.size());
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
mcQuestionContentDTO.setCaCount(new Integer(caList.size()).toString());
}
- McAction.logger.debug("listAddableQuestionContentDTO after swapping (up) candidates: ");
request.setAttribute(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(McAppConstants.NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO after repopulating data: " + listQuestionContentDTO);
sessionMap.put(McAppConstants.LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- McAction.logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule = request.getParameter(McAppConstants.ACTIVE_MODULE);
- McAction.logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(McAppConstants.TITLE);
- McAction.logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(McAppConstants.INSTRUCTIONS);
- McAction.logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(McAppConstants.ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(McAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- McAction.logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr = new Long(mcService.getToolDefaultContentIdBySignature(McAppConstants.MY_SIGNATURE))
.toString();
- ;
- McAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = new McGeneralAuthoringDTO();
- McAction.logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
mcGeneralAuthoringDTO.setActivityInstructions(richTextInstructions);
- McAction.logger.debug("activeModule: " + activeModule);
if (activeModule.equals(McAppConstants.AUTHORING)) {
String onlineInstructions = (String) sessionMap.get(McAppConstants.ONLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions = (String) sessionMap.get(McAppConstants.OFFLINE_INSTRUCTIONS_KEY);
- McAction.logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
List attachmentList = (List) sessionMap.get(McAppConstants.ATTACHMENT_LIST_KEY);
- McAction.logger.debug("attachmentList: " + attachmentList);
List deletedAttachmentList = (List) sessionMap.get(McAppConstants.DELETED_ATTACHMENT_LIST_KEY);
- McAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions = request.getParameter("onlineInstructions");
String strOfflineInstructions = request.getParameter("offlineInstructions");
- McAction.logger.debug("onlineInstructions: " + strOnlineInstructions);
- McAction.logger.debug("offlineInstructions: " + strOnlineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
}
@@ -4442,26 +3394,20 @@
mcAuthoringForm.setCurrentTab("1");
request.setAttribute(McAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO);
- McAction.logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap = authoringUtil.buildMarksMap();
- McAction.logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- McAction.logger.debug("generating dyn pass map using listQuestionContentDTO: " + listQuestionContentDTO);
Map passMarksMap = authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- McAction.logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark = AuthoringUtil.getTotalMark(listQuestionContentDTO);
- McAction.logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap = authoringUtil.buildCorrectMap();
- McAction.logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
@@ -4470,24 +3416,14 @@
mcGeneralAuthoringDTO.setMarkValue(mark);
- McAction.logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(McAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- McAction.logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
return newQuestionBox(mapping, form, request, response);
}
- /**
- * boolean existsContent(long toolContentID, IMcService mcService)
- *
- * @param toolContentID
- * @param mcService
- * @return
- */
protected boolean existsContent(long toolContentID, IMcService mcService) {
McContent mcContent = mcService.retrieveMc(new Long(toolContentID));
if (mcContent == null) {
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McDLStarterAction.java
===================================================================
diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McDLStarterAction.java (.../McDLStarterAction.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McDLStarterAction.java (.../McDLStarterAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -75,7 +75,6 @@
public class McDLStarterAction extends Action implements McAppConstants {
- static Logger logger = Logger.getLogger(McDLStarterAction.class.getName());
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException, McApplicationException {
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java
===================================================================
diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java (.../McExportForm.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportForm.java (.../McExportForm.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -32,29 +32,14 @@
*/
public class McExportForm extends ActionForm {
- static Logger logger = Logger.getLogger(McExportForm.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;
- }
- /**
- * @param logger The logger to set.
- */
- public static void setLogger(Logger logger) {
- McExportForm.logger = logger;
- }
- /**
* @return Returns the content.
*/
public String getContent() {
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java
===================================================================
diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningAction.java (.../McLearningAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -77,20 +77,7 @@
*
* @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.
- *
- * 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 McApplicationException
- * 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
@@ -197,9 +155,6 @@
}
/**
- * displayMc(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- * throws IOException, ServletException
- *
* responds to learner activity in learner mode.
*
* @param mapping
@@ -216,66 +171,50 @@
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
mcLearningForm.setToolSessionID(toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- McLearningAction.logger.debug("toolContentId: " + toolContentId);
mcLearningForm.setToolContentID(toolContentId);
- McLearningAction.logger.debug("mcLearningForm nextQuestionSelected : "
- + mcLearningForm.getNextQuestionSelected());
-
if (mcLearningForm.getNextQuestionSelected() != null && !mcLearningForm.getNextQuestionSelected().equals("")) {
- McLearningAction.logger.debug("processing getNextQuestionSelected...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
mcLearningForm.resetParameters();
setContentInUse(request, toolContentId, mcService);
return getNextOptions(mapping, form, request, response);
}
if (mcLearningForm.getContinueOptionsCombined() != null) {
- McLearningAction.logger.debug("processing getContinueOptionsCombined...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
return continueOptionsCombined(mapping, form, request, response);
} else if (mcLearningForm.getNextOptions() != null) {
- McLearningAction.logger.debug("processing getNextOptions...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
return getNextOptions(mapping, form, request, response);
} else if (mcLearningForm.getRedoQuestions() != null) {
- McLearningAction.logger.debug("processing getRedoQuestions...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
return redoQuestions(mapping, form, request, response);
} else if (mcLearningForm.getRedoQuestionsOk() != null) {
- McLearningAction.logger.debug("processing getRedoQuestionsOk...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
- McLearningAction.logger.debug("requested redoQuestionsOk, user is sure to redo the questions.");
return redoQuestions(request, mcLearningForm, mapping);
} else if (mcLearningForm.getViewAnswers() != null) {
- McLearningAction.logger.debug("processing getViewAnswers...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
mcLearningForm.setLearnerProgress(new Boolean(false).toString());
return viewAnswers(mapping, mcLearningForm, request, response);
} else if (mcLearningForm.getSubmitReflection() != null) {
- McLearningAction.logger.debug("processing getSubmitReflection...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
return submitReflection(mapping, form, request, response);
} else if (mcLearningForm.getForwardtoReflection() != null) {
- McLearningAction.logger.debug("processing getForwardtoReflection...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
return forwardtoReflection(mapping, form, request, response);
} else if (mcLearningForm.getLearnerFinished() != null) {
- McLearningAction.logger.debug("processing getLearnerFinished...");
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
setContentInUse(request, toolContentId, mcService);
return endLearning(mapping, form, request, response);
@@ -299,103 +238,72 @@
*/
public ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McLearningAction.logger.debug("dispatching endLearning ");
McLearningForm mcLearningForm = (McLearningForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
mcLearningForm.setToolSessionID(toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- McLearningAction.logger.debug("toolContentId: " + toolContentId);
mcLearningForm.setToolContentID(toolContentId);
- McLearningAction.logger.debug("mcLearningForm nextQuestionSelected : "
- + mcLearningForm.getNextQuestionSelected());
-
LearningUtil.saveFormRequestData(request, mcLearningForm, false);
- McLearningAction.logger.debug("requested learner finished, the learner should be directed to next activity.");
+ //requested learner finished, the learner should be directed to next activity
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
-
String userID = "";
HttpSession ss = SessionManager.getSession();
- McLearningAction.logger.debug("ss: " + ss);
if (ss != null) {
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
if (user != null && user.getUserID() != null) {
userID = user.getUserID().toString();
- McLearningAction.logger.debug("retrieved userId: " + userID);
}
}
- McLearningAction.logger.debug("attempting to leave/complete session with toolSessionId:" + toolSessionID
- + " and userID:" + userID);
+ //attempting to leave/complete session with toolSessionId:
McUtils.cleanUpSessionAbsolute(request);
String nextUrl = null;
try {
nextUrl = mcService.leaveToolSession(new Long(toolSessionID), new Long(userID));
- McLearningAction.logger.debug("nextUrl: " + nextUrl);
} catch (DataMissingException e) {
- McLearningAction.logger.debug("failure getting nextUrl: " + e);
+ McLearningAction.logger.error("failure getting nextUrl: " + e);
return mapping.findForward(McAppConstants.LEARNING_STARTER);
} catch (ToolException e) {
- McLearningAction.logger.debug("failure getting nextUrl: " + e);
+ McLearningAction.logger.error("failure getting nextUrl: " + e);
return mapping.findForward(McAppConstants.LEARNING_STARTER);
} catch (Exception e) {
- McLearningAction.logger.debug("unknown exception getting nextUrl: " + e);
+ McLearningAction.logger.error("unknown exception getting nextUrl: " + e);
return mapping.findForward(McAppConstants.LEARNING_STARTER);
}
- McLearningAction.logger.debug("success getting nextUrl: " + nextUrl);
-
McQueUsr mcQueUsr = mcService.getMcUserBySession(new Long(userID), mcSession.getUid());
- McLearningAction.logger.debug("mcQueUsr:" + mcQueUsr);
/* it is possible that mcQueUsr can be null if the content is set as runoffline and reflection is on */
if (mcQueUsr == null) {
- McLearningAction.logger
- .debug("attempt creating user record since it must exist for the runOffline + reflection screens");
UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
- McLearningAction.logger.debug("retrieving toolUser: " + toolUser);
- McLearningAction.logger.debug("retrieving toolUser userId: " + toolUser.getUserID());
- McLearningAction.logger.debug("retrieving toolUser username: " + toolUser.getLogin());
String userName = toolUser.getLogin();
String fullName = toolUser.getFirstName() + " " + toolUser.getLastName();
- McLearningAction.logger.debug("retrieving toolUser fullname: " + fullName);
Long userId = new Long(toolUser.getUserID().longValue());
- McLearningAction.logger.debug("userId: " + userId);
- McLearningAction.logger.debug("retrieving toolUser fullname: " + fullName);
mcQueUsr = new McQueUsr(userId, userName, fullName, mcSession, new TreeSet());
mcService.createMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("createMcQueUsr - mcQueUsr: " + mcQueUsr);
- McLearningAction.logger.debug("session uid: " + mcSession.getUid());
- McLearningAction.logger.debug("mcQueUsr: " + mcQueUsr);
mcService.createMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("created mcQueUsr in the db: " + mcQueUsr);
}
mcQueUsr.setResponseFinalised(true);
mcService.updateMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("response finalised for user:" + mcQueUsr);
mcService.updateMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("view summary requested by mcQueUsr: " + mcQueUsr);
List userAttempts = mcService.getLatestAttemptsForAUser(mcQueUsr.getUid());
- McLearningAction.logger.debug("userAttempts:" + userAttempts);
Iterator itAttempts = userAttempts.iterator();
while (itAttempts.hasNext()) {
@@ -404,69 +312,53 @@
mcService.updateMcUsrAttempt(mcUsrAttempt);
}
- McLearningAction.logger.debug("redirecting to the nextUrl: " + nextUrl);
response.sendRedirect(nextUrl);
return null;
}
/**
- * Set parseLearnerInput(List learnerInput, McContent mcContent, IMcService mcService)
+ *
*
* @param learnerInput
* @param mcContent
* @param mcService
* @return
*/
protected Set parseLearnerInput(List learnerInput, McContent mcContent, IMcService mcService) {
- McLearningAction.logger.debug("starting parseLearnerInput: " + learnerInput);
- McLearningAction.logger.debug("mcContent: " + mcContent);
- McLearningAction.logger.debug("mcContent uid: " + mcContent.getUid());
Set questionUids = new HashSet();
Iterator listLearnerInputIterator = learnerInput.iterator();
while (listLearnerInputIterator.hasNext()) {
String input = (String) listLearnerInputIterator.next();
- McLearningAction.logger.debug("input: " + input);
int pos = input.indexOf("-");
- McLearningAction.logger.debug("pos: " + pos);
String questionUid = input.substring(0, pos);
- McLearningAction.logger.debug("questionUid: " + questionUid);
questionUids.add(questionUid);
}
- McLearningAction.logger.debug("final set questionUid: " + questionUids);
List questionEntriesOrdered = mcService.getAllQuestionEntries(mcContent.getUid());
- McLearningAction.logger.debug("questionEntriesOrdered: " + questionEntriesOrdered);
Set questionOrderedUids = new TreeSet(new McComparator());
Iterator questionEntriesOrderedIterator = questionEntriesOrdered.iterator();
while (questionEntriesOrderedIterator.hasNext()) {
McQueContent mcQueContent = (McQueContent) questionEntriesOrderedIterator.next();
- McLearningAction.logger.debug("mcQueContent: " + mcQueContent);
- McLearningAction.logger.debug("mcQueContent text: " + mcQueContent.getQuestion());
Iterator questionUidsIterator = questionUids.iterator();
while (questionUidsIterator.hasNext()) {
String questionUid = (String) questionUidsIterator.next();
- McLearningAction.logger.debug("questionUid: " + questionUid);
- McLearningAction.logger.debug("questionUid versus objects uid : " + questionUid + " versus "
- + mcQueContent.getUid());
if (questionUid.equals(mcQueContent.getUid().toString())) {
questionOrderedUids.add(questionUid);
}
}
}
- McLearningAction.logger.debug("questionOrderedUids: " + questionOrderedUids);
return questionOrderedUids;
}
/**
- * List buildSelectedQuestionAndCandidateAnswersDTO(List learnerInput, McTempDataHolderDTO mcTempDataHolderDTO,
- * IMcService mcService, McContent mcContent)
*
+ *
* @param learnerInput
* @param mcTempDataHolderDTO
* @param mcService
@@ -475,18 +367,11 @@
*/
protected List buildSelectedQuestionAndCandidateAnswersDTO(List learnerInput,
McTempDataHolderDTO mcTempDataHolderDTO, IMcService mcService, McContent mcContent) {
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("starting buildSelectedQuestionAndCandidateAnswersDTO using learnerInput: "
- + learnerInput + " and mcContent: " + mcContent);
- }
int learnerMarks = 0;
int totalMarksPossible = 0;
Set questionUids = parseLearnerInput(learnerInput, mcContent, mcService);
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("set questionUids: " + questionUids);
- }
List questionAndCandidateAnswersList = new LinkedList();
@@ -513,25 +398,13 @@
int pos = input.indexOf("-");
String localQuestionUid = input.substring(0, pos);
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("input: " + input);
- McLearningAction.logger.debug("pos: " + pos);
- McLearningAction.logger.debug("localQuestionUid: " + localQuestionUid);
- }
-
if (currentQuestionUid.equals(localQuestionUid)) {
String caUid = input.substring(pos + 1);
McOptsContent mcOptsContent = mcQueContent.getOptionsContentByUID(new Long(caUid));
String mapIndexAsString = new Long(mapIndex).toString();
caMap.put(mapIndexAsString, mcOptsContent.getMcQueOptionText());
caIds.add(caUid);
mapIndex++;
-
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("equal uids found : " + localQuestionUid + " caUid: " + caUid);
- McLearningAction.logger.debug("mcOptsContent: " + mcOptsContent);
- McLearningAction.logger.debug("mcOptsContent text: " + mcOptsContent.getMcQueOptionText());
- }
}
}
mcLearnerAnswersDTO.setCandidateAnswers(caMap);
@@ -548,32 +421,17 @@
mcLearnerAnswersDTO.setMark(new Integer(0));
}
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("mark:: " + learnerMarks);
- McLearningAction.logger.debug("current mcLearnerAnswersDTO: " + mcLearnerAnswersDTO);
- }
-
questionAndCandidateAnswersList.add(mcLearnerAnswersDTO);
}// end question iterator
mcTempDataHolderDTO.setLearnerMark(new Integer(learnerMarks));
mcTempDataHolderDTO.setTotalMarksPossible(new Integer(totalMarksPossible));
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("final questionAndCandidateAnswersList: " + questionAndCandidateAnswersList);
- McLearningAction.logger.debug("final userMarks: " + learnerMarks);
- McLearningAction.logger.debug("totalMarksPossible: " + totalMarksPossible);
- McLearningAction.logger.debug("mcTempDataHolderDTO before return : " + mcTempDataHolderDTO);
- }
-
return questionAndCandidateAnswersList;
}
/**
- * continueOptionsCombined(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
- *
* responses to learner when they answer all the questions on a single page
*
* @param request
@@ -583,72 +441,56 @@
*/
public ActionForward continueOptionsCombined(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McLearningAction.logger.debug("dispatching continueOptionsCombined...");
McLearningForm mcLearningForm = (McLearningForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McLearningAction.logger.debug("retrieving mcService: " + mcService);
String httpSessionID = mcLearningForm.getHttpSessionID();
- McLearningAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McLearningAction.logger.debug("sessionMap: " + sessionMap);
String questionListingMode = mcLearningForm.getQuestionListingMode();
- McLearningAction.logger.debug("questionListingMode: " + questionListingMode);
List learnerInput = new LinkedList();
if (questionListingMode.equals(McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL)) {
- McLearningAction.logger.debug("listing mode is : " + McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL);
List sequentialCheckedCa = (List) sessionMap.get(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY);
- McLearningAction.logger.debug("pre sequentialCheckedCa: " + sequentialCheckedCa);
Iterator sequentialCheckedCaIterator = sequentialCheckedCa.iterator();
while (sequentialCheckedCaIterator.hasNext()) {
String input = (String) sequentialCheckedCaIterator.next();
- McLearningAction.logger.debug("input: " + input);
}
/* checkedCa refers to candidate answers */
String[] checkedCa = mcLearningForm.getCheckedCa();
- McLearningAction.logger.debug("checkedCa: " + checkedCa);
if (checkedCa != null) {
mcLearningForm.resetCa(mapping, request);
for (int i = 0; i < checkedCa.length; i++) {
String currentCa = checkedCa[i];
- McLearningAction.logger.debug("currentCa: " + currentCa);
sequentialCheckedCa.add(currentCa);
}
}
- McLearningAction.logger.debug("post sequentialCheckedCa: " + sequentialCheckedCa);
sequentialCheckedCaIterator = sequentialCheckedCa.iterator();
while (sequentialCheckedCaIterator.hasNext()) {
String input = (String) sequentialCheckedCaIterator.next();
- McLearningAction.logger.debug("input: " + input);
}
sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, sequentialCheckedCa);
request.getSession().setAttribute(httpSessionID, sessionMap);
learnerInput = sequentialCheckedCa;
- McLearningAction.logger.debug("end processing for mode : "
- + McAppConstants.QUESTION_LISTING_MODE_SEQUENTIAL);
} else {
Map parameters = request.getParameterMap();
Iterator iter = parameters.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
if (key.startsWith("checkedCa")) {
String currentCheckedCa = request.getParameter(key);
- McLearningAction.logger.debug("Found matching checkedCa: key " + key + " value " + currentCheckedCa
- + ".");
if (currentCheckedCa != null) {
learnerInput.add(currentCheckedCa);
}
@@ -658,64 +500,44 @@
mcLearningForm.resetCa(mapping, request);
}
- McLearningAction.logger.debug("final learnerInput: " + learnerInput);
-
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- McLearningAction.logger.debug("toolContentId: " + toolContentId);
/* process the answers */
McContent mcContent = mcService.retrieveMc(new Long(toolContentId));
- McLearningAction.logger.debug("mcContent: " + mcContent);
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
- McLearningAction.logger.debug("constructed a new mcGeneralLearnerFlowDTO");
McTempDataHolderDTO mcTempDataHolderDTO = new McTempDataHolderDTO();
boolean allQuestionsChecked = allQuestionsChecked(mcService, learnerInput, mcContent, mcTempDataHolderDTO);
- McLearningAction.logger.debug("allQuestionsChecked: " + allQuestionsChecked);
- McLearningAction.logger.debug("mcTempDataHolderDTO displayOrder: " + mcTempDataHolderDTO.getDisplayOrder());
if (!allQuestionsChecked) {
- McLearningAction.logger.debug("there are no selected answers for any questions: " + learnerInput);
+ //there are no selected answers for any questions
ActionMessages errors = new ActionMessages();
ActionMessage error = new ActionMessage("answers.submitted.none");
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
- McLearningAction.logger.debug("errors: " + errors);
saveErrors(request, errors);
- McLearningAction.logger.debug("errors saved: " + errors);
McLearningStarterAction mcLearningStarterAction = new McLearningStarterAction();
mcLearningStarterAction.commonContentSetup(request, mcContent, mcService, mcLearningForm, toolSessionID);
mcGeneralLearnerFlowDTO.setQuestionIndex(mcTempDataHolderDTO.getDisplayOrder());
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- McLearningAction.logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: "
- + request.getAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO));
- McLearningAction.logger.debug("returning to LOAD_LEARNER: " + McAppConstants.LOAD_LEARNER);
return mapping.findForward(McAppConstants.LOAD_LEARNER);
}
List selectedQuestionAndCandidateAnswersDTO = buildSelectedQuestionAndCandidateAnswersDTO(learnerInput,
mcTempDataHolderDTO, mcService, mcContent);
- McLearningAction.logger.debug("selectedQuestionAndCandidateAnswersDTO: "
- + selectedQuestionAndCandidateAnswersDTO);
request.setAttribute(McAppConstants.LIST_SELECTED_QUESTION_CANDIDATEANSWERS_DTO,
selectedQuestionAndCandidateAnswersDTO);
- McLearningAction.logger.debug("LIST_SELECTED_QUESTION_CANDIDATEANSWERS_DTO: "
- + request.getAttribute(McAppConstants.LIST_SELECTED_QUESTION_CANDIDATEANSWERS_DTO));
- McLearningAction.logger.debug("mcTempDataHolderDTO becomes: " + mcTempDataHolderDTO);
-
mcGeneralLearnerFlowDTO.setQuestionListingMode(McAppConstants.QUESTION_LISTING_MODE_COMBINED);
Integer learnerMark = mcTempDataHolderDTO.getLearnerMark();
@@ -727,46 +549,35 @@
request.getSession().setAttribute(httpSessionID, sessionMap);
Long toolSessionUid = mcSession.getUid();
- McLearningAction.logger.debug("toolSessionUid: " + toolSessionUid);
boolean isUserDefined = false;
String userID = "";
HttpSession ss = SessionManager.getSession();
- McLearningAction.logger.debug("ss: " + ss);
if (ss != null) {
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
if (user != null && user.getUserID() != null) {
userID = user.getUserID().toString();
- McLearningAction.logger.debug("retrieved userId: " + userID);
}
}
- McLearningAction.logger.debug("userID: " + userID);
McQueUsr existingMcQueUsr = mcService.getMcUserBySession(new Long(userID), mcSession.getUid());
- McLearningAction.logger.debug("existingMcQueUsr: " + existingMcQueUsr);
if (existingMcQueUsr != null) {
isUserDefined = true;
}
- McLearningAction.logger.debug("isUserDefined: " + isUserDefined);
McQueUsr mcQueUsr = null;
if (isUserDefined == false) {
mcQueUsr = LearningUtil.createUser(request, mcService, new Long(toolSessionID));
- McLearningAction.logger.debug("created user in the db: " + mcQueUsr);
} else {
mcQueUsr = existingMcQueUsr;
- McLearningAction.logger.debug("assign");
}
- McLearningAction.logger.debug("final mcQueUsr: " + mcQueUsr);
-
Integer currentHighestAttemptOrder = mcQueUsr.getLastAttemptOrder();
int newHighestAttempOrder = currentHighestAttemptOrder != null ? currentHighestAttemptOrder.intValue() + 1 : 1;
- McLearningAction.logger.debug("newHighestAttempOrder: " + newHighestAttempOrder);
// Have to work out in advance if passed so that we can store it against the attempts
boolean passed = mcQueUsr.isMarkPassed(learnerMark);
@@ -775,16 +586,13 @@
LearningUtil.createLearnerAttempt(request, mcQueUsr, selectedQuestionAndCandidateAnswersDTO, passed,
newHighestAttempOrder, null, mcService);
- McLearningAction.logger.debug("created user attempt in the db");
mcQueUsr.setLastAttemptOrder(newHighestAttempOrder);
mcQueUsr.setLastAttemptTotalMark(learnerMark);
mcService.updateMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("displayAnswers: " + mcContent.isDisplayAnswers());
mcGeneralLearnerFlowDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString());
- McLearningAction.logger.debug("showMarks: " + mcContent.isShowMarks());
mcGeneralLearnerFlowDTO.setShowMarks(new Boolean(mcContent.isShowMarks()).toString());
if (mcContent.isShowMarks()) {
Integer[] markStatistics = mcService.getMarkStatistics(mcSession);
@@ -799,65 +607,44 @@
}
Map mapQuestionMarks = LearningUtil.buildMarksMap(request, mcContent.getMcContentId(), mcService);
- McLearningAction.logger.debug("mapQuestionMarks:" + mapQuestionMarks);
- McLearningAction.logger.debug("user over passmark:" + mcGeneralLearnerFlowDTO.getUserOverPassMark());
- McLearningAction.logger.debug("is passmark applicable:" + mcGeneralLearnerFlowDTO.getPassMarkApplicable());
-
- McLearningAction.logger.debug("is tool reflective: " + mcContent.isReflect());
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
- McLearningAction.logger.debug("reflection subject: " + mcContent.getReflectionSubject());
String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject);
mcGeneralLearnerFlowDTO.setLatestAttemptMark(mcQueUsr.getLastAttemptTotalMark());
- McLearningAction.logger.debug("mcGeneralLearnerFlowDTO for jsp: " + mcGeneralLearnerFlowDTO);
-
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- McLearningAction.logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: "
- + request.getAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO));
return mapping.findForward(McAppConstants.INDIVIDUAL_REPORT);
}
public boolean allQuestionsChecked(IMcService mcService, List learnerInput, McContent mcContent,
McTempDataHolderDTO mcTempDataHolderDTO) {
- McLearningAction.logger.debug("starting allQuestionsChecked learnerInput: " + learnerInput);
boolean questionSelected = false;
Iterator listIterator = mcContent.getMcQueContents().iterator();
while (listIterator.hasNext()) {
McQueContent mcQueContent = (McQueContent) listIterator.next();
String uid = mcQueContent.getUid().toString();
- McLearningAction.logger.debug("using uid: " + uid);
questionSelected = false;
Iterator learnerInputIterator = learnerInput.iterator();
while (learnerInputIterator.hasNext() && !questionSelected) {
String learnerInputLine = (String) learnerInputIterator.next();
- McLearningAction.logger.debug("using learnerInputLine: " + learnerInputLine);
int sepIndex = learnerInputLine.indexOf("-");
- McLearningAction.logger.debug("having sepIndex: " + sepIndex);
String selectedUid = learnerInputLine.substring(0, sepIndex);
- McLearningAction.logger.debug("selectedUid: " + selectedUid);
if (uid.equals(selectedUid)) {
- McLearningAction.logger.debug("equal uids found: " + selectedUid);
questionSelected = true;
}
}
- McLearningAction.logger.debug("iterated loop questionSelected: " + questionSelected);
if (questionSelected == false) {
- if (LamsDispatchAction.log.isDebugEnabled()) {
- McLearningAction.logger.debug("Question not selected by user mcQueContent :" + mcQueContent);
- McLearningAction.logger.debug("mcQueContent displayorder:" + mcQueContent.getDisplayOrder());
- }
mcTempDataHolderDTO.setDisplayOrder(mcQueContent.getDisplayOrder());
return false;
}
@@ -880,91 +667,65 @@
*/
public ActionForward getNextOptions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McLearningAction.logger.debug("dispatching getNextOptions...");
McLearningForm mcLearningForm = (McLearningForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McLearningAction.logger.debug("mcService: " + mcService);
String questionIndex = mcLearningForm.getQuestionIndex();
- McLearningAction.logger.debug("questionIndex: " + questionIndex);
String httpSessionID = mcLearningForm.getHttpSessionID();
- McLearningAction.logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID);
- McLearningAction.logger.debug("sessionMap: " + sessionMap);
List sequentialCheckedCa = (List) sessionMap.get(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY);
- McLearningAction.logger.debug("pre sequentialCheckedCa: " + sequentialCheckedCa);
Iterator sequentialCheckedCaIterator = sequentialCheckedCa.iterator();
while (sequentialCheckedCaIterator.hasNext()) {
String input = (String) sequentialCheckedCaIterator.next();
- McLearningAction.logger.debug("input: " + input);
}
/* checkedCa refers to candidate answers */
String[] checkedCa = mcLearningForm.getCheckedCa();
- McLearningAction.logger.debug("checkedCa: " + checkedCa);
if (checkedCa != null) {
mcLearningForm.resetCa(mapping, request);
for (int i = 0; i < checkedCa.length; i++) {
String currentCa = checkedCa[i];
- McLearningAction.logger.debug("currentCa: " + currentCa);
sequentialCheckedCa.add(currentCa);
}
}
- McLearningAction.logger.debug("post sequentialCheckedCa: " + sequentialCheckedCa);
sequentialCheckedCaIterator = sequentialCheckedCa.iterator();
while (sequentialCheckedCaIterator.hasNext()) {
String input = (String) sequentialCheckedCaIterator.next();
- McLearningAction.logger.debug("input: " + input);
}
sessionMap.put(McAppConstants.QUESTION_AND_CANDIDATE_ANSWERS_KEY, sequentialCheckedCa);
request.getSession().setAttribute(httpSessionID, sessionMap);
- McLearningAction.logger.debug("updated sessionMap : " + sessionMap);
-
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- McLearningAction.logger.debug("toolContentId: " + toolContentId);
McContent mcContent = mcService.retrieveMc(new Long(toolContentId));
- McLearningAction.logger.debug("mcContent: " + mcContent);
boolean randomize = mcContent.isRandomize();
- McLearningAction.logger.debug("randomize: " + randomize);
List listQuestionAndCandidateAnswersDTO = LearningUtil.buildQuestionAndCandidateAnswersDTO(request, mcContent,
randomize, mcService);
- McLearningAction.logger.debug("listQuestionAndCandidateAnswersDTO: " + listQuestionAndCandidateAnswersDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO, listQuestionAndCandidateAnswersDTO);
- McLearningAction.logger.debug("LIST_QUESTION_CANDIDATEANSWERS_DTO: "
- + request.getAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO));
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
Integer totalQuestionCount = mcGeneralLearnerFlowDTO.getTotalQuestionCount();
Integer intQuestionIndex = new Integer(questionIndex);
- McLearningAction.logger.debug("intTotalQuestionCount versus intCurrentQuestionIndex: " + totalQuestionCount
- + " versus " + intQuestionIndex);
if (totalQuestionCount.equals(intQuestionIndex)) {
- McLearningAction.logger.debug("totalQuestionCount has been reached :" + totalQuestionCount);
mcGeneralLearnerFlowDTO.setTotalCountReached(new Boolean(true).toString());
}
- McLearningAction.logger.debug("is tool reflective: " + mcContent.isReflect());
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
- McLearningAction.logger.debug("reflection subject: " + mcContent.getReflectionSubject());
String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject);
@@ -973,7 +734,6 @@
mcGeneralLearnerFlowDTO.setTotalMarksPossible(mcContent.getTotalMarksPossible());
- McLearningAction.logger.debug("mcGeneralLearnerFlowDTO for jsp: " + mcGeneralLearnerFlowDTO);
mcGeneralLearnerFlowDTO.setQuestionIndex(new Integer(questionIndex));
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
@@ -996,39 +756,28 @@
*/
public ActionForward redoQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
- McLearningAction.logger.debug("dispatching redoQuestions...");
McLearningForm mcLearningForm = (McLearningForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- McLearningAction.logger.debug("toolContentId: " + toolContentId);
-
McContent mcContent = mcService.retrieveMc(new Long(toolContentId));
- McLearningAction.logger.debug("mcContent: " + mcContent);
boolean randomize = mcContent.isRandomize();
- McLearningAction.logger.debug("randomize: " + randomize);
List listQuestionAndCandidateAnswersDTO = LearningUtil.buildQuestionAndCandidateAnswersDTO(request, mcContent,
randomize, mcService);
- McLearningAction.logger.debug("listQuestionAndCandidateAnswersDTO: " + listQuestionAndCandidateAnswersDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO, listQuestionAndCandidateAnswersDTO);
- McLearningAction.logger.debug("LIST_QUESTION_CANDIDATEANSWERS_DTO: "
- + request.getAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO));
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
mcGeneralLearnerFlowDTO.setCurrentQuestionIndex(new Integer(1));
mcGeneralLearnerFlowDTO.setTotalCountReached(new Boolean(false).toString());
/* use existing session to extract PASSMARK_APPLICABLE and USER_OVER_PASSMARK */
String httpSessionID = mcLearningForm.getHttpSessionID();
- McLearningAction.logger.debug("httpSessionID: " + httpSessionID);
/* create a new session */
SessionMap sessionMap = new SessionMap();
@@ -1039,18 +788,15 @@
String userID = "";
HttpSession ss = SessionManager.getSession();
- McLearningAction.logger.debug("ss: " + ss);
if (ss != null) {
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
if (user != null && user.getUserID() != null) {
userID = user.getUserID().toString();
- McLearningAction.logger.debug("retrieved userId: " + userID);
}
}
McQueUsr mcQueUsr = mcService.getMcUserBySession(new Long(userID), mcSession.getUid());
- McLearningAction.logger.debug("mcQueUsr: " + mcQueUsr);
mcGeneralLearnerFlowDTO.setLatestAttemptMark(mcQueUsr.getLastAttemptTotalMark());
@@ -1073,10 +819,6 @@
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- if (McLearningAction.logger.isDebugEnabled()) {
- McLearningAction.logger.debug("mcGeneralLearnerFlowDTO for jsp: " + mcGeneralLearnerFlowDTO);
- }
-
LearningWebUtil.putActivityPositionInRequestByToolSessionId(new Long(toolSessionID), request, getServlet()
.getServletContext());
@@ -1187,9 +929,6 @@
}
/**
- *
- * viewAnswers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* allows the learner to view their answer history
*
* @param request
@@ -1205,73 +944,55 @@
}
/**
- * setContentInUse(HttpServletRequest request, String toolContentId, IMcService mcService)
- *
* indicates that some learners are using the content
*
* @param request
* @param toolContentId
* @param mcService
*/
protected void setContentInUse(HttpServletRequest request, String toolContentId, IMcService mcService) {
- McLearningAction.logger.debug("starting setContentInUse");
- McLearningAction.logger.debug("toolContentId:" + toolContentId);
McContent mcContent = mcService.retrieveMc(new Long(toolContentId));
- McLearningAction.logger.debug("mcContent:" + mcContent);
mcContent.setContentInUse(true);
- McLearningAction.logger.debug("content has been set to inuse");
mcService.saveMcContent(mcContent);
}
/**
- * redoQuestions(HttpServletRequest request, McLearningForm mcLearningForm, ActionMapping mapping)
*
+ *
* @param request
* @param mcLearningForm
* @param mapping
* @return
*/
public ActionForward redoQuestions(HttpServletRequest request, McLearningForm mcLearningForm, ActionMapping mapping) {
- McLearningAction.logger.debug("requested redoQuestions...");
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
/* reset the checked options MAP */
Map mapGeneralCheckedOptionsContent = new TreeMap(new McComparator());
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
String toolContentId = mcSession.getMcContent().getMcContentId().toString();
- McLearningAction.logger.debug("toolContentId: " + toolContentId);
McContent mcContent = mcService.retrieveMc(new Long(toolContentId));
- McLearningAction.logger.debug("mcContent: " + mcContent);
boolean randomize = mcContent.isRandomize();
- McLearningAction.logger.debug("randomize: " + randomize);
List listQuestionAndCandidateAnswersDTO = LearningUtil
.buildQuestionAndCandidateAnswersDTO(request, mcContent, randomize, mcService);
- McLearningAction.logger.debug("listQuestionAndCandidateAnswersDTO: " + listQuestionAndCandidateAnswersDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO, listQuestionAndCandidateAnswersDTO);
- McLearningAction.logger.debug("LIST_QUESTION_CANDIDATEANSWERS_DTO: "
- + request.getAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO));
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
mcGeneralLearnerFlowDTO.setQuestionIndex(new Integer(1));
- McLearningAction.logger.debug("is tool reflective: " + mcContent.isReflect());
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
- McLearningAction.logger.debug("reflection subject: " + mcContent.getReflectionSubject());
String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject);
- McLearningAction.logger.debug("mcContent.isRetries(): " + mcContent.isRetries());
mcGeneralLearnerFlowDTO.setRetries(new Boolean(mcContent.isRetries()).toString());
String passMarkApplicable = new Boolean(mcContent.isPassMarkApplicable()).toString();
@@ -1289,12 +1010,7 @@
Boolean showMarks = LearningUtil.isShowMarksOnQuestion(listQuestionAndCandidateAnswersDTO);
mcGeneralLearnerFlowDTO.setShowMarks(showMarks.toString());
- McLearningAction.logger.debug("mcGeneralLearnerFlowDTO for jsp: " + mcGeneralLearnerFlowDTO);
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- McLearningAction.logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: "
- + request.getAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO));
-
- McLearningAction.logger.debug("fwding to LOAD_LEARNER: " + McAppConstants.LOAD_LEARNER);
return mapping.findForward(McAppConstants.LOAD_LEARNER);
}
@@ -1307,7 +1023,6 @@
public void persistError(HttpServletRequest request, String message) {
ActionMessages errors = new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- McLearningAction.logger.debug("add " + message + " to ActionMessages:");
saveErrors(request, errors);
}
@@ -1326,71 +1041,41 @@
*/
public ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException, ToolException {
- McLearningAction.logger.debug("dispatching submitReflection...");
McLearningForm mcLearningForm = (McLearningForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McLearningAction.logger.debug("mcService: " + mcService);
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
mcLearningForm.setToolSessionID(toolSessionID);
String userID = request.getParameter("userID");
- McLearningAction.logger.debug("userID: " + userID);
mcLearningForm.setUserID(userID);
String reflectionEntry = request.getParameter(McAppConstants.ENTRY_TEXT);
- McLearningAction.logger.debug("reflectionEntry: " + reflectionEntry);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
McQueUsr mcQueUsr = mcService.getMcUserBySession(new Long(userID), mcSession.getUid());
- McLearningAction.logger.debug("McQueUsr:" + mcQueUsr);
/* it is possible that mcQueUsr can be null if the content is set as runoffline and reflection is on */
if (mcQueUsr == null) {
- McLearningAction.logger
- .debug("attempt creating user record since it must exist for the runOffline + reflection screens");
+ //attempt creating user record since it must exist for the runOffline + reflection screens
HttpSession ss = SessionManager.getSession();
UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER);
- McLearningAction.logger.debug("retrieving toolUser: " + toolUser);
- McLearningAction.logger.debug("retrieving toolUser userId: " + toolUser.getUserID());
- McLearningAction.logger.debug("retrieving toolUser username: " + toolUser.getLogin());
String userName = toolUser.getLogin();
String fullName = toolUser.getFirstName() + " " + toolUser.getLastName();
- McLearningAction.logger.debug("retrieving toolUser fullname: " + fullName);
Long userId = new Long(toolUser.getUserID().longValue());
- McLearningAction.logger.debug("userId: " + userId);
- McLearningAction.logger.debug("retrieving toolUser fullname: " + fullName);
mcQueUsr = new McQueUsr(userId, userName, fullName, mcSession, new TreeSet());
mcService.createMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("createMcQueUsr - mcQueUsr: " + mcQueUsr);
-
- McLearningAction.logger.debug("session uid: " + mcSession.getUid());
- McLearningAction.logger.debug("mcQueUsr: " + mcQueUsr);
mcService.createMcQueUsr(mcQueUsr);
- McLearningAction.logger.debug("created mcQueUsr in the db: " + mcQueUsr);
}
-
- McLearningAction.logger.debug("McQueUsr:" + mcQueUsr);
- McLearningAction.logger.debug("toolSessionID:" + toolSessionID);
- McLearningAction.logger.debug("CoreNotebookConstants.NOTEBOOK_TOOL:" + CoreNotebookConstants.NOTEBOOK_TOOL);
- McLearningAction.logger.debug("MY_SIGNATURE:" + McAppConstants.MY_SIGNATURE);
- McLearningAction.logger.debug("userID:" + userID);
- McLearningAction.logger.debug("reflectionEntry:" + reflectionEntry);
-
- McLearningAction.logger.debug("attempt getting notebookEntry: ");
NotebookEntry notebookEntry = mcService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL,
McAppConstants.MY_SIGNATURE, new Integer(userID));
- McLearningAction.logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
notebookEntry.setEntry(reflectionEntry);
mcService.updateEntry(notebookEntry);
@@ -1403,9 +1088,8 @@
}
/**
- * forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
- * response)
*
+ *
* @param mapping
* @param form
* @param request
@@ -1417,19 +1101,14 @@
*/
public ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException, ToolException {
- McLearningAction.logger.debug("dispatching forwardtoReflection...");
McLearningForm mcLearningForm = (McLearningForm) form;
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- McLearningAction.logger.debug("mcService: " + mcService);
String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID);
- McLearningAction.logger.debug("toolSessionID: " + toolSessionID);
McSession mcSession = mcService.retrieveMcSession(new Long(toolSessionID));
- McLearningAction.logger.debug("retrieving mcSession: " + mcSession);
McContent mcContent = mcSession.getMcContent();
- McLearningAction.logger.debug("using mcContent: " + mcContent);
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = new McGeneralLearnerFlowDTO();
mcGeneralLearnerFlowDTO.setActivityTitle(mcContent.getTitle());
@@ -1440,32 +1119,26 @@
String userID = "";
HttpSession ss = SessionManager.getSession();
- McLearningAction.logger.debug("ss: " + ss);
if (ss != null) {
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
if (user != null && user.getUserID() != null) {
userID = user.getUserID().toString();
- McLearningAction.logger.debug("retrieved userId: " + userID);
}
}
- McLearningAction.logger.debug("attempt getting notebookEntry: ");
+ //attempt getting notebookEntry
NotebookEntry notebookEntry = mcService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL,
McAppConstants.MY_SIGNATURE, new Integer(userID));
- McLearningAction.logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
String notebookEntryPresentable = notebookEntry.getEntry();
mcLearningForm.setEntryText(notebookEntryPresentable);
}
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- McLearningAction.logger.debug("final mcGeneralLearnerFlowDTO: " + mcGeneralLearnerFlowDTO);
- McLearningAction.logger.debug("fwd'ing to: " + McAppConstants.NOTEBOOK);
return mapping.findForward(McAppConstants.NOTEBOOK);
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java
===================================================================
diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningStarterAction.java (.../McLearningStarterAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -67,39 +67,6 @@
*
* @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.
- *
listQuestionAndCandidateAnswersDTO = LearningUtil
.buildQuestionAndCandidateAnswersDTO(request, mcContent, randomize, mcService);
- McLearningStarterAction.logger.debug("listQuestionAndCandidateAnswersDTO: "
- + listQuestionAndCandidateAnswersDTO);
request.setAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO, listQuestionAndCandidateAnswersDTO);
- McLearningStarterAction.logger.debug("LIST_QUESTION_CANDIDATEANSWERS_DTO: "
- + request.getAttribute(McAppConstants.LIST_QUESTION_CANDIDATEANSWERS_DTO));
-
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO = LearningUtil.buildMcGeneralLearnerFlowDTO(mcContent);
mcGeneralLearnerFlowDTO.setTotalCountReached(new Boolean(false).toString());
mcGeneralLearnerFlowDTO.setQuestionIndex(new Integer(1));
@@ -418,32 +377,20 @@
Boolean displayAnswers = mcContent.isDisplayAnswers();
mcGeneralLearnerFlowDTO.setDisplayAnswers(displayAnswers.toString());
- McLearningStarterAction.logger.debug("MCQ displayAnswers: " + mcGeneralLearnerFlowDTO.getDisplayAnswers());
-
- McLearningStarterAction.logger.debug("is tool reflective: " + mcContent.isReflect());
mcGeneralLearnerFlowDTO.setReflection(new Boolean(mcContent.isReflect()).toString());
- McLearningStarterAction.logger.debug("reflection subject: " + mcContent.getReflectionSubject());
-
String reflectionSubject = McUtils.replaceNewLines(mcContent.getReflectionSubject());
mcGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject);
String userID = mcLearningForm.getUserID();
- McLearningStarterAction.logger.debug("userID: " + userID);
-
- McLearningStarterAction.logger.debug("attempt getting notebookEntry: ");
NotebookEntry notebookEntry = mcService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL,
McAppConstants.MY_SIGNATURE, new Integer(userID));
- McLearningStarterAction.logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
String notebookEntryPresentable = McUtils.replaceNewLines(notebookEntry.getEntry());
mcGeneralLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
}
request.setAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
- McLearningStarterAction.logger.debug("MC_GENERAL_LEARNER_FLOW_DTO: "
- + request.getAttribute(McAppConstants.MC_GENERAL_LEARNER_FLOW_DTO));
}
protected ActionForward validateParameters(HttpServletRequest request, McLearningForm mcLearningForm,
@@ -454,13 +401,11 @@
String userID = "";
HttpSession ss = SessionManager.getSession();
- McLearningStarterAction.logger.debug("ss: " + ss);
if (ss != null) {
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
if ((user != null) && (user.getUserID() != null)) {
userID = user.getUserID().toString();
- McLearningStarterAction.logger.debug("retrieved userId: " + userID);
}
}
@@ -476,15 +421,13 @@
} else {
try {
toolSessionId = new Long(strToolSessionId).longValue();
- McLearningStarterAction.logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId));
} catch (NumberFormatException e) {
McLearningStarterAction.logger.error("error.sessionId.numberFormatException");
}
}
/*mode can be learner, teacher or author */
String mode = request.getParameter(McAppConstants.MODE);
- McLearningStarterAction.logger.debug("mode: " + mode);
if ((mode == null) || (mode.length() == 0)) {
McLearningStarterAction.logger.error("error.mode.required");
@@ -493,7 +436,6 @@
if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author"))) {
McLearningStarterAction.logger.error("error.mode.invalid");
}
- McLearningStarterAction.logger.debug("session LEARNING_MODE set to:" + mode);
return null;
}
@@ -507,7 +449,6 @@
public void persistError(HttpServletRequest request, String message) {
ActionMessages errors = new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- McLearningStarterAction.logger.debug("add " + message + " to ActionMessages:");
saveErrors(request, errors);
}
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java
===================================================================
diff -u -r941922b2ef901dad643b18f6a349b156b5a822ea -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 941922b2ef901dad643b18f6a349b156b5a822ea)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -85,19 +85,6 @@
/**
* * @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 McMonitoringAction extends LamsDispatchAction implements McAppConstants
{
- static Logger logger = Logger.getLogger(McMonitoringAction.class.getName());
+ static Logger logger= Logger.getLogger(McMonitoringAction.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 McApplicationException the known runtime exception
- *
- * unspecified(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) throws IOException,
- ServletException
-
* main content/question content management and workflow logic
*
*/
@@ -187,7 +149,6 @@
HttpServletResponse response) throws IOException,
ServletException
{
- logger.debug("dispatching unspecified...");
return null;
}
@@ -203,31 +164,26 @@
protected ActionForward commonSubmitSessionCode(McMonitoringForm mcMonitoringForm, HttpServletRequest request, ActionMapping mapping,
IMcService mcService, McGeneralMonitoringDTO mcGeneralMonitoringDTO) throws IOException, ServletException
{
- logger.debug("starting commonSubmitSessionCode...mcGeneralMonitoringDTO:" + mcGeneralMonitoringDTO);
repopulateRequestParameters(request, mcMonitoringForm, mcGeneralMonitoringDTO);
- logger.debug("done repopulateRequestParameters");
String currentMonitoredToolSession=request.getParameter("monitoredToolSessionId");
- logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
if (currentMonitoredToolSession == null)
{
- logger.debug("default to All");
+ //default to All
currentMonitoredToolSession="All";
}
String toolContentID =mcMonitoringForm.getToolContentID();
- logger.debug("toolContentID: " + toolContentID);
McContent mcContent=mcService.retrieveMc(new Long(toolContentID));
- logger.debug("existing mcContent:" + mcContent);
if (currentMonitoredToolSession.equals("All"))
{
List listMcAllSessionsDTO = new LinkedList();
- logger.debug("generate DTO for All sessions: ");
+ //generate DTO for All sessions
MonitoringUtil.setupAllSessionsData(request, mcContent, mcService);
mcGeneralMonitoringDTO.setSelectionCase(new Long(2));
@@ -236,19 +192,14 @@
else
{
McSession mcSession=mcService.retrieveMcSession(new Long(currentMonitoredToolSession));
- logger.debug("mcSession uid:" + mcSession.getUid());
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("session_name: " + mcSession.getSession_name());
mcGeneralMonitoringDTO.setGroupName(mcSession.getSession_name());
mcGeneralMonitoringDTO.setSelectionCase(new Long(1));
request.setAttribute(SELECTION_CASE, new Long(1));
}
- logger.debug("SELECTION_CASE: " + mcGeneralMonitoringDTO.getSelectionCase());
-
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession);
@@ -258,7 +209,6 @@
mcGeneralMonitoringDTO.setSummaryToolSessions(populateToolSessions(mcContent));
mcGeneralMonitoringDTO.setDisplayAnswers(new Boolean(mcContent.isDisplayAnswers()).toString());
- logger.debug("existing mcContent:" + mcContent);
boolean isGroupedActivity = mcService.isGroupedActivity(new Long(toolContentID));
request.setAttribute("isGroupedActivity", isGroupedActivity);
@@ -271,45 +221,39 @@
Map mapOptionsContent= new TreeMap(new McComparator());
Iterator queIterator=mcContent.getMcQueContents().iterator();
Long mapIndex=new Long(1);
- logger.debug("mapOptionsContent: " + mapOptionsContent);
while (queIterator.hasNext())
{
McQueContent mcQueContent=(McQueContent) queIterator.next();
if (mcQueContent != null)
{
- logger.debug("question: " + mcQueContent.getQuestion());
mapOptionsContent.put(mapIndex.toString(),mcQueContent.getQuestion());
mapIndex=new Long(mapIndex.longValue()+1);
}
}
- logger.debug("mapOptionsContent: " + mapOptionsContent);
int maxIndex=mapOptionsContent.size();
- logger.debug("maxIndex: " + maxIndex);
boolean isContentInUse=McUtils.isContentInUse(mcContent);
- logger.debug("isContentInUse:" + isContentInUse);
mcGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString());
if (isContentInUse == true)
{
- logger.debug("monitoring url does not allow editActivity since the content is in use.");
+ //monitoring url does not allow editActivity since the content is in use
mcGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString());
}
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
prepareReflectionData(request, mcContent, mcService, null, false, "All");
if (mcService.studentActivityOccurredGlobal(mcContent))
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
+ //USER_EXCEPTION_NO_TOOL_SESSIONS is set to false
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
}
else
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
+ //USER_EXCEPTION_NO_TOOL_SESSIONS is set to true
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
}
@@ -318,17 +262,14 @@
mcGeneralMonitoringDTO.setOfflineInstructions(mcContent.getOfflineInstructions());
List attachmentList = mcService.retrieveMcUploadedFiles(mcContent);
- logger.debug("attachmentList: " + attachmentList);
mcGeneralMonitoringDTO.setAttachmentList(attachmentList);
mcGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList());
/** ...till here **/
- logger.debug("end of commonSubmitSessionCode, mcGeneralMonitoringDTO: " + mcGeneralMonitoringDTO);
request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO);
EditActivityDTO editActivityDTO = new EditActivityDTO();
- logger.debug("isContentInUse:" + isContentInUse);
if (isContentInUse == true)
{
editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
@@ -338,18 +279,16 @@
/*find out if there are any reflection entries, from here*/
boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(mcService, mcContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
if (notebookEntriesExist)
{
request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
String userExceptionNoToolSessions=(String)mcGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions);
if (userExceptionNoToolSessions.equals("true"))
{
- logger.debug("there are no online student activity but there are reflections : ");
+ //there are no online student activity but there are reflections
request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
}
@@ -362,16 +301,7 @@
MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
-
- logger.debug("dumping jsp controllers: ");
- logger.debug("dumping jsp controlllers, mcGeneralMonitoringDTO, mcGeneralMonitoringDTO.getIsMonitoredContentInUse():" + mcGeneralMonitoringDTO.getIsMonitoredContentInUse());
- logger.debug("dumping jsp controlllers, mcGeneralMonitoringDTO, mcGeneralMonitoringDTO.getUserExceptionNoToolSessions():" + mcGeneralMonitoringDTO.getUserExceptionNoToolSessions());
- logger.debug("dumping jsp controlllers, mcGeneralMonitoringDTO, mcGeneralMonitoringDTO.getCurrentMonitoredToolSession():" + mcGeneralMonitoringDTO.getCurrentMonitoredToolSession());
- logger.debug("dumping jsp controlllers, mcGeneralMonitoringDTO, mcGeneralMonitoringDTO.getSelectionCase(): " + mcGeneralMonitoringDTO.getSelectionCase());
-
- logger.debug("dumping request level controlllers, REQUEST selectionCase: " + request.getAttribute(SELECTION_CASE));
-
return (mapping.findForward(LOAD_MONITORING_CONTENT));
}
@@ -398,18 +328,12 @@
sessionsMap.put("All" , "All");
}
- if ( logger.isDebugEnabled() )
- logger.debug("final sessionsMap:" + sessionsMap);
return sessionsMap;
}
/**
- * ActionForward submitSession(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response)
*
* submitSession
*
@@ -427,21 +351,14 @@
HttpServletResponse response)
throws IOException,ServletException
{
- logger.debug("dispatching submitSession..");
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
mcContent.setDisplayAnswers(new Boolean(true));
- logger.debug("mcContent: " + mcContent);
return commonSubmitSessionCode((McMonitoringForm) form, request, mapping, mcService, new McGeneralMonitoringDTO() );
}
/**
- * ActionForward displayAnswers(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response)
- *
* displayAnswers
*
* @param mapping
@@ -458,12 +375,10 @@
HttpServletResponse response)
throws IOException,ServletException
{
- logger.debug("dispatching displayAnswers..");
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
mcContent.setDisplayAnswers(new Boolean(true));
- logger.debug("mcContent: " + mcContent);
return commonSubmitSessionCode((McMonitoringForm) form, request, mapping, mcService, new McGeneralMonitoringDTO() );
}
@@ -490,71 +405,51 @@
ServletException,
ToolException
{
- logger.debug("dispatching editActivityQuestions...");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
- logger.debug("mcAuthoringForm: " + mcAuthoringForm);
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
-
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();
//String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR);
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
-
- logger.debug("title: " + mcContent.getTitle());
- logger.debug("instructions: " + mcContent.getInstructions());
-
mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle());
mcAuthoringForm.setTitle(mcContent.getTitle());
mcGeneralAuthoringDTO.setActivityInstructions(mcContent.getInstructions());
/* determine whether the request is from Monitoring url Edit Activity*/
String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER);
- logger.debug("sourceMcStarter: " + sourceMcStarter);
mcAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString());
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
boolean isContentInUse=McUtils.isContentInUse(mcContent);
- logger.debug("isContentInUse:" + isContentInUse);
mcGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(false).toString());
if (isContentInUse == true)
{
- logger.debug("monitoring url does not allow editActivity since the content is in use.");
+ //monitoring url does not allow editActivity since the content is in use
persistError(request,"error.content.inUse");
mcGeneralAuthoringDTO.setMonitoredContentInUse(new Boolean(true).toString());
}
EditActivityDTO editActivityDTO = new EditActivityDTO();
- logger.debug("isContentInUse:" + isContentInUse);
if (isContentInUse == true)
{
editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString());
@@ -578,27 +473,21 @@
AuthoringUtil authoringUtil= new AuthoringUtil();
List listQuestionContentDTO=authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
request.getSession().setAttribute(httpSessionID, sessionMap);
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- logger.debug("before fwding to jsp, mcAuthoringForm: " + mcAuthoringForm);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
@@ -609,12 +498,10 @@
if (mcService.studentActivityOccurredGlobal(mcContent))
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
}
else
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
}
@@ -623,30 +510,26 @@
mcGeneralMonitoringDTO.setOfflineInstructions(mcContent.getOfflineInstructions());
List attachmentList = mcService.retrieveMcUploadedFiles(mcContent);
- logger.debug("attachmentList: " + attachmentList);
mcGeneralMonitoringDTO.setAttachmentList(attachmentList);
mcGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- logger.debug("end of refreshSummaryData, mcGeneralMonitoringDTO" + mcGeneralMonitoringDTO);
request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO);
/*.. till here*/
/*find out if there are any reflection entries, from here*/
boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(mcService, mcContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
if (notebookEntriesExist)
{
request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
String userExceptionNoToolSessions=(String)mcGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug(": " + userExceptionNoToolSessions);
if (userExceptionNoToolSessions.equals("true"))
{
- logger.debug("there are no online student activity but there are reflections : ");
+ //there are no online student activity but there are reflections
request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
}
@@ -661,14 +544,12 @@
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("forwarding to LOAD_MONITORING_CONTENT: " + LOAD_MONITORING_CONTENT);
return mapping.findForward(LOAD_MONITORING_CONTENT);
}
/**
- * persistError(HttpServletRequest request, String message)
* persists error messages to request scope
* @param request
* @param message
@@ -677,7 +558,6 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
@@ -687,9 +567,6 @@
/**
*
- * ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
-
submits content into the tool database
*
* @param mapping
@@ -703,95 +580,70 @@
public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispathcing submitAllContent :" +form);
-
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
Map mapQuestionContent=AuthoringUtil.extractMapQuestionContent(listQuestionContentDTO);
- logger.debug("extracted mapQuestionContent: " + mapQuestionContent);
Map mapFeedback=AuthoringUtil.extractMapFeedback(listQuestionContentDTO);
- logger.debug("extracted mapFeedback: " + mapFeedback);
Map mapWeights=new TreeMap(new McComparator());
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
Map mapMarks=AuthoringUtil.extractMapMarks(listQuestionContentDTO);
- logger.debug("extracted mapMarks: " + mapMarks);
Map mapCandidatesList=AuthoringUtil.extractMapCandidatesList(listQuestionContentDTO);
- logger.debug("extracted mapCandidatesList: " + mapCandidatesList);
-
ActionMessages errors = new ActionMessages();
- logger.debug("mapQuestionContent size: " + mapQuestionContent.size());
if (mapQuestionContent.size() == 0)
{
ActionMessage error = new ActionMessage("questions.none.submitted");
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
- logger.debug("errors: " + errors);
AuthoringUtil authoringUtil= new AuthoringUtil();
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("activeModule: " + activeModule);
if (activeModule.equals(AUTHORING))
{
List attachmentListBackup= new ArrayList();
List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY);
- logger.debug("attachmentList: " + attachmentList);
attachmentListBackup=attachmentList;
List deletedAttachmentListBackup= new ArrayList();
List deletedAttachmentList=(List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY);
- logger.debug("deletedAttachmentList: " + deletedAttachmentList);
deletedAttachmentListBackup=deletedAttachmentList;
String onlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY);
- logger.debug("onlineInstructions: " + onlineInstructions);
mcGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions);
String offlineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY);
- logger.debug("offlineInstructions: " + offlineInstructions);
mcGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions);
mcGeneralAuthoringDTO.setAttachmentList(attachmentList);
mcGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList);
String strOnlineInstructions= request.getParameter("onlineInstructions");
String strOfflineInstructions= request.getParameter("offlineInstructions");
- logger.debug("onlineInstructions: " + strOnlineInstructions);
- logger.debug("offlineInstructions: " + strOfflineInstructions);
mcAuthoringForm.setOfflineInstructions(strOfflineInstructions);
mcAuthoringForm.setOnlineInstructions(strOnlineInstructions);
@@ -802,9 +654,6 @@
String richTextTitle = request.getParameter(TITLE);
String richTextInstructions = request.getParameter(INSTRUCTIONS);
-
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -815,17 +664,9 @@
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
mcGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
-
- logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
- logger.debug("there are no issues with input, continue and submit data");
McContent mcContentTest=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContentTest: " + mcContentTest);
-
- logger.debug("errors: " + errors);
if(!errors.isEmpty()){
saveErrors(request, errors);
logger.debug("errors saved: " + errors);
@@ -835,50 +676,40 @@
McContent mcContent=mcContentTest;
if(errors.isEmpty()){
- logger.debug("errors is empty: " + errors);
authoringUtil.removeRedundantQuestions(mapQuestionContent, mcService, mcAuthoringForm, request, strToolContentID);
- logger.debug("end of removing unused entries... ");
mcContent=authoringUtil.saveOrUpdateMcContent(mapQuestionContent, mapFeedback, mapWeights,
mapMarks, mapCandidatesList, mcService, mcAuthoringForm, request, mcContentTest, strToolContentID);
- logger.debug("mcContent: " + mcContent);
long defaultContentID=0;
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
defaultContentID=mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
if (mcContent != null)
{
mcGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
}
- logger.debug("updated mcGeneralAuthoringDTO to: " + mcGeneralAuthoringDTO);
authoringUtil.reOrganizeDisplayOrder(mapQuestionContent, mcService, mcAuthoringForm, mcContent);
- logger.debug("post reOrganizeDisplayOrder: " + mcContent);
- logger.debug("strToolContentID: " + strToolContentID);
McUtils.setDefineLater(request, false, strToolContentID, mcService);
- logger.debug("define later set to false");
+ //define later set to false
McUtils.setFormProperties(request, mcService,
mcAuthoringForm, mcGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID);
- logger.debug("go back to view only screen");
+ //go back to view only screen
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
mcGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString());
}
else
{
- logger.debug("errors is not empty: " + errors);
+ //errors is not empty
if (mcContent != null)
{
long defaultContentID=0;
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
defaultContentID=mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
if (mcContent != null)
{
@@ -891,7 +722,6 @@
mcGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
}
}
- logger.debug("end of refreshSummaryData, mcGeneralMonitoringDTO" + mcGeneralMonitoringDTO);
request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO);
@@ -901,12 +731,10 @@
mcGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
@@ -917,19 +745,15 @@
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
@@ -948,12 +772,10 @@
/*common screen data*/
if (mcService.studentActivityOccurredGlobal(mcContent))
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
}
else
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
}
@@ -962,25 +784,22 @@
mcGeneralMonitoringDTO.setOfflineInstructions(mcContent.getOfflineInstructions());
List attachmentList = mcService.retrieveMcUploadedFiles(mcContent);
- logger.debug("attachmentList: " + attachmentList);
mcGeneralMonitoringDTO.setAttachmentList(attachmentList);
mcGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList());
/*find out if there are any reflection entries, from here*/
boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(mcService, mcContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
if (notebookEntriesExist)
{
request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
String userExceptionNoToolSessions=(String)mcGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug(": " + userExceptionNoToolSessions);
if (userExceptionNoToolSessions.equals("true"))
{
- logger.debug("there are no online student activity but there are reflections : ");
+ //there are no online student activity but there are reflections
request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
}
@@ -991,21 +810,16 @@
/* ... till here*/
MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO);
MonitoringUtil.generateGroupsSessionData(request, mcService, mcContent);
- logger.debug("ending setupCommonScreenData, mcContent " + mcContent);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
-
- logger.debug("forwarding to :" + LOAD_MONITORING);
return mapping.findForward(LOAD_MONITORING);
}
/**
*
- * saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* @param mapping
* @param form
* @param request
@@ -1017,60 +831,32 @@
public ActionForward saveSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispathcing saveSingleQuestion");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
-
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
-
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
-
String passmark=request.getParameter("passmark");
- logger.debug("passmark: " + passmark);
-
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
caList=AuthoringUtil.removeBlankEntries(caList);
- logger.debug("caList after removing blank entries: " + caList);
boolean validateSingleCorrectCandidate=authoringUtil.validateSingleCorrectCandidate(caList);
- logger.debug("validateSingleCorrectCandidate: " + validateSingleCorrectCandidate);
boolean validateOnlyOneCorrectCandidate=authoringUtil.validateOnlyOneCorrectCandidate(caList);
- logger.debug("validateOnlyOneCorrectCandidate: " + validateOnlyOneCorrectCandidate);
@@ -1089,68 +875,51 @@
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
- logger.debug("errors: " + errors);
if(!errors.isEmpty()){
saveErrors(request, errors);
logger.debug("errors saved: " + errors);
}
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("entry using mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
mcGeneralAuthoringDTO.setPassMarkValue(passmark);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
if(errors.isEmpty())
{
- logger.debug("errors is empty: " + errors);
-
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
+ //errors is empty
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
String editableQuestionIndex=request.getParameter("editableQuestionIndex");
- logger.debug("editableQuestionIndex: " + editableQuestionIndex);
mcAuthoringForm.setQuestionIndex(editableQuestionIndex);
if ((newQuestion != null) && (newQuestion.length() > 0))
{
if ((editQuestionBoxRequest != null) && (editQuestionBoxRequest.equals("false")))
{
- logger.debug("request for add and save");
boolean duplicates=AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- logger.debug("duplicates: " + duplicates);
-
if (!duplicates)
{
McQuestionContentDTO mcQuestionContentDTO= null;
Iterator listIterator=listQuestionContentDTO.iterator();
while (listIterator.hasNext())
{
mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals("")))
{
@@ -1161,40 +930,34 @@
}
}
- logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
mcQuestionContentDTO.setQuestion(newQuestion);
mcQuestionContentDTO.setFeedback(feedback);
mcQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
mcQuestionContentDTO.setMark(mark);
- logger.debug("caList size:" + mcQuestionContentDTO.getListCandidateAnswersDTO().size());
mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO().size()).toString());
listQuestionContentDTO=AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, mcQuestionContentDTO, editableQuestionIndex);
- logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " + listQuestionContentDTO);
}
else
{
- logger.debug("duplicate question entry, not adding");
+ //duplicate question entry, not adding
}
}
else
{
- logger.debug("request for edit and save.");
+ //request for edit and save
McQuestionContentDTO mcQuestionContentDTO= null;
Iterator listIterator=listQuestionContentDTO.iterator();
while (listIterator.hasNext())
{
mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals("")))
{
@@ -1205,33 +968,28 @@
}
}
- logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
mcQuestionContentDTO.setQuestion(newQuestion);
mcQuestionContentDTO.setFeedback(feedback);
mcQuestionContentDTO.setDisplayOrder(editableQuestionIndex);
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
mcQuestionContentDTO.setMark(mark);
- logger.debug("caList size:" + mcQuestionContentDTO.getListCandidateAnswersDTO().size());
mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO().size()).toString());
listQuestionContentDTO=AuthoringUtil.reorderUpdateListQuestionContentDTO(listQuestionContentDTO, mcQuestionContentDTO, editableQuestionIndex);
- logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " + listQuestionContentDTO);
}
}
else
{
- logger.debug("entry blank, not adding");
+ //entry blank, not adding
}
- logger.debug("entryusing mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
commonSaveCode(request, mcGeneralAuthoringDTO,
mcAuthoringForm, sessionMap, activeModule, strToolContentID,
@@ -1243,54 +1001,43 @@
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("fwd ing to LOAD_MONITORING: " + LOAD_MONITORING);
return (mapping.findForward(LOAD_MONITORING));
}
else
{
- logger.debug("errors is not empty: " + errors);
-
+ //errors is not empty
commonSaveCode(request, mcGeneralAuthoringDTO,
mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID,listQuestionContentDTO);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString());
- logger.debug("forwarding using newEditableQuestionBox");
return newEditableQuestionBox(mapping, form, request, response);
}
}
/**
- * commonSaveCode(HttpServletRequest request, McGeneralAuthoringDTO mcGeneralAuthoringDTO,
- McAuthoringForm mcAuthoringForm, SessionMap sessionMap, String activeModule, String strToolContentID,
- String defaultContentIdStr, IMcService mcService, String httpSessionID, List listQuestionContentDTO)
*
* @param request
* @param mcGeneralAuthoringDTO
@@ -1310,8 +1057,6 @@
String richTextTitle = request.getParameter(TITLE);
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -1345,41 +1090,28 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
-
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
- logger.debug("httpSessionID: " + httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
request.getSession().setAttribute(httpSessionID, sessionMap);
- logger.debug("mcGeneralAuthoringDTO.getMapQuestionContent(); " + mcGeneralAuthoringDTO.getMapQuestionContent());
}
/**
- * addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
*
* @param mapping
* @param form
@@ -1392,92 +1124,49 @@
public ActionForward addSingleQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispathcing addSingleQuestion");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
-
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString());
AuthoringUtil authoringUtil= new AuthoringUtil();
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
List listAddableQuestionContentDTO = (List)sessionMap.get(NEW_ADDABLE_QUESTION_CONTENT_KEY);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
McQuestionContentDTO mcQuestionContentDTONew = null;
int listSize=listQuestionContentDTO.size();
- logger.debug("listSize: " + listSize);
-
- logger.debug("listAddableQuestionContentDTO now: " + listAddableQuestionContentDTO);
request.setAttribute(NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
String passmark=request.getParameter("passmark");
- logger.debug("passmark: " + passmark);
mcGeneralAuthoringDTO.setPassMarkValue(passmark);
-
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
-
caList=AuthoringUtil.removeBlankEntries(caList);
- logger.debug("caList after removing blank entries: " + caList);
-
boolean validateSingleCorrectCandidate=authoringUtil.validateSingleCorrectCandidate(caList);
- logger.debug("validateSingleCorrectCandidate: " + validateSingleCorrectCandidate);
-
-
boolean validateOnlyOneCorrectCandidate=authoringUtil.validateOnlyOneCorrectCandidate(caList);
- logger.debug("validateOnlyOneCorrectCandidate: " + validateOnlyOneCorrectCandidate);
-
-
ActionMessages errors = new ActionMessages();
@@ -1493,21 +1182,17 @@
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
}
- logger.debug("errors: " + errors);
if(!errors.isEmpty()){
saveErrors(request, errors);
logger.debug("errors saved: " + errors);
}
- logger.debug("errors saved: " + errors);
-
if(errors.isEmpty())
{
if ((newQuestion != null) && (newQuestion.length() > 0))
{
boolean duplicates=AuthoringUtil.checkDuplicateQuestions(listQuestionContentDTO, newQuestion);
- logger.debug("duplicates: " + duplicates);
if (!duplicates)
{
@@ -1518,105 +1203,73 @@
mcQuestionContentDTO.setMark(mark);
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
- logger.debug("caList size:" + mcQuestionContentDTO.getListCandidateAnswersDTO().size());
mcQuestionContentDTO.setCaCount(new Integer(mcQuestionContentDTO.getListCandidateAnswersDTO().size()).toString());
listQuestionContentDTO.add(mcQuestionContentDTO);
- logger.debug("updated listQuestionContentDTO: " + listQuestionContentDTO);
}
else
{
- logger.debug("entry duplicate, not adding");
+ //entry duplicate, not adding
}
}
else
{
- logger.debug("entry blank, not adding");
+ //entry blank, not adding
}
}
else
{
- logger.debug("errors, not adding");
+ //errors, not adding
- logger.debug("errors is not empty: " + errors);
-
commonSaveCode(request, mcGeneralAuthoringDTO,
mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID,listQuestionContentDTO);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
- logger.debug("forwarding using newQuestionBox");
return newQuestionBox(mapping, form, request, response);
}
-
-
- logger.debug("entry using mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
-
-
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
-
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
-
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
commonSaveCode(request, mcGeneralAuthoringDTO,
mcAuthoringForm, sessionMap, activeModule, strToolContentID,
defaultContentIdStr, mcService, httpSessionID,listQuestionContentDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("before forwarding mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
-
- logger.debug("fwd LOAD_MONITORING");
return (mapping.findForward(LOAD_MONITORING));
}
@@ -1638,49 +1291,36 @@
public ActionForward newQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
- logger.debug("dispathcing newQuestionBox");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
- String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
+ String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();
/* create default mcContent object*/
McContent mcContent=mcService.retrieveMc(new Long(defaultContentIdStr));
- logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
String richTextTitle = request.getParameter(TITLE);
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -1695,73 +1335,48 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
String requestType=request.getParameter("requestType");
- logger.debug("requestType: " + requestType);
-
List listAddableQuestionContentDTO = (List)sessionMap.get(NEW_ADDABLE_QUESTION_CONTENT_KEY);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
-
if ((requestType != null) && (requestType.equals("direct")))
{
- logger.debug("requestType is direct");
+ //requestType is direct
listAddableQuestionContentDTO=authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- logger.debug("listAddableQuestionContentDTO from db: " + listAddableQuestionContentDTO);
}
request.setAttribute(NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
-
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
-
-
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
- logger.debug("final listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
mcGeneralAuthoringDTO.setToolContentID(strToolContentID);
@@ -1777,15 +1392,11 @@
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
-
- logger.debug("fwd ing to newQuestionBox: ");
return (mapping.findForward("newQuestionBox"));
}
/**
- * newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* opens up an new screen within the current page for editing a question
*
* @param mapping
@@ -1799,33 +1410,26 @@
public ActionForward newEditableQuestionBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
- logger.debug("dispathcing newEditableQuestionBox");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
request.setAttribute(CURRENT_EDITABLE_QUESTION_INDEX,questionIndex);
mcAuthoringForm.setEditableQuestionIndex(questionIndex);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
String editableQuestion="";
String editableFeedback="";
@@ -1834,8 +1438,6 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
@@ -1846,56 +1448,42 @@
editableFeedback=mcQuestionContentDTO.getFeedback();
editableQuestion=mcQuestionContentDTO.getQuestion();
editableMark=mcQuestionContentDTO.getMark();
- logger.debug("editableFeedback found :" + editableFeedback);
List candidates=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidates found :" + candidates);
break;
}
}
}
- logger.debug("editableFeedback found :" + editableFeedback);
- logger.debug("editableQuestion found :" + editableQuestion);
- logger.debug("editableMark found :" + editableMark);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO = (McGeneralAuthoringDTO) request.getAttribute(MC_GENERAL_AUTHORING_DTO);
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
if (mcGeneralAuthoringDTO == null)
mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
mcGeneralAuthoringDTO.setMarkValue(editableMark);
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
String richTextTitle = request.getParameter(TITLE);
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextTitle: " + richTextTitle);
- logger.debug("richTextInstructions: " + richTextInstructions);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
mcAuthoringForm.setTitle(richTextTitle);
@@ -1912,54 +1500,39 @@
AuthoringUtil authoringUtil = new AuthoringUtil();
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- logger.debug("mcGeneralAuthoringDTO now: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
String requestNewEditableQuestionBox=(String )request.getAttribute("requestNewEditableQuestionBox");
- logger.debug("requestNewEditableQuestionBox: " + requestNewEditableQuestionBox);
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
if ( (requestNewEditableQuestionBox != null) && requestNewEditableQuestionBox.equals("true"))
{
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
}
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
-
- logger.debug("final listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
mcGeneralAuthoringDTO.setToolContentID(strToolContentID);
@@ -1975,18 +1548,12 @@
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
-
- logger.debug("fwd ing to editQuestionBox: ");
return (mapping.findForward("editQuestionBox"));
}
/**
- *
- * ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
-
removes a question from the questions map
*
* @param mapping
@@ -1999,40 +1566,27 @@
*/
public ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching removeQuestion");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
McQuestionContentDTO mcQuestionContentDTO= null;
Iterator listIterator=listQuestionContentDTO.iterator();
while (listIterator.hasNext())
{
mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals("")))
{
@@ -2044,54 +1598,38 @@
}
}
- logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
mcQuestionContentDTO.setQuestion("");
- logger.debug("listQuestionContentDTO after remove:" + listQuestionContentDTO);
listQuestionContentDTO=AuthoringUtil.reorderListQuestionContentDTO(listQuestionContentDTO, questionIndex );
- logger.debug("listQuestionContentDTO reordered:" + listQuestionContentDTO);
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
-
-
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
+
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
if (mcContent == null)
{
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
mcContent=mcService.retrieveMc(new Long(defaultContentIdStr));
}
- logger.debug("final mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -2120,32 +1658,22 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("mcQuestionContentDTO now: " + mcQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
@@ -2154,14 +1682,11 @@
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("fwd ing to LOAD_MONITORING: " + LOAD_MONITORING);
return (mapping.findForward(LOAD_MONITORING));
}
/**
- * moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* moves a question down in the list
*
* moveQuestionDown
@@ -2175,69 +1700,38 @@
*/
public ActionForward moveQuestionDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching moveQuestionDown");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
listQuestionContentDTO=AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "down");
- logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
listQuestionContentDTO=AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
-
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
-
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -2266,46 +1760,34 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("fwd ing to LOAD_MONITORING: " + LOAD_MONITORING);
return (mapping.findForward(LOAD_MONITORING));
}
/**
- * moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
- * moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) *
*
* @param mapping
* @param form
@@ -2317,68 +1799,37 @@
*/
public ActionForward moveQuestionUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching moveQuestionUp");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
listQuestionContentDTO=AuthoringUtil.swapNodes(listQuestionContentDTO, questionIndex, "up");
- logger.debug("listQuestionContentDTO after swap: " + listQuestionContentDTO);
-
listQuestionContentDTO=AuthoringUtil.reorderSimpleListQuestionContentDTO(listQuestionContentDTO);
- logger.debug("listQuestionContentDTO after reordersimple: " + listQuestionContentDTO);
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -2407,31 +1858,22 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
@@ -2440,15 +1882,12 @@
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("fwd ing to LOAD_MONITORING: " + LOAD_MONITORING);
return (mapping.findForward(LOAD_MONITORING));
}
/**
- * moveCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* moves a candidate dwn in the list
*
* @param mapping
@@ -2461,34 +1900,22 @@
*/
public ActionForward moveCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching moveCandidateDown");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
AuthoringUtil authoringUtil = new AuthoringUtil();
-
boolean validateCandidateAnswersNotBlank =authoringUtil.validateCandidateAnswersNotBlank(request);
- logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
-
ActionMessages errors = new ActionMessages();
if (!validateCandidateAnswersNotBlank)
@@ -2505,11 +1932,9 @@
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
if (errors.isEmpty())
{
@@ -2520,25 +1945,19 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
if ((displayOrder != null) && (!displayOrder.equals("")))
{
if (displayOrder.equals(questionIndex))
{
- logger.debug("displayOrder equals questionIndex :" + questionIndex);
editableQuestion=mcQuestionContentDTO.getQuestion();
candidates=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidates found :" + candidates);
- logger.debug("but we are using the repopulated caList here: " + caList);
listCandidates=AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "down");
- logger.debug("swapped candidates :" + listCandidates);
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
@@ -2547,46 +1966,31 @@
}
}
- logger.debug("candidates found :" + candidates);
- logger.debug("swapped candidates is :" + listCandidates);
}
- logger.debug("listQuestionContentDTO after swapped candidates :" + listQuestionContentDTO);
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -2613,52 +2017,41 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
setupCommonScreenData(mcContent, mcService,request);
@@ -2670,7 +2063,6 @@
/**
- * moveCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
*
* moves a candidate up in the list
*
@@ -2684,34 +2076,21 @@
*/
public ActionForward moveCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching moveCandidateUp");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
-
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank =authoringUtil.validateCandidateAnswersNotBlank(request);
- logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
ActionMessages errors = new ActionMessages();
@@ -2729,11 +2108,7 @@
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
-
-
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
if (errors.isEmpty())
@@ -2745,28 +2120,17 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
-
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
if ((displayOrder != null) && (!displayOrder.equals("")))
{
if (displayOrder.equals(questionIndex))
{
- logger.debug("displayOrder equals questionIndex :" + questionIndex);
editableQuestion=mcQuestionContentDTO.getQuestion();
candidates=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidates found :" + candidates);
-
- logger.debug("using repopulated caList:" + caList);
-
listCandidates=AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "up");
- logger.debug("swapped candidates :" + listCandidates);
-
-
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
mcQuestionContentDTO.setCaCount(new Integer(listCandidates.size()).toString());
@@ -2775,47 +2139,26 @@
}
}
- logger.debug("candidates found :" + candidates);
- logger.debug("swapped candidates is :" + listCandidates);
}
-
- logger.debug("listQuestionContentDTO after swapped candidates :" + listQuestionContentDTO);
-
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -2842,63 +2185,48 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
request.setAttribute("requestNewEditableQuestionBox",new Boolean(true).toString());
return newEditableQuestionBox(mapping, form, request, response);
-
}
/**
- * removeCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
- *
* removes a candidate from the list
*
* @param mapping
@@ -2911,49 +2239,30 @@
*/
public ActionForward removeCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching removeCandidate");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
-
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
-
McQuestionContentDTO mcQuestionContentDTO= null;
Iterator listIterator=listQuestionContentDTO.iterator();
while (listIterator.hasNext())
{
mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
- logger.debug("mcQuestionContentDTO question:" + mcQuestionContentDTO.getQuestion());
String question=mcQuestionContentDTO.getQuestion();
String displayOrder=mcQuestionContentDTO.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
if ((displayOrder != null) && (!displayOrder.equals("")))
{
@@ -2965,81 +2274,50 @@
}
}
- logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
- logger.debug("setting caList for the content:");
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
List candidateAnswers=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidateAnswers:" + candidateAnswers);
McCandidateAnswersDTO mcCandidateAnswersDTO= null;
Iterator listCaIterator=candidateAnswers.iterator();
int caIndex=0;
while (listCaIterator.hasNext())
{
caIndex ++;
- logger.debug("caIndex:" + caIndex);
mcCandidateAnswersDTO= (McCandidateAnswersDTO)listCaIterator.next();
- logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO);
- logger.debug("mcCandidateAnswersDTO question:" + mcCandidateAnswersDTO.getCandidateAnswer());
if (caIndex == new Integer(candidateIndex).intValue())
{
- logger.debug("candidateIndex found");
mcCandidateAnswersDTO.setCandidateAnswer("");
break;
}
}
- logger.debug("candidateAnswers after resetting answer" + candidateAnswers);
candidateAnswers=AuthoringUtil.reorderListCandidatesDTO(candidateAnswers);
- logger.debug("candidateAnswers after reordering candidate nodes" + candidateAnswers);
-
mcQuestionContentDTO.setListCandidateAnswersDTO(candidateAnswers);
mcQuestionContentDTO.setCaCount(new Integer(candidateAnswers.size()).toString());
-
- logger.debug("listQuestionContentDTO after remove: " + listQuestionContentDTO);
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
if (mcContent == null)
{
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
mcContent=mcService.retrieveMc(new Long(defaultContentIdStr));
}
- logger.debug("final mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -3066,52 +2344,36 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("mcQuestionContentDTO now: " + mcQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
-
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
setupCommonScreenData(mcContent, mcService,request);
@@ -3124,7 +2386,6 @@
/**
- * newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
*
* enables adding a new candidate answer
*
@@ -3138,75 +2399,44 @@
*/
public ActionForward newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching newCandidateBox");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String questionIndex=request.getParameter("questionIndex");
- logger.debug("questionIndex: " + questionIndex);
mcAuthoringForm.setQuestionIndex(questionIndex);
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList=authoringUtil.repopulateCandidateAnswersBox(request, true);
- logger.debug("repopulated caList: " + caList);
int caCount=caList.size();
- logger.debug("caCount: " + caCount);
-
-
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
-
String passmark=request.getParameter("passmark");
- logger.debug("passmark: " + passmark);
-
-
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
int currentQuestionCount= listQuestionContentDTO.size();
- logger.debug("currentQuestionCount: " + currentQuestionCount);
-
-
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
-
McQuestionContentDTO mcQuestionContentDTOLocal= null;
Iterator listIterator=listQuestionContentDTO.iterator();
while (listIterator.hasNext())
{
mcQuestionContentDTOLocal= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTOLocal:" + mcQuestionContentDTOLocal);
- logger.debug("mcQuestionContentDTOLocal question:" + mcQuestionContentDTOLocal.getQuestion());
String question=mcQuestionContentDTOLocal.getQuestion();
String displayOrder=mcQuestionContentDTOLocal.getDisplayOrder();
- logger.debug("displayOrder:" + displayOrder);
-
if ((displayOrder != null) && (!displayOrder.equals("")))
{
if (displayOrder.equals(questionIndex))
@@ -3217,45 +2447,28 @@
}
}
- logger.debug("mcQuestionContentDTOLocal found:" + mcQuestionContentDTOLocal);
-
if (mcQuestionContentDTOLocal != null)
{
mcQuestionContentDTOLocal.setListCandidateAnswersDTO(caList);
mcQuestionContentDTOLocal.setCaCount(new Integer(caList.size()).toString());
}
-
- logger.debug("listQuestionContentDTO after repopulating data: " + listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -3282,52 +2495,33 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("mcQuestionContentDTOLocal now: " + mcQuestionContentDTOLocal);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
-
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
-
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
setupCommonScreenData(mcContent, mcService,request);
@@ -3340,32 +2534,24 @@
public ActionForward moveAddedCandidateUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching moveAddedCandidateUp");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
AuthoringUtil authoringUtil = new AuthoringUtil();
boolean validateCandidateAnswersNotBlank =authoringUtil.validateCandidateAnswersNotBlank(request);
- logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
-
ActionMessages errors = new ActionMessages();
if (!validateCandidateAnswersNotBlank)
@@ -3381,18 +2567,11 @@
}
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
-
-
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
List listAddableQuestionContentDTO = (List)sessionMap.get(NEW_ADDABLE_QUESTION_CONTENT_KEY);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
-
if (errors.isEmpty())
{
List candidates =new LinkedList();
@@ -3403,55 +2582,35 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
candidates=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidates found :" + candidates);
- logger.debug("but we are using the repopulated caList here: " + caList);
-
listCandidates=AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "up");
- logger.debug("swapped candidates :" + listCandidates);
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
}
}
- logger.debug("listAddableQuestionContentDTO after swapping (up) candidates: " + listAddableQuestionContentDTO);
request.setAttribute(NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -3478,50 +2637,38 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
setupCommonScreenData(mcContent, mcService,request);
@@ -3535,31 +2682,18 @@
public ActionForward moveAddedCandidateDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching moveAddedCandidateDown");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
-
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
AuthoringUtil authoringUtil = new AuthoringUtil();
-
boolean validateCandidateAnswersNotBlank =authoringUtil.validateCandidateAnswersNotBlank(request);
- logger.debug("validateCandidateAnswersNotBlank: " + validateCandidateAnswersNotBlank);
-
ActionMessages errors = new ActionMessages();
if (!validateCandidateAnswersNotBlank)
@@ -3575,16 +2709,13 @@
}
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
List listAddableQuestionContentDTO = (List)sessionMap.get(NEW_ADDABLE_QUESTION_CONTENT_KEY);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
if (errors.isEmpty())
@@ -3597,55 +2728,33 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
candidates=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidates found :" + candidates);
- logger.debug("but we are using the repopulated caList here: " + caList);
-
listCandidates=AuthoringUtil.swapCandidateNodes(caList, candidateIndex, "down");
- logger.debug("swapped candidates :" + listCandidates);
-
mcQuestionContentDTO.setListCandidateAnswersDTO(listCandidates);
}
}
- logger.debug("listAddableQuestionContentDTO after moving down candidates: ");
request.setAttribute(NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -3672,54 +2781,38 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
-
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
-
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
-
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
@@ -3731,39 +2824,30 @@
public ActionForward removeAddedCandidate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching removeAddedCandidate");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList=authoringUtil.repopulateCandidateAnswersBox(request, false);
- logger.debug("repopulated caList: " + caList);
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
List listAddableQuestionContentDTO = (List)sessionMap.get(NEW_ADDABLE_QUESTION_CONTENT_KEY);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
List candidates =new LinkedList();
@@ -3774,92 +2858,54 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
candidates=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidates found :" + candidates);
-
- logger.debug("mcQuestionContentDTO found:" + mcQuestionContentDTO);
- logger.debug("setting caList for the content:");
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
List candidateAnswers=mcQuestionContentDTO.getListCandidateAnswersDTO();
- logger.debug("candidateAnswers:" + candidateAnswers);
-
McCandidateAnswersDTO mcCandidateAnswersDTO= null;
Iterator listCaIterator=candidateAnswers.iterator();
int caIndex=0;
while (listCaIterator.hasNext())
{
caIndex ++;
- logger.debug("caIndex:" + caIndex);
mcCandidateAnswersDTO= (McCandidateAnswersDTO)listCaIterator.next();
- logger.debug("mcCandidateAnswersDTO:" + mcCandidateAnswersDTO);
- logger.debug("mcCandidateAnswersDTO question:" + mcCandidateAnswersDTO.getCandidateAnswer());
-
if (caIndex == new Integer(candidateIndex).intValue())
{
- logger.debug("candidateIndex found");
mcCandidateAnswersDTO.setCandidateAnswer("");
-
-
break;
}
}
- logger.debug("candidateAnswers after resetting answer" + candidateAnswers);
candidateAnswers=AuthoringUtil.reorderListCandidatesDTO(candidateAnswers);
- logger.debug("candidateAnswers after reordering candidate nodes" + candidateAnswers);
-
mcQuestionContentDTO.setListCandidateAnswersDTO(candidateAnswers);
mcQuestionContentDTO.setCaCount(new Integer(candidateAnswers.size()).toString());
-
- logger.debug("listQuestionContentDTO after remove: " + listQuestionContentDTO);
}
-
- logger.debug("listAddableQuestionContentDTO : " + listAddableQuestionContentDTO);
request.setAttribute(NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
if (mcContent == null)
{
- logger.debug("using defaultContentIdStr: " + defaultContentIdStr);
mcContent=mcService.retrieveMc(new Long(defaultContentIdStr));
}
- logger.debug("final mcContent: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -3887,53 +2933,42 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
mcAuthoringForm.setFeedback(feedback);
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
mcGeneralAuthoringDTO.setMarkValue(mark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
setupCommonScreenData(mcContent, mcService,request);
@@ -3945,65 +2980,27 @@
public ActionForward newAddedCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
- logger.debug("dispatching newAddedCandidateBox");
McAuthoringForm mcAuthoringForm = (McMonitoringForm) form;
IMcService mcService =McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
String httpSessionID=mcAuthoringForm.getHttpSessionID();
- logger.debug("httpSessionID: " + httpSessionID);
-
SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID);
- logger.debug("sessionMap: " + sessionMap);
-
-
String candidateIndex=request.getParameter("candidateIndex");
- logger.debug("candidateIndex: " + candidateIndex);
mcAuthoringForm.setCandidateIndex(candidateIndex);
-
String totalMarks=request.getParameter("totalMarks");
- logger.debug("totalMarks: " + totalMarks);
-
-
List listQuestionContentDTO=(List)sessionMap.get(LIST_QUESTION_CONTENT_DTO_KEY);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
-
-
AuthoringUtil authoringUtil = new AuthoringUtil();
List caList=authoringUtil.repopulateCandidateAnswersBox(request, true);
- logger.debug("repopulated caList: " + caList);
-
int caCount=caList.size();
- logger.debug("caCount: " + caCount);
-
-
String newQuestion=request.getParameter("newQuestion");
- logger.debug("newQuestion: " + newQuestion);
-
String mark=request.getParameter("mark");
- logger.debug("mark: " + mark);
-
String passmark=request.getParameter("passmark");
- logger.debug("passmark: " + passmark);
String feedback=request.getParameter("feedback");
- logger.debug("feedback: " + feedback);
-
int currentQuestionCount= listQuestionContentDTO.size();
- logger.debug("currentQuestionCount: " + currentQuestionCount);
-
-
String editQuestionBoxRequest=request.getParameter("editQuestionBoxRequest");
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
-
-
List listAddableQuestionContentDTO = (List)sessionMap.get(NEW_ADDABLE_QUESTION_CONTENT_KEY);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
-
-
List candidates =new LinkedList();
List listCandidates =new LinkedList();
@@ -4012,50 +3009,30 @@
while (listIterator.hasNext())
{
McQuestionContentDTO mcQuestionContentDTO= (McQuestionContentDTO)listIterator.next();
- logger.debug("mcQuestionContentDTO:" + mcQuestionContentDTO);
-
- logger.debug("caList:" + caList);
- logger.debug("caList size:" + caList.size());
mcQuestionContentDTO.setListCandidateAnswersDTO(caList);
mcQuestionContentDTO.setCaCount(new Integer(caList.size()).toString());
}
- logger.debug("listAddableQuestionContentDTO after swapping (up) candidates: ");
request.setAttribute(NEW_ADDABLE_QUESTION_CONTENT_LIST, listAddableQuestionContentDTO);
sessionMap.put(NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
-
- logger.debug("listQuestionContentDTO after repopulating data: " + listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
-
String richTextTitle = request.getParameter(TITLE);
- logger.debug("richTextTitle: " + richTextTitle);
-
String richTextInstructions = request.getParameter(INSTRUCTIONS);
- logger.debug("richTextInstructions: " + richTextInstructions);
-
-
sessionMap.put(ACTIVITY_TITLE_KEY, richTextTitle);
sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions);
String strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
-
String defaultContentIdStr=new Long(mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE)).toString();;
- logger.debug("defaultContentIdStr: " + defaultContentIdStr);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
mcGeneralAuthoringDTO.setActivityTitle(richTextTitle);
@@ -4082,59 +3059,38 @@
mcAuthoringForm.setCurrentTab("3");
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
- logger.debug("listQuestionContentDTO now: " + listQuestionContentDTO);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
- logger.debug("generating dyn pass map using listQuestionContentDTO: " +listQuestionContentDTO);
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTO, false);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTO);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
mcGeneralAuthoringDTO.setEditableQuestionText(newQuestion);
mcAuthoringForm.setFeedback(feedback);
mcGeneralAuthoringDTO.setMarkValue(mark);
- logger.debug("before saving final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
-
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
-
- logger.debug("editQuestionBoxRequest: " + editQuestionBoxRequest);
-
McContent mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
-
setupCommonScreenData(mcContent, mcService,request);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
return newQuestionBox(mapping, form, request, response);
}
-
-
-
-
-
/**
- * prepareReflectionData(HttpServletRequest request, McContent mcContent,
- IMcService mcService, String userID, boolean exportMode)
- *
* prepares reflection data
*
* @param request
@@ -4146,28 +3102,21 @@
public void prepareReflectionData(HttpServletRequest request, McContent mcContent,
IMcService mcService, String userID, boolean exportMode)
{
- logger.debug("starting prepareReflectionData: " + mcContent);
- logger.debug("exportMode: " + exportMode);
List reflectionsContainerDTO= new LinkedList();
if (userID == null)
{
- logger.debug("all users mode");
for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();)
{
McSession mcSession = (McSession) sessionIter.next();
- logger.debug("mcSession: " + mcSession);
for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();)
{
McQueUsr user = (McQueUsr) userIter.next();
- logger.debug("user: " + user);
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
ReflectionDTO reflectionDTO = new ReflectionDTO();
reflectionDTO.setUserId(user.getQueUsrId().toString());
@@ -4184,24 +3133,19 @@
}
else
{
- logger.debug("single user mode");
+ //single user mode
for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();)
{
McSession mcSession = (McSession) sessionIter.next();
- logger.debug("mcSession: " + mcSession);
for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();)
{
McQueUsr user = (McQueUsr) userIter.next();
- logger.debug("user: " + user);
-
if (user.getQueUsrId().toString().equals(userID))
{
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
ReflectionDTO reflectionDTO = new ReflectionDTO();
reflectionDTO.setUserId(user.getQueUsrId().toString());
@@ -4219,8 +3163,6 @@
}
-
- logger.debug("reflectionsContainerDTO: " + reflectionsContainerDTO);
request.getSession().setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO);
if (exportMode)
@@ -4231,10 +3173,6 @@
/**
- * ActionForward openNotebook(ActionMapping mapping,
- ActionForm form, HttpServletRequest request,
- HttpServletResponse response)
- *
* allows viewing users reflection data
*
* @param mapping
@@ -4251,47 +3189,29 @@
HttpServletResponse response) throws IOException,
ServletException, ToolException
{
- logger.debug("dispatching openNotebook...");
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
-
String uid=request.getParameter("uid");
- logger.debug("uid: " + uid);
-
String userId=request.getParameter("userId");
- logger.debug("userId: " + userId);
-
String userName=request.getParameter("userName");
- logger.debug("userName: " + userName);
-
String sessionId=request.getParameter("sessionId");
- logger.debug("sessionId: " + sessionId);
-
-
NotebookEntry notebookEntry = mcService.getEntry(new Long(sessionId),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(userId));
- logger.debug("notebookEntry: " + notebookEntry);
-
McGeneralLearnerFlowDTO mcGeneralLearnerFlowDTO= new McGeneralLearnerFlowDTO();
if (notebookEntry != null) {
String notebookEntryPresentable=McUtils.replaceNewLines(notebookEntry.getEntry());
mcGeneralLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable);
mcGeneralLearnerFlowDTO.setUserName(userName);
}
- logger.debug("mcGeneralLearnerFlowDTO: " + mcGeneralLearnerFlowDTO);
request.setAttribute(MC_GENERAL_LEARNER_FLOW_DTO, mcGeneralLearnerFlowDTO);
return mapping.findForward(LEARNER_NOTEBOOK);
}
/**
- * prepareReflectionData(HttpServletRequest request, McContent mcContent,
- IMcService mcService, String userID, boolean exportMode, String currentSessionId)
*
* @param request
* @param mcContent
@@ -4303,17 +3223,12 @@
public void prepareReflectionData(HttpServletRequest request, McContent mcContent,
IMcService mcService, String userID, boolean exportMode, String currentSessionId)
{
- logger.debug("starting prepareReflectionData: " + mcContent);
- logger.debug("currentSessionId: " + currentSessionId);
- logger.debug("userID: " + userID);
- logger.debug("exportMode: " + exportMode);
List reflectionsContainerDTO= new LinkedList();
reflectionsContainerDTO=getReflectionList(mcContent, userID, mcService);
- logger.debug("reflectionsContainerDTO: " + reflectionsContainerDTO);
request.setAttribute(REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO);
if (exportMode)
@@ -4324,7 +3239,6 @@
/**
- * List getReflectionList(McContent mcContent, String userID, IMcService mcService)
*
* returns reflection data for all sessions
*
@@ -4335,28 +3249,22 @@
*/
public List getReflectionList(McContent mcContent, String userID, IMcService mcService)
{
- logger.debug("getting reflections for all sessions");
List reflectionsContainerDTO= new LinkedList();
if (userID == null)
{
- logger.debug("all users mode");
+ //all users mode
for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();)
{
McSession mcSession = (McSession) sessionIter.next();
- logger.debug("mcSession: " + mcSession);
- logger.debug("mcSession sessionId: " + mcSession.getMcSessionId());
for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();)
{
McQueUsr user = (McQueUsr) userIter.next();
- logger.debug("user: " + user);
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
ReflectionDTO reflectionDTO = new ReflectionDTO();
reflectionDTO.setUserId(user.getQueUsrId().toString());
@@ -4372,25 +3280,19 @@
}
else
{
- logger.debug("single user mode");
+ //single user mode
for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();)
{
McSession mcSession = (McSession) sessionIter.next();
- logger.debug("mcSession: " + mcSession);
for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();)
{
McQueUsr user = (McQueUsr) userIter.next();
- logger.debug("user: " + user);
-
if (user.getQueUsrId().toString().equals(userID))
{
- logger.debug("getting reflection for user with userID: " + userID);
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
ReflectionDTO reflectionDTO = new ReflectionDTO();
reflectionDTO.setUserId(user.getQueUsrId().toString());
@@ -4410,9 +3312,6 @@
}
/**
- *
- * List getReflectionListForSession(McContent mcContent, String userID, IMcService mcService, String currentSessionId)
-
* returns reflection data for a specific session
*
* @param mcContent
@@ -4423,33 +3322,25 @@
*/
public List getReflectionListForSession(McContent mcContent, String userID, IMcService mcService, String currentSessionId)
{
- logger.debug("getting reflections for a specific session");
- logger.debug("currentSessionId: " + currentSessionId);
-
List reflectionsContainerDTO= new LinkedList();
if (userID == null)
{
- logger.debug("all users mode");
+ //all users mode
for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();)
{
McSession mcSession = (McSession) sessionIter.next();
- logger.debug("mcSession: " + mcSession);
- logger.debug("mcSession sessionId: " + mcSession.getMcSessionId());
if (currentSessionId.equals(mcSession.getMcSessionId()))
{
for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();)
{
McQueUsr user = (McQueUsr) userIter.next();
- logger.debug("user: " + user);
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
ReflectionDTO reflectionDTO = new ReflectionDTO();
reflectionDTO.setUserId(user.getQueUsrId().toString());
@@ -4466,28 +3357,21 @@
}
else
{
- logger.debug("single user mode");
+ //single user mode
for (Iterator sessionIter = mcContent.getMcSessions().iterator(); sessionIter.hasNext();)
{
McSession mcSession = (McSession) sessionIter.next();
- logger.debug("mcSession: " + mcSession);
if (currentSessionId.equals(mcSession.getMcSessionId()))
{
for (Iterator userIter = mcSession.getMcQueUsers().iterator(); userIter.hasNext();)
{
McQueUsr user = (McQueUsr) userIter.next();
- logger.debug("user: " + user);
-
if (user.getQueUsrId().toString().equals(userID))
{
- logger.debug("getting reflection for user with userID: " + userID);
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(user.getQueUsrId().toString()));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null) {
ReflectionDTO reflectionDTO = new ReflectionDTO();
reflectionDTO.setUserId(user.getQueUsrId().toString());
@@ -4510,28 +3394,21 @@
/**
- * prepareEditActivityScreenData(HttpServletRequest request, McContent mcContent)
- *
* prepareEditActivityScreenData
*
* @param request
* @param mcContent
*/
public void prepareEditActivityScreenData(HttpServletRequest request, McContent mcContent)
{
- logger.debug("starting prepareEditActivityScreenData: " + mcContent);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
mcGeneralAuthoringDTO.setActivityTitle(mcContent.getTitle());
mcGeneralAuthoringDTO.setActivityInstructions(mcContent.getInstructions());
-
- logger.debug("final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
}
/**
- * void repopulateRequestParameters(HttpServletRequest request, McMonitoringForm mcMonitoringForm,
- McGeneralMonitoringDTO mcGeneralMonitoringDTO)
*
* @param request
* @param mcMonitoringForm
@@ -4540,63 +3417,52 @@
protected void repopulateRequestParameters(HttpServletRequest request, McMonitoringForm mcMonitoringForm,
McGeneralMonitoringDTO mcGeneralMonitoringDTO)
{
- logger.debug("starting repopulateRequestParameters");
String toolContentID=request.getParameter(TOOL_CONTENT_ID);
- logger.debug("toolContentID: " + toolContentID);
mcMonitoringForm.setToolContentID(toolContentID);
mcGeneralMonitoringDTO.setToolContentID(toolContentID);
String activeModule=request.getParameter(ACTIVE_MODULE);
- logger.debug("activeModule: " + activeModule);
mcMonitoringForm.setActiveModule(activeModule);
mcGeneralMonitoringDTO.setActiveModule(activeModule);
String defineLaterInEditMode=request.getParameter(DEFINE_LATER_IN_EDIT_MODE);
- logger.debug("defineLaterInEditMode: " + defineLaterInEditMode);
mcMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode);
mcGeneralMonitoringDTO.setDefineLaterInEditMode(defineLaterInEditMode);
String isToolSessionChanged=request.getParameter(IS_TOOL_SESSION_CHANGED);
- logger.debug("isToolSessionChanged: " + isToolSessionChanged);
mcMonitoringForm.setIsToolSessionChanged(isToolSessionChanged);
mcGeneralMonitoringDTO.setIsToolSessionChanged(isToolSessionChanged);
String responseId=request.getParameter(RESPONSE_ID);
- logger.debug("responseId: " + responseId);
mcMonitoringForm.setResponseId(responseId);
mcGeneralMonitoringDTO.setResponseId(responseId);
String currentUid=request.getParameter(CURRENT_UID);
- logger.debug("currentUid: " + currentUid);
mcMonitoringForm.setCurrentUid(currentUid);
mcGeneralMonitoringDTO.setCurrentUid(currentUid);
}
/**
- * void setupCommonScreenData(McContent mcContent, IMcService mcService, HttpServletRequest request)
*
* @param mcContent
* @param mcService
* @param request
*/
protected void setupCommonScreenData(McContent mcContent, IMcService mcService, HttpServletRequest request)
{
- logger.debug("starting setupCommonScreenData, mcContent " + mcContent);
/*setting up USER_EXCEPTION_NO_TOOL_SESSIONS, from here */
McGeneralMonitoringDTO mcGeneralMonitoringDTO= new McGeneralMonitoringDTO();
mcGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
if (mcService.studentActivityOccurredGlobal(mcContent))
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false");
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString());
}
else
{
- logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true");
mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString());
}
@@ -4605,30 +3471,26 @@
mcGeneralMonitoringDTO.setOfflineInstructions(mcContent.getOfflineInstructions());
List attachmentList = mcService.retrieveMcUploadedFiles(mcContent);
- logger.debug("attachmentList: " + attachmentList);
mcGeneralMonitoringDTO.setAttachmentList(attachmentList);
mcGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList());
- logger.debug("end of refreshSummaryData, mcGeneralMonitoringDTO" + mcGeneralMonitoringDTO);
request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO);
/*.. till here*/
/*find out if there are any reflection entries, from here*/
boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(mcService, mcContent);
- logger.debug("notebookEntriesExist : " + notebookEntriesExist);
if (notebookEntriesExist)
{
request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
String userExceptionNoToolSessions=(String)mcGeneralMonitoringDTO.getUserExceptionNoToolSessions();
- logger.debug(": " + userExceptionNoToolSessions);
if (userExceptionNoToolSessions.equals("true"))
{
- logger.debug("there are no online student activity but there are reflections : ");
+ //there are no online student activity but there are reflections
request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString());
}
}
@@ -4641,17 +3503,11 @@
MonitoringUtil.setSessionUserCount(mcContent, mcGeneralMonitoringDTO);
MonitoringUtil.generateGroupsSessionData(request, mcService, mcContent);
MonitoringUtil.setupAllSessionsData(request, mcContent,mcService);
- logger.debug("ending setupCommonScreenData, mcContent " + mcContent);
}
/**
- * ActionForward downloadMarks(ActionMapping mapping,
- ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response)
- *
* downloadMarks
*
* @param mapping
@@ -4708,10 +3564,6 @@
}
/**
- * prepareSessionDataSpreadsheet(HttpServletRequest request, HttpServletResponse response McContent mcContent,
- IMcService mcService, MessageService messageService, String currentMonitoredToolSession)
- *
- *
* prepareSessionDataSpreadsheet
*
* @param request
@@ -4739,8 +3591,6 @@
Map mapOptionsContent= new TreeMap(new McComparator());
mapOptionsContent.clear();
- logger.debug("setting existing content data from the db");
-
Iterator queIterator= mcContent.getMcQueContents().iterator();
Long mapIndex=new Long(1);
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java
===================================================================
diff -u -rfc9683793d78bf103e13bc18fe56006c92e7901d -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision fc9683793d78bf103e13bc18fe56006c92e7901d)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -99,7 +99,6 @@
redirect="false"
/>
-
*
*/
@@ -109,15 +108,10 @@
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException, McApplicationException
{
- logger.debug("init McMonitoringStarterAction...");
McUtils.cleanUpSessionAbsolute(request);
IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext());
- logger.debug("mcService: " + mcService);
-
McMonitoringForm mcMonitoringForm = (McMonitoringForm) form;
- logger.debug("mcMonitoringForm: " + mcMonitoringForm);
-
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
McGeneralMonitoringDTO mcGeneralMonitoringDTO=new McGeneralMonitoringDTO();
@@ -138,7 +132,6 @@
mcMonitoringForm.setCurrentTab("1");
mcGeneralMonitoringDTO.setCurrentTab("1");
- logger.debug("setting current tab to 1: ");
mcMonitoringForm.setActiveModule(MONITORING);
mcGeneralMonitoringDTO.setActiveModule(MONITORING);
@@ -153,24 +146,15 @@
mcGeneralAuthoringDTO.setActivityTitle(mcGeneralMonitoringDTO.getActivityTitle());
mcGeneralAuthoringDTO.setActivityInstructions(mcGeneralMonitoringDTO.getActivityInstructions());
mcGeneralAuthoringDTO.setActiveModule(MONITORING);
-
- if ( logger.isDebugEnabled() ) {
- logger.debug("mcGeneralMonitoringDTO: " + mcGeneralMonitoringDTO);
- logger.debug("mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
- }
request.setAttribute(MC_GENERAL_MONITORING_DTO, mcGeneralMonitoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
- logger.debug("calling submitSession with selectedToolSessionId" + mcMonitoringForm.getSelectedToolSessionId());
return new McMonitoringAction().commonSubmitSessionCode(mcMonitoringForm, request, mapping, mcService, mcGeneralMonitoringDTO);
}
/**
- * initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response,
- IMcService mcService, McGeneralMonitoringDTO mcGeneralMonitoringDTO)
-
initialises monitoring data
*
* @param mapping
@@ -204,19 +188,16 @@
List listQuestionContentDTO= new LinkedList();
Map mapOptionsContent= new TreeMap(new McComparator());
- logger.debug("setting existing content data from the db");
mapOptionsContent.clear();
Iterator queIterator=mcContent.getMcQueContents().iterator();
Long mapIndex=new Long(1);
- logger.debug("mapOptionsContent: " + mapOptionsContent);
while (queIterator.hasNext())
{
McQuestionContentDTO mcContentDTO=new McQuestionContentDTO();
McQueContent mcQueContent=(McQueContent) queIterator.next();
if (mcQueContent != null)
{
- logger.debug("question: " + mcQueContent.getQuestion());
mapOptionsContent.put(mapIndex.toString(),mcQueContent.getQuestion());
mcContentDTO.setQuestion(mcQueContent.getQuestion());
@@ -226,21 +207,16 @@
mapIndex=new Long(mapIndex.longValue()+1);
}
}
- logger.debug("Map initialized with existing contentid to: " + mapOptionsContent);
mcGeneralMonitoringDTO.setMapOptionsContent(mapOptionsContent);
/* ends here*/
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- logger.debug("end initializing monitoring data...");
mcGeneralMonitoringDTO.setExistsOpenMcs(new Boolean(false).toString());
- logger.debug("post refreshes, mcGeneralMonitoringDTO: " + mcGeneralMonitoringDTO);
/* SELECTION_CASE == 2 indicates start up */
request.setAttribute(SELECTION_CASE, new Long(2));
- logger.debug("SELECTION_CASE: " + request.getAttribute(SELECTION_CASE));
/* Default to All for tool Sessions so that all tool sessions' summary information gets displayed when the module starts up */
request.setAttribute(CURRENT_MONITORED_TOOL_SESSION, "All");
@@ -267,7 +243,6 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerAction.java
===================================================================
diff -u -rfd8292deb95c595b3d948e003dd9ff1807f7b569 -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerAction.java (.../McPedagogicalPlannerAction.java) (revision fd8292deb95c595b3d948e003dd9ff1807f7b569)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McPedagogicalPlannerAction.java (.../McPedagogicalPlannerAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -56,8 +56,6 @@
public class McPedagogicalPlannerAction extends LamsDispatchAction {
- private static Logger logger = Logger.getLogger(McPedagogicalPlannerAction.class);
-
@Override
protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java
===================================================================
diff -u -r06fc623e39b864fa777669c1a52bd8d6ee19b23e -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 06fc623e39b864fa777669c1a52bd8d6ee19b23e)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java (.../McStarterAction.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -155,9 +155,6 @@
/**
*
* @author Ozgur Demirtas
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
*
* A Map data structure is used to present the UI.
*/
@@ -168,46 +165,37 @@
throws IOException, ServletException, McApplicationException {
McUtils.cleanUpSessionAbsolute(request);
- logger.debug("init authoring mode.");
McAuthoringForm mcAuthoringForm = (McAuthoringForm) form;
- logger.debug("mcAuthoringForm: " + mcAuthoringForm);
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
- logger.debug("contentFolderID: " + contentFolderID);
mcAuthoringForm.setContentFolderID(contentFolderID);
McGeneralAuthoringDTO mcGeneralAuthoringDTO= new McGeneralAuthoringDTO();
mcGeneralAuthoringDTO.setContentFolderID(contentFolderID);
Map mapQuestionContent= new TreeMap(new McComparator());
- logger.debug("mapQuestionContent: " + mapQuestionContent);
mcAuthoringForm.resetRadioBoxes();
IMcService mcService =null;
if ((getServlet() == null) || (getServlet().getServletContext() == null))
{
- logger.debug("obtaining mcService from the form");
mcService=mcAuthoringForm.getMcService();
}
else
{
- logger.debug("obtaining mcService via proxy");
mcService =McServiceProxy.getMcService(getServlet().getServletContext());
}
- logger.debug("mcService: " + mcService);
mcGeneralAuthoringDTO.setCurrentTab("1");
- logger.debug("setting currrent tab to 1:");
mcGeneralAuthoringDTO.setMonitoringOriginatedDefineLater(new Boolean(false).toString());
String servletPath=request.getServletPath();
- logger.debug("getServletPath: "+ servletPath);
String requestedModule=null;
if (servletPath.indexOf("authoringStarter") > 0)
{
- logger.debug("request is for authoring module");
+ //request is for authoring module
mcGeneralAuthoringDTO.setActiveModule(AUTHORING);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
mcGeneralAuthoringDTO.setShowAuthoringTabs(new Boolean(true).toString());
@@ -216,7 +204,7 @@
}
else
{
- logger.debug("request is for define later module either direcly from define later url or monitoring url");
+ //request is for define later module either direcly from define later url or monitoring url
mcGeneralAuthoringDTO.setActiveModule(DEFINE_LATER);
mcGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString());
mcGeneralAuthoringDTO.setShowAuthoringTabs(new Boolean(false).toString());
@@ -225,19 +213,16 @@
if (servletPath.indexOf("monitoring") > 0)
{
- logger.debug("request is from monitoring url.");
+ //request is from monitoring url
mcGeneralAuthoringDTO.setMonitoringOriginatedDefineLater(new Boolean(true).toString());
}
}
- logger.debug("requestedModule: " + requestedModule);
mcGeneralAuthoringDTO.setRequestedModule(requestedModule);
String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER);
- logger.debug("sourceMcStarter: " + sourceMcStarter);
boolean validateSignature=readSignature(request,mapping, mcService, mcGeneralAuthoringDTO, mcAuthoringForm);
- logger.debug("validateSignature: " + validateSignature);
if (validateSignature == false)
{
logger.debug("error during validation");
@@ -249,11 +234,9 @@
/*
* find out whether the request is coming from monitoring module for EditActivity tab or from authoring environment url
*/
- logger.debug("no problems getting the default content, will render authoring screen");
String strToolContentID="";
/*the authoring url must be passed a tool content id*/
strToolContentID=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID);
- logger.debug("strToolContentID: " + strToolContentID);
mcGeneralAuthoringDTO.setToolContentID(strToolContentID);
SessionMap sessionMap = new SessionMap();
@@ -270,30 +253,25 @@
{
/*it is possible that the original request for authoring module is coming from monitoring url which keeps the
TOOL_CONTENT_ID in the session*/
- logger.debug("strToolContentID is null, handle this");
Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID);
- logger.debug("toolContentID: " + toolContentID);
if (toolContentID != null)
{
strToolContentID= toolContentID.toString();
- logger.debug("cached strToolContentID from the session: " + strToolContentID);
+ //cached strToolContentID from the session
}
else
{
- logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session.");
+ //we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session.
/*use default content instead of giving a warning*/
defaultContentId=mcAuthoringForm.getDefaultContentIdStr();
- logger.debug("using MCQ defaultContentId: " + defaultContentId);
strToolContentID=defaultContentId;
}
}
- logger.debug("final strToolContentID: " + strToolContentID);
if ((strToolContentID == null) || (strToolContentID.equals("")))
{
McUtils.cleanUpSessionAbsolute(request);
- logger.debug("forwarding to: " + ERROR_LIST);
//return (mapping.findForward(ERROR_LIST));
}
@@ -312,36 +290,25 @@
McContent mcContent=null;
if (!existsContent(new Long(strToolContentID).longValue(), mcService))
{
- logger.debug("getting default content");
/*fetch default content*/
defaultContentIdStr=mcAuthoringForm.getDefaultContentIdStr();
- logger.debug("defaultContentIdStr:" + defaultContentIdStr);
mcContent=retrieveContent(request, mapping, mcAuthoringForm, mapQuestionContent,
new Long(defaultContentIdStr).longValue(), true, mcService, mcGeneralAuthoringDTO, sessionMap);
- logger.debug("post retrive content :" + sessionMap);
}
else
{
- logger.debug("getting existing content");
/* it is possible that the content is in use by learners.*/
mcContent=mcService.retrieveMc(new Long(strToolContentID));
- logger.debug("mcContent: " + mcContent);
if (mcService.studentActivityOccurredGlobal(mcContent))
{
McUtils.cleanUpSessionAbsolute(request);
- logger.debug("student activity occurred on this content:" + mcContent);
}
mcContent=retrieveContent(request, mapping, mcAuthoringForm, mapQuestionContent,
new Long(strToolContentID).longValue(),false, mcService, mcGeneralAuthoringDTO, sessionMap);
-
- logger.debug("post retrive content :" + sessionMap);
}
- logger.debug("mcGeneralAuthoringDTO.getOnlineInstructions() :" + mcGeneralAuthoringDTO.getOnlineInstructions());
- logger.debug("mcGeneralAuthoringDTO.getOfflineInstructions():" + mcGeneralAuthoringDTO.getOfflineInstructions());
-
if ((mcGeneralAuthoringDTO.getOnlineInstructions() == null) || (mcGeneralAuthoringDTO.getOnlineInstructions().length() == 0))
{
mcGeneralAuthoringDTO.setOnlineInstructions(DEFAULT_ONLINE_INST);
@@ -357,43 +324,26 @@
}
- logger.debug("final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
- logger.debug("will return to jsp with: " + sourceMcStarter);
String destination=McUtils.getDestination(sourceMcStarter, requestedModule);
- logger.debug("destination: " + destination);
-
Map mapQuestionContentLocal=mcGeneralAuthoringDTO.getMapQuestionContent();
- logger.debug("mapQuestionContentLocal: " + mapQuestionContentLocal);
-
- logger.debug("mapQuestionContent: " + mapQuestionContent);
sessionMap.put(MAP_QUESTION_CONTENT_KEY, mapQuestionContent);
-
-
AuthoringUtil authoringUtil =new AuthoringUtil();
List listAddableQuestionContentDTO=authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- logger.debug("listAddableQuestionContentDTO: " + listAddableQuestionContentDTO);
sessionMap.put(NEW_ADDABLE_QUESTION_CONTENT_KEY, listAddableQuestionContentDTO);
- logger.debug("persisting sessionMap into session: " + sessionMap);
request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap);
Map marksMap=authoringUtil.buildMarksMap();
- logger.debug("marksMap: " + marksMap);
mcGeneralAuthoringDTO.setMarksMap(marksMap);
mcGeneralAuthoringDTO.setMarkValue("1");
-
List listQuestionContentDTOLocal=authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- logger.debug("listQuestionContentDTOLocal: " + listQuestionContentDTOLocal);
-
Map passMarksMap=authoringUtil.buildDynamicPassMarkMap(listQuestionContentDTOLocal, true);
- logger.debug("passMarksMap: " + passMarksMap);
mcGeneralAuthoringDTO.setPassMarksMap(passMarksMap);
String totalMark=AuthoringUtil.getTotalMark(listQuestionContentDTOLocal);
- logger.debug("totalMark: " + totalMark);
mcAuthoringForm.setTotalMarks(totalMark);
mcGeneralAuthoringDTO.setTotalMarks(totalMark);
@@ -407,22 +357,15 @@
mcGeneralAuthoringDTO.setPassMarkValue (passMark);
Map correctMap=authoringUtil.buildCorrectMap();
- logger.debug("correctMap: " + correctMap);
mcGeneralAuthoringDTO.setCorrectMap(correctMap);
-
- logger.debug("before fwding to jsp, mcAuthoringForm : " + mcAuthoringForm);
- logger.debug("final mcGeneralAuthoringDTO: " + mcGeneralAuthoringDTO);
request.setAttribute(MC_GENERAL_AUTHORING_DTO, mcGeneralAuthoringDTO);
return (mapping.findForward(destination));
}
-
-
/**
* retrives the existing content information from the db and prepares the data for presentation purposes.
- * ActionForward retrieveExistingContent(HttpServletRequest request, ActionMapping mapping, McAuthoringForm mcAuthoringForm, Map mapQuestionContent, long toolContentID)
*
* @param request
* @param mapping
@@ -435,13 +378,7 @@
Map mapQuestionContent, long toolContentID, boolean isDefaultContent, IMcService mcService,
McGeneralAuthoringDTO mcGeneralAuthoringDTO, SessionMap sessionMap)
{
- logger.debug("starting retrieveContent: " + mcService);
- logger.debug("toolContentID: " + toolContentID);
- logger.debug("isDefaultContent: " + isDefaultContent);
-
- logger.debug("getting content with id:" + toolContentID);
McContent mcContent = mcService.retrieveMc(new Long(toolContentID));
- logger.debug("McContent: " + mcContent);
McUtils.populateAuthoringDTO(request, mcContent, mcGeneralAuthoringDTO);
@@ -486,39 +423,29 @@
AuthoringUtil authoringUtil= new AuthoringUtil();
List listQuestionContentDTO=authoringUtil.buildDefaultQuestionContent(mcContent, mcService);
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size()));
- logger.debug("listQuestionContentDTO: " + listQuestionContentDTO);
request.setAttribute(LIST_QUESTION_CONTENT_DTO,listQuestionContentDTO);
sessionMap.put(LIST_QUESTION_CONTENT_DTO_KEY, listQuestionContentDTO);
if (isDefaultContent)
{
- logger.debug("overwriting default question.");
+ //overwriting default question
mcGeneralAuthoringDTO.setDefaultQuestionContent("Sample Question 1?");
}
- logger.debug("mapQuestionContent is:" + mapQuestionContent);
mcGeneralAuthoringDTO.setMapQuestionContent(mapQuestionContent);
-
-
- logger.debug("mcContent.getOnlineInstructions():" + mcContent.getOnlineInstructions());
- logger.debug("mcContent.getOfflineInstructions():" + mcContent.getOfflineInstructions());
mcGeneralAuthoringDTO.setOnlineInstructions(mcContent.getOnlineInstructions());
mcGeneralAuthoringDTO.setOfflineInstructions(mcContent.getOfflineInstructions());
mcAuthoringForm.setOnlineInstructions(mcContent.getOnlineInstructions());
mcAuthoringForm.setOfflineInstructions(mcContent.getOfflineInstructions());
sessionMap.put(ONLINE_INSTRUCTIONS_KEY, mcContent.getOnlineInstructions());
sessionMap.put(OFFLINE_INSTRUCTIONS_KEY, mcContent.getOfflineInstructions());
-
- logger.debug("ACTIVITY_TITLE_KEY set to:" + sessionMap.get(ACTIVITY_TITLE_KEY ));
mcAuthoringForm.resetUserAction();
- logger.debug("returning mcContent:" + mcContent);
return mcContent;
}
@@ -527,28 +454,23 @@
* each tool has a signature. MC 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 boolean readSignature(HttpServletRequest request, ActionMapping mapping, IMcService mcService,
McGeneralAuthoringDTO mcGeneralAuthoringDTO, McAuthoringForm mcAuthoringForm)
{
- logger.debug("mcService: " + mcService);
/*
* retrieve the default content id based on tool signature
*/
long defaultContentID=0;
try
{
- logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
defaultContentID=mcService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug("retrieved tool default contentId: " + defaultContentID);
if (defaultContentID == 0)
{
- logger.debug("default content id has not been setup");
+ //default content id has not been setup
return false;
}
}
@@ -564,18 +486,14 @@
long contentUID=0;
try
{
- logger.debug("retrieve uid of the content based on default content id determined above: " + defaultContentID);
McContent mcContent=mcService.retrieveMc(new Long(defaultContentID));
if (mcContent == null)
{
logger.debug("Exception occured: No default content");
persistError(request,"error.defaultContent.notSetup");
return false;
}
- logger.debug("using mcContent: " + mcContent);
- logger.debug("using mcContent uid: " + mcContent.getUid());
contentUID=mcContent.getUid().longValue();
- logger.debug("contentUID: " + contentUID);
}
catch(Exception e)
{
@@ -585,7 +503,6 @@
}
- logger.debug("MC tool has the default content id: " + defaultContentID);
mcGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString());
mcAuthoringForm.setDefaultContentIdStr(new Long(defaultContentID).toString());
@@ -595,7 +512,6 @@
/**
- * existsContent(long toolContentID)
* @param long toolContentID
* @return boolean
* determine whether a specific toolContentID exists in the db
@@ -613,9 +529,6 @@
/**
* bridges define later url request to authoring functionality
*
- * executeDefineLater(ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response, IMcService mcService)
- throws IOException, ServletException, McApplicationException
*
* @param mapping
* @param form
@@ -630,7 +543,6 @@
public ActionForward executeDefineLater(ActionMapping mapping, McAuthoringForm mcAuthoringForm,
HttpServletRequest request, HttpServletResponse response, IMcService mcService)
throws IOException, ServletException, McApplicationException {
- logger.debug("calling execute..., mcService will be needed next.");
return execute(mapping, mcAuthoringForm, request, response);
}
@@ -644,7 +556,6 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
}
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java
===================================================================
diff -u -rfc9683793d78bf103e13bc18fe56006c92e7901d -r4735ebf9bbf0e57d393c3a86007bb08f1238cf3d
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision fc9683793d78bf103e13bc18fe56006c92e7901d)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 4735ebf9bbf0e57d393c3a86007bb08f1238cf3d)
@@ -63,12 +63,9 @@
*
*/
public class MonitoringUtil implements McAppConstants{
- static Logger logger = Logger.getLogger(MonitoringUtil.class.getName());
/**
*
- * buildGroupsQuestionData(HttpServletRequest request, McContent mcContent)
- *
* ends up populating the attempt history for all the users of all the tool sessions for a content
*
* @param request
@@ -77,19 +74,16 @@
*/
public static List buildGroupsQuestionData(HttpServletRequest request, McContent mcContent, IMcService mcService)
{
- logger.debug("will be building groups question data for content:..." + mcContent);
- logger.debug("mcService: " + mcService);
+ //will be building groups question data for content
List listQuestions=mcService.getAllQuestionEntries(mcContent.getUid());
- logger.debug("listQuestions:..." + listQuestions);
List listMonitoredAnswersContainerDTO= new LinkedList();
Iterator itListQuestions = listQuestions.iterator();
while (itListQuestions.hasNext())
{
McQueContent mcQueContent =(McQueContent)itListQuestions.next();
- logger.debug("mcQueContent:..." + mcQueContent);
if (mcQueContent != null)
{
@@ -99,24 +93,19 @@
mcMonitoredAnswersDTO.setMark(mcQueContent.getMark().toString());
List listCandidateAnswersDTO=mcService.populateCandidateAnswersDTO(mcQueContent.getUid());
- logger.debug("listCandidateAnswersDTO:..." + listCandidateAnswersDTO);
mcMonitoredAnswersDTO.setCandidateAnswersCorrect(listCandidateAnswersDTO);
Map questionAttemptData= buildGroupsAttemptData(request, mcContent, mcQueContent, mcQueContent.getUid(), mcService, null);
- logger.debug("questionAttemptData:..." + questionAttemptData);
mcMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData);
listMonitoredAnswersContainerDTO.add(mcMonitoredAnswersDTO);
}
}
- logger.debug("final listMonitoredAnswersContainerDTO:..." + listMonitoredAnswersContainerDTO);
return listMonitoredAnswersContainerDTO;
}
/**
- * buildGroupsQuestionDataForExportLearner(HttpServletRequest request, McContent mcContent,
- IMcService mcService, McSession mcSession, McQueUsr mcQueUsr)
*
* @param request
* @param mcContent
@@ -128,21 +117,15 @@
public static List buildGroupsQuestionDataForExportLearner(HttpServletRequest request, McContent mcContent,
IMcService mcService, McSession mcSession, McQueUsr mcQueUsr)
{
- logger.debug("will be building groups question data for content:..." + mcContent);
- logger.debug("using mcSession:..." + mcSession);
- logger.debug("using mcQueUsr:..." + mcQueUsr);
- logger.debug("mcService: " + mcService);
List listQuestions=mcService.getAllQuestionEntries(mcContent.getUid());
- logger.debug("listQuestions:..." + listQuestions);
List listMonitoredAnswersContainerDTO= new LinkedList();
Iterator itListQuestions = listQuestions.iterator();
while (itListQuestions.hasNext())
{
McQueContent mcQueContent =(McQueContent)itListQuestions.next();
- logger.debug("mcQueContent:..." + mcQueContent);
if (mcQueContent != null)
{
@@ -152,28 +135,22 @@
mcMonitoredAnswersDTO.setMark(mcQueContent.getMark().toString());
List listCandidateAnswersDTO=mcService.populateCandidateAnswersDTO(mcQueContent.getUid());
- logger.debug("listCandidateAnswersDTO:..." + listCandidateAnswersDTO);
mcMonitoredAnswersDTO.setCandidateAnswersCorrect(listCandidateAnswersDTO);
// Get the attempts for this user. The maps must match the maps in buildGroupsAttemptData or the jsp won't work.
List listMonitoredUserContainerDTO=getAttemptEntries(request, mcService, mcQueUsr, mcSession, mcQueContent.getUid(), new LinkedList(), false);
Map questionAttemptData = new TreeMap(new McStringComparator());
questionAttemptData.put(mcSession.getSession_name(), listMonitoredUserContainerDTO);
- if ( logger.isDebugEnabled() ) {
- logger.debug("questionAttemptData:..." + questionAttemptData);
- }
mcMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData);
listMonitoredAnswersContainerDTO.add(mcMonitoredAnswersDTO);
}
}
- logger.debug("final listMonitoredAnswersContainerDTO:..." + listMonitoredAnswersContainerDTO);
return listMonitoredAnswersContainerDTO;
}
/**
- * List buildGroupsMarkData(HttpServletRequest request, McContent mcContent, IMcService mcService)
*
* @param request
* @param mcContent
@@ -182,16 +159,14 @@
*/
public static List buildGroupsMarkData(HttpServletRequest request, McContent mcContent, IMcService mcService)
{
- logger.debug("will be building groups mark data for content:..." + mcContent);
List listMonitoredMarksContainerDTO= new LinkedList();
Set sessions=mcContent.getMcSessions();
Iterator sessionsIterator=sessions.iterator();
int numQuestions = mcContent.getMcQueContents().size();
while (sessionsIterator.hasNext())
{
- McSession mcSession=(McSession) sessionsIterator.next();
- logger.debug("iterating mcSession:..." + mcSession);
+ McSession mcSession=(McSession) sessionsIterator.next();
McSessionMarkDTO mcSessionMarkDTO= new McSessionMarkDTO();
mcSessionMarkDTO.setSessionId(mcSession.getMcSessionId().toString());
@@ -206,7 +181,6 @@
while (usersIterator.hasNext())
{
McQueUsr mcQueUsr=(McQueUsr) usersIterator.next();
- logger.debug("iterating mcQueUsr:..." + mcQueUsr);
McUserMarkDTO mcUserMarkDTO= new McUserMarkDTO();
mcUserMarkDTO.setSessionId(mcSession.getMcSessionId().toString());
@@ -259,15 +233,11 @@
listMonitoredMarksContainerDTO.add(mcSessionMarkDTO);
}
- if ( logger.isDebugEnabled() )
- logger.debug("final listMonitoredMarksContainerDTO:..." + listMonitoredMarksContainerDTO);
return listMonitoredMarksContainerDTO;
}
/**
- *
- * buildGroupsAttemptData(HttpServletRequest request, McContent mcContent, McQueContent mcQueContent)
*
* helps populating user's attempt history
*
@@ -279,7 +249,6 @@
public static Map buildGroupsAttemptData(HttpServletRequest request, McContent mcContent, McQueContent mcQueContent,
Long questionUid, IMcService mcService, McQueUsr mcQueUsr)
{
- logger.debug("will be building groups attempt data for mcQueContent:..." + mcQueContent + " questionUid:" + questionUid);
Map mapMonitoredAttemptsContainerDTO= new TreeMap(new McStringComparator());
Iterator sessionIterator = mcContent.getMcSessions().iterator();
@@ -291,15 +260,10 @@
mapMonitoredAttemptsContainerDTO.put(mcSession.getSession_name(), sessionUsersAttempts);
}
- if ( logger.isDebugEnabled() )
- logger.debug("final mapMonitoredAttemptsContainerDTO:..." + mapMonitoredAttemptsContainerDTO);
-
return mapMonitoredAttemptsContainerDTO;
}
/**
- *
- * populateSessionUsersAttempts(HttpServletRequest request,List listMcUsers)
*
* ends up populating all the user's attempt data of a particular tool session
*
@@ -311,10 +275,6 @@
*/
public static List populateSessionUsersAttempts(HttpServletRequest request,Long sessionId, Set listMcUsers, Long questionUid, IMcService mcService)
{
- if ( logger.isDebugEnabled() ) {
- logger.debug("starting populateSessionUsersAttempts");
- logger.debug("will be populating users marks for session id: " + sessionId);
- }
McSession mcSession=mcService.retrieveMcSession(sessionId);
@@ -330,8 +290,6 @@
}
/**
- * Map getAttemptEntries(HttpServletRequest request, IMcService mcService, McQueUsr mcQueUsr, McSession mcSession,
- String questionUid, List listMonitoredUserContainerDTO, Map mapMonitoredUserContainerDTO)
*
* @param request
* @param mcService
@@ -345,13 +303,9 @@
public static List getAttemptEntries(HttpServletRequest request, IMcService mcService, McQueUsr mcQueUsr, McSession mcSession,
Long questionUid, List listMonitoredUserContainerDTO, boolean latestOnly)
{
- logger.debug("starting getAttemptEntries.");
- logger.debug("mcQueUsr: " + mcQueUsr);
- logger.debug("mcSession: " + mcSession);
if (mcQueUsr != null)
{
- logger.debug("getting listUserAttempts for user id: " + mcQueUsr.getUid() + " and que content id: " + questionUid);
McMonitoredUserDTO mcMonitoredUserDTO = new McMonitoredUserDTO();
mcMonitoredUserDTO.setUserName(mcQueUsr.getFullname());
@@ -388,9 +342,6 @@
mcMonitoredUserDTO.setUsersAttempts(attemptMap);
}
- if ( logger.isDebugEnabled() )
- logger.debug("final constructed mcMonitoredUserDTO: " + mcMonitoredUserDTO);
-
listMonitoredUserContainerDTO.add(mcMonitoredUserDTO);
}
@@ -411,11 +362,9 @@
while (iteratorSession.hasNext())
{
McSession mcSession=(McSession) iteratorSession.next();
- logger.debug("mcSession: " + mcSession);
if (mcSession != null)
{
- logger.debug("mcSession id: " + mcSession.getMcSessionId());
if (mcSession.getSessionStatus().equals(COMPLETED))
{
@@ -434,45 +383,33 @@
/**
- * boolean notebookEntriesExist(IMcService mcService, McContent mcContent)
*
* @param mcService
* @param mcContent
* @return
*/
public static boolean notebookEntriesExist(IMcService mcService, McContent mcContent)
{
- logger.debug("finding out about content level notebook entries: " + mcContent);
Iterator iteratorSession= mcContent.getMcSessions().iterator();
while (iteratorSession.hasNext())
{
McSession mcSession=(McSession) iteratorSession.next();
- logger.debug("mcSession: " + mcSession);
if (mcSession != null)
{
- logger.debug("mcSession id: " + mcSession.getMcSessionId());
Iterator iteratorUser=mcSession.getMcQueUsers().iterator();
while (iteratorUser.hasNext())
{
McQueUsr mcQueUsr=(McQueUsr) iteratorUser.next();
- logger.debug("mcQueUsr: " + mcQueUsr);
if (mcQueUsr != null)
{
- logger.debug("mcQueUsr id: " + mcQueUsr.getQueUsrId());
-
- logger.debug("attempt getting notebookEntry: ");
NotebookEntry notebookEntry = mcService.getEntry(mcSession.getMcSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL,
MY_SIGNATURE, new Integer(mcQueUsr.getQueUsrId().intValue()));
-
- logger.debug("notebookEntry: " + notebookEntry);
-
if (notebookEntry != null)
{
- logger.debug("found at least one notebookEntry: " + notebookEntry.getEntry());
return true;
}
@@ -485,37 +422,26 @@
/**
- * generateGroupsSessionData(HttpServletRequest request, IMcService mcService, McContent mcContent)
- *
* @param request
* @param mcService
* @param mcContent
*/
public static void generateGroupsSessionData(HttpServletRequest request, IMcService mcService, McContent mcContent)
{
- logger.debug("generateGroupsSessionData: " + mcContent);
-
List listAllGroupsDTO=buildGroupBasedSessionData(request, mcContent, mcService);
- logger.debug("listAllGroupsDTO: " + listAllGroupsDTO);
-
request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO);
}
/**
- * List buildGroupBasedSessionData(HttpServletRequest request, McContent mcContent, IMcService mcService)
- *
* @param request
* @param mcContent
* @param mcService
* @return
*/
public static List buildGroupBasedSessionData(HttpServletRequest request, McContent mcContent, IMcService mcService)
{
- logger.debug("buildGroupBasedSessionData" + mcContent);
- logger.debug("will be building groups question data for content:..." + mcContent);
List listQuestions=mcService.getAllQuestionEntries(mcContent.getUid());
- logger.debug("listQuestions:..." + listQuestions);
List listAllGroupsContainerDTO= new LinkedList();
@@ -524,12 +450,9 @@
while (iteratorSession.hasNext())
{
McSession mcSession=(McSession) iteratorSession.next();
- logger.debug("iteration for group based session data: " + mcSession);
String currentSessionId=mcSession.getMcSessionId().toString();
- logger.debug("currentSessionId: " + currentSessionId);
String currentSessionName=mcSession.getSession_name();
- logger.debug("currentSessionName: " + currentSessionName);
McAllGroupsDTO mcAllGroupsDTO= new McAllGroupsDTO();
List listMonitoredAnswersContainerDTO= new LinkedList();
@@ -540,11 +463,9 @@
while (itListQuestions.hasNext())
{
McQueContent mcQueContent =(McQueContent)itListQuestions.next();
- logger.debug("mcQueContent:..." + mcQueContent);
if (mcQueContent != null)
{
- logger.debug("populating McMonitoredAnswersDTO for : " + mcQueContent);
McMonitoredAnswersDTO mcMonitoredAnswersDTO= new McMonitoredAnswersDTO();
mcMonitoredAnswersDTO.setQuestionUid(mcQueContent.getUid().toString());
mcMonitoredAnswersDTO.setQuestion(mcQueContent.getQuestion());
@@ -553,28 +474,19 @@
Map questionAttemptData = new TreeMap();
- logger.debug("generated questionAttemptData: " + questionAttemptData);
mcMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData);
- logger.debug("adding mcMonitoredAnswersDTO to the listMonitoredAnswersContainerDTO: " + mcMonitoredAnswersDTO);
listMonitoredAnswersContainerDTO.add(mcMonitoredAnswersDTO);
}
}
}
- logger.debug("listMonitoredAnswersContainerDTO:" + listMonitoredAnswersContainerDTO);
-
- logger.debug("adding listMonitoredAnswersContainerDTO to the mcAllGroupsDTO:" + listMonitoredAnswersContainerDTO);
mcAllGroupsDTO.setGroupData(listMonitoredAnswersContainerDTO);
mcAllGroupsDTO.setSessionName(currentSessionName);
mcAllGroupsDTO.setSessionId(currentSessionId);
- logger.debug("built mcAllGroupsDTO:" + mcAllGroupsDTO);
listAllGroupsContainerDTO.add(mcAllGroupsDTO);
}
-
-
- logger.debug("final listAllGroupsContainerDTO:..." + listAllGroupsContainerDTO);
return listAllGroupsContainerDTO;
}