Index: lams_tool_laqa/build.properties
===================================================================
diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/build.properties (.../build.properties) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02)
+++ lams_tool_laqa/build.properties (.../build.properties) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -21,7 +21,6 @@
sessiontimeout=120
signature=laqa11
-#signature=questionAnswer
# the URL used to access LAMS
toolContext=/lams/tool/laqa11
Index: lams_tool_laqa/build.xml
===================================================================
diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/build.xml (.../build.xml) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02)
+++ lams_tool_laqa/build.xml (.../build.xml) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -20,7 +20,7 @@
http://www.gnu.org/licenses/gpl.txt
-->
-
Action class that controls the logic of tool behavior.
@@ -173,9 +159,7 @@ * Struts action class as all of them are handled in *CustomStrutsExceptionHandler.
*
- * @author ozgurd
- * ----------------XDoclet Tags--------------------
- * ----------------XDoclet Tags--------------------
+ * @author Ozgur Demirtas
*/
public class QAction extends DispatchAction implements QaAppConstants
{
@@ -236,9 +220,7 @@
response);
QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
- logger.debug(logger + " " + this.getClass().getName() + "loadQ: form read: " + qaAuthoringForm);
-
/**
* the status of define later is determined from the property inspector and
* by now, we know whether it is on or off
@@ -248,7 +230,7 @@
boolean defineLaterStatus=QaUtils.getDefineLaterStatus();
Boolean defineLater=new Boolean(defineLaterStatus);
- logger.debug(logger + " " + this.getClass().getName() + "defineLater: " + defineLater);
+ logger.debug("defineLater: " + defineLater);
if (defineLater.equals(new Boolean(false)))
{
request.getSession().setAttribute(IS_DEFINE_LATER,"false");
@@ -260,9 +242,9 @@
request.getSession().setAttribute(DISABLE_TOOL,"disabled");
}
- //retrieve the default question content map
+ /**retrieve the default question content map */
Map mapQuestionContent=(Map)request.getSession().getAttribute(MAP_QUESTION_CONTENT);
- logger.debug(logger + " " + this.getClass().getName() + "MAP_QUESTION_CONTENT:" + request.getSession().getAttribute(MAP_QUESTION_CONTENT));
+ logger.debug("MAP_QUESTION_CONTENT:" + request.getSession().getAttribute(MAP_QUESTION_CONTENT));
String userAction="";
if (qaAuthoringForm.getAddContent() != null)
@@ -285,34 +267,32 @@
{
userAction=SUBMIT_ALL_CONTENT;
}
- logger.debug(logger + " " + this.getClass().getName() + "user action is: " + userAction);
+ logger.debug("user action is: " + userAction);
- //add a new question to Map
+ /** add a new question to Map */
if (userAction.equalsIgnoreCase(ADD_NEW_QUESTION))
{
request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(true));
authoringUtil.reconstructQuestionContentMapForAdd(mapQuestionContent, request);
- }//delete a question
+ }/** delete a question*/
else if (userAction.equalsIgnoreCase(REMOVE_QUESTION))
{
request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(true));
authoringUtil.reconstructQuestionContentMapForRemove(mapQuestionContent, request, qaAuthoringForm);
- } //remove selected content
+ } /**remove selected content*/
else if (userAction.equalsIgnoreCase(REMOVE_ALL_CONTENT))
{
authoringUtil.removeAllDBContent(request);
QaUtils.cleanupSession(request);
- //reset all user actions
qaAuthoringForm.resetUserAction();
return (mapping.findForward(LOAD_STARTER));
}
else if (userAction.equalsIgnoreCase(SUBMIT_TAB_DONE))
{
- logger.debug(logger + " " + this.getClass().getName() + "user is done with this tab.");
- //reset all user actions
+ logger.debug("user is done with this tab.");
qaAuthoringForm.resetUserAction();
return (mapping.findForward(LOAD_QUESTIONS));
- }//submit questions contained in the Map
+ }/**submit questions contained in the Map*/
else if (userAction.equalsIgnoreCase(SUBMIT_ALL_CONTENT))
{
ActionMessages errors= new ActionMessages();
@@ -324,13 +304,13 @@
if ((qaAuthoringForm.getTitle() == null) || (qaAuthoringForm.getTitle().length() == 0))
{
errors.add(Globals.ERROR_KEY,new ActionMessage("error.title"));
- logger.debug(logger + " " + this.getClass().getName() + "add title to ActionMessages:");
+ logger.debug("add title to ActionMessages");
}
if ((qaAuthoringForm.getInstructions() == null) || (qaAuthoringForm.getInstructions().length() == 0))
{
errors.add(Globals.ERROR_KEY, new ActionMessage("error.instructions"));
- logger.debug(logger + " " + this.getClass().getName() + "add instructions to ActionMessages: ");
+ logger.debug("add instructions to ActionMessages: ");
}
/**
@@ -340,7 +320,7 @@
if ((defaultQuestionEntry == null) || (defaultQuestionEntry.length() == 0))
{
errors.add(Globals.ERROR_KEY, new ActionMessage("error.defaultquestion.empty"));
- logger.debug(logger + " " + this.getClass().getName() + "add error.defaultquestion.empty to ActionMessages: ");
+ logger.debug("add error.defaultquestion.empty to ActionMessages: ");
}
Boolean renderMonitoringEditActivity=(Boolean)request.getSession().getAttribute(RENDER_MONITORING_EDITACTIVITY);
@@ -350,13 +330,13 @@
if ((qaAuthoringForm.getReportTitle() == null) || (qaAuthoringForm.getReportTitle().length() == 0))
{
errors.add(Globals.ERROR_KEY, new ActionMessage("error.reportTitle"));
- logger.debug(logger + " " + this.getClass().getName() + "add reportTitle to ActionMessages: ");
+ logger.debug("add reportTitle to ActionMessages: ");
}
if ((qaAuthoringForm.getMonitoringReportTitle() == null) || (qaAuthoringForm.getMonitoringReportTitle().length() == 0))
{
errors.add(Globals.ERROR_KEY, new ActionMessage("error.monitorReportTitle"));
- logger.debug(logger + " " + this.getClass().getName() + "add monitorReportTitle to ActionMessages: ");
+ logger.debug("add monitorReportTitle to ActionMessages: ");
}
}
/**
@@ -366,7 +346,7 @@
saveErrors(request,errors);
if (errors.size() > 0)
{
- logger.debug(logger + " " + this.getClass().getName() + "returning back to from to fix errors:");
+ logger.debug("returning back to from to fix errors:");
request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(true));
return (mapping.findForward(LOAD_QUESTIONS));
}
@@ -376,37 +356,37 @@
*/
IQaService qaService =QaUtils.getToolService(request);
Long monitoredContentId=(Long)request.getSession().getAttribute(MONITORED_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "MONITORED_CONTENT_ID: " + monitoredContentId);
+ logger.debug("MONITORED_CONTENT_ID: " + monitoredContentId);
if (monitoredContentId != null)
{
qaService.unsetAsDefineLater(monitoredContentId);
- logger.debug(logger + " " + this.getClass().getName() + "MONITORED_CONTENT_ID has been unset as defineLater: ");
+ logger.debug("MONITORED_CONTENT_ID has been unset as defineLater: ");
}
authoringUtil.reconstructQuestionContentMapForSubmit(mapQuestionContent, request);
- //delete existing content from the database
+ /**delete existing content from the database*/
authoringUtil.removeAllDBContent(request);
- //create-recreate the content in the db
+ /**create-recreate the content in the db*/
QaContent qaContent=authoringUtil.createContent(mapQuestionContent, request, qaAuthoringForm);
authoringUtil.createQuestionContent(mapQuestionContent, request, qaContent);
- //giving the user a feedback
+ /**give the user a feedback*/
errors.clear();
errors.add(Globals.ERROR_KEY, new ActionMessage("submit.successful"));
- logger.debug(logger + " " + this.getClass().getName() + "submit successful: ");
+ logger.debug("submit successful.");
saveErrors(request,errors);
}
else
{
- logger.debug(logger + " " + this.getClass().getName() + "Warning!: Uncatered-for user action: " + userAction);
+ logger.debug("Warning!: Uncatered-for user action: " + userAction);
}
- //reset all user actions
+ /**reset all user actions*/
qaAuthoringForm.resetUserAction();
/*
ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, WebUtil.PARAM_MODE,MODE_OPTIONAL);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving mode: " + mode);
+ logger.debug("retrieving mode: " + mode);
*/
return (mapping.findForward(LOAD_QUESTIONS));
@@ -445,7 +425,7 @@
* check the define later status
*/
Boolean defineLater=(Boolean)request.getSession().getAttribute(IS_DEFINE_LATER);
- logger.debug(logger + " " + this.getClass().getName() + "learning-defineLater: " + defineLater);
+ logger.debug("learning-defineLater: " + defineLater);
if (defineLater.booleanValue() == true)
{
persistError(request,"error.defineLater");
@@ -455,42 +435,42 @@
LearningUtil learningUtil= new LearningUtil();
QaLearningForm qaLearningForm = (QaLearningForm) form;
- //retrieve the default question content map
+ /**retrieve the default question content map*/
Map mapQuestions=(Map)request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER);
- logger.debug(logger + " " + this.getClass().getName() + "MAP_QUESTION_CONTENT_LEARNER:" + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER));
+ logger.debug("MAP_QUESTION_CONTENT_LEARNER:" + request.getSession().getAttribute(MAP_QUESTION_CONTENT_LEARNER));
- //retrieve the answers Map
+ /**retrieve the answers Map*/
Map mapAnswers=(Map)request.getSession().getAttribute(MAP_ANSWERS);
- logger.debug(logger + " " + this.getClass().getName() + "MAP_ANSWERS:" + mapAnswers);
+ logger.debug("MAP_ANSWERS:" + mapAnswers);
- //obtain author's question listing preference
+ /**obtain author's question listing preference*/
String questionListingMode=(String) request.getSession().getAttribute(QUESTION_LISTING_MODE);
- //maintain Map either based on sequential listing or based on combined listing
+ /**maintain Map either based on sequential listing or based on combined listing*/
if (questionListingMode.equalsIgnoreCase(QUESTION_LISTING_MODE_SEQUENTIAL))
{
- logger.debug(logger + " " + this.getClass().getName() + "QUESTION_LISTING_MODE_SEQUENTIAL");
+ logger.debug("QUESTION_LISTING_MODE_SEQUENTIAL");
int currentQuestionIndex=new Long(qaLearningForm.getCurrentQuestionIndex()).intValue();
- logger.debug(logger + " " + this.getClass().getName() + "currentQuestionIndex is: " + currentQuestionIndex);
- logger.debug(logger + " " + this.getClass().getName() + "getting answer for question: " + currentQuestionIndex + "as: " + qaLearningForm.getAnswer());
- logger.debug(logger + " " + this.getClass().getName() + "mapAnswers size:" + mapAnswers.size());
+ logger.debug("currentQuestionIndex is: " + currentQuestionIndex);
+ logger.debug("getting answer for question: " + currentQuestionIndex + "as: " + qaLearningForm.getAnswer());
+ logger.debug("mapAnswers size:" + mapAnswers.size());
if (mapAnswers.size() >= currentQuestionIndex)
{
- logger.debug(logger + " " + this.getClass().getName() + "mapAnswers size:" + mapAnswers.size() + " and currentQuestionIndex: " + currentQuestionIndex);
+ logger.debug("mapAnswers size:" + mapAnswers.size() + " and currentQuestionIndex: " + currentQuestionIndex);
mapAnswers.remove(new Long(currentQuestionIndex).toString());
}
- logger.debug(logger + " " + this.getClass().getName() + "before adding to mapAnswers: " + mapAnswers);
+ logger.debug("before adding to mapAnswers: " + mapAnswers);
mapAnswers.put(new Long(currentQuestionIndex).toString(), qaLearningForm.getAnswer());
- logger.debug(logger + " " + this.getClass().getName() + "adding new answer:" + qaLearningForm.getAnswer() + " to mapAnswers.");
+ logger.debug("adding new answer:" + qaLearningForm.getAnswer() + " to mapAnswers.");
if (qaLearningForm.getGetNextQuestion() != null)
currentQuestionIndex++;
else if (qaLearningForm.getGetPreviousQuestion() != null)
currentQuestionIndex--;
request.getSession().setAttribute(CURRENT_ANSWER, mapAnswers.get(new Long(currentQuestionIndex).toString()));
- logger.debug(logger + " " + this.getClass().getName() + "currentQuestionIndex will be: " + currentQuestionIndex);
+ logger.debug("currentQuestionIndex will be: " + currentQuestionIndex);
request.getSession().setAttribute(CURRENT_QUESTION_INDEX, new Long(currentQuestionIndex));
learningUtil.feedBackAnswersProgress(request,currentQuestionIndex);
qaLearningForm.resetUserActions(); /**resets all except submitAnswersContent */
@@ -501,7 +481,7 @@
for (int questionIndex=INITIAL_QUESTION_COUNT.intValue(); questionIndex<= mapQuestions.size(); questionIndex++ )
{
String answer=request.getParameter("answer" + questionIndex);
- logger.debug(logger + " " + this.getClass().getName() + " answer for question " + questionIndex + " is:" + answer);
+ logger.debug("answer for question " + questionIndex + " is:" + answer);
mapAnswers.put(new Long(questionIndex).toString(), answer);
}
}
@@ -517,17 +497,15 @@
if (qaLearningForm.getSubmitAnswersContent() != null)
{
logger.debug(logger + " " + this.getClass().getName() + "submit the responses: " + mapAnswers);
- //recreate the users and responses
+ /**recreate the users and responses*/
learningUtil.createUsersAndResponses(mapAnswers, request);
- //reset all user actions
qaLearningForm.resetUserActions();
- //also reset this button
qaLearningForm.setSubmitAnswersContent(null);
- //start generating a report for the Learner
+ /**start generating a report for the Learner*/
learningUtil.buidLearnerReport(request,1);
learningUtil.lockContent(request);
- logger.debug(logger + " " + this.getClass().getName() + "content has been locked");
+ logger.debug("content has been locked");
return (mapping.findForward(LEARNER_REPORT));
}
/**
@@ -542,9 +520,8 @@
Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID);
User user=(User)request.getSession().getAttribute(TOOL_USER);
- logger.debug(logger + " " + this.getClass().getName() + "Simulating container behaviour by calling " +
- "leaveToolSession() with toolSessionId: " + toolSessionId + " and " +
- "user: " + user);
+ logger.debug("simulating container behaviour by calling " +
+ "leaveToolSession() with toolSessionId: " + toolSessionId + " and user: " + user);
/**
* mark the tool session as COMPLETE
@@ -554,7 +531,7 @@
qaSession.setSession_end_date(new Date(System.currentTimeMillis()));
qaSession.setSession_status(COMPLETED);
qaService.updateQaSession(qaSession);
- logger.debug(logger + " " + this.getClass().getName() + "tool session has been marked COMPLETE: " + qaSession);
+ logger.debug("tool session has been marked COMPLETE: " + qaSession);
/*
ILearnerService learnerService =LearnerServiceProxy.getLearnerService(getServlet().getServletContext());
logger.debug(logger + " " + this.getClass().getName() + "learnerService: " + learnerService);
@@ -568,9 +545,8 @@
*/
QaUtils.cleanupSession(request);
- //reset all user actions
+ /** reset all user actions */
qaLearningForm.resetUserActions();
-
return (mapping.findForward(LOAD));
}
@@ -595,12 +571,11 @@
if (qaAuthoringForm.getSummaryMonitoring() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "request for getSummaryMonitoring, start proxying...");
- logger.debug(logger + " " + this.getClass().getName() + "NO_AVAILABLE_SESSIONS: " +
- request.getSession().getAttribute(NO_AVAILABLE_SESSIONS));
+ logger.debug("request for getSummaryMonitoring, start proxying...");
+ logger.debug("NO_AVAILABLE_SESSIONS: " + request.getSession().getAttribute(NO_AVAILABLE_SESSIONS));
Boolean noAvailableSessions=(Boolean)request.getSession().getAttribute(NO_AVAILABLE_SESSIONS);
- logger.debug(logger + " " + this.getClass().getName() + "NO_AVAILABLE_SESSIONS: " +noAvailableSessions);
+ logger.debug("NO_AVAILABLE_SESSIONS: " +noAvailableSessions);
qaAuthoringForm.resetUserAction();
if ((noAvailableSessions != null) && (noAvailableSessions.booleanValue()))
{
@@ -611,15 +586,15 @@
}
else
{
- logger.debug(logger + " " + this.getClass().getName() + "NO_AVAILABLE_SESSIONS: " +false);
+ logger.debug("NO_AVAILABLE_SESSIONS: " +false);
QaMonitoringAction qaMonitoringAction=new QaMonitoringAction();
QaMonitoringForm qaMonitoringForm=new QaMonitoringForm();
return qaMonitoringAction.generateToolSessionDataMap(mapping,qaMonitoringForm,request,response);
}
}
else if (qaAuthoringForm.getInstructionsMonitoring() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "QAction- request for getInstructionsMonitoring()");
+ logger.debug("QAction- request for getInstructionsMonitoring()");
qaAuthoringForm.resetUserAction();
QaMonitoringAction qaMonitoringAction=new QaMonitoringAction();
QaMonitoringForm qaMonitoringForm=new QaMonitoringForm();
@@ -628,24 +603,22 @@
}
else if (qaAuthoringForm.getEditActivityMonitoring() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "QAction-request for getEditActivityMonitoring()");
+ logger.debug("QAction-request for getEditActivityMonitoring()");
QaStarterAction qaStarterAction = new QaStarterAction();
- logger.debug(logger + " " + this.getClass().getName() + "forward to Authoring Basic tab ");
+ logger.debug("forwarding to Authoring Basic tab.");
ActionForward actionForward=qaStarterAction.startMonitoringSummary(mapping, qaAuthoringForm, request, response);
- logger.debug(logger + " " + this.getClass().getName() + "actionForward: " + actionForward);
+ logger.debug("actionForward: " + actionForward);
qaAuthoringForm.resetUserAction();
return (actionForward);
}
else if (qaAuthoringForm.getStatsMonitoring() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "TO BE FIXED request for getStatsMonitoring()");
qaAuthoringForm.resetUserAction();
QaMonitoringAction qaMonitoringAction=new QaMonitoringAction();
QaMonitoringForm qaMonitoringForm=new QaMonitoringForm();
qaMonitoringForm.setStats("stats");
return qaMonitoringAction.generateToolSessionDataMap(mapping,qaMonitoringForm,request,response);
}
-
return null;
}
@@ -658,7 +631,7 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug(logger + " " + this.getClass().getName() + "add " + message +" to ActionMessages:");
+ logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java
===================================================================
diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java (.../QaAuthoringForm.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java (.../QaAuthoringForm.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -10,50 +10,47 @@
/**
* ActionForm for the Authoring environment
*/
-import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.lamsfoundation.lams.tool.qa.QaAppConstants;
/**
- * @author ozgurd
+ * @author Ozgur Demirtas
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class QaAuthoringForm extends ActionForm implements QaAppConstants {
- static Logger logger = Logger.getLogger(QaAuthoringForm.class.getName());
-
- //controllers
+ /** form controllers */
protected String addContent;
protected String removeContent;
protected String removeAllContent;
protected String submitAllContent;
protected String submitTabDone;
- //tab controller, these may go away once the Flash wraps the jsp
+ /** tab controller, these may go away once the Flash wraps the jsp */
protected String choice;
protected String choiceBasic;
protected String choiceAdvanced;
protected String choiceInstructions;
- //basic content
+ /** basic content */
protected String title;
protected String instructions;
protected String questionIndex;
protected String isRemoveContent;
protected String toolContentId;
- //instructions content
+ /** instructions content */
protected String onlineInstructions;
protected String offlineInstructions;
- //advanced content
+ /** advanced content */
protected String synchInMonitor;
protected String reportTitle;
protected String monitoringReportTitle;
protected String endLearningMessage;
protected String usernameVisible;
protected String questionsSequenced;
- //proxy controllers for Monitoring tabs
+ /** proxy controllers for Monitoring tabs */
protected String summaryMonitoring;
protected String instructionsMonitoring;
protected String editActivityMonitoring;
@@ -116,7 +113,6 @@
this.synchInMonitor =OPTION_OFF;
this.usernameVisible =OPTION_OFF;
this.questionsSequenced =OPTION_OFF;
- logger.debug(logger + " " + this.getClass().getName() + "resetting RadioBoxes to: " + this.getSynchInMonitor());
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaEmptyForm.java
===================================================================
diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaEmptyForm.java (.../QaEmptyForm.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaEmptyForm.java (.../QaEmptyForm.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -13,7 +13,7 @@
import org.apache.struts.action.ActionForm;
/**
- * @author ozgurd
+ * @author Ozgur Demirtas
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java
===================================================================
diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java (.../QaLearningForm.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningForm.java (.../QaLearningForm.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -10,21 +10,19 @@
/**
* ActionForm for the Learning environment
*/
-import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.lamsfoundation.lams.tool.qa.QaAppConstants;
/**
- * @author ozgurd
+ * @author Ozgur Demirtas
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class QaLearningForm extends ActionForm implements QaAppConstants {
- static Logger logger = Logger.getLogger(QaLearningForm.class.getName());
protected String answer;
protected String currentQuestionIndex;
- //controller
+ /** form controllers */
protected String submitAnswersContent;
protected String getNextQuestion;
protected String getPreviousQuestion;
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java
===================================================================
diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -36,7 +36,7 @@
/**
*
- * @author ozgurd
+ * @author Ozgur Demirtas
*
* Learner mode takes in the parameters USER_ID, TOOL_SESSION_ID and TOOL_CONTENT_ID
*
@@ -75,7 +75,7 @@
* reset the question index to 1
*/
request.getSession().setAttribute(CURRENT_QUESTION_INDEX, "1");
- logger.debug(logger + " " + this.getClass().getName() + "CURRENT_QUESTION_INDEX: " + request.getSession().getAttribute(CURRENT_QUESTION_INDEX));
+ logger.debug("CURRENT_QUESTION_INDEX: " + request.getSession().getAttribute(CURRENT_QUESTION_INDEX));
/**
* reset the current answer
@@ -92,7 +92,7 @@
* retrive the service
*/
IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService: " + qaService);
+ logger.debug("retrieving qaService: " + qaService);
request.getSession().setAttribute(TOOL_SERVICE, qaService);
/**
@@ -106,10 +106,10 @@
String userId=request.getParameter(USER_ID);
if ((userId == null) || (userId.length()==0))
{
- logger.debug(logger + " " + this.getClass().getName() + "error: The tool expects userId");
+ logger.debug("error: The tool expects userId");
persistError(request,"error.authoringUser.notAvailable");
request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
@@ -122,21 +122,21 @@
{
persistError(request,"error.userId.notNumeric");
request.setAttribute(USER_EXCEPTION_USERID_NOTNUMERIC, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
- logger.debug(logger + " " + this.getClass().getName() + "TOOL_USER is:" + request.getSession().getAttribute(TOOL_USER));
+ logger.debug("TOOL_USER is:" + request.getSession().getAttribute(TOOL_USER));
/**
* verify that userID does not already exist in the db
*/
QaQueUsr qaQueUsr=qaService.loadQaQueUsr(new Long(userId));
- logger.debug(logger + " " + this.getClass().getName() + "QaQueUsr:" + qaQueUsr);
+ logger.debug("QaQueUsr:" + qaQueUsr);
if (qaQueUsr != null)
{
persistError(request,"error.userId.existing");
request.setAttribute(USER_EXCEPTION_USERID_EXISTING, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
@@ -149,22 +149,22 @@
{
persistError(request, "error.contentId.required");
request.setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
else
{
try
{
toolContentId=new Long(strToolContentId).longValue();
- logger.debug(logger + " " + this.getClass().getName() + "passed TOOL_CONTENT_ID : " + new Long(toolContentId));
+ logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId));
request.getSession().setAttribute(TOOL_CONTENT_ID,new Long(toolContentId));
}
catch(NumberFormatException e)
{
persistError(request, "error.contentId.numberFormatException");
request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
}
@@ -173,7 +173,7 @@
{
persistError(request, "error.content.doesNotExist");
request.setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
@@ -188,31 +188,31 @@
{
persistError(request, "error.toolSessionId.required");
request.setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
else
{
try
{
toolSessionId=new Long(strToolSessionId).longValue();
- logger.debug(logger + " " + this.getClass().getName() + "passed TOOL_SESSION_ID : " + new Long(toolSessionId));
+ logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionId));
request.getSession().setAttribute(TOOL_SESSION_ID,new Long(toolSessionId));
}
catch(NumberFormatException e)
{
persistError(request, "error.sessionId.numberFormatException");
- logger.debug(logger + " " + this.getClass().getName() + "add error.sessionId.numberFormatException to ActionMessages: ");
+ logger.debug("add error.sessionId.numberFormatException to ActionMessages.");
request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD);
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
}
TimeZone timeZone=TimeZone.getDefault();
- logger.debug(logger + " " + this.getClass().getName() + "current timezone: " + timeZone.getDisplayName());
+ logger.debug("current timezone: " + timeZone.getDisplayName());
request.getSession().setAttribute(TIMEZONE, timeZone.getDisplayName());
- logger.debug(logger + " " + this.getClass().getName() + "current timezone id: " + timeZone.getID());
+ logger.debug("current timezone id: " + timeZone.getID());
request.getSession().setAttribute(TIMEZONE_ID, timeZone.getID());
@@ -225,10 +225,10 @@
if (!QaUtils.existsSession(toolSessionId, request))
{
Long currentToolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "Simulating container behaviour: calling createToolSession with toolSessionId : " +
- new Long(toolSessionId) + " and toolContentId: " + currentToolContentId);
+ logger.debug("simulating container behaviour: calling createToolSession with toolSessionId : " +
+ new Long(toolSessionId) + " and toolContentId: " + currentToolContentId);
qaService.createToolSession(new Long(toolSessionId), currentToolContentId);
- logger.debug(logger + " " + this.getClass().getName() + "Simulated container behaviour:");
+ logger.debug("simulated container behaviour.");
}
/**
@@ -237,7 +237,7 @@
*/
QaSession qaSession=qaService.retrieveQaSessionOrNullById(toolSessionId);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaSession: " + qaSession);
+ logger.debug("retrieving qaSession: " + qaSession);
/**
* find out what content this tool session is referring to
* get the content for this tool session (many to one mapping)
@@ -247,34 +247,34 @@
* Each passed tool session id points to a particular content. Many to one mapping.
*/
qaContent=qaSession.getQaContent();
- logger.debug(logger + " " + this.getClass().getName() + "using qaContent: " + qaContent);
+ logger.debug("using qaContent: " + qaContent);
/**
* The content we retrieved above must have been created before in Authoring time.
* And the passed tool session id already refers to it.
*/
- logger.debug(logger + " " + this.getClass().getName() + "REPORT_TITLE_LEARNER: " + qaContent.getReportTitle());
+ logger.debug("REPORT_TITLE_LEARNER: " + qaContent.getReportTitle());
request.getSession().setAttribute(REPORT_TITLE_LEARNER,qaContent.getReportTitle());
request.getSession().setAttribute(END_LEARNING_MESSAGE,qaContent.getEndLearningMessage());
- logger.debug(logger + " " + this.getClass().getName() + "END_LEARNING_MESSAGE: " + qaContent.getEndLearningMessage());
+ logger.debug("END_LEARNING_MESSAGE: " + qaContent.getEndLearningMessage());
- logger.debug(logger + " " + this.getClass().getName() + "IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline());
+ logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + qaContent.isRunOffline());
request.getSession().setAttribute(IS_TOOL_ACTIVITY_OFFLINE, new Boolean(qaContent.isRunOffline()).toString());
- logger.debug(logger + " " + this.getClass().getName() + "IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible());
+ logger.debug("IS_USERNAME_VISIBLE: " + qaContent.isUsernameVisible());
request.getSession().setAttribute(IS_USERNAME_VISIBLE, new Boolean(qaContent.isUsernameVisible()));
- logger.debug(logger + " " + this.getClass().getName() + "IS_DEFINE_LATER: " + qaContent.isDefineLater());
+ logger.debug("IS_DEFINE_LATER: " + qaContent.isDefineLater());
request.getSession().setAttribute(IS_DEFINE_LATER, new Boolean(qaContent.isDefineLater()));
/**
* convince jsp: Learning mode requires this setting for jsp to generate the user's report
*/
request.getSession().setAttribute(CHECK_ALL_SESSIONS_COMPLETED, new Boolean(false));
- logger.debug(logger + " " + this.getClass().getName() + "IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced());
+ logger.debug("IS_QUESTIONS_SEQUENCED: " + qaContent.isQuestionsSequenced());
String feedBackType="";
if (qaContent.isQuestionsSequenced())
{
@@ -286,7 +286,7 @@
request.getSession().setAttribute(QUESTION_LISTING_MODE, QUESTION_LISTING_MODE_COMBINED);
feedBackType=FEEDBACK_TYPE_COMBINED;
}
- logger.debug(logger + " " + this.getClass().getName() + "QUESTION_LISTING_MODE: " + request.getSession().getAttribute(QUESTION_LISTING_MODE));
+ logger.debug("QUESTION_LISTING_MODE: " + request.getSession().getAttribute(QUESTION_LISTING_MODE));
/**
* fetch question content from content
@@ -310,13 +310,13 @@
request.getSession().setAttribute(MAP_ANSWERS, mapAnswers);
request.getSession().setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestions);
- logger.debug(logger + " " + this.getClass().getName() + "qaContent has : " + mapQuestions.size() + " entries.");
+ logger.debug("qaContent has : " + mapQuestions.size() + " entries.");
request.getSession().setAttribute(TOTAL_QUESTION_COUNT, new Long(mapQuestions.size()).toString());
String userFeedback= feedBackType + request.getSession().getAttribute(TOTAL_QUESTION_COUNT) + QUESTIONS;
request.getSession().setAttribute(USER_FEEDBACK, userFeedback);
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to learning screen");
+ logger.debug("forwarding to: " + LOAD);
return (mapping.findForward(LOAD));
}
@@ -329,7 +329,7 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug(logger + " " + this.getClass().getName() + "add " + message +" to ActionMessages:");
+ logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java
===================================================================
diff -u -r861c3ee9fb6adda0f075e93533a2640c3041e9f9 -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 861c3ee9fb6adda0f075e93533a2640c3041e9f9)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java (.../QaMonitoringAction.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -18,6 +18,12 @@
*
*http://www.gnu.org/licenses/gpl.txt
*/
+
+/**
+ *
+ * @author Ozgur Demirtas
+*/
+
package org.lamsfoundation.lams.tool.qa.web;
import java.io.IOException;
@@ -60,9 +66,8 @@
{
QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
MonitoringUtil monitoringUtil = new MonitoringUtil();
- logger.debug(logger + " " + this.getClass().getName() + "calling findSelectedMonitoringTab");
monitoringUtil.findSelectedMonitoringTab(form, request);
- logger.debug(logger + " " + this.getClass().getName() + "called findSelectedMonitoringTab");
+ logger.debug("done with findSelectedMonitoringTab");
/**
* load the values for online and offline instructions
@@ -73,43 +78,41 @@
if (initialMonitoringContentId != null)
{
QaContent qaContent=qaService.retrieveQa(initialMonitoringContentId.longValue());
- logger.debug(logger + " " + this.getClass().getName() + "qaContent: " + qaContent);
+ logger.debug("qaContent: " + qaContent);
request.getSession().setAttribute(MONITORED_OFFLINE_INSTRUCTIONS, qaContent.getOfflineInstructions());
request.getSession().setAttribute(MONITORED_ONLINE_INSTRUCTIONS, qaContent.getOnlineInstructions());
- logger.debug(logger + " " + this.getClass().getName() + "session updated with on/off instructions");
+ logger.debug("session updated with online/offline instructions");
}
-
/**
* determine what screen(tab) to generate
*/
String choiceMonitoring=(String)request.getSession().getAttribute(CHOICE_MONITORING);
- logger.debug(logger + " " + this.getClass().getName() + "CHOICE_MONITORING: " + choiceMonitoring);
+ logger.debug("CHOICE_MONITORING: " + choiceMonitoring);
if (choiceMonitoring.equalsIgnoreCase(CHOICE_TYPE_MONITORING_SUMMARY))
{
- logger.debug(logger + " " + this.getClass().getName() + "will generate summary screen");
+ logger.debug("will generate summary screen");
return generateSummaryScreen(mapping, form, request, response);
}
else if (choiceMonitoring.equalsIgnoreCase(CHOICE_TYPE_MONITORING_INSTRUCTIONS))
{
- logger.debug(logger + " " + this.getClass().getName() + "will generate instructions screen");
+ logger.debug("will generate instructions screen");
request.getSession().setAttribute(MONITORING_INSTRUCTIONS_VISITED, new Boolean(true));
return generateInstructionsScreen(mapping, form, request, response);
}
else if (choiceMonitoring.equalsIgnoreCase(CHOICE_TYPE_MONITORING_EDITACTIVITY))
{
- logger.debug(logger + " " + this.getClass().getName() + "will generate editActivity screen");
+ logger.debug("will generate editActivity screen");
request.getSession().setAttribute(MONITORING_EDITACTIVITY_VISITED, new Boolean(true));
return generateEditActivityScreen(mapping, form, request, response);
}
else if (choiceMonitoring.equalsIgnoreCase(CHOICE_TYPE_MONITORING_STATS))
{
- logger.debug(logger + " " + this.getClass().getName() + "will generate stats screen");
+ logger.debug("will generate stats screen");
request.getSession().setAttribute(MONITORING_STATS_VISITED, new Boolean(true));
return generateStatsScreen(mapping, form, request, response);
}
-
return null;
}
@@ -123,14 +126,14 @@
QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
Boolean noToolSessionsAvailable=(Boolean)request.getSession().getAttribute(NO_TOOL_SESSIONS_AVAILABLE);
- logger.debug(logger + " " + this.getClass().getName() + "generateSummaryScreen has noToolSessionsAvailable: " + noToolSessionsAvailable);
+ logger.debug("generateSummaryScreen has noToolSessionsAvailable: " + noToolSessionsAvailable);
if ((noToolSessionsAvailable !=null) && (noToolSessionsAvailable.booleanValue()))
{
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "detected noToolSessionsAvailable:" + noToolSessionsAvailable);
+ logger.debug("detected noToolSessionsAvailable:" + noToolSessionsAvailable);
persistError(request,"error.content.onlyContentAndNoSessions");
request.setAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_REPORT);
+ logger.debug("forwarding to: " + MONITORING_REPORT);
return (mapping.findForward(MONITORING_REPORT));
}
@@ -141,68 +144,62 @@
if (qaMonitoringForm.getEditReport() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "responseId for editReport" + responseId);
+ logger.debug("responseId for editReport" + responseId);
request.getSession().setAttribute(DATAMAP_EDITABLE_RESPONSE_ID, responseId);
}
else if (qaMonitoringForm.getUpdateReport() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "request for responseUpdate with id: "
- + request.getSession().getAttribute(DATAMAP_EDITABLE_RESPONSE_ID));
+ logger.debug("request for responseUpdate with id: " + request.getSession().getAttribute(DATAMAP_EDITABLE_RESPONSE_ID));
responseId=(String)request.getSession().getAttribute(DATAMAP_EDITABLE_RESPONSE_ID);
String updatedResponse=qaMonitoringForm.getUpdatedResponse();
monitoringUtil.updateResponse(request, responseId, updatedResponse);
request.getSession().setAttribute(DATAMAP_EDITABLE_RESPONSE_ID, "");
- logger.debug(logger + " " + this.getClass().getName() + "end of updateResponse with: " + responseId + "-" + updatedResponse);
+ logger.debug("end of updateResponse with: " + responseId + "-" + updatedResponse);
}
if (qaMonitoringForm.getHideReport() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "hiddenResponseId for hideReport" + hiddenResponseId);
+ logger.debug("hiddenResponseId for hideReport" + hiddenResponseId);
request.getSession().setAttribute(DATAMAP_HIDDEN_RESPONSE_ID, hiddenResponseId);
monitoringUtil.hideResponse(request, hiddenResponseId);
}
if (qaMonitoringForm.getUnhideReport() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "hiddenResponseId for unHideReport" + unHiddenResponseId);
+ logger.debug("hiddenResponseId for unHideReport" + unHiddenResponseId);
request.getSession().setAttribute(DATAMAP_HIDDEN_RESPONSE_ID, "");
monitoringUtil.unHideResponse(request, unHiddenResponseId);
}
+ logger.debug("DATAMAP_EDITABLE_RESPONSE_ID: " + request.getSession().getAttribute(DATAMAP_EDITABLE_RESPONSE_ID));
+ logger.debug("DATAMAP_HIDDEN_RESPONSE_ID: " + request.getSession().getAttribute(DATAMAP_HIDDEN_RESPONSE_ID));
- logger.debug(logger + " " + this.getClass().getName() + "DATAMAP_EDITABLE_RESPONSE_ID: " +
- request.getSession().getAttribute(DATAMAP_EDITABLE_RESPONSE_ID));
-
- logger.debug(logger + " " + this.getClass().getName() + "DATAMAP_HIDDEN_RESPONSE_ID: " +
- request.getSession().getAttribute(DATAMAP_HIDDEN_RESPONSE_ID));
-
qaMonitoringForm.setUpdatedResponse("");
- logger.debug(logger + " " + this.getClass().getName() + "request for summary");
+ logger.debug("request for summary");
String isToolSessionChanged=request.getParameter(IS_TOOL_SESSION_CHANGED);
- logger.debug(logger + " " + this.getClass().getName() + "IS_TOOL_SESSION_CHANGED - before loop: " + isToolSessionChanged);
+ logger.debug("IS_TOOL_SESSION_CHANGED - initial: " + isToolSessionChanged);
/**
* sessionList holds all the toolSessionIds passed to summary page to be presented in a drop-down box.
*/
Map sessionList = new TreeMap();
int SELECTION_CASE=0;
- logger.debug(logger + " " + this.getClass().getName() + "isNonDefaultScreensVisited: " + monitoringUtil.isNonDefaultScreensVisited(request));
+ logger.debug("isNonDefaultScreensVisited: " + monitoringUtil.isNonDefaultScreensVisited(request));
-
/**
* Following conditions test which entry has been selected in the monitoring mode-summary screen drop box.
* is Default page
*/
String selectionCase=(String)request.getSession().getAttribute("selectionCase");
- logger.debug(logger + " " + this.getClass().getName() + "current selectionCase: " + selectionCase);
+ logger.debug("current selectionCase: " + selectionCase);
boolean sessionListReadable=false;
if ((isToolSessionChanged == null) && !monitoringUtil.isNonDefaultScreensVisited(request))
{
- logger.debug(logger + " " + this.getClass().getName() + "First case based on null. Gets rendered only once in http session life time");
- logger.debug(logger + " " + this.getClass().getName() + "summary to use MAX_TOOL_SESSION_COUNT");
+ logger.debug("First case based on null. Gets rendered only once in http session life time");
+ logger.debug("summary to use MAX_TOOL_SESSION_COUNT");
/**
* initialize sessionList with "All", which is the default option.
*/
@@ -212,7 +209,7 @@
}
else if ((isToolSessionChanged == null) && monitoringUtil.isNonDefaultScreensVisited(request))
{
- logger.debug(logger + " " + this.getClass().getName() + "Other tabs visited. Gets rendered for all tool sessions");
+ logger.debug("Other tabs visited. Gets rendered for all tool sessions");
sessionList.put("All", "All");
READABLE_TOOL_SESSION_COUNT=MAX_TOOL_SESSION_COUNT;
SELECTION_CASE=2;
@@ -221,14 +218,14 @@
else if ((isToolSessionChanged != null) && isToolSessionChanged.equalsIgnoreCase("1"))
{
String selectedToolSessionId=(String)request.getParameter("toolSessionId1");
- logger.debug(logger + " " + this.getClass().getName() + "selectedToolSessionId" + selectedToolSessionId);
+ logger.debug("selectedToolSessionId" + selectedToolSessionId);
/**
* is "All" selected
*/
if (selectedToolSessionId.equalsIgnoreCase("All"))
{
- logger.debug(logger + " " + this.getClass().getName() + "Second case");
- logger.debug(logger + " " + this.getClass().getName() + "summary to use MAX_TOOL_SESSION_COUNT");
+ logger.debug("Second case");
+ logger.debug("summary to use MAX_TOOL_SESSION_COUNT");
/**
* initialize sessionList with "All", which is the default option.
*/
@@ -242,32 +239,32 @@
/**
* is a single session id selected
*/
- logger.debug(logger + " " + this.getClass().getName() + "Third case");
- logger.debug(logger + " " + this.getClass().getName() + "selectedToolSessionId" + selectedToolSessionId);
+ logger.debug("Third case");
+ logger.debug("selectedToolSessionId" + selectedToolSessionId);
READABLE_TOOL_SESSION_COUNT=new Integer(2);
SELECTION_CASE=3;
request.getSession().setAttribute(CURRENT_MONITORED_TOOL_SESSION,selectedToolSessionId);
- logger.debug(logger + " " + this.getClass().getName() + "CURRENT_MONITORED_TOOL_SESSION " + selectedToolSessionId);
+ logger.debug("CURRENT_MONITORED_TOOL_SESSION " + selectedToolSessionId);
}
}
else if (isToolSessionChanged.equals("") && (selectionCase.equals("3")))
{
/**
* is a single session id selected
*/
- logger.debug(logger + " " + this.getClass().getName() + "case with single session and edit or update selected");
+ logger.debug("case with single session and edit or update selected");
READABLE_TOOL_SESSION_COUNT=new Integer(2);
SELECTION_CASE=3;
}
else if (isToolSessionChanged.equals(""))
{
- logger.debug(logger + " " + this.getClass().getName() + "All is selected");
+ logger.debug("All is selected");
sessionList.put("All", "All");
READABLE_TOOL_SESSION_COUNT=MAX_TOOL_SESSION_COUNT;
SELECTION_CASE=2;
sessionListReadable=true;
}
- logger.debug(logger + " " + this.getClass().getName() + "SELECTION_CASE: " + SELECTION_CASE);
+ logger.debug("final SELECTION_CASE: " + SELECTION_CASE);
boolean useSelectedToolSessionId=false;
String selectedToolSessionId = (String) request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION);
@@ -276,10 +273,9 @@
useSelectedToolSessionId=true;
}
-
if ((qaMonitoringForm.getEditReport() == null) && (qaMonitoringForm.getUpdateReport() == null))
{
- logger.debug(logger + " " + this.getClass().getName() + "no editReport or updateReport selected");
+ logger.debug("no editReport or updateReport selected");
request.getSession().setAttribute(DATAMAP_EDITABLE_RESPONSE_ID, "");
request.getSession().setAttribute("selectionCase",new Long(SELECTION_CASE).toString());
}
@@ -290,12 +286,12 @@
*/
Map mapToolSessions= new TreeMap(new QaStringComparator());
request.getSession().setAttribute(MAP_TOOL_SESSIONS,mapToolSessions);
- logger.debug(logger + " " + this.getClass().getName() + "MAP_TOOL_SESSIONS placed into session");
+ logger.debug("MAP_TOOL_SESSIONS placed into session");
Map mapUserResponses= new TreeMap(new QaStringComparator());
request.getSession().setAttribute(MAP_USER_RESPONSES,mapUserResponses);
- logger.debug(logger + " " + this.getClass().getName() + "MAP_USER_RESPONSES placed into session");
- logger.debug(logger + " " + this.getClass().getName() + "request for contributeLesson");
+ logger.debug("MAP_USER_RESPONSES placed into session");
+ logger.debug("request for contributeLesson");
/**
* monitoring reads all the toolSessionsIds appended one after other until it finds a null one. The cap was limited to 500.
* This is the case all the tool sessions are using the same content.
@@ -308,107 +304,107 @@
*/
IQaService qaService = QaUtils.getToolService(request);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService: " + qaService);
+ logger.debug("retrieving qaService: " + qaService);
if (qaService == null)
{
qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService from proxy: " + qaService);
+ logger.debug("retrieving qaService from proxy: " + qaService);
request.getSession().setAttribute(TOOL_SERVICE, qaService);
}
request.getSession().setAttribute(NO_AVAILABLE_SESSIONS,new Boolean(false));
- logger.debug(logger + " " + this.getClass().getName() + "NO_AVAILABLE_SESSIONS: " + false);
+ logger.debug("NO_AVAILABLE_SESSIONS: " + false);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving ORIGINAL_TOOL_SESSIONS");
+ logger.debug("retrieving ORIGINAL_TOOL_SESSIONS");
Map originalSessionList=(Map)request.getSession().getAttribute(ORIGINAL_TOOL_SESSIONS);
- logger.debug(logger + " " + this.getClass().getName() + "retrieved ORIGINAL_TOOL_SESSIONS : " + originalSessionList);
+ logger.debug("retrieved ORIGINAL_TOOL_SESSIONS : " + originalSessionList);
/**
* monitoredToolSessionsCounter holds the total number of valid toolSessionIds passed to the monitoring url
*/
- logger.debug(logger + " " + this.getClass().getName() + "READABLE_TOOL_SESSION_COUNT: " + READABLE_TOOL_SESSION_COUNT);
+ logger.debug("READABLE_TOOL_SESSION_COUNT: " + READABLE_TOOL_SESSION_COUNT);
int monitoredToolSessionsCounter=0;
for (int toolSessionIdCounter=1; toolSessionIdCounter < READABLE_TOOL_SESSION_COUNT.intValue(); toolSessionIdCounter++)
{
- logger.debug(logger + " " + this.getClass().getName() + "toolSessionIdCounter: " + toolSessionIdCounter);
+ logger.debug("toolSessionIdCounter: " + toolSessionIdCounter);
String strToolSessionId="";
if (useSelectedToolSessionId)
{
strToolSessionId=(String) request.getSession().getAttribute(CURRENT_MONITORED_TOOL_SESSION);
- logger.debug(logger + " " + this.getClass().getName() + "using strToolSessionId: " +strToolSessionId);
+ logger.debug("using strToolSessionId: " +strToolSessionId);
}
else
{
strToolSessionId=(String) originalSessionList.get(""+toolSessionIdCounter);
- logger.debug(logger + " " + this.getClass().getName() + "using strToolSessionId from the session: ");
+ logger.debug("using strToolSessionId from the session: ");
}
- logger.debug(logger + " " + this.getClass().getName() + "original strToolSessionId: " + strToolSessionId);
+ logger.debug("original strToolSessionId: " + strToolSessionId);
String strRetrievableToolSessionId="";
/**
* catering for un-formatted monitoring url
* Watch for case where the "All" is selected in the drop-down.
*/
- logger.debug(logger + " " + this.getClass().getName() + "SELECTION_CASE: " + SELECTION_CASE);
+ logger.debug("SELECTION_CASE: " + SELECTION_CASE);
if ((strToolSessionId == null) && (SELECTION_CASE == 1))
{
- logger.debug(logger + " " + this.getClass().getName() + "un-formatted monitoring url, exiting...");
+ logger.debug("un-formatted monitoring url, exiting...");
break;
}
else if ((!sessionListReadable) && ((strToolSessionId == null) || (strToolSessionId.length() == 0)))
{
- logger.debug(logger + " " + this.getClass().getName() + "un-formatted monitoring url, exiting...");
+ logger.debug("un-formatted monitoring url, exiting...");
break;
}
else
{
if (sessionListReadable)
{
- logger.debug(logger + " " + this.getClass().getName() + "sessionListReadable is true.");
- logger.debug(logger + " " + this.getClass().getName() + "strToolSessionId is All: " + strToolSessionId);
+ logger.debug("sessionListReadable is true.");
+ logger.debug("strToolSessionId is All: " + strToolSessionId);
sessionList=(Map)request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS);
- logger.debug(logger + " " + this.getClass().getName() + "toolSessionIdCounter: " + toolSessionIdCounter);
+ logger.debug("toolSessionIdCounter: " + toolSessionIdCounter);
logger.debug(logger + " " + this.getClass().getName() + "sessionList size: " + sessionList.size());
if (toolSessionIdCounter==sessionList.size())
{
- logger.debug(logger + " " + this.getClass().getName() + "sessionList size equals toolSessionIdCounter, exiting...");
+ logger.debug("sessionList size equals toolSessionIdCounter, exiting...");
break;
}
- logger.debug(logger + " " + this.getClass().getName() + "sessionList: " + sessionList);
+ logger.debug("sessionList: " + sessionList);
strToolSessionId=(String)sessionList.get("Group" + toolSessionIdCounter);
- logger.debug(logger + " " + this.getClass().getName() + "strToolSessionId from sessionList: " + strToolSessionId);
+ logger.debug("strToolSessionId from sessionList: " + strToolSessionId);
}
strRetrievableToolSessionId=strToolSessionId;
- logger.debug(logger + " " + this.getClass().getName() + "retrievableStrToolSessionId: " + strRetrievableToolSessionId);
+ logger.debug("retrievableStrToolSessionId: " + strRetrievableToolSessionId);
QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(strRetrievableToolSessionId).longValue());
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaSession: " + qaSession);
+ logger.debug("retrieving qaSession: " + qaSession);
if (qaSession !=null)
{
monitoredToolSessionsCounter++;
request.getSession().setAttribute(TOOL_SESSION_ID, new Long(strToolSessionId));
- logger.debug(logger + " " + this.getClass().getName() + "TOOL_SESSION_ID in session");
+ logger.debug("TOOL_SESSION_ID in session");
if (READABLE_TOOL_SESSION_COUNT.equals(MAX_TOOL_SESSION_COUNT))
{
- logger.debug(logger + " " + this.getClass().getName() + "default screen - READABLE_TOOL_SESSION_COUNT equals MAX_TOOL_SESSION_COUNT");
+ logger.debug("default screen - READABLE_TOOL_SESSION_COUNT equals MAX_TOOL_SESSION_COUNT");
/**
* add the current toolSessionId to the arraylist for the drop-down box
*/
sessionList.put("Group" + monitoredToolSessionsCounter, strToolSessionId);
- logger.debug(logger + " " + this.getClass().getName() + "sessionList Map new entry, strToolSessionId added to the list: " + toolSessionIdCounter + "->" + strToolSessionId );
+ logger.debug("sessionList Map new entry, strToolSessionId added to the list: " + toolSessionIdCounter + "->" + strToolSessionId );
}
/**
* get to content from the tool session
*/
QaContent qaContent=qaSession.getQaContent();
- logger.debug(logger + " " + this.getClass().getName() + "using qaContent: " + qaContent);
- logger.debug(logger + " " + this.getClass().getName() + "Monitor - contribute will be using TOOL_CONTENT_ID: " + qaContent.getQaContentId());
+ logger.debug("using qaContent: " + qaContent);
+ logger.debug("Monitor - contribute will be using TOOL_CONTENT_ID: " + qaContent.getQaContentId());
/**
* editActivity-defineLater screen depends on MONITORED_CONTENT_ID
@@ -426,17 +422,16 @@
*/
request.getSession().setAttribute(IS_USERNAME_VISIBLE, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "REPORT_TITLE_MONITOR: " + qaContent.getMonitoringReportTitle());
+ logger.debug("REPORT_TITLE_MONITOR: " + qaContent.getMonitoringReportTitle());
request.getSession().setAttribute(REPORT_TITLE_MONITOR,qaContent.getMonitoringReportTitle());
/**
* check if the author requires that the all tool sessions must be COMPLETED before the report in Monitoring
*/
boolean isAllSessionsCompleted=monitoringUtil.isSessionsSync(request,qaContent.getQaContentId().longValue());
- logger.debug(logger + " " + this.getClass().getName() + "Monitor - contribute will be using isAllSessionsCompleted: " + isAllSessionsCompleted);
-
- logger.debug(logger + " " + this.getClass().getName() + "Monitor - contribute will be using isSynchInMonitor: " + qaContent.isSynchInMonitor());
+ logger.debug("Monitor - contribute will be using isAllSessionsCompleted: " + isAllSessionsCompleted);
+ logger.debug("Monitor - contribute will be using isSynchInMonitor: " + qaContent.isSynchInMonitor());
/**
* if the author requires syncronization but not all the sessions are COMPLETED give an error
*/
@@ -447,21 +442,21 @@
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage("error.synchInMonitor"));
- logger.debug(logger + " " + this.getClass().getName() + "add synchInMonitor to ActionMessages: ");
+ logger.debug("add synchInMonitor to ActionMessages");
saveErrors(request,errors);
}
else
{
request.getSession().setAttribute(CHECK_ALL_SESSIONS_COMPLETED, new Boolean(false));
}
- logger.debug(logger + " " + this.getClass().getName() + "IS_ALL_SESSIONS_COMPLETED:" + request.getSession().getAttribute(IS_ALL_SESSIONS_COMPLETED));
- logger.debug(logger + " " + this.getClass().getName() + "CHECK_ALL_SESSIONS_COMPLETED" + request.getSession().getAttribute(CHECK_ALL_SESSIONS_COMPLETED));
+ logger.debug("IS_ALL_SESSIONS_COMPLETED:" + request.getSession().getAttribute(IS_ALL_SESSIONS_COMPLETED));
+ logger.debug("CHECK_ALL_SESSIONS_COMPLETED" + request.getSession().getAttribute(CHECK_ALL_SESSIONS_COMPLETED));
LearningUtil learningUtil= new LearningUtil();
/**
* generate a report for the Author/Teacher
*/
- logger.debug(logger + " " + this.getClass().getName() + "calling buidMonitoringReport with toolSessionIdCounter:" + toolSessionIdCounter);
+ logger.debug("calling buidMonitoringReport with toolSessionIdCounter:" + toolSessionIdCounter);
learningUtil.buidLearnerReport(request, toolSessionIdCounter);
}
}
@@ -472,52 +467,51 @@
*/
if (READABLE_TOOL_SESSION_COUNT.equals(MAX_TOOL_SESSION_COUNT))
{
- logger.debug(logger + " " + this.getClass().getName() + "sessionList storable");
+ logger.debug("sessionList storable");
request.getSession().setAttribute(SUMMARY_TOOL_SESSIONS,sessionList);
- logger.debug(logger + " " + this.getClass().getName() + "SUMMARY_TOOL_SESSIONS stored into the session:" + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS));
+ logger.debug("SUMMARY_TOOL_SESSIONS stored into the session:" + request.getSession().getAttribute(SUMMARY_TOOL_SESSIONS));
}
mapToolSessions=(Map)request.getSession().getAttribute(MAP_TOOL_SESSIONS);
- logger.debug(logger + " " + this.getClass().getName() + "before forwarding MAP_TOOL_SESSIONS:" + mapToolSessions);
+ logger.debug("before forwarding MAP_TOOL_SESSIONS:" + mapToolSessions);
if (mapToolSessions.size() == 0)
{
request.getSession().setAttribute(NO_AVAILABLE_SESSIONS,new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "NO_AVAILABLE_SESSIONS: " +true);
+ logger.debug("NO_AVAILABLE_SESSIONS: " +true);
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage("error.noStudentActivity"));
- logger.debug(logger + " " + this.getClass().getName() + "add error.noStudentActivity to ActionMessages");
+ logger.debug("add error.noStudentActivity to ActionMessages");
saveErrors(request,errors);
}
Boolean noAvailableSessions=(Boolean) request.getSession().getAttribute(NO_AVAILABLE_SESSIONS);
- logger.debug(logger + " " + this.getClass().getName() + "before forwarding NO_AVAILABLE_SESSIONS:" + noAvailableSessions);
+ logger.debug("before forwarding NO_AVAILABLE_SESSIONS:" + noAvailableSessions);
Map mapMonitoringQuestions=(Map)request.getSession().getAttribute(MAP_MONITORING_QUESTIONS);
- logger.debug(logger + " " + this.getClass().getName() + "before forwarding MAP_MONITORING_QUESTIONS:" + mapMonitoringQuestions);
+ logger.debug("before forwarding MAP_MONITORING_QUESTIONS:" + mapMonitoringQuestions);
String targetMode=(String )request.getSession().getAttribute(TARGET_MODE);
- logger.debug(logger + " " + this.getClass().getName() + "TARGET_MODE: " + targetMode);
+ logger.debug("TARGET_MODE: " + targetMode);
return (mapping.findForward(MONITORING_REPORT));
}
-
public ActionForward generateInstructionsScreen(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException
{
- logger.debug(logger + " " + this.getClass().getName() + "will generateInstructionsScreen ");
+ logger.debug(logger + " " + this.getClass().getName() + "will generateInstructionsScreen.");
QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
Long initialMonitoringContentId=(Long)request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID);
if (initialMonitoringContentId == null)
{
- logger.debug(logger + " " + this.getClass().getName() + "missing content id:");
+ logger.debug("missing content id:");
persistError(request,"error.tab.contentId.required");
request.setAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_ERROR);
+ logger.debug("forwarding to: " + MONITORING_REPORT);
return (mapping.findForward(MONITORING_REPORT));
}
@@ -536,10 +530,10 @@
request.getSession().setAttribute(CONTENT_LOCKED, new Boolean(false));
IQaService qaService=(IQaService)request.getSession().getAttribute(TOOL_SERVICE);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService: " + qaService);
+ logger.debug("retrieving qaService: " + qaService);
Long toolContentId=(Long)request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "toolContentId: " + toolContentId);
+ logger.debug("toolContentId: " + toolContentId);
if (toolContentId == null)
{
@@ -548,7 +542,7 @@
* in this case, toolContentId must have been passed separetely
*/
Long monitoredContentId=(Long)request.getSession().getAttribute(MONITORED_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "will generateEditActivityScreen: " + monitoredContentId);
+ logger.debug("will generateEditActivityScreen: " + monitoredContentId);
if (monitoredContentId == null)
{
@@ -559,16 +553,16 @@
}
request.getSession().setAttribute(MONITORED_CONTENT_ID, toolContentId);
- logger.debug(logger + " " + this.getClass().getName() + "will use monitoredContentId: " + toolContentId);
+ logger.debug("will use monitoredContentId: " + toolContentId);
QaContent qaContent=qaService.loadQa(toolContentId.longValue());
- logger.debug(logger + " " + this.getClass().getName() + "will use qaContent: " + qaContent);
+ logger.debug("will use qaContent: " + qaContent);
request.getSession().setAttribute(IS_MONITORING_DEFINE_LATER, new Boolean(qaContent.isDefineLater()));
- logger.debug(logger + " " + this.getClass().getName() + "IS_MONITORING_DEFINE_LATER: " + request.getSession().getAttribute(IS_MONITORING_DEFINE_LATER));
+ logger.debug("IS_MONITORING_DEFINE_LATER: " + request.getSession().getAttribute(IS_MONITORING_DEFINE_LATER));
- logger.debug(logger + " " + this.getClass().getName() + "calling studentActivityOccurredGlobal with: " + qaContent);
+ logger.debug("calling studentActivityOccurredGlobal with: " + qaContent);
boolean studentActivity=qaService.studentActivityOccurredGlobal(qaContent);
- logger.debug(logger + " " + this.getClass().getName() + "studentActivity on content: " + studentActivity);
+ logger.debug("studentActivity on content: " + studentActivity);
qaMonitoringForm.resetUserAction();
if (studentActivity == false)
@@ -578,20 +572,20 @@
*/
QaStarterAction qaStarterAction = new QaStarterAction();
QaAuthoringForm qaAuthoringForm = new QaAuthoringForm();
- logger.debug(logger + " " + this.getClass().getName() + "forward to Authoring Basic tab ");
+ logger.debug("forward to Authoring Basic tab ");
ActionForward actionForward=qaStarterAction.startMonitoringSummary(mapping, qaAuthoringForm, request, response);
- logger.debug(logger + " " + this.getClass().getName() + "actionForward: " + actionForward);
+ logger.debug("actionForward: " + actionForward);
return (actionForward);
}
else
{
- logger.debug(logger + " " + this.getClass().getName() + "forward to warning screen as the content is not allowed to be modified.");
+ logger.debug("forward to warning screen as the content is not allowed to be modified.");
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage("error.content.inUse"));
saveErrors(request,errors);
request.getSession().setAttribute(CONTENT_LOCKED, new Boolean(true));
request.setAttribute(START_MONITORING_SUMMARY_REQUEST, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forward to:" + LOAD);
+ logger.debug("forwarding to:" + LOAD);
return (mapping.findForward(LOAD));
}
}
@@ -608,15 +602,15 @@
if ((noToolSessionsAvailable !=null) && (noToolSessionsAvailable.booleanValue()))
{
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "detected noToolSessionsAvailable:" + noToolSessionsAvailable);
+ logger.debug("detected noToolSessionsAvailable:" + noToolSessionsAvailable);
persistError(request,"error.content.onlyContentAndNoSessions");
request.setAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_ERROR);
+ logger.debug("forwarding to: " + MONITORING_REPORT);
return (mapping.findForward(MONITORING_REPORT));
}
IQaService qaService=(IQaService)request.getSession().getAttribute(TOOL_SERVICE);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService: " + qaService);
+ logger.debug("retrieving qaService: " + qaService);
Map mapStats= new TreeMap(new QaStringComparator());
request.getSession().setAttribute(MAP_STATS,mapStats);
@@ -625,24 +619,24 @@
for (int toolSessionIdCounter=1; toolSessionIdCounter < READABLE_TOOL_SESSION_COUNT.intValue(); toolSessionIdCounter++)
{
String strToolSessionId=(String)sessionList.get("Group" + toolSessionIdCounter);
- logger.debug(logger + " " + this.getClass().getName() + "strToolSessionId from http session: " + strToolSessionId);
+ logger.debug("strToolSessionId from http session: " + strToolSessionId);
if ((strToolSessionId != null) && (strToolSessionId.length() > 0))
{
QaSession qaSession=qaService.retrieveQaSessionOrNullById(new Long(strToolSessionId).longValue());
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaSession: " + qaSession);
+ logger.debug("retrieving qaSession: " + qaSession);
if (qaSession != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaSession: " + qaSession);
+ logger.debug("retrieving qaSession: " + qaSession);
int countSessionUser=qaService.countSessionUser(qaSession);
- logger.debug(logger + " " + this.getClass().getName() + "countSessionUser: " + countSessionUser);
+ logger.debug("countSessionUser: " + countSessionUser);
mapStats.put(strToolSessionId, new Integer(countSessionUser).toString());
request.getSession().setAttribute(MAP_STATS,mapStats);
}
}
}
mapStats=(Map)request.getSession().getAttribute(MAP_STATS);
- logger.debug(logger + " " + this.getClass().getName() + "final MAP_STATS: " + mapStats);
+ logger.debug("final MAP_STATS: " + mapStats);
qaMonitoringForm.resetUserAction();
return (mapping.findForward(MONITORING_REPORT));
}
@@ -673,7 +667,7 @@
ServletException
{
request.getSession().setAttribute(DATAMAP_EDITABLE, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "will generate editable summary screen");
+ logger.debug("will generate editable summary screen");
return generateSummaryScreen(mapping, form, request, response);
}
@@ -687,40 +681,40 @@
IQaService qaService =QaUtils.getToolService(request);
if (qaMonitoringForm.getSubmitMonitoringInstructions() != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "request for prosssing Monitoring instructions :");
+ logger.debug("request for prosssing Monitoring instructions :");
qaMonitoringForm.setSubmitMonitoringInstructions(null);
- logger.debug(logger + " " + this.getClass().getName() + "online instructions :" + qaMonitoringForm.getOnlineInstructions());
- logger.debug(logger + " " + this.getClass().getName() + "offline instructions :" + qaMonitoringForm.getOfflineInstructions());
+ logger.debug("online instructions :" + qaMonitoringForm.getOnlineInstructions());
+ logger.debug("offline instructions :" + qaMonitoringForm.getOfflineInstructions());
Long initialMonitoringContentId=(Long)request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID);
if (initialMonitoringContentId == null)
{
- logger.debug(logger + " " + this.getClass().getName() + "missing content id:");
+ logger.debug("missing content id:");
persistError(request,"error.tab.contentId.required");
request.setAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_ERROR);
+ logger.debug("forwarding to: " + MONITORING_ERROR);
return (mapping.findForward(MONITORING_REPORT));
}
else
{
/**
* update the content
*/
- logger.debug(logger + " " + this.getClass().getName() + "content id: " + initialMonitoringContentId);
+ logger.debug("content id: " + initialMonitoringContentId);
QaContent qaContent=qaService.retrieveQa(initialMonitoringContentId.longValue());
- logger.debug(logger + " " + this.getClass().getName() + "qaContent: " + qaContent);
+ logger.debug("qaContent: " + qaContent);
qaContent.setOnlineInstructions(qaMonitoringForm.getOnlineInstructions());
qaContent.setOfflineInstructions(qaMonitoringForm.getOfflineInstructions());
qaService.updateQa(qaContent);
- logger.debug(logger + " " + this.getClass().getName() + "qaContent updated in the db");
+ logger.debug("qaContent updated in the db");
request.getSession().setAttribute(MONITORED_OFFLINE_INSTRUCTIONS, qaContent.getOfflineInstructions());
request.getSession().setAttribute(MONITORED_ONLINE_INSTRUCTIONS, qaContent.getOnlineInstructions());
- logger.debug(logger + " " + this.getClass().getName() + "session updated with on/off instructions");
+ logger.debug("session updated with online/offline instructions");
request.setAttribute(MONITORING_INSTRUCTIONS_UPDATE_MESSAGE, new Boolean(true));
return (mapping.findForward(MONITORING_REPORT));
}
}
- logger.debug(logger + " " + this.getClass().getName() + "end of online-offline instructions content handling");
+ logger.debug("end of online-offline instructions content handling");
return null;
}
@@ -733,7 +727,7 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug(logger + " " + this.getClass().getName() + "add " + message +" to ActionMessages:");
+ logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java
===================================================================
diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java (.../QaMonitoringForm.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java (.../QaMonitoringForm.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -15,7 +15,7 @@
import org.lamsfoundation.lams.tool.qa.QaAppConstants;
/**
- * @author ozgurd
+ * @author Ozgur Demirtas
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java
===================================================================
diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -6,7 +6,9 @@
*/
/**
- *
+ * @author Ozgur Demirtas
+
+ * *
* Monitoring screen does have 4 tabs:
* Summary : default tab, either all sessions by default or single sessions selected, enable edit responses and hide responses
* Instructions: Online+offline instructions+multipe file uploads + new table
@@ -17,6 +19,7 @@
* SUMMARY_TOOL_SESSIONS keeps all the passed toolSessionIds in an arrayList.
*/
+
package org.lamsfoundation.lams.tool.qa.web;
import java.io.IOException;
import java.util.Iterator;
@@ -53,7 +56,6 @@
throws IOException, ServletException, QaApplicationException
{
QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form;
- logger.debug(logger + " " + this.getClass().getName() + "started monitoring mode : " + qaMonitoringForm);
/**
* retrive the service
@@ -62,12 +64,11 @@
qaService =(IQaService)request.getSession().getAttribute(TOOL_SERVICE);
if (qaService == null)
{
- logger.debug(logger + " " + this.getClass().getName() + "qaService is not found yet:");
qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService from the session: " + qaService);
+ logger.debug("retrieving qaService from the session: " + qaService);
request.getSession().setAttribute(TOOL_SERVICE, qaService);
}
- logger.debug(logger + " " + this.getClass().getName() + "retrieved qaService: " + qaService);
+ logger.debug("retrieved qaService: " + qaService);
/**
* mark the http session as an authoring activity
@@ -94,47 +95,47 @@
{
persistError(request,"error.userId.notNumeric");
request.setAttribute(USER_EXCEPTION_USERID_NOTNUMERIC, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD_QUESTIONS);
+ logger.debug("forwarding to: " + MONITORING_REPORT);
return (mapping.findForward(MONITORING_REPORT));
}
}
if ((userId == null) || (userId.length()==0))
{
- logger.debug(logger + " " + this.getClass().getName() + "error: The tool expects userId");
+ logger.debug("error: The tool expects userId");
persistError(request,"error.authoringUser.notAvailable");
request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_ERROR);
+ logger.debug("forwarding to: " + MONITORING_REPORT);
return (mapping.findForward(MONITORING_REPORT));
}
- logger.debug(logger + " " + this.getClass().getName() + "TOOL_USER is:" + request.getSession().getAttribute(TOOL_USER));
+ logger.debug("TOOL_USER is:" + request.getSession().getAttribute(TOOL_USER));
String toolContentId=request.getParameter(TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "TOOL_CONTENT_ID: " + toolContentId);
+ logger.debug("TOOL_CONTENT_ID: " + toolContentId);
Long initialMonitoringContentId=(Long) request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "INITIAL_MONITORING_TOOL_CONTENT_ID: " + initialMonitoringContentId);
+ logger.debug("INITIAL_MONITORING_TOOL_CONTENT_ID: " + initialMonitoringContentId);
if ((toolContentId == null) || (toolContentId.length() == 0))
{
logger.debug(logger + "Warning!: toolContentId is not available!");
}
else if (initialMonitoringContentId != null)
{
- logger.debug(logger + " " + this.getClass().getName() + "using INITIAL_MONITORING_TOOL_CONTENT_ID: " + initialMonitoringContentId);
+ logger.debug("using INITIAL_MONITORING_TOOL_CONTENT_ID: " + initialMonitoringContentId);
toolContentId=initialMonitoringContentId.toString();
}
try
{
if ((toolContentId != null) && (toolContentId.length() > 0))
{
- logger.debug(logger + "Since TOOL_CONTENT_ID has been passed explicitly we will refer to that one instead of the one derived from tool sessions");
+ logger.debug("Since TOOL_CONTENT_ID has been passed explicitly we will refer to that one instead of the one derived from tool sessions");
if (!QaUtils.existsContent(new Long(toolContentId).longValue(), request))
{
persistError(request,"error.content.doesNotExist");
request.setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_ERROR);
+ logger.debug("forwarding to: " + MONITORING_ERROR);
return (mapping.findForward(MONITORING_REPORT));
}
request.getSession().setAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID, new Long(toolContentId));
@@ -144,10 +145,10 @@
{
persistError(request,"error.numberFormatException");
request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_ERROR);
+ logger.debug("forwarding to: " + MONITORING_ERROR);
return (mapping.findForward(MONITORING_REPORT));
}
- logger.debug(logger + "final INITIAL_MONITORING_TOOL_CONTENT_ID: " + request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID));
+ logger.debug("final INITIAL_MONITORING_TOOL_CONTENT_ID: " + request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID));
/**
* load the values for online and offline instructions
@@ -156,10 +157,10 @@
if (initialMonitoringContentId != null)
{
QaContent qaContent=qaService.retrieveQa(initialMonitoringContentId.longValue());
- logger.debug(logger + " " + this.getClass().getName() + "qaContent: " + qaContent);
+ logger.debug("qaContent: " + qaContent);
request.getSession().setAttribute(MONITORED_OFFLINE_INSTRUCTIONS, qaContent.getOfflineInstructions());
request.getSession().setAttribute(MONITORED_ONLINE_INSTRUCTIONS, qaContent.getOnlineInstructions());
- logger.debug(logger + " " + this.getClass().getName() + "session updated with online/offline instructions");
+ logger.debug("session updated with online/offline instructions");
}
/**
@@ -169,15 +170,15 @@
*/
boolean isOnlyContentIdAvailable = isOnlyContentIdAvailable(request);
- logger.debug(logger + "final isOnlyContentIdAvailable: " + isOnlyContentIdAvailable);
+ logger.debug("final isOnlyContentIdAvailable: " + isOnlyContentIdAvailable);
request.getSession().setAttribute(NO_TOOL_SESSIONS_AVAILABLE, new Boolean(false));
if (isOnlyContentIdAvailable == false)
{
/**
* this block of code will normally never run!
*/
- logger.debug(logger + "Warning! We are not supposed to reach here.");
+ logger.debug("Warning! We are not supposed to reach here!");
/*
logger.debug(logger + "found sessions: isOnlyContentIdAvailable: " + isOnlyContentIdAvailable);
if ((toolContentId != null) && (toolContentId.length() > 0))
@@ -224,23 +225,14 @@
}
else
{
- logger.debug(logger + "isOnlyContentIdAvailable: " + isOnlyContentIdAvailable);
- logger.debug(logger + "no tool sessions passed and they will be populated from toolContentId.");
+ logger.debug("isOnlyContentIdAvailable: " + isOnlyContentIdAvailable);
+ logger.debug("no tool sessions passed and they will be populated from toolContentId.");
qaMonitoringForm.resetUserAction();
- /*
- persistError(request,"error.content.onlyContentAndNoSessions");
- request.setAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS, new Boolean(true));
- request.getSession().setAttribute(NO_TOOL_SESSIONS_AVAILABLE, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + MONITORING_REPORT);
- request.getSession().setAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID, new Long(toolContentId));
- logger.debug(logger + "INITIAL_MONITORING_TOOL_CONTENT_ID: " + request.getSession().getAttribute(INITIAL_MONITORING_TOOL_CONTENT_ID));
- return (mapping.findForward(MONITORING_REPORT));
- */
- logger.debug(logger + "getting qaContent for toolContentId: " + toolContentId);
+ logger.debug("getting qaContent for toolContentId: " + toolContentId);
QaContent qaContent=qaService.loadQa(new Long(toolContentId).longValue());
- logger.debug(logger + "retrieved qaContent: " + qaContent);
+ logger.debug("retrieved qaContent: " + qaContent);
List listToolSessionIds=qaService.getToolSessionsForContent(qaContent);
- logger.debug(logger + "retrieved listToolSessionIds: " + listToolSessionIds);
+ logger.debug("retrieved listToolSessionIds: " + listToolSessionIds);
Map originalSessionList= new TreeMap(new QaStringComparator());
Iterator sessionIdsIterator=listToolSessionIds.iterator();
@@ -252,7 +244,7 @@
originalSessionList.put(new Integer(sessionIdCounter).toString(), derivedToolSessionId.toString());
sessionIdCounter++;
}
- logger.debug(logger + "constructed originalSessionList: " + originalSessionList);
+ logger.debug("constructed originalSessionList: " + originalSessionList);
if (originalSessionList.size() == 0)
request.getSession().setAttribute(NO_TOOL_SESSIONS_AVAILABLE, new Boolean(true));
@@ -277,15 +269,15 @@
* copyToolContent(Long fromContentId, Long toContentId)
*/
strFromToolContentId=request.getParameter(FROM_TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "FROM_TOOL_CONTENT_ID: " + strFromToolContentId);
+ logger.debug("FROM_TOOL_CONTENT_ID: " + strFromToolContentId);
if (strFromToolContentId == null)
{
throw new QaApplicationException("Exception occured: " +
"Tool expects a legitimate FROM_TOOL_CONTENT_ID from the container. Can't continue!");
}
strToToolContentId=request.getParameter(TO_TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "TO_TOOL_CONTENT_ID: " + strToToolContentId);
+ logger.debug("TO_TOOL_CONTENT_ID: " + strToToolContentId);
if (strToToolContentId == null)
{
throw new QaApplicationException("Exception occured: " +
@@ -311,7 +303,7 @@
* TESTED to work
*/
strToToolContentId=request.getParameter(TO_TOOL_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "TO_TOOL_CONTENT_ID: " + strToToolContentId);
+ logger.debug("TO_TOOL_CONTENT_ID: " + strToToolContentId);
if (strToToolContentId == null)
{
throw new QaApplicationException("Exception occured: " +
@@ -328,36 +320,36 @@
* Parameter: userId
*/
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "request for forceComplete");
+ logger.debug("request for forceComplete");
userId=request.getParameter(MONITOR_USER_ID);
- logger.debug(logger + " " + this.getClass().getName() + "MONITOR_USER_ID: " + userId);
+ logger.debug("MONITOR_USER_ID: " + userId);
qaService.setAsForceComplete(new Long(userId));
- logger.debug(logger + " " + this.getClass().getName() + "end of setAsForceComplete with userId: " + userId);
+ logger.debug("end of setAsForceComplete with userId: " + userId);
}
/**
* summary tab is one of the main tabs in monitoring screen, summary is the default tab
*/
else if (qaMonitoringForm.getSummary() != null)
{
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "do generateToolSessionDataMap");
+ logger.debug("do generateToolSessionDataMap");
QaMonitoringAction qaMonitoringAction= new QaMonitoringAction();
return qaMonitoringAction.generateToolSessionDataMap(mapping,form,request,response);
}
else if (qaMonitoringForm.getInstructions() != null)
{
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "request for instructions");
+ logger.debug("request for instructions");
}
else if (qaMonitoringForm.getEditActivity() != null)
{
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "request for editActivity");
+ logger.debug("request for editActivity");
}
else if (qaMonitoringForm.getStats() != null)
{
qaMonitoringForm.resetUserAction();
- logger.debug(logger + " " + this.getClass().getName() + "request for stats");
+ logger.debug("request for stats");
}
return null;
}
@@ -382,12 +374,12 @@
if (existsContentId && (!existsToolSession))
{
- logger.debug(logger + " " + this.getClass().getName() + "OnlyContentIdAvailable");
+ logger.debug("OnlyContentIdAvailable");
return true;
}
else
{
- logger.debug(logger + " " + this.getClass().getName() + "Not OnlyContentIdAvailable");
+ logger.debug("Not OnlyContentIdAvailable");
return false;
}
}
@@ -401,7 +393,7 @@
for (int toolSessionIdCounter=1; toolSessionIdCounter < MAX_TOOL_SESSION_COUNT.intValue(); toolSessionIdCounter++)
{
String strToolSessionId=request.getParameter(TOOL_SESSION_ID + toolSessionIdCounter);
- logger.debug(logger + " " + this.getClass().getName() + "TOOL_SESSION_ID: " + strToolSessionId);
+ logger.debug("TOOL_SESSION_ID: " + strToolSessionId);
if ((strToolSessionId != null) && (strToolSessionId.length() > 0))
{
QaSession qaSession=null;
@@ -417,37 +409,36 @@
if (qaSession != null)
{
QaContent qaContent=qaSession.getQaContent();
- logger.debug(logger + " " + this.getClass().getName() + "using qaContent: " + qaContent);
- logger.debug(logger + " " + this.getClass().getName() + "qaContent id versus toolSession's content id: " + toolContentId +
- " versus " + qaContent.getQaContentId());
+ logger.debug("using qaContent: " + qaContent);
+ logger.debug("qaContent id versus toolSession's content id: " + toolContentId + " versus " + qaContent.getQaContentId());
if (!qaContent.getQaContentId().equals(toolContentId))
{
- logger.debug(logger + " " + this.getClass().getName() + "qaContent and toolSesion not compatible:");
+ logger.debug("qaContent and toolSesion not compatible:");
return false;
}
}
else
{
- logger.debug(logger + " " + this.getClass().getName() + "error: TOOL_SESSION_ID passed does not refer to an existing tool session.");
+ logger.debug("error: TOOL_SESSION_ID passed does not refer to an existing tool session.");
request.setAttribute(USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST, new Boolean(true));
break;
}
}
if ((strToolSessionId == null) && (toolSessionIdCounter == 1))
{
- logger.debug(logger + " " + this.getClass().getName() + "error: TOOL_SESSION_IDs not passed in the right format");
+ logger.debug("error: TOOL_SESSION_IDs not passed in the right format");
request.setAttribute(USER_EXCEPTION_WRONG_FORMAT, new Boolean(true));
break;
}
if ((strToolSessionId != null) && (strToolSessionId.length() == 0) && (toolSessionIdCounter == 1))
{
- logger.debug(logger + " " + this.getClass().getName() + "error: TOOL_SESSION_IDs not passed in the right format");
+ logger.debug("error: TOOL_SESSION_IDs not passed in the right format");
request.setAttribute(USER_EXCEPTION_WRONG_FORMAT, new Boolean(true));
break;
}
}
- logger.debug(logger + " " + this.getClass().getName() + "qaContent and toolSesion compatible:");
+ logger.debug("qaContent and toolSesion compatible:");
return true;
}
@@ -460,7 +451,7 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug(logger + " " + this.getClass().getName() + "add " + message +" to ActionMessages:");
+ logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java
===================================================================
diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb)
@@ -1,4 +1,7 @@
/**
+ * @author Ozgur Demirtas
+ *
+ *
* Created on 8/03/2005
* initializes the tool's authoring mode
*/
@@ -57,20 +60,19 @@
QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form;
qaAuthoringForm.resetRadioBoxes();
- logger.debug(logger + " " + this.getClass().getName() + "reset radioboxes");
-
+
request.getSession().setAttribute(IS_DEFINE_LATER,"false");
request.getSession().setAttribute(DISABLE_TOOL,"");
/**
* retrive the service
*/
IQaService qaService = QaUtils.getToolService(request);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService from session: " + qaService);
+ logger.debug("retrieving qaService from session: " + qaService);
if (qaService == null)
{
qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService from proxy: " + qaService);
+ logger.debug("retrieving qaService from proxy: " + qaService);
request.getSession().setAttribute(TOOL_SERVICE, qaService);
}
@@ -80,20 +82,20 @@
long contentId=0;
try
{
- logger.debug(logger + " " + this.getClass().getName() + "attempt retrieving tool with signatute : " + MY_SIGNATURE);
+ logger.debug("attempt retrieving tool with signatute : " + MY_SIGNATURE);
contentId=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug(logger + " " + this.getClass().getName() + "retrieved tool default contentId: " + contentId);
+ logger.debug("retrieved tool default contentId: " + contentId);
if (contentId == 0)
{
- logger.debug(logger + " " + this.getClass().getName() + "default content id has not been setup");
+ logger.debug("default content id has not been setup");
persistError(request,"error.defaultContent.notSetup");
request.setAttribute(USER_EXCEPTION_DEAFULTCONTENT_NOTSETUP, new Boolean(true));
return (mapping.findForward(LOAD_QUESTIONS));
}
}
catch(Exception e)
{
- logger.debug(logger + " " + this.getClass().getName() + "error getting the default content id: " + e.getMessage());
+ logger.debug("error getting the default content id: " + e.getMessage());
persistError(request,"error.defaultContent.notSetup");
request.setAttribute(USER_EXCEPTION_DEAFULTCONTENT_NOTSETUP, new Boolean(true));
return (mapping.findForward(LOAD_QUESTIONS));
@@ -104,25 +106,24 @@
*/
try
{
- logger.debug(logger + " " + this.getClass().getName() + "retrieve the default question content based on default contentId: " + contentId);
+ logger.debug("retrieve the default question content based on default contentId: " + contentId);
QaQueContent qaQueContent=qaService.getToolDefaultQuestionContent(contentId);
- logger.debug(logger + " " + this.getClass().getName() + "using QaQueContent: " + qaQueContent);
+ logger.debug("using QaQueContent: " + qaQueContent);
if (qaQueContent == null)
{
- logger.debug(logger + " " + this.getClass().getName() + "Exception occured: " + " No default question content");
+ logger.debug("Exception occured: No default question content");
request.setAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE, new Boolean(true));
persistError(request,"error.defaultQuestionContent.notAvailable");
return (mapping.findForward(LOAD_QUESTIONS));
}
/**
* display a single sample question
*/
- System.out.println(this.getClass().getName() + "set default qa que content to: " + qaQueContent.getQuestion() );
request.getSession().setAttribute(DEFAULT_QUESTION_CONTENT, qaQueContent.getQuestion());
}
catch(Exception e)
{
- logger.debug(logger + " " + this.getClass().getName() + "Exception occured: " + " No default question content");
+ logger.debug("Exception occured: No default question content");
request.setAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE, new Boolean(true));
persistError(request,"error.defaultQuestionContent.notAvailable");
return (mapping.findForward(LOAD_QUESTIONS));
@@ -168,7 +169,7 @@
if ((userId == null) || (userId.length()==0))
{
- logger.debug(logger + " " + this.getClass().getName() + "error: The tool expects userId");
+ logger.debug("error: The tool expects userId");
persistError(request,"error.authoringUser.notAvailable");
request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true));
return (mapping.findForward(LOAD_QUESTIONS));
@@ -180,17 +181,17 @@
*/
String strToolContentId="";
Boolean isMonitoringEditActivityVisited=(Boolean)request.getSession().getAttribute(MONITORING_EDITACTIVITY_VISITED);
- logger.debug(logger + " " + this.getClass().getName() + "isMonitoringEditActivityVisited: " + isMonitoringEditActivityVisited);
+ logger.debug("isMonitoringEditActivityVisited: " + isMonitoringEditActivityVisited);
Long monitoredContentId=(Long)request.getSession().getAttribute(MONITORED_CONTENT_ID);
- logger.debug(logger + " " + this.getClass().getName() + "MONITORED_CONTENT_ID: " + monitoredContentId);
+ logger.debug("MONITORED_CONTENT_ID: " + monitoredContentId);
request.getSession().setAttribute(RENDER_MONITORING_EDITACTIVITY,new Boolean(false));
Boolean startMonitoringSummaryRequest=(Boolean)request.getAttribute(START_MONITORING_SUMMARY_REQUEST);
if ((startMonitoringSummaryRequest != null) && (startMonitoringSummaryRequest.booleanValue()))
{
- logger.debug(logger + " " + this.getClass().getName() + "will render Monitoring Edit Activity screen");
+ logger.debug("will render Monitoring Edit Activity screen");
if ((isMonitoringEditActivityVisited != null) && (isMonitoringEditActivityVisited.booleanValue()))
{
if (monitoredContentId != null)
@@ -199,23 +200,23 @@
* request is from Edit Activity tab in monitoring
*/
strToolContentId=monitoredContentId.toString();
- logger.debug(logger + " " + this.getClass().getName() + "request is from Edit Activity tab in monitoring: " + monitoredContentId);
- logger.debug(logger + " " + this.getClass().getName() + "using MONITORED_CONTENT_ID: " + monitoredContentId);
+ logger.debug("request is from Edit Activity tab in monitoring: " + monitoredContentId);
+ logger.debug("using MONITORED_CONTENT_ID: " + monitoredContentId);
request.getSession().setAttribute(RENDER_MONITORING_EDITACTIVITY,new Boolean(true));
}
}
}
else
{
- logger.debug(logger + " " + this.getClass().getName() + "will render authoring screen");
+ logger.debug("will render authoring screen");
/**
* request is from authoring environment
*/
request.setAttribute(START_MONITORING_SUMMARY_REQUEST, new Boolean(false));
- logger.debug(logger + " " + this.getClass().getName() + "request is from authoring environment: ");
+ logger.debug("request is from authoring environment: ");
strToolContentId=request.getParameter(TOOL_CONTENT_ID);
}
- logger.debug(logger + " " + this.getClass().getName() + "usable strToolContentId: " + strToolContentId);
+ logger.debug("usable strToolContentId: " + strToolContentId);
/**
* Process incoming tool content id
@@ -225,14 +226,14 @@
try
{
toolContentId=new Long(strToolContentId).longValue();
- logger.debug(logger + " " + this.getClass().getName() + "passed TOOL_CONTENT_ID : " + toolContentId);
+ logger.debug("passed TOOL_CONTENT_ID : " + toolContentId);
request.getSession().setAttribute(TOOL_CONTENT_ID,strToolContentId);
}
catch(NumberFormatException e)
{
persistError(request,"error.numberFormatException");
request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forwarding to: " + LOAD_QUESTIONS);
+ logger.debug("forwarding to: " + LOAD_QUESTIONS);
return (mapping.findForward(LOAD_QUESTIONS));
}
@@ -251,29 +252,29 @@
* get default content from db, user never created any content before
*/
contentId=qaService.getToolDefaultContentIdBySignature(MY_SIGNATURE);
- logger.debug(logger + " " + this.getClass().getName() + " " + "getting default content with id:" + contentId);
+ logger.debug("getting default content with id:" + contentId);
QaContent defaultQaContent = qaService.retrieveQa(contentId);
- logger.debug(logger + " " + this.getClass().getName() + " " + defaultQaContent);
+ logger.debug("defaultQaContent: " + defaultQaContent);
/**
- * this is a new content creation, the content must always be unlocked
+ * this is a new content creation, the content must always be unlocked
+ * CONTENT_LOCKED means CONTENT_IN_USE
*/
request.getSession().setAttribute(CONTENT_LOCKED, new Boolean(false));
- logger.debug(logger + " " + this.getClass().getName() + "CONTENT_LOCKED: " + request.getSession().getAttribute(CONTENT_LOCKED));
+ logger.debug("CONTENT_LOCKED: " + request.getSession().getAttribute(CONTENT_LOCKED));
if (defaultQaContent == null)
{
- logger.debug(logger + " " + this.getClass().getName() + "Exception occured: " + " No default content");
+ logger.debug("Exception occured: No default content");
request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE, new Boolean(true));
persistError(request,"error.defaultContent.notAvailable");
return (mapping.findForward(LOAD_QUESTIONS));
}
QaUtils.setDefaultSessionAttributes(request, defaultQaContent, qaAuthoringForm);
- logger.debug(logger + " " + this.getClass().getName() + "set UsernameVisible to OFF: ");
qaAuthoringForm.setUsernameVisible(OFF);
- logger.debug(logger + " " + this.getClass().getName() + "UsernameVisible: " + qaAuthoringForm.getUsernameVisible());
+ logger.debug("UsernameVisible: " + qaAuthoringForm.getUsernameVisible());
qaAuthoringForm.setQuestionsSequenced(OFF);
qaAuthoringForm.setSynchInMonitor(OFF);
@@ -282,46 +283,46 @@
* place the default question as the first entry in the Map
*/
mapQuestionContent.put(INITIAL_QUESTION_COUNT,request.getSession().getAttribute(DEFAULT_QUESTION_CONTENT));
- logger.debug(logger + " " + this.getClass().getName() + "Map initialized with default contentid to: " + mapQuestionContent);
+ logger.debug("Map initialized with default contentid to: " + mapQuestionContent);
}
else
{
/**
* fetch the existing content from db, user will be presented with her previously created content data
* Note that the content might have been LOCKED(content in use) if one or more learner has started activities with this content
*/
- logger.debug(logger + " " + this.getClass().getName() + " " + "getting existing content with id:" + toolContentId);
+ logger.debug("getting existing content with id:" + toolContentId);
QaContent defaultQaContent = qaService.retrieveQa(toolContentId);
- logger.debug(logger + " " + this.getClass().getName() + " " + defaultQaContent);
+ logger.debug("defaultQaContent: " + defaultQaContent);
boolean studentActivity=qaService.studentActivityOccurredGlobal(defaultQaContent);
- logger.debug(logger + " " + this.getClass().getName() + "studentActivity on content: " + studentActivity);
+ logger.debug("studentActivity on content: " + studentActivity);
if (studentActivity)
{
- logger.debug(logger + " " + this.getClass().getName() + "forward to warning screen as the content is not allowed to be modified.");
+ logger.debug("forward to warning screen as the content is not allowed to be modified.");
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage("error.content.inUse"));
saveErrors(request,errors);
request.getSession().setAttribute(CONTENT_LOCKED, new Boolean(true));
- logger.debug(logger + " " + this.getClass().getName() + "forward to:" + LOAD);
+ logger.debug("forwarding to:" + LOAD);
return (mapping.findForward(LOAD));
}
request.getSession().setAttribute(CONTENT_LOCKED, new Boolean(isContentLocked(defaultQaContent)));
- logger.debug(logger + " " + this.getClass().getName() + "CONTENT_LOCKED: " + request.getSession().getAttribute(CONTENT_LOCKED));
+ logger.debug("CONTENT_LOCKED: " + request.getSession().getAttribute(CONTENT_LOCKED));
QaUtils.setDefaultSessionAttributes(request, defaultQaContent, qaAuthoringForm);
/**
* determine the status of radio boxes
*/
- logger.debug(logger + " " + this.getClass().getName() + "IS_USERNAME_VISIBLE: " + defaultQaContent.isUsernameVisible());
- logger.debug(logger + " " + this.getClass().getName() + "set UsernameVisible to : " + defaultQaContent.isUsernameVisible());
+ logger.debug("IS_USERNAME_VISIBLE: " + defaultQaContent.isUsernameVisible());
+ logger.debug("set UsernameVisible to : " + defaultQaContent.isUsernameVisible());
if (defaultQaContent.isUsernameVisible())
qaAuthoringForm.setUsernameVisible(ON);
else
qaAuthoringForm.setUsernameVisible(OFF);
- logger.debug(logger + " " + this.getClass().getName() + "UsernameVisible: " + qaAuthoringForm.getUsernameVisible());
+ logger.debug("UsernameVisible: " + qaAuthoringForm.getUsernameVisible());
if (defaultQaContent.isSynchInMonitor())
qaAuthoringForm.setSynchInMonitor(ON);
else
@@ -343,26 +344,23 @@
request.getSession().setAttribute(END_LEARNING_MESSSAGE, defaultQaContent.getEndLearningMessage());
request.getSession().setAttribute(CREATION_DATE, defaultQaContent.getCreationDate());
- logger.debug(logger + " " + this.getClass().getName() + "IS_QUESTIONS_SEQUENCED_MONITORING: " +
- request.getSession().getAttribute(IS_QUESTIONS_SEQUENCED_MONITORING));
+ logger.debug("IS_QUESTIONS_SEQUENCED_MONITORING: " + request.getSession().getAttribute(IS_QUESTIONS_SEQUENCED_MONITORING));
+ logger.debug("IS_DEFINE_LATER: " + request.getSession().getAttribute(IS_DEFINE_LATER));
- logger.debug(logger + " " + this.getClass().getName() + "IS_DEFINE_LATER: " +
- request.getSession().getAttribute(IS_DEFINE_LATER));
-
/**
* get the existing question content
*/
- logger.debug(logger + " " + this.getClass().getName() + " " + "setting existing content data from the db");
+ logger.debug("setting existing content data from the db");
mapQuestionContent.clear();
Iterator queIterator=defaultQaContent.getQaQueContents().iterator();
Long mapIndex=new Long(1);
- logger.debug(logger + " " + this.getClass().getName() + " " + "mapQuestionContent: " + mapQuestionContent);
+ logger.debug("mapQuestionContent: " + mapQuestionContent);
while (queIterator.hasNext())
{
QaQueContent qaQueContent=(QaQueContent) queIterator.next();
if (qaQueContent != null)
{
- logger.debug(logger + " " + this.getClass().getName() + " " + "question: " + qaQueContent.getQuestion());
+ logger.debug("question: " + qaQueContent.getQuestion());
mapQuestionContent.put(mapIndex.toString(),qaQueContent.getQuestion());
/**
* make the first entry the default(first) one for jsp
@@ -372,17 +370,17 @@
mapIndex=new Long(mapIndex.longValue()+1);
}
}
- logger.debug(logger + " " + this.getClass().getName() + "Map initialized with existing contentid to: " + mapQuestionContent);
+ logger.debug("Map initialized with existing contentid to: " + mapQuestionContent);
}
request.getSession().setAttribute(MAP_QUESTION_CONTENT, mapQuestionContent);
- logger.debug(logger + " " + this.getClass().getName() + "starter initialized the Comparable Map: " + request.getSession().getAttribute("mapQuestionContent") );
+ logger.debug("starter initialized the Comparable Map: " + request.getSession().getAttribute("mapQuestionContent") );
/**
* load questions page
*/
- logger.debug(logger + " " + this.getClass().getName() + "START_MONITORING_SUMMARY_REQUEST: " + request.getAttribute(START_MONITORING_SUMMARY_REQUEST));
- logger.debug(logger + " " + this.getClass().getName() + "RENDER_MONITORING_EDITACTIVITY: " + request.getAttribute(RENDER_MONITORING_EDITACTIVITY));
+ logger.debug("START_MONITORING_SUMMARY_REQUEST: " + request.getAttribute(START_MONITORING_SUMMARY_REQUEST));
+ logger.debug("RENDER_MONITORING_EDITACTIVITY: " + request.getAttribute(RENDER_MONITORING_EDITACTIVITY));
qaAuthoringForm.resetUserAction();
return (mapping.findForward(LOAD_QUESTIONS));
}
@@ -400,24 +398,23 @@
* retrive the service
*/
IQaService qaService =QaUtils.getToolService(request);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaService: " + qaService);
-
- QaContent qaContent=qaService.loadQa(toolContentId);
- logger.debug(logger + " " + this.getClass().getName() + "retrieving qaContent: " + qaContent);
+ QaContent qaContent=qaService.loadQa(toolContentId);
if (qaContent == null)
return false;
return true;
}
/**
- * find out if the content is locked or not. If it is a locked content, the author can not modify it.
+ * find out if the content is locked or not. If it is a locked content, the author can not modify it.
+ * The idea of content being locked is, once any one learner starts using a particular content
+ * that content should become unmodifiable.
* @param qaContent
* @return
*/
protected boolean isContentLocked(QaContent qaContent)
{
- logger.debug(logger + " " + this.getClass().getName() + "is content locked: " + qaContent.isContentLocked());
+ logger.debug("is content locked: " + qaContent.isContentLocked());
return qaContent.isContentLocked();
}
@@ -439,8 +436,7 @@
{
ActionMessages errors= new ActionMessages();
errors.add(Globals.ERROR_KEY, new ActionMessage(message));
- logger.debug(logger + " " + this.getClass().getName() + "add " + message +" to ActionMessages:");
+ logger.debug("add " + message +" to ActionMessages:");
saveErrors(request,errors);
}
-
}