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 --> - + @@ -88,7 +88,7 @@ - @@ -122,7 +122,7 @@ /> - + @@ -200,7 +200,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -316,7 +316,7 @@ - Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java (.../Nullable.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Nullable.java (.../Nullable.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -26,7 +26,7 @@ * The domain object that allows NULL as return value should implement this * interface. * - * @author ozgurd + * @author Ozgur Demirtas * */ public interface Nullable Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -7,7 +7,7 @@ package org.lamsfoundation.lams.tool.qa; /** - * @author ozgurd + * @author Ozgur Demirtas * * TODO: Check back the constants with "Attention" * Holds constants used throughout the application Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaApplicationException.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaApplicationException.java (.../QaApplicationException.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaApplicationException.java (.../QaApplicationException.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -26,7 +26,7 @@ * not suppose to be try and catched in any level. The struts should be taking * care of handling this exception.

* - * @author ozgurd +* @author Ozgur Demirtas * */ public class QaApplicationException extends RuntimeException Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaComparator.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaComparator.java (.../QaComparator.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaComparator.java (.../QaComparator.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -12,7 +12,7 @@ import org.apache.log4j.Logger; /** - * @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/QaConstants.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaConstants.java (.../QaConstants.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaConstants.java (.../QaConstants.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -22,10 +22,13 @@ /** - * This is a constant utility class that defines all constants that needs to be + * + * @author Ozgur Demirtas + + * + * * This is a constant utility class that defines all constants that needs to be * shared around the qa tool. * - * @author ozgurd * */ Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaContent.java =================================================================== diff -u -rb7c4250adc416462793208c4393c5befc2dc69c7 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaContent.java (.../QaContent.java) (revision b7c4250adc416462793208c4393c5befc2dc69c7) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaContent.java (.../QaContent.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -13,7 +13,7 @@ /** - * @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/QaQueContent.java =================================================================== diff -u -r866e5012ca9e3e0591eef3d026f6406d5acc97b6 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java (.../QaQueContent.java) (revision 866e5012ca9e3e0591eef3d026f6406d5acc97b6) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueContent.java (.../QaQueContent.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -32,7 +32,7 @@ /** * - * @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/QaQueUsr.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueUsr.java (.../QaQueUsr.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaQueUsr.java (.../QaQueUsr.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -34,7 +34,7 @@ import org.apache.log4j.Logger; /** * - * @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/QaSession.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaSession.java (.../QaSession.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaSession.java (.../QaSession.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -35,6 +35,9 @@ /** + * + * @author Ozgur Demirtas + * * QaSession Value Object * The value object that maps to our model database table: tl_laqa11_session * The relevant hibernate mapping resides in: QaSession.hbm.xml Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaStringComparator.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaStringComparator.java (.../QaStringComparator.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaStringComparator.java (.../QaStringComparator.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -12,7 +12,7 @@ import org.apache.log4j.Logger; /** - * @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/QaUsrResp.java =================================================================== diff -u -rb7c4250adc416462793208c4393c5befc2dc69c7 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUsrResp.java (.../QaUsrResp.java) (revision b7c4250adc416462793208c4393c5befc2dc69c7) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUsrResp.java (.../QaUsrResp.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -11,6 +11,9 @@ /** + * + * @author Ozgur Demirtas + * * QaUsrResp Value Object * The value object that maps to our model database table: tl_laqa11_usr_resp * The relevant hibernate mapping resides in: QaQueResp.hbm.xml Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -29,8 +29,9 @@ * We use the same userId property as the user table key when we are saving learner responses and associated user data. * * */ + /** - * @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/dao/IQaContentDAO.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaContentDAO.java (.../IQaContentDAO.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaContentDAO.java (.../IQaContentDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -27,7 +27,7 @@ /** * - * @author ozgurd + * @author Ozgur Demirtas * */ public interface IQaContentDAO Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueContentDAO.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueContentDAO.java (.../IQaQueContentDAO.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueContentDAO.java (.../IQaQueContentDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -28,7 +28,7 @@ /** * - * @author ozgurd + * @author Ozgur Demirtas * */ public interface IQaQueContentDAO Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java (.../IQaQueUsrDAO.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaQueUsrDAO.java (.../IQaQueUsrDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -26,7 +26,7 @@ /** * - * @author ozgurd + * @author Ozgur Demirtas * */ public interface IQaQueUsrDAO Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java (.../IQaSessionDAO.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaSessionDAO.java (.../IQaSessionDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -28,7 +28,8 @@ /** * - * @author ozgurd + * * @author Ozgur Demirtas + * */ public interface IQaSessionDAO { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java (.../IQaUsrRespDAO.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUsrRespDAO.java (.../IQaUsrRespDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -25,7 +25,7 @@ /** * - * @author ozgurd + * @author Ozgur Demirtas * */ public interface IQaUsrRespDAO Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java (.../QaContentDAO.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java (.../QaContentDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -18,7 +18,7 @@ /** - * @author ozgurd + * @author Ozgur Demirtas * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates @@ -49,8 +49,7 @@ */ public QaContent loadQaById(long qaId) { - logger.debug(logger + " " + this.getClass().getName() + " " + "loadQaById called with: " + qaId); - return (QaContent) this.getHibernateTemplate().get(QaContent.class, new Long(qaId)); + return (QaContent) this.getHibernateTemplate().get(QaContent.class, new Long(qaId)); } @@ -104,7 +103,6 @@ /** GETS CALLED BY CONTRACT */ public void removeAllQaSession(QaContent qaContent){ - logger.debug(logger + " " + this.getClass().getName() + " " + "before removing all sessions: "); this.getHibernateTemplate().deleteAll(qaContent.getQaSessions()); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueContentDAO.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueContentDAO.java (.../QaQueContentDAO.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueContentDAO.java (.../QaQueContentDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -22,7 +22,7 @@ /** - * @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/dao/hibernate/QaQueUsrDAO.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaQueUsrDAO.java (.../QaQueUsrDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -16,7 +16,7 @@ /** - * @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/dao/hibernate/QaSessionDAO.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java (.../QaSessionDAO.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java (.../QaSessionDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -30,7 +30,7 @@ /** - * @author ozgurd + * @author Ozgur Demirtas * */ public class QaSessionDAO extends HibernateDaoSupport implements Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUsrRespDAO.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUsrRespDAO.java (.../QaUsrRespDAO.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUsrRespDAO.java (.../QaUsrRespDAO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -22,7 +22,6 @@ import net.sf.hibernate.Hibernate; -import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaQueUsr; import org.lamsfoundation.lams.tool.qa.QaUsrResp; import org.lamsfoundation.lams.tool.qa.dao.IQaUsrRespDAO; @@ -31,7 +30,7 @@ /** * - * @author ozgurd + * @author Ozgur Demirtas * */ public class QaUsrRespDAO extends HibernateDaoSupport implements IQaUsrRespDAO Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java (.../IQaService.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java (.../IQaService.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -35,7 +35,7 @@ * This interface define the contract that all Survey service provider must * follow. * - * @author ozgurd + * @author Ozgur Demirtas */ public interface IQaService { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java (.../QaServicePOJO.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java (.../QaServicePOJO.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -41,7 +41,6 @@ import org.lamsfoundation.lams.tool.qa.dao.IQaQueUsrDAO; import org.lamsfoundation.lams.tool.qa.dao.IQaSessionDAO; import org.lamsfoundation.lams.tool.qa.dao.IQaUsrRespDAO; -import org.lamsfoundation.lams.tool.qa.web.QaMonitoringAction; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; @@ -63,7 +62,7 @@ * new persistent session or connect to existing persistent session in the * begining and it close or disconnect to the persistent session in the end. * - * @author ozgurd + * @author Ozgur Demirtas * */ @@ -81,7 +80,7 @@ private IUserManagementService userManagementService; private ILamsToolService toolService; - static Logger logger = Logger.getLogger(QaMonitoringAction.class.getName()); + static Logger logger = Logger.getLogger(QaServicePOJO.class.getName()); public QaServicePOJO(){} @@ -359,7 +358,7 @@ { try { - logger.debug(logger + " " + this.getClass().getName() + "before updateQaSession: " + qaSession); + logger.debug("before updateQaSession: " + qaSession); qaSessionDAO.UpdateQaSession(qaSession); } catch (DataAccessException e) @@ -464,14 +463,14 @@ { try { - logger.debug(logger + " " + this.getClass().getName() + "getCurrentUserData: " + username); + logger.debug("getCurrentUserData: " + username); /** * this will return null if the username not found */ User user=userManagementService.getUserByLogin(username); if (user == null) { - logger.debug(logger + " " + this.getClass().getName() + "No user with the username: "+ username + " exists."); + logger.debug("No user with the username: "+ username + " exists."); throw new QaApplicationException("No user with that username exists."); } return user; @@ -620,33 +619,33 @@ */ public boolean studentActivityOccurredGlobal(QaContent qaContent) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + "using qaContent: " + qaContent); + logger.debug("using qaContent: " + qaContent); Iterator questionIterator=qaContent.getQaQueContents().iterator(); while (questionIterator.hasNext()) { QaQueContent qaQueContent=(QaQueContent)questionIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated question : " + qaQueContent); + logger.debug("iterated question : " + qaQueContent); Iterator responsesIterator=qaQueContent.getQaUsrResps().iterator(); while (responsesIterator.hasNext()) { - logger.debug(logger + " " + this.getClass().getName() + "there is at least one response"); + logger.debug("there is at least one response"); /** * proved the fact that there is at least one response for this content. */ return true; } } - logger.debug(logger + " " + this.getClass().getName() + "there is no response for this content"); + logger.debug("there is no response for this content"); return false; } public int countIncompleteSession(QaContent qa) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of countIncompleteSession: " + qa); - logger.debug(logger + " " + this.getClass().getName() + " " + "QaContentId: " + qa.getQaContentId()); + logger.debug("start of countIncompleteSession: " + qa); + logger.debug("qaContentId: " + qa.getQaContentId()); int countIncompleteSession=qaSessionDAO.countIncompleteSession(qa); - logger.debug(logger + " " + this.getClass().getName() + " " + "countIncompleteSession: " + countIncompleteSession); + logger.debug("countIncompleteSession: " + countIncompleteSession); return countIncompleteSession; } @@ -661,10 +660,10 @@ */ public boolean studentActivityOccurred(QaContent qa) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of studentActivityOccurred: " + qa); - logger.debug(logger + " " + this.getClass().getName() + " " + "QaContentId: " + qa.getQaContentId()); + logger.debug("start of studentActivityOccurred: " + qa); + logger.debug("qaContentId: " + qa.getQaContentId()); int countStudentActivity=qaSessionDAO.studentActivityOccurred(qa); - logger.debug(logger + " " + this.getClass().getName() + " " + "countIncompleteSession: " + countStudentActivity); + logger.debug("countIncompleteSession: " + countStudentActivity); if (countStudentActivity > 0) return true; return false; @@ -686,7 +685,7 @@ */ public void copyToolContent(Long fromContentId, Long toContentId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of copyToolContent with ids: " + fromContentId + " and " + toContentId); + logger.debug("start of copyToolContent with ids: " + fromContentId + " and " + toContentId); if (fromContentId == null || toContentId == null) throw new QaApplicationException("Failed to copy content" @@ -696,26 +695,26 @@ QaContent fromContent = qaDAO.loadQaById(fromContentId.longValue()); if (fromContent == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + "WARNING!, retrieved fromContent is null: "); + logger.debug("WARNING!, retrieved fromContent is null: "); throw new QaApplicationException("WARNING! Fail to create fromContent. Can't continue!"); } else { - logger.debug(logger + " " + this.getClass().getName() + " " + "retrieved fromContent: " + fromContent); + logger.debug("retrieved fromContent: " + fromContent); QaContent toContent = QaContent.newInstance(fromContent,toContentId); if (toContent == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + "WARNING!, retrieved fromContent is null: "); + logger.debug("WARNING!, retrieved fromContent is null: "); throw new QaApplicationException("WARNING! Fail to create toContent. Can't continue!"); } else { - logger.debug(logger + " " + this.getClass().getName() + " " + "retrieved toContent: " + toContent); + logger.debug("retrieved toContent: " + toContent); qaDAO.saveQa(toContent); - logger.debug(logger + " " + this.getClass().getName() + " " + "toContent has been saved successfully: " + toContent); + logger.debug("toContent has been saved successfully: " + toContent); } } - logger.debug(logger + " " + this.getClass().getName() + " " + "end of copyToolContent with ids: " + fromContentId + " and " + toContentId); + logger.debug("end of copyToolContent with ids: " + fromContentId + " and " + toContentId); } catch (DataAccessException e) { @@ -738,14 +737,14 @@ */ public void setAsForceCompleteSession(Long toolSessionId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + " request for setAsForceCompleteSession has come for toolSessionId: " + toolSessionId); + logger.debug("rrequest for setAsForceCompleteSession has come for toolSessionId: " + toolSessionId); QaSession qaSession=retrieveQaSessionOrNullById(toolSessionId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + " " + " retrieved qaSession is : " + qaSession); + logger.debug("retrieved qaSession is : " + qaSession); qaSession.setSession_status(QaSession.COMPLETED); - logger.debug(logger + " " + this.getClass().getName() + " " + " updated qaSession to COMPLETED : "); + logger.debug("updated qaSession to COMPLETED : "); updateQaSession(qaSession); - logger.debug(logger + " " + this.getClass().getName() + " " + " updated qaSession to COMPLETED in the db : "); + logger.debug("updated qaSession to COMPLETED in the db : "); } @@ -760,53 +759,53 @@ */ public void setAsForceComplete(Long userId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + " request for setAsForceComplete has come for userId: " + userId); + logger.debug("request for setAsForceComplete has come for userId: " + userId); QaQueUsr qaQueUsr=loadQaQueUsr(userId); if (qaQueUsr != null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " retrieved qaQueUsr : " + qaQueUsr); - logger.debug(logger + " " + this.getClass().getName() + " " + " retrieved qaQueUsr has the tool session : " + qaQueUsr.getQaSession()); + logger.debug("retrieved qaQueUsr : " + qaQueUsr); + logger.debug("retrieved qaQueUsr has the tool session : " + qaQueUsr.getQaSession()); QaSession qaSession=qaQueUsr.getQaSession(); if (qaSession != null) { Long usersToolSessionId=qaSession.getQaSessionId(); - logger.debug(logger + " " + this.getClass().getName() + " " + " retrieved tool session has tool session id : " + usersToolSessionId); + logger.debug("retrieved tool session has tool session id : " + usersToolSessionId); qaSession=retrieveQaSessionOrNullById(usersToolSessionId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + " " + " retrieved qaSession is : " + qaSession); + logger.debug("retrieved qaSession is : " + qaSession); qaSession.setSession_status(QaSession.COMPLETED); - logger.debug(logger + " " + this.getClass().getName() + " " + " updated qaSession to COMPLETED : "); + logger.debug("updated qaSession to COMPLETED : "); updateQaSession(qaSession); - logger.debug(logger + " " + this.getClass().getName() + " " + " updated qaSession to COMPLETED in the db : "); + logger.debug("updated qaSession to COMPLETED in the db : "); QaContent qaContent=qaSession.getQaContent(); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaSession uses qaContent : " + qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaSession uses qaContentId : " + qaContent.getQaContentId()); + logger.debug("qaSession uses qaContent : " + qaContent); + logger.debug("qaSession uses qaContentId : " + qaContent.getQaContentId()); /** * if all the sessions of this content is COMPLETED, unlock the content * */ int countIncompleteSession=countIncompleteSession(qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaSession countIncompleteSession : " + countIncompleteSession); + logger.debug("qaSession countIncompleteSession : " + countIncompleteSession); if (countIncompleteSession == 0) { qaContent.setContentLocked(false); updateQa(qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaContent has been updated for contentLocked" + qaContent); + logger.debug("qaContent has been updated for contentLocked" + qaContent); } } else { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved qaSession is null."); + logger.debug("WARNING!: retrieved qaSession is null."); throw new QaApplicationException("Fail to setAsForceComplete" + " based on null qaSession."); } } else { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved qaQueUsr is null."); + logger.debug("WARNING!: retrieved qaQueUsr is null."); throw new QaApplicationException("Fail to setAsForceComplete" + " based on null qaQueUsr."); } @@ -815,23 +814,23 @@ public void unsetAsDefineLater(Long toolContentId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + " request for unsetAsDefineLater with toolContentId: " + toolContentId); + logger.debug("request for unsetAsDefineLater with toolContentId: " + toolContentId); if (toolContentId == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved toolContentId is null."); + logger.debug("WARNING!: retrieved toolContentId is null."); throw new QaApplicationException("Fail to setAsDefineLater" + " based on null toolContentId."); } QaContent qaContent = qaDAO.loadQaById(toolContentId.longValue()); if (qaContent == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved qaContent is null."); + logger.debug("WARNING!!!: retrieved qaContent is null."); throw new QaApplicationException("Fail to unsetAsDefineLater" + " based on null qaContent."); } qaContent.setDefineLater(false); updateQa(qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaContent has been updated for unsetAsDefineLater: " + qaContent); + logger.debug("qaContent has been updated for unsetAsDefineLater: " + qaContent); } /** @@ -843,23 +842,23 @@ */ public void setAsDefineLater(Long toolContentId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + " request for setAsDefineLater with toolContentId: " + toolContentId); + logger.debug("request for setAsDefineLater with toolContentId: " + toolContentId); if (toolContentId == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved toolContentId is null."); + logger.debug("WARNING!: retrieved toolContentId is null."); throw new QaApplicationException("Fail to setAsDefineLater" + " based on null toolContentId."); } QaContent qaContent = qaDAO.loadQaById(toolContentId.longValue()); if (qaContent == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved qaContent is null."); + logger.debug("WARNING!: retrieved qaContent is null."); throw new QaApplicationException("Fail to setAsDefineLater" + " based on null qaContent."); } qaContent.setDefineLater(true); updateQa(qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaContent has been updated for defineLater: " + qaContent); + logger.debug("qaContent has been updated for defineLater: " + qaContent); } /** @@ -871,23 +870,23 @@ */ public void setAsRunOffline(Long toolContentId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + " request for setAsRunOffline with toolContentId:" + toolContentId); + logger.debug("request for setAsRunOffline with toolContentId:" + toolContentId); if (toolContentId == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved toolContentId is null."); + logger.debug("WARNING!: retrieved toolContentId is null."); throw new QaApplicationException("Fail to setAsRunOffline" + " based on null toolContentId."); } QaContent qaContent = qaDAO.loadQaById(toolContentId.longValue()); if (qaContent == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + " WARNING!!!: retrieved qaContent is null."); + logger.debug("WARNING!: retrieved qaContent is null."); throw new QaApplicationException("Fail to setAsRunOffline" + " based on null qaContent."); } qaContent.setRunOffline(true); updateQa(qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + " qaContent has been updated for RunOffline: " + qaContent); + logger.debug("qaContent has been updated for RunOffline: " + qaContent); } @@ -902,40 +901,40 @@ */ public void removeToolContent(Long toolContentId) { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of removeToolContent with toolContentId: " + toolContentId); + logger.debug("start of removeToolContent with toolContentId: " + toolContentId); QaContent qaContent = qaDAO.loadQaById(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaContent: " + qaContent); + logger.debug("retrieving qaContent: " + qaContent); if (qaContent != null) { Iterator sessionIterator=qaContent.getQaSessions().iterator(); while (sessionIterator.hasNext()) { QaSession qaSession=(QaSession)sessionIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaSession : " + qaSession); + logger.debug("iterated qaSession : " + qaSession); Iterator sessionUsersIterator=qaSession.getQaQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { QaQueUsr qaQueUsr=(QaQueUsr) sessionUsersIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr : " + qaQueUsr); + logger.debug("iterated qaQueUsr : " + qaQueUsr); Iterator sessionUsersResponsesIterator=qaQueUsr.getQaUsrResps().iterator(); while (sessionUsersResponsesIterator.hasNext()) { QaUsrResp qaUsrResp=(QaUsrResp)sessionUsersResponsesIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaUsrResp : " + qaUsrResp); + logger.debug("iterated qaUsrResp : " + qaUsrResp); removeUserResponse(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "removed qaUsrResp : " + qaUsrResp); + logger.debug("removed qaUsrResp : " + qaUsrResp); } } } - logger.debug(logger + " " + this.getClass().getName() + " " + "removed all existing responses of toolContent with toolContentId:" + + logger.debug("removed all existing responses of toolContent with toolContentId:" + toolContentId); qaDAO.removeQa(toolContentId); - logger.debug(logger + " " + this.getClass().getName() + " " + "removed qaContent:" + qaContent); + logger.debug("removed qaContent:" + qaContent); } } @@ -952,12 +951,12 @@ if (qaSession == null) { - logger.debug(logger + " " + this.getClass().getName() + "qaSession does not exist yet: " + toolSessionId); + logger.debug("qaSession does not exist yet: " + toolSessionId); return false; } else { - logger.debug(logger + " " + this.getClass().getName() + "retrieving an existing qaSession: " + qaSession + " " + toolSessionId); + logger.debug("retrieving an existing qaSession: " + qaSession + " " + toolSessionId); } return true; } @@ -972,7 +971,7 @@ */ public void createToolSession(Long toolSessionId, Long toolContentId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of createToolSession with ids: " + toolSessionId + " and " + toolContentId); + logger.debug("start of createToolSession with ids: " + toolSessionId + " and " + toolContentId); if (toolSessionId == null || toolContentId == null) throw new QaApplicationException("Fail to create a qa session" + " based on null toolSessionId or toolContentId"); @@ -983,11 +982,11 @@ try { QaContent qaContent = qaDAO.loadQaById(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + " " + "created qaContent: " + qaContent); + logger.debug("created qaContent: " + qaContent); if (qaContent == null) { - logger.debug(logger + " " + this.getClass().getName() + " " + "WARNING!!: qaContent is null! . " + + logger.debug("WARNING!: qaContent is null! . " + "We can't create a new tool session based on a null qa content. Can't continue!"); throw new QaApplicationException("WARNING! Fail to create tool session since there is no content with toolContentId:" + toolContentId); } @@ -1004,9 +1003,9 @@ qaContent, new TreeSet()); - logger.debug(logger + " " + this.getClass().getName() + " " + "created qaSession: " + qaSession); + logger.debug("created qaSession: " + qaSession); qaSessionDAO.CreateQaSession(qaSession); - logger.debug(logger + " " + this.getClass().getName() + " " + "created qaSession in the db: " + qaSession); + logger.debug("created qaSession in the db: " + qaSession); } } catch (DataAccessException e) @@ -1029,8 +1028,8 @@ */ public String leaveToolSession(Long toolSessionId,User learner) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of leaveToolSession with toolSessionId:" + toolSessionId); - logger.debug(logger + " " + this.getClass().getName() + " " + "start of leaveToolSession with learner:" + learner); + logger.debug("start of leaveToolSession with toolSessionId:" + toolSessionId); + logger.debug("start of leaveToolSession with learner:" + learner); try { /* @@ -1070,33 +1069,33 @@ public BasicToolVO getToolBySignature(String toolSignature) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + "attempt retrieving tool with signature : " + toolSignature); + logger.debug("attempt retrieving tool with signature : " + toolSignature); BasicToolVO tool=toolService.getToolBySignature(toolSignature); - logger.debug(logger + " " + this.getClass().getName() + " " + "retrieved tool: " + tool); + logger.debug("retrieved tool: " + tool); return tool; } public long getToolDefaultContentIdBySignature(String toolSignature) throws QaApplicationException { long contentId=0; - logger.debug(logger + " " + this.getClass().getName() + "before attempting retrieving tool with signature : " + toolSignature); + logger.debug("before attempting retrieving tool with signature : " + toolSignature); contentId=toolService.getToolDefaultContentIdBySignature(toolSignature); - logger.debug(logger + " " + this.getClass().getName() + " " + "tool default contentId : " + contentId); + logger.debug("tool default contentId : " + contentId); return contentId; } public QaQueContent getToolDefaultQuestionContent(long contentId) throws QaApplicationException { - logger.debug(logger + " " + this.getClass().getName() + "before attempting retrieving QaQueContent with contentId : " + contentId); + logger.debug("before attempting retrieving QaQueContent with contentId : " + contentId); QaQueContent qaQueContent=qaQueContentDAO.getToolDefaultQuestionContent(contentId); - logger.debug(logger + " " + this.getClass().getName() + "retrieved QaQueContent : " + qaQueContent); + logger.debug("retrieved QaQueContent : " + qaQueContent); return qaQueContent; } public List getToolSessionsForContent(QaContent qa) { - logger.debug(logger + " " + this.getClass().getName() + "attempt retrieving listToolSessionIds for : " + qa); + logger.debug("attempt retrieving listToolSessionIds for : " + qa); List listToolSessionIds=qaSessionDAO.getToolSessionsForContent(qa); return listToolSessionIds; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java (.../QaServiceProxy.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServiceProxy.java (.../QaServiceProxy.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -35,11 +35,12 @@ * In this way, the presentation tier will no longer be aware of the changes in * service layer. Therefore we can feel free to switch the business logic * implementation.

+ * + * @author Ozgur Demirtas * */ public class QaServiceProxy { - //private IQaService lnkIQaService; /** * Return the survey domain service object. It will delegate to the Spring * helper method to retrieve the proper bean from Spring bean factory. Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -29,7 +29,7 @@ /** * * Keeps all operations needed for Authoring mode. - * @author ozgurd + * @author Ozgur Demirtas * */ public class AuthoringUtil implements QaAppConstants{ @@ -42,17 +42,16 @@ */ protected void reconstructQuestionContentMapForAdd(Map mapQuestionContent, HttpServletRequest request) { - logger.debug(logger + " " + this.getClass().getName() + "pre-add Map content: " + mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "pre-add Map size: " + mapQuestionContent.size()); + logger.debug("pre-add Map content: " + mapQuestionContent); + logger.debug("pre-add Map size: " + mapQuestionContent.size()); - //repopulate the Map repopulateMap(mapQuestionContent, request); mapQuestionContent.put(new Long(mapQuestionContent.size()+1).toString(), ""); request.getSession().setAttribute("mapQuestionContent", mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "post-add Map is: " + mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "post-add count " + mapQuestionContent.size()); + logger.debug("post-add Map is: " + mapQuestionContent); + logger.debug("post-add count " + mapQuestionContent.size()); } @@ -64,24 +63,21 @@ protected void reconstructQuestionContentMapForRemove(Map mapQuestionContent, HttpServletRequest request, QaAuthoringForm qaAuthoringForm) { String questionIndex =qaAuthoringForm.getQuestionIndex(); - logger.debug(logger + " " + this.getClass().getName() + "pre-delete map content: " + mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "questionIndex: " + questionIndex); + logger.debug("pre-delete map content: " + mapQuestionContent); + logger.debug("questionIndex: " + questionIndex); long longQuestionIndex= new Long(questionIndex).longValue(); + logger.debug("pre-delete count: " + mapQuestionContent.size()); - logger.debug(logger + " " + this.getClass().getName() + "pre-delete count: " + mapQuestionContent.size()); - - //repopulate the Map repopulateMap(mapQuestionContent, request); - logger.debug(logger + " " + this.getClass().getName() + "after repopulateMap"); - logger.debug(logger + " " + this.getClass().getName() + "questionIndex: " + questionIndex); + logger.debug("post-repopulateMap questionIndex: " + questionIndex); mapQuestionContent.remove(new Long(longQuestionIndex).toString()); - logger.debug(logger + " " + this.getClass().getName() + "removed the question content with index: " + longQuestionIndex); + logger.debug("removed the question content with index: " + longQuestionIndex); request.getSession().setAttribute("mapQuestionContent", mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "post-delete count " + mapQuestionContent.size()); - logger.debug(logger + " " + this.getClass().getName() + "post-delete map content: " + mapQuestionContent); + logger.debug("post-delete count " + mapQuestionContent.size()); + logger.debug("post-delete map content: " + mapQuestionContent); } @@ -92,10 +88,9 @@ */ protected void reconstructQuestionContentMapForSubmit(Map mapQuestionContent, HttpServletRequest request) { - logger.debug(logger + " " + this.getClass().getName() + "pre-submit Map:" + mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "pre-submit Map size :" + mapQuestionContent.size()); + logger.debug("pre-submit Map:" + mapQuestionContent); + logger.debug("pre-submit Map size :" + mapQuestionContent.size()); - //repopulate the Map repopulateMap(mapQuestionContent, request); Map mapFinalQuestionContent = new TreeMap(new QaComparator()); @@ -105,13 +100,13 @@ if ((pairs.getValue() != null) && (!pairs.getValue().equals(""))) { mapFinalQuestionContent.put(pairs.getKey(), pairs.getValue()); - logger.debug(logger + " " + this.getClass().getName() + "Adding the pair: " + pairs.getKey() + " = " + pairs.getValue()); + logger.debug("adding the pair: " + pairs.getKey() + " = " + pairs.getValue()); } } mapQuestionContent=(TreeMap)mapFinalQuestionContent; request.getSession().setAttribute("mapQuestionContent", mapQuestionContent); - logger.debug(logger + " " + this.getClass().getName() + "post-submit Map:" + mapQuestionContent); + logger.debug("post-submit Map:" + mapQuestionContent); } @@ -122,28 +117,27 @@ */ protected void repopulateMap(Map mapQuestionContent, HttpServletRequest request) { - logger.debug(logger + " " + this.getClass().getName() + "queIndex: " + request.getSession().getAttribute("queIndex")); + logger.debug("queIndex: " + request.getSession().getAttribute("queIndex")); long queIndex= new Long(request.getSession().getAttribute("queIndex").toString()).longValue(); - logger.debug(logger + " " + this.getClass().getName() + "queIndex: " + queIndex); + logger.debug("queIndex: " + queIndex); - //if there is data in the Map remaining from previous session remove those + /** if there is data in the Map remaining from previous session remove those */ mapQuestionContent.clear(); - logger.debug(logger + " " + this.getClass().getName() + "Map got initialized: " + mapQuestionContent); + logger.debug("Map got initialized: " + mapQuestionContent); - for (long i=0; i < queIndex ; i++) { String candidateQuestionEntry =request.getParameter("questionContent" + i); if (i==0) { request.getSession().setAttribute("defaultQuestionContent", candidateQuestionEntry); - logger.debug(logger + " " + this.getClass().getName() + "defaultQuestionContent set to: " + candidateQuestionEntry); + logger.debug("defaultQuestionContent set to: " + candidateQuestionEntry); } if ((candidateQuestionEntry != null) && (candidateQuestionEntry.length() > 0)) { - logger.debug(logger + " " + this.getClass().getName() + "using key: " + i); + logger.debug("using key: " + i); mapQuestionContent.put(new Long(i+1).toString(), candidateQuestionEntry); - logger.debug(logger + " " + this.getClass().getName() + "added new entry: "); + logger.debug("added new entry."); } } } @@ -172,27 +166,27 @@ String choiceAdvanced=qaAuthoringForm.getChoiceAdvanced(); String choiceInstructions=qaAuthoringForm.getChoiceInstructions(); - //make the Basic tab the default one + /** make the Basic tab the default one */ request.getSession().setAttribute(CHOICE,CHOICE_TYPE_BASIC); if (choiceBasic != null) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_BASIC"); + logger.debug("CHOICE_TYPE_BASIC"); request.getSession().setAttribute(CHOICE,CHOICE_TYPE_BASIC); } else if (choiceAdvanced != null) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_ADVANCED"); + logger.debug("CHOICE_TYPE_ADVANCED"); request.getSession().setAttribute(CHOICE,CHOICE_TYPE_ADVANCED); } else if (choiceInstructions != null) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_INSTRUCTIONS"); + logger.debug("CHOICE_TYPE_INSTRUCTIONS"); request.getSession().setAttribute(CHOICE,CHOICE_TYPE_INSTRUCTIONS); } - logger.debug(logger + " " + this.getClass().getName() + "CHOICE is:" + request.getSession().getAttribute(CHOICE)); - //reset tab controllers + logger.debug("CHOICE is:" + request.getSession().getAttribute(CHOICE)); + /** reset tab controllers */ qaAuthoringForm.choiceBasic=null; qaAuthoringForm.choiceAdvanced=null; qaAuthoringForm.choiceInstructions=null; @@ -213,20 +207,18 @@ request.setAttribute(START_MONITORING_SUMMARY_REQUEST, new Boolean(false)); } - logger.debug(logger + " " + this.getClass().getName() + "QaCTION, START_MONITORING_SUMMARY_REQUEST: " + - request.getAttribute(START_MONITORING_SUMMARY_REQUEST)); - - logger.debug(logger + " " + this.getClass().getName() + "formIndex:" + request.getAttribute(FORM_INDEX)); + logger.debug("START_MONITORING_SUMMARY_REQUEST: " + request.getAttribute(START_MONITORING_SUMMARY_REQUEST)); + logger.debug("formIndex:" + request.getAttribute(FORM_INDEX)); request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(false)); if (qaAuthoringForm.getEdit() != null) { - logger.debug(logger + " " + this.getClass().getName() + "request for editActivity - editmode"); + logger.debug("request for editActivity - editmode"); 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); qaService.setAsDefineLater(monitoredContentId); - logger.debug(logger + " " + this.getClass().getName() + "MONITORED_CONTENT_ID has been marked as defineLater: "); + logger.debug("MONITORED_CONTENT_ID has been marked as defineLater: "); request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(true)); } else @@ -246,19 +238,18 @@ */ protected QaContent createContent(Map mapQuestionContent, HttpServletRequest request, QaAuthoringForm qaAuthoringForm) { - //get the service IQaService qaService =QaUtils.getToolService(request); - //the tool content id is passed from the container to the tool and placed into session in the QaStarterAction + /** the tool content id is passed from the container to the tool and placed into session in the QaStarterAction */ String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID); if ((toolContentId != null) && (!toolContentId.equals(""))) { - logger.debug(logger + " " + this.getClass().getName() + "passed TOOL_CONTENT_ID : " + new Long(toolContentId)); - //delete the existing content in the database before applying new content + logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId)); + /**delete the existing content in the database before applying new content*/ qaService.deleteQaById(new Long(toolContentId)); - logger.debug(logger + " " + this.getClass().getName() + "post-deletion existing content"); + logger.debug("post-deletion existing content"); } - logger.debug(logger + " " + this.getClass().getName() + "using TOOL_CONTENT_ID: " + toolContentId); + logger.debug("using TOOL_CONTENT_ID: " + toolContentId); request.getSession().setAttribute(TOOL_CONTENT_ID,toolContentId); boolean isQuestionsSequenced=false; @@ -278,7 +269,7 @@ Boolean renderMonitoringEditActivity=(Boolean)request.getSession().getAttribute(RENDER_MONITORING_EDITACTIVITY); if ((renderMonitoringEditActivity != null) && (renderMonitoringEditActivity.booleanValue())) { - logger.debug(logger + " " + this.getClass().getName() + "getting booleans based on editActivity"); + logger.debug("getting booleans based on editActivity"); isQuestionsSequencedBoolean=(Boolean)request.getSession().getAttribute(IS_QUESTIONS_SEQUENCED_MONITORING); isSynchInMonitorBoolean=(Boolean)request.getSession().getAttribute(IS_SYNCH_INMONITOR_MONITORING); isUsernameVisibleBoolean=(Boolean)request.getSession().getAttribute(IS_USERNAME_VISIBLE_MONITORING); @@ -300,17 +291,16 @@ } else { - logger.debug(logger + " " + this.getClass().getName() + "getting booleans based on normal flow: "); - logger.debug(logger + " " + this.getClass().getName() + "isQuestionsSequenced: " + qaAuthoringForm.getQuestionsSequenced()); + logger.debug("getting booleans based on normal flow: "); + logger.debug("isQuestionsSequenced: " + qaAuthoringForm.getQuestionsSequenced()); if (qaAuthoringForm.getQuestionsSequenced().equalsIgnoreCase(ON)) isQuestionsSequenced=true; - logger.debug(logger + " " + this.getClass().getName() + "isSynchInMonitor: " + qaAuthoringForm.getSynchInMonitor()); + logger.debug("isSynchInMonitor: " + qaAuthoringForm.getSynchInMonitor()); if (qaAuthoringForm.getSynchInMonitor().equalsIgnoreCase(ON)) isSynchInMonitor=true; - - logger.debug(logger + " " + this.getClass().getName() + "isUsernameVisible: " + qaAuthoringForm.getUsernameVisible()); + logger.debug("isUsernameVisible: " + qaAuthoringForm.getUsernameVisible()); if (qaAuthoringForm.getUsernameVisible().equalsIgnoreCase(ON)) isUsernameVisible=true; @@ -324,25 +314,24 @@ if (creationDate == null) creationDate=new Date(System.currentTimeMillis()).toString(); - - //obtain user object from the session + /**obtain user object from the session*/ User toolUser=(User)request.getSession().getAttribute(TOOL_USER); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser: " + toolUser); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser userId: " + toolUser.getUserId()); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserId()); String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser fullname: " + fullName); + logger.debug("retrieving toolUser fullname: " + fullName); long userId=toolUser.getUserId().longValue(); - //create a new qa content and leave the default content intact + /** create a new qa content and leave the default content intact*/ QaContent qa = new QaContent(); qa.setQaContentId(new Long(toolContentId)); qa.setTitle(qaAuthoringForm.getTitle()); qa.setInstructions(qaAuthoringForm.getInstructions()); - qa.setCreationDate(creationDate); //preserve this from the db - qa.setUpdateDate(new Date(System.currentTimeMillis())); //keep updating this one - qa.setCreatedBy(userId); //make sure we are setting the userId from the User object above + qa.setCreationDate(creationDate); /**preserve this from the db*/ + qa.setUpdateDate(new Date(System.currentTimeMillis())); /**keep updating this one*/ + qa.setCreatedBy(userId); /**make sure we are setting the userId from the User object above*/ qa.setUsernameVisible(isUsernameVisible); - qa.setQuestionsSequenced(isQuestionsSequenced); //the default question listing in learner mode will be all in the same page + qa.setQuestionsSequenced(isQuestionsSequenced); /**the default question listing in learner mode will be all in the same page*/ qa.setSynchInMonitor(isSynchInMonitor); qa.setOnlineInstructions(onlineInstructions); qa.setOfflineInstructions(offlineInstructions); @@ -351,12 +340,11 @@ qa.setMonitoringReportTitle(monitoringReportTitle); qa.setQaQueContents(new TreeSet()); qa.setQaSessions(new TreeSet()); - logger.debug(logger + " " + this.getClass().getName() + "qa content :" + qa); + logger.debug("qa content :" + qa); - //create the content in the db + /**create the content in the db*/ qaService.createQa(qa); - logger.debug(logger + " " + this.getClass().getName() + "qa created with content id: " + toolContentId); - + logger.debug("qa created with content id: " + toolContentId); return qa; } @@ -376,9 +364,9 @@ while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry)itMap.next(); - logger.debug(logger + " " + this.getClass().getName() + "Using the pair: " + pairs.getKey() + " = " + pairs.getValue()); + logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); - //make sure question entered is NOT blank + /**make sure question entered is NOT blank*/ if (pairs.getValue().toString().length() != 0) { QaQueContent queContent= new QaQueContent(pairs.getValue().toString(), @@ -387,16 +375,15 @@ null, null); - logger.debug(logger + " " + this.getClass().getName() + " queContent: " + queContent); + logger.debug("queContent: " + queContent); qaService.createQaQue(queContent); - logger.debug(logger + " " + this.getClass().getName() + "a qaQueContent created:"); + logger.debug("a qaQueContent created:"); } } - logger.debug(logger + " " + this.getClass().getName() + "all questions in the Map persisted:"); + logger.debug("all questions in the Map persisted:"); } - /** remove existing content data from the db * * qaService.removeToolContent(Long toolContentId) gets automatically called only in monitoring mode when @@ -412,24 +399,24 @@ protected void removeAllDBContent(HttpServletRequest request) { IQaService qaService =QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "retrieve qaService: " + qaService); + logger.debug("retrieve qaService: " + qaService); String toolContentId=null; if (request.getSession().getAttribute(TOOL_CONTENT_ID) != null) toolContentId=(String)(request.getSession().getAttribute(TOOL_CONTENT_ID)); if ((toolContentId != null) && (!toolContentId.equals(""))) { - logger.debug(logger + " " + this.getClass().getName() + "simulate container behaviour by calling: removeToolContent with: " + new Long(toolContentId)); + logger.debug("simulate container behaviour by calling: removeToolContent with: " + new Long(toolContentId)); /** * we are calling removeToolContent to clear content tables although this method normally * gets called only in the monitoring mode automatically by the core. * * Having this method here also makes sure that this contract has implemented and tested properly. */ qaService.removeToolContent(new Long(toolContentId)); - logger.debug(logger + " " + this.getClass().getName() + "simulated container behaviour by calling: removeToolContent with: " + toolContentId); - logger.debug(logger + " " + this.getClass().getName() + "removed content from database for content id:" + toolContentId); + logger.debug("simulated container behaviour by calling: removeToolContent with: " + toolContentId); + logger.debug("removed content from database for content id:" + toolContentId); } } @@ -442,16 +429,15 @@ public void simulatePropertyInspector_RunOffline(HttpServletRequest request) { IQaService qaService =QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "retrieve qaService: " + qaService); String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID); if ((toolContentId != null) && (!toolContentId.equals(""))) { - logger.debug(logger + " " + this.getClass().getName() + "passed TOOL_CONTENT_ID : " + new Long(toolContentId)); + logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId)); qaService.setAsRunOffline(new Long(toolContentId)); - logger.debug(logger + " " + this.getClass().getName() + "post-RunAsOffline"); + logger.debug("post-RunAsOffline"); } - logger.debug(logger + " " + this.getClass().getName() + "end of simulating RunOffline on content id: " + toolContentId); + logger.debug("end of simulating RunOffline on content id: " + toolContentId); } /** @@ -462,16 +448,15 @@ public void simulatePropertyInspector_setAsDefineLater(HttpServletRequest request) { IQaService qaService =QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "retrieve qaService: " + qaService); String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID); if ((toolContentId != null) && (!toolContentId.equals(""))) { - logger.debug(logger + " " + this.getClass().getName() + "passed TOOL_CONTENT_ID : " + new Long(toolContentId)); + logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId)); qaService.setAsDefineLater(new Long(toolContentId)); - logger.debug(logger + " " + this.getClass().getName() + "post-setAsDefineLater"); + logger.debug("post-setAsDefineLater"); } - logger.debug(logger + " " + this.getClass().getName() + "end of simulating setAsDefineLater on content id: " + toolContentId); + logger.debug("end of simulating setAsDefineLater on content id: " + toolContentId); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java =================================================================== diff -u -rdbc459a54a0eb6961b4c331f3174cc1fa4661f02 -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java (.../LearningUtil.java) (revision dbc459a54a0eb6961b4c331f3174cc1fa4661f02) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java (.../LearningUtil.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -31,7 +31,7 @@ /** * * Keeps all operations needed for Learning mode. - * @author ozgurd + * @author Ozgur Demirtas * */ public class LearningUtil implements QaAppConstants{ @@ -47,34 +47,34 @@ /** * retrive contentId from the http session */ - logger.debug(logger + " " + this.getClass().getName() + "attempt retrieving toolContentId: " + request.getSession().getAttribute(TOOL_CONTENT_ID)); + logger.debug("attempt retrieving toolContentId: " + request.getSession().getAttribute(TOOL_CONTENT_ID)); Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); QaContent qaContent=qaService.retrieveQa(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaContent: " + qaContent); + logger.debug("retrieving qaContent: " + qaContent); Iterator sessionIterator=qaContent.getQaSessions().iterator(); while (sessionIterator.hasNext()) { QaSession qaSession=(QaSession)sessionIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaSession : " + qaSession); + logger.debug("iterated qaSession : " + qaSession); Iterator sessionUsersIterator=qaSession.getQaQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { QaQueUsr qaQueUsr=(QaQueUsr) sessionUsersIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr : " + qaQueUsr); + logger.debug("iterated qaQueUsr : " + qaQueUsr); Iterator sessionUsersResponsesIterator=qaQueUsr.getQaUsrResps().iterator(); while (sessionUsersResponsesIterator.hasNext()) { QaUsrResp qaUsrResp=(QaUsrResp)sessionUsersResponsesIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaUsrResp : " + qaUsrResp); + logger.debug("iterated qaUsrResp : " + qaUsrResp); qaService.removeUserResponse(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "removed qaUsrResp : " + qaUsrResp); + logger.debug("removed qaUsrResp : " + qaUsrResp); } } } - logger.debug(logger + " " + this.getClass().getName() + "end of deleteSessionUsersAndResponses()"); + logger.debug("end of deleteSessionUsersAndResponses()"); } @@ -92,11 +92,11 @@ /** * retrive contentId from the http session */ - logger.debug(logger + " " + this.getClass().getName() + "attempt retrieving toolContentId: " + request.getSession().getAttribute(TOOL_CONTENT_ID)); + logger.debug("attempt retrieving toolContentId: " + request.getSession().getAttribute(TOOL_CONTENT_ID)); Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); QaContent qaContent=qaService.retrieveQa(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaContent: " + qaContent); + logger.debug("retrieving qaContent: " + qaContent); /** * get iterator of questions collection @@ -105,41 +105,41 @@ while (contentIterator.hasNext()) { QaQueContent qaQueContent=(QaQueContent)contentIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaQueContent: " + qaQueContent); + logger.debug("retrieving qaQueContent: " + qaQueContent); if (qaQueContent != null) { Set qaQueUsers=qaQueContent.getQaQueUsers(); - logger.debug(logger + " " + this.getClass().getName() + "qaQueUsers size: " + qaQueUsers.size()); + logger.debug("qaQueUsers size: " + qaQueUsers.size()); /** * iterate users and delete them */ Iterator usersIterator=qaQueUsers.iterator(); while (usersIterator.hasNext()) { QaQueUsr qaQueUsr=(QaQueUsr) usersIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaQueUsr: " + qaQueUsr); + logger.debug("retrieving qaQueUsr: " + qaQueUsr); if (qaQueUsr != null) { Set qaUsrResps=qaQueUsr.getQaUsrResps(); - logger.debug(logger + " " + this.getClass().getName() + "retrieving user's all responses : " + qaUsrResps); + logger.debug("retrieving user's all responses : " + qaUsrResps); Iterator responsesIterator=qaUsrResps.iterator(); while (responsesIterator.hasNext()) { QaUsrResp qaUsrResp=(QaUsrResp)responsesIterator.next(); if (qaUsrResp != null) { - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaUsrResp: " + qaUsrResp); + logger.debug("retrieving qaUsrResp: " + qaUsrResp); qaService.removeUserResponse(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "removed qaUsrResp with id:" + qaUsrResp.getResponseId()); + logger.debug("removed qaUsrResp with id:" + qaUsrResp.getResponseId()); } } qaService.deleteQaQueUsr(qaQueUsr); - logger.debug(logger + " " + this.getClass().getName() + "deleted user: " + qaQueUsr); + logger.debug("deleted user: " + qaQueUsr); } } } } - logger.debug(logger + " " + this.getClass().getName() + "end of deleteExistingUsersAndResponses()"); + logger.debug("end of deleteExistingUsersAndResponses()"); } @@ -153,42 +153,42 @@ protected void createUsersAndResponses(Map mapAnswers, HttpServletRequest request) { IQaService qaService =QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-retrieving qaService: " + qaService); + logger.debug("createUsers-retrieving qaService: " + qaService); User toolUser=(User)request.getSession().getAttribute(TOOL_USER); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser: " + toolUser); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser userId: " + toolUser.getUserId()); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser username: " + toolUser.getLogin()); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserId()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); /** * !!double check this!! */ String userName=toolUser.getLogin(); String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser fullname: " + fullName); + logger.debug("retrieving toolUser fullname: " + fullName); Long userId=new Long(toolUser.getUserId().longValue()); /** * retrive contentId from the http session */ - logger.debug(logger + " " + this.getClass().getName() + "createUsers-attempt retrieving toolContentId: " + request.getSession().getAttribute(TOOL_CONTENT_ID)); + logger.debug("createUsers-attempt retrieving toolContentId: " + request.getSession().getAttribute(TOOL_CONTENT_ID)); Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); /** * obtain QaContent to be used in creating QaQueUsr */ QaContent qaContent=qaService.retrieveQa(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-retrieving qaContent: " + qaContent); + logger.debug("createUsers-retrieving qaContent: " + qaContent); /** * get QaSession to be used in creating QaQueUsr */ Long toolSessionId=(Long)request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-retrieving toolSessionId: " + toolSessionId); + logger.debug("createUsers-retrieving toolSessionId: " + toolSessionId); QaSession qaSession = qaService.retrieveQaSessionOrNullById(toolSessionId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-retrieving qaSession: " + qaSession); + logger.debug("createUsers-retrieving qaSession: " + qaSession); Iterator contentIterator=qaContent.getQaQueContents().iterator(); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-attempt iteration questions"); + logger.debug("createUsers-attempt iteration questions"); QaQueUsr qaQueUsr= new QaQueUsr(userId, userName, @@ -197,14 +197,13 @@ qaSession, new TreeSet()); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-qaQueUsr: " + qaQueUsr); + logger.debug("createQaQueUsr - qaQueUsr: " + qaQueUsr); if (qaQueUsr != null) { qaService.createQaQueUsr(qaQueUsr); - logger.debug(logger + " " + this.getClass().getName() + "createUsers-qaQueUsr created in the db: " + qaQueUsr); + logger.debug("createUsers-qaQueUsr created in the db: " + qaQueUsr); } - while (contentIterator.hasNext()) { QaQueContent qaQueContent=(QaQueContent)contentIterator.next(); @@ -224,10 +223,9 @@ */ String answer=(String)mapAnswers.get(displayOrder); - logger.debug(logger + " " + this.getClass().getName() + "iterationg question-answers: displayOrder: " + displayOrder + - " question: " + question + " answer: " + answer); + logger.debug("iterationg question-answers: displayOrder: " + displayOrder + + " question: " + question + " answer: " + answer); - String timezone=(String)request.getSession().getAttribute(TIMEZONE); if (timezone == null) timezone=""; @@ -237,16 +235,16 @@ qaQueContent, qaQueUsr); - logger.debug(logger + " " + this.getClass().getName() + "iterationg qaUsrResp: " + qaUsrResp); + logger.debug("iterationg qaUsrResp: " + qaUsrResp); if (qaUsrResp != null) { qaService.createQaUsrResp(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "created qaUsrResp in the db"); + logger.debug("created qaUsrResp in the db"); } } } - logger.debug(logger + " " + this.getClass().getName() + "both users and their responses created in the db"); + logger.debug("both the users and their responses created in the db"); } @@ -267,85 +265,85 @@ * find out the current tool session */ Long toolSessionId=(Long) request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug(logger + " " + this.getClass().getName() + "processUserResponses using toolSessionId: " + toolSessionId); + logger.debug("processUserResponses using toolSessionId: " + toolSessionId); /** * holds all the tool sessions passed in from the url * used in monitoring mode */ Map mapToolSessions=(Map)request.getSession().getAttribute(MAP_TOOL_SESSIONS); - logger.debug(logger + " " + this.getClass().getName() + "retrieving MAP_TOOL_SESSIONS from the session: " + mapToolSessions); + logger.debug("retrieving MAP_TOOL_SESSIONS from the session: " + mapToolSessions); /** * keys of the Map refers to questions and values refers to user info and their entries * used in learning mode */ Map mapMainReport= new TreeMap(new QaStringComparator()); - logger.debug(logger + " " + this.getClass().getName() + "mapMainReport created with QaStringComparator"); + logger.debug("mapMainReport created with QaStringComparator"); Long toolContentId=(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug(logger + " " + this.getClass().getName() + "current toolContentId: " + toolContentId); + logger.debug("current toolContentId: " + toolContentId); QaContent qaContent=qaService.loadQa(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "retrieve qaContent: " + qaContent); + logger.debug("retrieve qaContent: " + qaContent); Iterator contentIterator=qaContent.getQaQueContents().iterator(); - logger.debug(logger + " " + this.getClass().getName() + "content iteration count: " + qaContent.getQaQueContents().size()); + logger.debug("content iteration count: " + qaContent.getQaQueContents().size()); int questionIndex=0; /** * used to iterate responses to questions within the tool sessions in the jsp level in the monitoring mode */ Map mapQuestions= new TreeMap(new QaStringComparator()); - logger.debug(logger + " " + this.getClass().getName() + "mapQuestions created with QaStringComparator"); + logger.debug("mapQuestions created with QaStringComparator"); /** * used to iterate questions within the tool sessions in the jsp level in the monitoring mode */ Map mapMonitoringQuestions= new TreeMap(new QaStringComparator()); - logger.debug(logger + " " + this.getClass().getName() + "mapMonitoringQuestions created with QaStringComparator"); + logger.debug("mapMonitoringQuestions created with QaStringComparator"); while (contentIterator.hasNext()) { QaQueContent qaQueContent=(QaQueContent)contentIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "retrieve qaQueContent: " + qaQueContent); + logger.debug("retrieve qaQueContent: " + qaQueContent); if (qaQueContent != null) { /** * obtain All responses from ALL users to this question */ Set qaUsrResps=qaQueContent.getQaUsrResps(); - logger.debug(logger + " " + this.getClass().getName() + "the set of user responses qaUsrResps: " + qaUsrResps); + logger.debug("the set of user responses qaUsrResps: " + qaUsrResps); /** * deal with all responses */ questionIndex=questionIndex+1; - logger.debug(logger + " " + this.getClass().getName() + "current questionIndex: " + questionIndex); + logger.debug("current questionIndex: " + questionIndex); String targetMode=(String )request.getSession().getAttribute(TARGET_MODE); - logger.debug(logger + " " + this.getClass().getName() + "TARGET_MODE: " + targetMode); + logger.debug("TARGET_MODE: " + targetMode); - logger.debug(logger + " " + this.getClass().getName() + "buidLearnerReport for TARGET_MODE: " + targetMode); + logger.debug("buidLearnerReport for TARGET_MODE: " + targetMode); if (targetMode.equalsIgnoreCase(TARGET_MODE_MONITORING)) { Map mapUserResponses=processUserResponses(request, qaUsrResps, questionIndex, new TreeMap()); /** * Map mapQuestions for holding the question index /responses pair */ mapQuestions.put(new Integer(questionIndex).toString(),mapUserResponses); - logger.debug(logger + " " + this.getClass().getName() + "getting mapQuestions: " + mapQuestions); + logger.debug("getting mapQuestions: " + mapQuestions); /** * Map mapQuestions for holding the questions themselves */ mapMonitoringQuestions.put(new Integer(questionIndex).toString(),qaQueContent.getQuestion()); - logger.debug(logger + " " + this.getClass().getName() + "getting mapMonitoringQuestions: " + mapMonitoringQuestions); + logger.debug("getting mapMonitoringQuestions: " + mapMonitoringQuestions); request.getSession().setAttribute(MAP_MONITORING_QUESTIONS,mapMonitoringQuestions); mapToolSessions.put(toolSessionId.toString(), mapQuestions); - logger.debug(logger + " " + this.getClass().getName() + "mapToolSessionsupdated: " + mapToolSessions); + logger.debug("mapToolSessionsupdated: " + mapToolSessions); request.getSession().setAttribute(MAP_TOOL_SESSIONS,mapToolSessions); - logger.debug(logger + " " + this.getClass().getName() + "MAP_TOOL_SESSIONS in session updated: " + mapToolSessions); + logger.debug("MAP_TOOL_SESSIONS in session updated: " + mapToolSessions); } else { @@ -355,13 +353,11 @@ } } } - logger.debug(logger + " " + this.getClass().getName() + "mapMainReport: " + mapMainReport); + logger.debug("mapMainReport: " + mapMainReport); request.getSession().setAttribute(MAP_MAIN_REPORT, mapMainReport); } - - /** * This method prepares the report to eb presented in both leraning and monitoring mode. * In learning mode in places the curresnt user's data in the first row. @@ -380,27 +376,26 @@ */ protected Map processUserResponses(HttpServletRequest request, Set qaUsrResps, int questionIndex, Map mapUserResponses) { - logger.debug(logger + " " + this.getClass().getName() + "will be processing user responses: "); + logger.debug("will be processing user responses: "); /** * find out the current tool session */ Long toolSessionId=(Long) request.getSession().getAttribute(TOOL_SESSION_ID); - logger.debug(logger + " " + this.getClass().getName() + "processUserResponses using toolSessionId: " + toolSessionId); + logger.debug("processUserResponses using toolSessionId: " + toolSessionId); - /** * find out the tool's mode. We produce different reports for learning and monitoring */ String targetMode=(String )request.getSession().getAttribute(TARGET_MODE); - logger.debug(logger + " " + this.getClass().getName() + "TARGET_MODE: " + targetMode); + logger.debug("TARGET_MODE: " + targetMode); if (targetMode.equalsIgnoreCase(TARGET_MODE_MONITORING)) { - logger.debug(logger + " " + this.getClass().getName() + "processUserResponses for TARGET_MODE: " + targetMode); + logger.debug("processUserResponses for TARGET_MODE: " + targetMode); if (qaUsrResps.isEmpty()) - logger.debug(logger + " " + this.getClass().getName() + "the set of user responses for a particular question is empty."); + logger.debug("the set of user responses for a particular question is empty."); Iterator itResps=qaUsrResps.iterator(); /** @@ -410,51 +405,50 @@ while (itResps.hasNext()) { QaUsrResp qaUsrResp=(QaUsrResp)itResps.next(); - logger.debug(logger + " " + this.getClass().getName() + "using qaUsrResp: " + qaUsrResp + " with responseIndex: " + responseIndex); + logger.debug("using qaUsrResp: " + qaUsrResp + " with responseIndex: " + responseIndex); /** * Don't include the blank answers in the report. Make sure it is the requirement. */ if ((qaUsrResp != null) && (qaUsrResp.getAnswer() != null) && (!qaUsrResp.getAnswer().equals(""))) { - logger.debug(logger + " " + this.getClass().getName() + "iterated qaUsrResp:" + qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "isResponseHidden: " + qaUsrResp.isHidden()); + logger.debug("iterated qaUsrResp:" + qaUsrResp); + logger.debug("isResponseHidden: " + qaUsrResp.isHidden()); QaQueUsr qaQueUsr=qaUsrResp.getQaQueUser(); //find out what you need to display: fullname or login (userName)? - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr fullName:" + qaQueUsr.getFullname()); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr userName:" + qaQueUsr.getUsername()); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr userName:" + qaQueUsr.getQaSession()); - logger.debug(logger + " " + this.getClass().getName() + "using responseIndex: " + responseIndex); + logger.debug("iterated qaQueUsr fullName:" + qaQueUsr.getFullname()); + logger.debug("iterated qaQueUsr userName:" + qaQueUsr.getUsername()); + logger.debug("iterated qaQueUsr userName:" + qaQueUsr.getQaSession()); + logger.debug("using responseIndex: " + responseIndex); QaSession qaSession=qaQueUsr.getQaSession(); if (toolSessionId.equals(qaSession.getQaSessionId())) { responseIndex=responseIndex+1; - logger.debug(logger + " " + this.getClass().getName() + "responseIndex incremented to: " + responseIndex); + logger.debug("responseIndex incremented to: " + responseIndex); mapUserResponses.put(new Integer(responseIndex).toString(), qaQueUsr.getFullname() + " " + qaUsrResp.getAttemptTime() + " " + qaUsrResp.getAnswer()); - logger.debug(logger + " " + this.getClass().getName() + "setting attemptTime: " + "aTime" + questionIndex +""+ responseIndex + "---------" + qaUsrResp.getAttemptTime()); - logger.debug(logger + " " + this.getClass().getName() + "setting final monitoring report data with:" + toolSessionId + " " + questionIndex + " " + responseIndex); + logger.debug("setting attemptTime: " + "aTime" + questionIndex +""+ responseIndex + "---------" + qaUsrResp.getAttemptTime()); + logger.debug("setting final monitoring report data with:" + toolSessionId + " " + questionIndex + " " + responseIndex); request.getSession().setAttribute(FULLNAME + toolSessionId + "" + questionIndex +""+ responseIndex, qaQueUsr.getFullname()); request.getSession().setAttribute(ANSWER + toolSessionId + "" + questionIndex +""+ responseIndex, qaUsrResp.getAnswer()); request.getSession().setAttribute(ATIME + toolSessionId + "" + questionIndex +""+ responseIndex, qaUsrResp.getAttemptTime()); request.getSession().setAttribute(RESPONSE_ID + toolSessionId + "" + questionIndex +""+ responseIndex, qaUsrResp.getResponseId()); boolean isResponseHidden=qaUsrResp.isHidden(); - logger.debug(logger + " " + this.getClass().getName() + "isResponseHidden: " + isResponseHidden); + logger.debug("isResponseHidden: " + isResponseHidden); request.getSession().setAttribute(RESPONSE_HIDDEN + toolSessionId + "" + questionIndex +""+ responseIndex, new Boolean(isResponseHidden)); } } } - } else if (targetMode.equalsIgnoreCase(TARGET_MODE_LEARNING)) { - logger.debug(logger + " " + this.getClass().getName() + "processUserResponses for TARGET_MODE: " + targetMode); + logger.debug("processUserResponses for TARGET_MODE: " + targetMode); /** * find out whos is the current user. Important to know for reporting responses in learning mode */ User toolUser=(User)request.getSession().getAttribute(TOOL_USER); - logger.debug(logger + " " + this.getClass().getName() + "retrieving toolUser: " + toolUser + " userName: " + toolUser.getLogin()); + logger.debug("retrieving toolUser: " + toolUser + " userName: " + toolUser.getLogin()); /** * !!double check if String userName=toolUser.getLogin(); */ @@ -465,11 +459,11 @@ * Only applies to learning mode. */ Boolean isUsernameVisible=(Boolean)request.getSession().getAttribute(IS_USERNAME_VISIBLE); - logger.debug(logger + " " + this.getClass().getName() + "IS_USERNAME_VISIBLE: " + isUsernameVisible); + logger.debug("IS_USERNAME_VISIBLE: " + isUsernameVisible); if (qaUsrResps.isEmpty()) - logger.debug(logger + " " + this.getClass().getName() + "the set of user responses for a particular question is empty."); + logger.debug("the set of user responses for a particular question is empty."); Iterator itResps=qaUsrResps.iterator(); /** @@ -479,19 +473,19 @@ while (itResps.hasNext()) { QaUsrResp qaUsrResp=(QaUsrResp)itResps.next(); - logger.debug(logger + " " + this.getClass().getName() + "using qaUsrResp: " + qaUsrResp + " with responseIndex: " + responseIndex); + logger.debug("using qaUsrResp: " + qaUsrResp + " with responseIndex: " + responseIndex); /** * Don't include the blank answers in the report. Make sure it is the requirement. */ if ((qaUsrResp != null) && (!qaUsrResp.isHidden()) && (qaUsrResp.getAnswer() != null) && (!qaUsrResp.getAnswer().equals(""))) { - logger.debug(logger + " " + this.getClass().getName() + "iterated qaUsrResp:" + qaUsrResp); + logger.debug("iterated qaUsrResp:" + qaUsrResp); QaQueUsr qaQueUsr=qaUsrResp.getQaQueUser(); //find out what you need to display: fullname or login (userName)? - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr fullName:" + qaQueUsr.getFullname()); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr userName:" + qaQueUsr.getUsername()); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr userName:" + qaQueUsr.getQaSession()); - logger.debug(logger + " " + this.getClass().getName() + "using responseIndex: " + responseIndex); + logger.debug("iterated qaQueUsr fullName:" + qaQueUsr.getFullname()); + logger.debug("iterated qaQueUsr userName:" + qaQueUsr.getUsername()); + logger.debug("iterated qaQueUsr userName:" + qaQueUsr.getQaSession()); + logger.debug("using responseIndex: " + responseIndex); /** * find out if the current tool user's login(userName) is the same as the iterated user's userName. @@ -508,58 +502,58 @@ * get user's tool session */ QaSession qaSession=qaQueUsr.getQaSession(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaQueUsr userName:" + qaSession.getQaSessionId()); - logger.debug(logger + " " + this.getClass().getName() + "incoming toolSessionId versus user's toolSessionId:" + toolSessionId + " versus " + qaSession.getQaSessionId()); + logger.debug("iterated qaQueUsr userName:" + qaSession.getQaSessionId()); + logger.debug("incoming toolSessionId versus user's toolSessionId:" + toolSessionId + " versus " + qaSession.getQaSessionId()); - logger.debug(logger + " " + this.getClass().getName() + "toolSessionId versus iterated session id: " + toolSessionId + "--" + qaSession.getQaSessionId()); - logger.debug(logger + " " + this.getClass().getName() + "learner report includes only those responses in the same tool session: " + toolSessionId); + logger.debug("toolSessionId versus iterated session id: " + toolSessionId + "--" + qaSession.getQaSessionId()); + logger.debug("learner report includes only those responses in the same tool session: " + toolSessionId); if (toolSessionId.equals(qaSession.getQaSessionId())) { responseIndex=responseIndex+1; - logger.debug(logger + " " + this.getClass().getName() + "responseIndex incremented to: " + responseIndex); + logger.debug("responseIndex incremented to: " + responseIndex); if (isUsernameVisible.booleanValue()) { - logger.debug(logger + " " + this.getClass().getName() + "IS_USERNAME_VISIBLE:" + isUsernameVisible.booleanValue()); + logger.debug("IS_USERNAME_VISIBLE:" + isUsernameVisible.booleanValue()); mapUserResponses.put(new Integer(responseIndex).toString(), qaQueUsr.getFullname() + " " + qaUsrResp.getAttemptTime() + " " + qaUsrResp.getAnswer()); - logger.debug(logger + " " + this.getClass().getName() + "Building request level response data with: " + + logger.debug("Building request level response data with: " + "fullname" + questionIndex +""+ responseIndex); request.getSession().setAttribute(FULLNAME + questionIndex +""+ responseIndex, qaQueUsr.getFullname()); } else /** we won't display the usernames of these users*/ { - logger.debug(logger + " " + this.getClass().getName() + "IS_USERNAME_VISIBLE:" + isUsernameVisible.booleanValue()); + logger.debug("IS_USERNAME_VISIBLE:" + isUsernameVisible.booleanValue()); mapUserResponses.put(new Integer(responseIndex).toString(), " " + qaUsrResp.getAttemptTime() + " " + qaUsrResp.getAnswer()); - logger.debug(logger + " " + this.getClass().getName() + "Building request level response data with: " + + logger.debug("Building request level response data with: " + "aTime" + questionIndex +""+ responseIndex); } /** * place these whether username visible or not */ - logger.debug(logger + " " + this.getClass().getName() + "setting attemptTime: " + "aTime" + questionIndex +""+ responseIndex + + logger.debug("setting attemptTime: " + "aTime" + questionIndex +""+ responseIndex + "---------" + qaUsrResp.getAttemptTime() +"-----" + qaUsrResp.getTimezone() ); request.getSession().setAttribute(ANSWER + questionIndex +""+ responseIndex, qaUsrResp.getAnswer()); request.getSession().setAttribute(ATIME + questionIndex +""+ responseIndex, qaUsrResp.getAttemptTime()); request.getSession().setAttribute(FORMATTED_ATIME + questionIndex +""+ responseIndex, QaUtils.getFormattedDateString(qaUsrResp.getAttemptTime())); - logger.debug(logger + " " + this.getClass().getName() + "setting formattedDatetime"); + logger.debug("setting formattedDatetime"); request.getSession().setAttribute(TIMEZONE + questionIndex +""+ responseIndex, qaUsrResp.getTimezone()); if (qaQueUsr.getUsername().equalsIgnoreCase(toolUser.getLogin())) { request.getSession().setAttribute(FULLNAME + questionIndex +""+ responseIndex, qaQueUsr.getFullname()); - logger.debug(logger + " " + this.getClass().getName() + "include fullName for current learner: " + "fullName" + questionIndex +""+ responseIndex + "---" + qaQueUsr.getFullname()); - logger.debug(logger + " " + this.getClass().getName() + "current learner:" + qaQueUsr.getUsername()); + logger.debug("include fullName for current learner: " + "fullName" + questionIndex +""+ responseIndex + "---" + qaQueUsr.getFullname()); + logger.debug("current learner:" + qaQueUsr.getUsername()); request.getSession().setAttribute(CURRENTLEARNER_FULLNAME , qaQueUsr.getFullname()); - logger.debug(logger + " " + this.getClass().getName() + "current learner fullname:" + qaQueUsr.getFullname()); + logger.debug("current learner fullname:" + qaQueUsr.getFullname()); } } } } } - logger.debug(logger + " " + this.getClass().getName() + "Learner report MAP_USER_RESPONSES: " + mapUserResponses); + logger.debug("Learner report MAP_USER_RESPONSES: " + mapUserResponses); return mapUserResponses; } @@ -573,9 +567,9 @@ protected void feedBackAnswersProgress(HttpServletRequest request, int currentQuestionIndex) { String totalQuestionCount=(String)request.getSession().getAttribute(TOTAL_QUESTION_COUNT); - logger.debug(logger + " " + this.getClass().getName() + "totalQuestionCount: " + totalQuestionCount); + logger.debug("totalQuestionCount: " + totalQuestionCount); int remainingQuestionCount=new Long(totalQuestionCount).intValue() - currentQuestionIndex +1; - logger.debug(logger + " " + this.getClass().getName() + "remainingQuestionCount: " + remainingQuestionCount); + logger.debug("remainingQuestionCount: " + remainingQuestionCount); String userFeedback=""; if (remainingQuestionCount != 0) userFeedback= "Remaining question count: " + remainingQuestionCount; @@ -589,14 +583,13 @@ { IQaService qaService =QaUtils.getToolService(request); Long toolContentId=(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug(logger + " " + this.getClass().getName() + "current toolContentId: " + toolContentId); + logger.debug("current toolContentId: " + toolContentId); QaContent qaContent=qaService.loadQa(toolContentId.longValue()); - logger.debug(logger + " " + this.getClass().getName() + "retrieve qaContent: " + qaContent); + logger.debug("retrieve qaContent: " + qaContent); qaContent.setContentLocked(true); - logger.debug(logger + " " + this.getClass().getName() + " " + "content with id : " + toolContentId + "has been marked LOCKED"); + logger.debug("content with id : " + toolContentId + "has been marked LOCKED"); qaService.updateQa(qaContent); - logger.debug(logger + " " + this.getClass().getName() + " " + "content with id : " + toolContentId + "has been marked LOCKED and updated in the db"); + logger.debug("content with id : " + toolContentId + "has been marked LOCKED and updated in the db"); } - } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -23,7 +23,7 @@ /** * * Keeps all operations needed for Monitoring mode. - * @author ozgurd + * @author Ozgur Demirtas * */ public class MonitoringUtil implements QaAppConstants{ @@ -37,11 +37,11 @@ public boolean isSessionsSync(HttpServletRequest request, long toolContentId) { - logger.debug(logger + " " + this.getClass().getName() + " " + "start of isSessionsSync with toolContentId: " + toolContentId); + logger.debug("start of isSessionsSync with toolContentId: " + toolContentId); IQaService qaService =QaUtils.getToolService(request); QaContent qaContent =qaService.loadQa(toolContentId); - logger.debug(logger + " " + this.getClass().getName() + "retrieving qaContent: " + qaContent); + logger.debug("retrieving qaContent: " + qaContent); /** * iterate all the tool sessions, if even one session is INCOMPLETE, the functions returns false @@ -52,7 +52,7 @@ while (sessionIterator.hasNext()) { QaSession qaSession=(QaSession)sessionIterator.next(); - logger.debug(logger + " " + this.getClass().getName() + "iterated qaSession : " + qaSession); + logger.debug("iterated qaSession : " + qaSession); if (qaSession.getSession_status().equalsIgnoreCase(QaSession.INCOMPLETE)) return false; } @@ -72,7 +72,7 @@ request.getSession().removeAttribute(DATAMAP_EDITABLE_RESPONSE_ID); request.getSession().removeAttribute(DATAMAP_HIDDEN_RESPONSE_ID); - //remove session attributes used commonly + /** remove session attributes used commonly */ request.getSession().removeAttribute(IS_USERNAME_VISIBLE); request.getSession().removeAttribute(REPORT_TITLE_MONITOR); request.getSession().removeAttribute(IS_ALL_SESSIONS_COMPLETED); @@ -99,15 +99,15 @@ * copyToolContent(Long fromContentId, Long toContentId) */ strFromToolContentId=request.getParameter(FROM_TOOL_CONTENT_ID); - logger.debug(logger + " " + " startLesson" + "FROM_TOOL_CONTENT_ID: " + strFromToolContentId); + logger.debug("startLesson" + "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 + " " + " startLesson" + "TO_TOOL_CONTENT_ID: " + strToToolContentId); + logger.debug("startLesson" + "TO_TOOL_CONTENT_ID: " + strToToolContentId); if (strToToolContentId == null) { throw new QaApplicationException("Exception occured: " + @@ -142,7 +142,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: " + @@ -160,11 +160,11 @@ * Parameter: userId */ qaMonitoringForm.resetUserAction(); - logger.debug(logger + " " + this.getClass().getName() + "request for forceComplete"); + logger.debug("request for forceComplete"); String 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); } @@ -203,25 +203,25 @@ if (choiceTypeMonitoringSummary != null) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_MONITORING_SUMMARY"); + logger.debug("CHOICE_TYPE_MONITORING_SUMMARY"); request.getSession().setAttribute(CHOICE_MONITORING,CHOICE_TYPE_MONITORING_SUMMARY); } else if ((choiceTypeMonitoringInstructions != null) || (qaMonitoringForm.getSubmitMonitoringInstructions() != null)) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_MONITORING_INSTRUCTIONS"); + logger.debug("CHOICE_TYPE_MONITORING_INSTRUCTIONS"); request.getSession().setAttribute(CHOICE_MONITORING,CHOICE_TYPE_MONITORING_INSTRUCTIONS); } else if (choiceTypeMonitoringEditActivity != null) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_MONITORING_EDITACTIVITY"); + logger.debug("CHOICE_TYPE_MONITORING_EDITACTIVITY"); request.getSession().setAttribute(CHOICE_MONITORING,CHOICE_TYPE_MONITORING_EDITACTIVITY); } else if (choiceTypeMonitoringStats != null) { - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_TYPE_MONITORING_STATS"); + logger.debug("CHOICE_TYPE_MONITORING_STATS"); request.getSession().setAttribute(CHOICE_MONITORING,CHOICE_TYPE_MONITORING_STATS); } - logger.debug(logger + " " + this.getClass().getName() + "CHOICE_MONITORING is:" + request.getSession().getAttribute(CHOICE_MONITORING)); + logger.debug("CHOICE_MONITORING is:" + request.getSession().getAttribute(CHOICE_MONITORING)); /** reset tab controllers */ qaMonitoringForm.setSummary(null); @@ -236,8 +236,8 @@ Boolean monitoringEditActivityVisited = (Boolean) request.getSession().getAttribute(MONITORING_EDITACTIVITY_VISITED); Boolean monitoringStatsVisited = (Boolean) request.getSession().getAttribute(MONITORING_STATS_VISITED); - logger.debug(logger + " " + this.getClass().getName() + "isNonDefaultScreensVisited:" + monitoringInstructionsVisited - + " " + monitoringEditActivityVisited + " " + monitoringStatsVisited); + logger.debug("isNonDefaultScreensVisited:" + monitoringInstructionsVisited + " " + + monitoringEditActivityVisited + " " + monitoringStatsVisited); if ((monitoringInstructionsVisited != null) && (monitoringInstructionsVisited.booleanValue())) return true; @@ -255,36 +255,36 @@ { IQaService qaService=QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "load response with responseId: " + new Long(responseId).longValue()); + logger.debug("load response with responseId: " + new Long(responseId).longValue()); QaUsrResp qaUsrResp=qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug(logger + " " + this.getClass().getName() + "loaded user response: " + qaUsrResp); + logger.debug("loaded user response: " + qaUsrResp); qaUsrResp.setAnswer(updatedResponse); qaService.updateQaUsrResp(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "updated user response in the db: " + qaUsrResp); + logger.debug("updated user response in the db: " + qaUsrResp); } public void hideResponse(HttpServletRequest request, String responseId) { IQaService qaService=QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "load response with responseId for hiding: " + new Long(responseId).longValue()); + logger.debug("load response with responseId for hiding: " + new Long(responseId).longValue()); QaUsrResp qaUsrResp=qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug(logger + " " + this.getClass().getName() + "loaded user response: " + qaUsrResp); + logger.debug("loaded user response: " + qaUsrResp); qaUsrResp.setHidden(true); qaService.updateQaUsrResp(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "updated user response in the db: " + qaUsrResp); + logger.debug("updated user response in the db: " + qaUsrResp); } public void unHideResponse(HttpServletRequest request, String responseId) { IQaService qaService=QaUtils.getToolService(request); - logger.debug(logger + " " + this.getClass().getName() + "load response with responseId for un-hiding: " + new Long(responseId).longValue()); + logger.debug("load response with responseId for un-hiding: " + new Long(responseId).longValue()); QaUsrResp qaUsrResp=qaService.retrieveQaUsrResp(new Long(responseId).longValue()); - logger.debug(logger + " " + this.getClass().getName() + "loaded user response: " + qaUsrResp); + logger.debug("loaded user response: " + qaUsrResp); qaUsrResp.setHidden(false); qaService.updateQaUsrResp(qaUsrResp); - logger.debug(logger + " " + this.getClass().getName() + "updated user response in the db: " + qaUsrResp); + logger.debug("updated user response in the db: " + qaUsrResp); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java =================================================================== diff -u -r16e844de3f7c34b44baee1b28e67e708f42d00bf -r5ba75a338c76b23778bf80ab835209d38e2316cb --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java (.../QAction.java) (revision 16e844de3f7c34b44baee1b28e67e708f42d00bf) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java (.../QAction.java) (revision 5ba75a338c76b23778bf80ab835209d38e2316cb) @@ -43,25 +43,19 @@ import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.usermanagement.User; + /** * - * monitoring to support modification and hiding of user responses + * once lams_learning is ready and appContext file is src/ then FINISH toool session will work. * */ + /** * - * once lams_learning is erady and appContext file is src/ then FINISH toool session will work. - * - */ -/** - * - * content_locked is done - */ -/** - * * done: removed styling, except error messages and table centering * */ + /** * The tool's Spring configuration file: qaCompactApplicationContext.xml * Main service bean of the tool is: org.lamsfoundation.lams.tool.qa.service.QaServicePOJO @@ -72,9 +66,10 @@ /** * - * the tool's web.xml will be modified to have classpath to learning service. + * the tool's web.xml will be modified to have classpath to learning service. * This is how the tool gets the definition of "learnerService" */ + /** * * when to reset define later and synchin monitor etc.. @@ -106,14 +101,9 @@ * http://jira.jboss.com/jira/browse/JBWEB-19 */ -/** - * TO DO: definelater to be created completely at monitor time? - * populating User id from the tool url. - * - */ /** - * eliminate the calls to: + * eliminate calls: * authoringUtil.simulatePropertyInspector_RunOffline(request); * authoringUtil.simulatePropertyInspector_setAsDefineLater(request); */ @@ -154,10 +144,6 @@ * GROUPING SUPPORT: Find out what to do. */ -/** - * - * take force_offline and define_later outside of the tool - */ /** *

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); } - }