Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentUserDAO.java =================================================================== diff -u -r5c770157545dea3dbc72e22a1dd1107c56cf22eb -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentUserDAO.java (.../AssessmentUserDAO.java) (revision 5c770157545dea3dbc72e22a1dd1107c56cf22eb) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/AssessmentUserDAO.java (.../AssessmentUserDAO.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -33,14 +33,18 @@ AssessmentUser getUserByUserIDAndSessionID(Long userID, Long sessionId); - AssessmentUser getUserByUserIDAndContentID(Long userId, Long contentId); + AssessmentUser getUserCreatedAssessment(Long userId, Long contentId); + + AssessmentUser getUserByIdAndContent(Long userId, Long contentId); List getBySessionID(Long sessionId); List getPagedUsersBySession(Long sessionId, int page, int size, String sortBy, String sortOrder, String searchString, IUserManagementService userManagementService); int getCountUsersBySession(Long sessionId, String searchString); + + int getCountUsersByContentId(Long contentId); List getPagedUsersBySessionAndQuestion(Long sessionId, Long questionUid, int page, int size, String sortBy, String sortOrder, String searchString, IUserManagementService userManagementService); Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentUserDAOHibernate.java =================================================================== diff -u -r5c770157545dea3dbc72e22a1dd1107c56cf22eb -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentUserDAOHibernate.java (.../AssessmentUserDAOHibernate.java) (revision 5c770157545dea3dbc72e22a1dd1107c56cf22eb) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dao/hibernate/AssessmentUserDAOHibernate.java (.../AssessmentUserDAOHibernate.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -40,8 +40,6 @@ @Repository public class AssessmentUserDAOHibernate extends LAMSBaseDAO implements AssessmentUserDAO { - private static final String FIND_BY_USER_ID_CONTENT_ID = "from " + AssessmentUser.class.getName() - + " as u where u.userId =? and u.assessment.contentId=?"; private static final String FIND_BY_USER_ID_SESSION_ID = "from " + AssessmentUser.class.getName() + " as u where u.userId =? and u.session.sessionId=?"; private static final String FIND_BY_SESSION_ID = "from " + AssessmentUser.class.getName() @@ -74,7 +72,10 @@ @SuppressWarnings("rawtypes") @Override - public AssessmentUser getUserByUserIDAndContentID(Long userId, Long contentId) { + public AssessmentUser getUserCreatedAssessment(Long userId, Long contentId) { + final String FIND_BY_USER_ID_CONTENT_ID = "from " + AssessmentUser.class.getName() + + " as u where u.userId =? and u.assessment.contentId=?"; + List list = doFind(FIND_BY_USER_ID_CONTENT_ID, new Object[] { userId, contentId }); if (list == null || list.size() == 0) { return null; @@ -83,6 +84,18 @@ } @Override + public AssessmentUser getUserByIdAndContent(Long userId, Long contentId) { + final String FIND_BY_USER_ID_CONTENT_ID = "from " + AssessmentUser.class.getName() + + " as u where u.userId =? and u.session.assessment.contentId=?"; + + List list = doFind(FIND_BY_USER_ID_CONTENT_ID, new Object[] { userId, contentId }); + if (list == null || list.size() == 0) { + return null; + } + return (AssessmentUser) list.get(0); + } + + @Override @SuppressWarnings("unchecked") public List getBySessionID(Long sessionId) { return (List) this.doFind(FIND_BY_SESSION_ID, sessionId); @@ -172,7 +185,24 @@ return ((Number) list.get(0)).intValue(); } } + + @Override + public int getCountUsersByContentId(Long contentId) { + String LOAD_USERS_ORDERED_BY_NAME = "SELECT COUNT(*) FROM " + AssessmentUser.class.getName() + " user" + + " WHERE user.assessment.contentId = :contentId "; + + Query query = getSession().createQuery(LOAD_USERS_ORDERED_BY_NAME); + query.setLong("contentId", contentId); + List list = query.list(); + + if ((list == null) || (list.size() == 0)) { + return 0; + } else { + return ((Number) list.get(0)).intValue(); + } + } + @SuppressWarnings("rawtypes") @Override public Object[] getStatsMarksBySession(Long sessionId) { Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentDTO.java =================================================================== diff -u --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentDTO.java (revision 0) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentDTO.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,46 @@ +package org.lamsfoundation.lams.tool.assessment.dto; + +import java.util.Set; + +import org.lamsfoundation.lams.tool.assessment.model.Assessment; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion; + +public class TblAssessmentDTO { + private String activityTitle; + private Assessment assessment; + private int attemptedLearnersNumber; + private Set questions; + + public String getActivityTitle() { + return activityTitle; + } + + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + + public Assessment getAssessment() { + return assessment; + } + + public void setAssessment(Assessment assessment) { + this.assessment = assessment; + } + + public int getAttemptedLearnersNumber() { + return attemptedLearnersNumber; + } + + public void setAttemptedLearnersNumber(int attemptedLearnersNumber) { + this.attemptedLearnersNumber = attemptedLearnersNumber; + } + + public Set getQuestions() { + return questions; + } + + public void setQuestions(Set questions) { + this.questions = questions; + } + +} Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentQuestionDTO.java =================================================================== diff -u --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentQuestionDTO.java (revision 0) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentQuestionDTO.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,48 @@ +package org.lamsfoundation.lams.tool.assessment.dto; + +import java.util.List; + +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion; + +/** + * TBL modification of Assessment tool's QuestionSummary. + */ +public class TblAssessmentQuestionDTO { + private AssessmentQuestion question; + private List sessionQuestionResults; + + private String questionTypeLabel; + private String correctAnswer; + + public AssessmentQuestion getQuestion() { + return question; + } + + public void setQuestion(AssessmentQuestion question) { + this.question = question; + } + + public List getSessionQuestionResults() { + return sessionQuestionResults; + } + + public void setSessionQuestionResults(List sessionQuestionResults) { + this.sessionQuestionResults = sessionQuestionResults; + } + + public String getQuestionTypeLabel() { + return questionTypeLabel; + } + + public void setQuestionTypeLabel(String questionTypeLabel) { + this.questionTypeLabel = questionTypeLabel; + } + + public String getCorrectAnswer() { + return correctAnswer; + } + + public void setCorrectAnswer(String correctAnswer) { + this.correctAnswer = correctAnswer; + } +} Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentQuestionResultDTO.java =================================================================== diff -u --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentQuestionResultDTO.java (revision 0) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dto/TblAssessmentQuestionResultDTO.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,24 @@ +package org.lamsfoundation.lams.tool.assessment.dto; + +public class TblAssessmentQuestionResultDTO { + + private boolean correct; + private String answer; + + public boolean isCorrect() { + return correct; + } + + public void setCorrect(boolean correct) { + this.correct = correct; + } + + public String getAnswer() { + return answer; + } + + public void setAnswer(String answer) { + this.answer = answer; + } + +} Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentOutputFactory.java =================================================================== diff -u -r248e47a1f8714d3e57be1e4dc12b4fae4f396cb3 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentOutputFactory.java (.../AssessmentOutputFactory.java) (revision 248e47a1f8714d3e57be1e4dc12b4fae4f396cb3) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentOutputFactory.java (.../AssessmentOutputFactory.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -119,7 +119,7 @@ TreeMap output = new TreeMap(); - AssessmentSession session = assessmentService.getAssessmentSessionBySessionId(toolSessionId); + AssessmentSession session = assessmentService.getSessionBySessionId(toolSessionId); if ((session != null) && (session.getAssessment() != null)) { Assessment assessment = session.getAssessment(); @@ -162,7 +162,7 @@ public ToolOutput getToolOutput(String name, IAssessmentService assessmentService, Long toolSessionId, Long learnerId) { if (name != null) { - AssessmentSession session = assessmentService.getAssessmentSessionBySessionId(toolSessionId); + AssessmentSession session = assessmentService.getSessionBySessionId(toolSessionId); if ((session != null) && (session.getAssessment() != null)) { Assessment assessment = session.getAssessment(); Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -r9c5964cc6b8152e9ddb6651e900b7b74f0a4e110 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 9c5964cc6b8152e9ddb6651e900b7b74f0a4e110) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -164,7 +164,7 @@ @Override public boolean isUserGroupLeader(AssessmentUser user, Long toolSessionId) { - AssessmentSession session = getAssessmentSessionBySessionId(toolSessionId); + AssessmentSession session = getSessionBySessionId(toolSessionId); AssessmentUser groupLeader = session.getGroupLeader(); return (groupLeader != null) && user.getUserId().equals(groupLeader.getUserId()); @@ -176,7 +176,7 @@ return null; } - AssessmentSession assessmentSession = getAssessmentSessionBySessionId(toolSessionId); + AssessmentSession assessmentSession = getSessionBySessionId(toolSessionId); AssessmentUser leader = assessmentSession.getGroupLeader(); // check leader select tool for a leader only in case QA tool doesn't know it. As otherwise it will screw // up previous scratches done @@ -343,6 +343,11 @@ public int getCountUsersBySession(Long sessionId, String searchString) { return assessmentUserDao.getCountUsersBySession(sessionId, searchString); } + + @Override + public int getCountUsersByContentId(Long contentId) { + return assessmentUserDao.getCountUsersByContentId(contentId); + } @Override public List getPagedUsersBySessionAndQuestion(Long sessionId, Long questionUid, int page, @@ -396,9 +401,14 @@ } @Override - public AssessmentUser getUserByIDAndContent(Long userId, Long contentId) { - return assessmentUserDao.getUserByUserIDAndContentID(userId, contentId); + public AssessmentUser getUserCreatedAssessment(Long userId, Long contentId) { + return assessmentUserDao.getUserCreatedAssessment(userId, contentId); } + + @Override + public AssessmentUser getUserByIdAndContent(Long userId, Long contentId) { + return assessmentUserDao.getUserByIdAndContent(userId, contentId); + } @Override public AssessmentUser getUserByIDAndSession(Long userId, Long sessionId) { @@ -442,9 +452,14 @@ } @Override - public AssessmentSession getAssessmentSessionBySessionId(Long sessionId) { + public AssessmentSession getSessionBySessionId(Long sessionId) { return assessmentSessionDao.getSessionBySessionId(sessionId); } + + @Override + public List getSessionsByContentId(Long toolContentId) { + return assessmentSessionDao.getByContentId(toolContentId); + } @Override public void setAttemptStarted(Assessment assessment, AssessmentUser assessmentUser, Long toolSessionId) { @@ -1280,7 +1295,7 @@ // in case of UseSelectLeaderToolOuput - display only one user if (assessment.isUseSelectLeaderToolOuput()) { - AssessmentSession session = getAssessmentSessionBySessionId(sessionId); + AssessmentSession session = getSessionBySessionId(sessionId); AssessmentUser groupLeader = session.getGroupLeader(); if (groupLeader != null) { @@ -1691,7 +1706,7 @@ sessionTitle[0] = new ExcelCell(sessionDTO.getSessionName(), true); userSummaryTab.add(sessionTitle); - AssessmentSession assessmentSession = getAssessmentSessionBySessionId(sessionDTO.getSessionId()); + AssessmentSession assessmentSession = getSessionBySessionId(sessionDTO.getSessionId()); Set assessmentUsers = assessmentSession.getAssessmentUsers(); @@ -2489,7 +2504,7 @@ // reset it to new toolContentId toolContentObj.setContentId(toolContentId); - AssessmentUser user = assessmentUserDao.getUserByUserIDAndContentID(new Long(newUserUid.longValue()), + AssessmentUser user = assessmentUserDao.getUserCreatedAssessment(new Long(newUserUid.longValue()), toolContentId); if (user == null) { user = new AssessmentUser(); @@ -2751,7 +2766,7 @@ public void forceCompleteUser(Long toolSessionId, User user) { Long userId = user.getUserId().longValue(); - AssessmentSession session = getAssessmentSessionBySessionId(toolSessionId); + AssessmentSession session = getSessionBySessionId(toolSessionId); if ((session == null) || (session.getAssessment() == null)) { return; } @@ -2929,7 +2944,7 @@ "Assessment Tool does not support Overall Feedback for REST Authoring. " + toolContentJSON); } - AssessmentUser assessmentUser = getUserByIDAndContent(userID.longValue(), toolContentID); + AssessmentUser assessmentUser = getUserCreatedAssessment(userID.longValue(), toolContentID); if (assessmentUser == null) { assessmentUser = new AssessmentUser(); assessmentUser.setFirstName(toolContentJSON.getString("firstName")); Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java =================================================================== diff -u -rfeb6062a5128a445b1fa0095b8c9d6cf232af90f -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (.../IAssessmentService.java) (revision feb6062a5128a445b1fa0095b8c9d6cf232af90f) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (.../IAssessmentService.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -122,6 +122,8 @@ String searchString); int getCountUsersBySession(Long sessionId, String searchString); + + int getCountUsersByContentId(Long contentId); List getPagedUsersBySessionAndQuestion(Long sessionId, Long questionUid, int page, int size, String sortBy, String sortOrder, String searchString); @@ -151,12 +153,20 @@ void createUser(AssessmentUser assessmentUser); /** + * Get user created current Assessment. + * + * @param long1 + * @return + */ + AssessmentUser getUserCreatedAssessment(Long userID, Long contentId); + + /** * Get user by given userID and toolContentID. * * @param long1 * @return */ - AssessmentUser getUserByIDAndContent(Long userID, Long contentId); + AssessmentUser getUserByIdAndContent(Long userID, Long contentId); /** * Get user by sessionID and UserID @@ -197,7 +207,15 @@ * @param sessionId * @return */ - AssessmentSession getAssessmentSessionBySessionId(Long sessionId); + AssessmentSession getSessionBySessionId(Long sessionId); + + /** + * Get all assessment toolSessions by toolContentId + * + * @param toolContentId + * @return + */ + List getSessionsByContentId(Long toolContentId); /** * Save or update assessment result. Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/AuthoringAction.java =================================================================== diff -u -ra8acf18e203ec2888e353d2eaef939f471252088 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision a8acf18e203ec2888e353d2eaef939f471252088) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -376,7 +376,7 @@ HttpSession ss = SessionManager.getSession(); // get back login user DTO UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - assessmentUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()), + assessmentUser = service.getUserCreatedAssessment(new Long(user.getUserID().intValue()), assessmentPO.getContentId()); if (assessmentUser == null) { assessmentUser = new AssessmentUser(user, assessmentPO); Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java =================================================================== diff -u -r9c5964cc6b8152e9ddb6651e900b7b74f0a4e110 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (.../LearningAction.java) (revision 9c5964cc6b8152e9ddb6651e900b7b74f0a4e110) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (.../LearningAction.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -416,7 +416,7 @@ IAssessmentService service = getAssessmentService(); Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - AssessmentSession session = service.getAssessmentSessionBySessionId(toolSessionId); + AssessmentSession session = service.getSessionBySessionId(toolSessionId); AssessmentUser leader = session.getGroupLeader(); //in case of time limit - prevent user from seeing questions page longer than time limit allows @@ -1296,7 +1296,7 @@ AssessmentUser assessmentUser = service.getUserByIDAndSession(new Long(user.getUserID().intValue()), sessionId); if (assessmentUser == null) { - AssessmentSession session = service.getAssessmentSessionBySessionId(sessionId); + AssessmentSession session = service.getSessionBySessionId(sessionId); assessmentUser = new AssessmentUser(user, session); service.createUser(assessmentUser); } Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/MonitoringAction.java =================================================================== diff -u -r5c770157545dea3dbc72e22a1dd1107c56cf22eb -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 5c770157545dea3dbc72e22a1dd1107c56cf22eb) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -361,7 +361,7 @@ //in case of UseSelectLeaderToolOuput - display only one user if (assessment.isUseSelectLeaderToolOuput()) { - AssessmentSession session = service.getAssessmentSessionBySessionId(sessionId); + AssessmentSession session = service.getSessionBySessionId(sessionId); AssessmentUser groupLeader = session.getGroupLeader(); if (groupLeader != null) { @@ -449,7 +449,7 @@ //in case of UseSelectLeaderToolOuput - display only one user if (assessment.isUseSelectLeaderToolOuput()) { - AssessmentSession session = service.getAssessmentSessionBySessionId(sessionId); + AssessmentSession session = service.getSessionBySessionId(sessionId); AssessmentUser groupLeader = session.getGroupLeader(); if (groupLeader != null) { @@ -590,14 +590,14 @@ HttpServletResponse response) throws IOException { initAssessmentService(); String sessionMapID = request.getParameter(AssessmentConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession() - .getAttribute(sessionMapID); String fileName = null; boolean showUserNames = true; Long contentId = null; List sessionDtos; - if (sessionMap != null) { + if (sessionMapID != null) { + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(sessionMapID); request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); contentId = (Long) sessionMap.get(AssessmentConstants.ATTR_TOOL_CONTENT_ID); showUserNames = true; Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/TblMonitoringAction.java =================================================================== diff -u --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/TblMonitoringAction.java (revision 0) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/TblMonitoringAction.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,454 @@ +package org.lamsfoundation.lams.tool.assessment.web.action; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONException; +import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.ToolActivity; +import org.lamsfoundation.lams.lesson.Lesson; +import org.lamsfoundation.lams.tool.assessment.AssessmentConstants; +import org.lamsfoundation.lams.tool.assessment.dto.TblAssessmentDTO; +import org.lamsfoundation.lams.tool.assessment.dto.AssessmentResultDTO; +import org.lamsfoundation.lams.tool.assessment.dto.OptionDTO; +import org.lamsfoundation.lams.tool.assessment.dto.QuestionDTO; +import org.lamsfoundation.lams.tool.assessment.dto.QuestionSummary; +import org.lamsfoundation.lams.tool.assessment.dto.SessionDTO; +import org.lamsfoundation.lams.tool.assessment.dto.TblAssessmentQuestionDTO; +import org.lamsfoundation.lams.tool.assessment.dto.TblAssessmentQuestionResultDTO; +import org.lamsfoundation.lams.tool.assessment.model.Assessment; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestion; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionOption; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentQuestionResult; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentResult; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentSession; +import org.lamsfoundation.lams.tool.assessment.model.AssessmentUser; +import org.lamsfoundation.lams.tool.assessment.model.QuestionReference; +import org.lamsfoundation.lams.tool.assessment.service.IAssessmentService; +import org.lamsfoundation.lams.tool.assessment.util.AssessmentEscapeUtils; +import org.lamsfoundation.lams.tool.assessment.util.AssessmentSessionComparator; +import org.lamsfoundation.lams.tool.assessment.util.SequencableComparator; +import org.lamsfoundation.lams.util.ExcelCell; +import org.lamsfoundation.lams.util.ExcelUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +public class TblMonitoringAction extends LamsDispatchAction { + private static Logger logger = Logger.getLogger(TblMonitoringAction.class.getName()); + + private IAssessmentService assessmentService; + + /** + * Shows ira page in case of Assessment activity + */ + public ActionForward iraAssessment(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initAssessmentService(); + + Long toolContentId = WebUtil.readLongParam(request, "assessmentToolContentIds"); + String assessmentActivityTitle = request.getParameter("assessmentActivityTitles"); + + String[] toolContentIds = new String[] {toolContentId.toString()}; + String[] activityTitles = new String[] {assessmentActivityTitle}; + + List assessmentDtos = getAssessmentDtos(toolContentIds, activityTitles); + request.setAttribute("assessmentDtos", assessmentDtos); + + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentId); + request.setAttribute("isIraAssessment", true); + return mapping.findForward("assessment"); + } + + private List getAssessmentDtos(String[] toolContentIds, String[] activityTitles) { + List assessmentDtos = new ArrayList(); + int i = 0; + for (String toolContentIdStr : toolContentIds) { + String activityTitle = activityTitles[i++]; + + //skip empty contentIds + if (toolContentIdStr.length() == 0) { + continue; + } + Long toolContentId = Long.parseLong(toolContentIdStr); + + TblAssessmentDTO assessmentDto = new TblAssessmentDTO(); + + int attemptedLearnersNumber = assessmentService.getCountUsersByContentId(toolContentId); + assessmentDto.setAttemptedLearnersNumber(attemptedLearnersNumber); + assessmentDto.setActivityTitle(activityTitle); + + Assessment assessment = assessmentService.getAssessmentByContentId(toolContentId); + assessmentDto.setAssessment(assessment); + assessmentDto.setQuestions(prepareQuestionsList(assessment)); + assessmentDtos.add(assessmentDto); + } + + return assessmentDtos; + } + + private Set prepareQuestionsList(Assessment assessment) { + // question list to display + Set questions = new TreeSet(); + boolean hasRandomQuestion = false; + for (QuestionReference reference : (Set) assessment.getQuestionReferences()) { + hasRandomQuestion |= reference.isRandomQuestion(); + } + // in case there is at least one random question - we need to show all questions + if (hasRandomQuestion) { + questions.addAll(assessment.getQuestions()); + + // show only questions from question list otherwise + } else { + for (QuestionReference reference : (Set) assessment.getQuestionReferences()) { + //sort questions the same way references are sorted (as per LKC request) + AssessmentQuestion question = reference.getQuestion(); + question.setSequenceId(reference.getSequenceId()); + questions.add(question); + } + } + return questions; + } + + /** + * Shows aes page + */ + public ActionForward aes(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initAssessmentService(); + + String[] toolContentIds = request.getParameter("assessmentToolContentIds").split(","); + String[] activityTitles = request.getParameter("assessmentActivityTitles").split("\\,"); + + List assessmentDtos = getAssessmentDtos(toolContentIds, activityTitles); + request.setAttribute("assessmentDtos", assessmentDtos); + + Long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID, true); + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentId); + + return mapping.findForward("assessment"); + } + + /** + * Shows ira StudentChoices page + */ + public ActionForward aesStudentChoices(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initAssessmentService(); + + Long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Assessment assessment = assessmentService.getAssessmentByContentId(toolContentId); + Map questionSummaries = assessmentService.getQuestionSummaryForExport(assessment); + List tblQuestionDtos = new ArrayList(); + for (QuestionSummary questionSummary : questionSummaries.values()) { + AssessmentQuestion question = questionSummary.getQuestion(); + + TblAssessmentQuestionDTO tblQuestionDto = new TblAssessmentQuestionDTO(); + tblQuestionDto.setQuestion(question); + tblQuestionDto.setQuestionTypeLabel(TblMonitoringAction.getAssessmentQuestionTypeLabel(question.getType())); + tblQuestionDto.setCorrectAnswer(getAssessmentCorrectAnswer(question)); + + List sessionQuestionResults = new ArrayList(); + for (List questionResultsPerSession : questionSummary + .getQuestionResultsPerSession()) { + + TblAssessmentQuestionResultDTO tblQuestionResultDto = new TblAssessmentQuestionResultDTO(); + String answer = ""; + boolean correct = false; + if (!questionResultsPerSession.isEmpty()) { + AssessmentQuestionResult questionResult = questionResultsPerSession.get(0); + answer = AssessmentEscapeUtils.printResponsesForJqgrid(questionResult); + correct = questionResult.getMaxMark() == null ? false + : (questionResult.getPenalty() + questionResult.getMark() + 0.1) >= questionResult + .getMaxMark(); + } + tblQuestionResultDto.setAnswer(answer); + tblQuestionResultDto.setCorrect(correct); + + sessionQuestionResults.add(tblQuestionResultDto); + } + tblQuestionDto.setSessionQuestionResults(sessionQuestionResults); + + tblQuestionDtos.add(tblQuestionDto); + } + + SortedSet sessions = new TreeSet(new AssessmentSessionComparator()); + sessions.addAll(assessmentService.getSessionsByContentId(assessment.getContentId())); + + request.setAttribute("sessions", sessions); + request.setAttribute("questionDtos", tblQuestionDtos); + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentId); + return mapping.findForward("assessmentStudentChoices"); + } + + /** + * Used only for excell export (for getUserSummaryData() method). + */ + private static String getAssessmentQuestionTypeLabel(short type) { + switch (type) { + case AssessmentConstants.QUESTION_TYPE_ESSAY: + return "Essay"; + case AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS: + return "Matching Pairs"; + case AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE: + return "Multiple Choice"; + case AssessmentConstants.QUESTION_TYPE_NUMERICAL: + return "Numerical"; + case AssessmentConstants.QUESTION_TYPE_ORDERING: + return "Ordering"; + case AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER: + return "Short Answer"; + case AssessmentConstants.QUESTION_TYPE_TRUE_FALSE: + return "True/False"; + case AssessmentConstants.QUESTION_TYPE_MARK_HEDGING: + return "Mark Hedging"; + default: + return null; + } + } + + /** + * Used only for excell export (for getUserSummaryData() method). + */ + private String getAssessmentCorrectAnswer(AssessmentQuestion question) { + StringBuilder sb = new StringBuilder(); + + if (question != null) { + switch (question.getType()) { + case AssessmentConstants.QUESTION_TYPE_ESSAY: + return "N.A."; + + case AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS: + for (AssessmentQuestionOption option : question.getOptions()) { + sb.append((option.getQuestion() + " - " + option.getOptionString()).replaceAll("\\<.*?\\>", "") + + "
"); + } + return sb.toString(); + + case AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE: + case AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER: + for (AssessmentQuestionOption option : question.getOptions()) { + if (option.getGrade() == 1f) { + return option.getOptionString(); + } + } + break; + + case AssessmentConstants.QUESTION_TYPE_NUMERICAL: + for (AssessmentQuestionOption option : question.getOptions()) { + if (option.getGrade() == 1f) { + return "" + option.getOptionFloat(); + } + } + break; + + case AssessmentConstants.QUESTION_TYPE_ORDERING: + TreeSet correctOptionSet = new TreeSet( + new SequencableComparator()); + correctOptionSet.addAll(question.getOptions()); + + for (AssessmentQuestionOption option : question.getOptions()) { + sb.append(option.getOptionString() + "\n"); + } + return sb.toString(); + + case AssessmentConstants.QUESTION_TYPE_TRUE_FALSE: + return new Boolean(question.getCorrectAnswer()).toString(); + + case AssessmentConstants.QUESTION_TYPE_MARK_HEDGING: + for (AssessmentQuestionOption option : question.getOptions()) { + if (option.isCorrect()) { + return option.getOptionString(); + } + } + break; + + default: + return null; + } + } + + return null; + } + +// /** +// * Excel Summary Export. +// * +// * @param mapping +// * @param form +// * @param request +// * @param response +// * @return +// * @throws IOException +// */ +// public ActionForward exportExcelAssessment(ActionMapping mapping, ActionForm form, HttpServletRequest request, +// HttpServletResponse response) throws IOException, ServletException { +// initAssessmentService(); +// +// Long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); +// Assessment assessment = assessmentService.getAssessmentByContentId(toolContentId); +// +// List sessionDtos = assessmentService.getSessionDtos(toolContentId, false); +// boolean showUserNames = true; +// LinkedHashMap dataToExport = assessmentService.exportSummary(assessment, sessionDtos, +// showUserNames); +// +// response.setContentType("application/x-download"); +// String fileName = "assessment_" + assessment.getUid() + "_export.xlsx"; +// response.setHeader("Content-Disposition", "attachment;filename=" + fileName); +// log.debug("Exporting assessment to a spreadsheet: " + assessment.getContentId()); +// +// ServletOutputStream out = response.getOutputStream(); +// ExcelUtil.createExcel(out, dataToExport, "Exported on", true); +// +// return null; +// } + + /** + * Get ModalDialog for Teams tab. + * + * @throws JSONException + * @throws IOException + */ + public ActionForward getModalDialogForTeamsTab(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws JSONException, IOException { + initAssessmentService(); + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); + + AssessmentUser user = assessmentService.getUserByIdAndContent(userId, toolContentId); + AssessmentResultDTO result = assessmentService.getUserMasterDetail(user.getSession().getSessionId(), userId); + request.setAttribute(AssessmentConstants.ATTR_ASSESSMENT_RESULT, result); + + +// // release object from the cache (it's required when we have modified result object in the same request) +// AssessmentResult result = assessmentService.getLastFinishedAssessmentResultNotFromChache(assessment.getUid(), userId); +// +// for (Set questionsForOnePage : pagedQuestionDtos) { +// for (QuestionDTO questionDto : questionsForOnePage) { +// +// // find corresponding questionResult +// for (AssessmentQuestionResult questionResult : result.getQuestionResults()) { +// if (questionDto.getUid().equals(questionResult.getAssessmentQuestion().getUid())) { +// +// // copy questionResult's info to the question +// questionDto.setResponseSubmitted(questionResult.getFinishDate() != null); +// +// // required for showing right/wrong answers icons on results page correctly +// if (questionDto.getType() == AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER +// || questionDto.getType() == AssessmentConstants.QUESTION_TYPE_NUMERICAL) { +// boolean isAnsweredCorrectly = false; +// for (OptionDTO optionDto : questionDto.getOptionDtos()) { +// if (optionDto.getUid().equals(questionResult.getSubmittedOptionUid())) { +// isAnsweredCorrectly = optionDto.getGrade() > 0; +// break; +// } +// } +// questionDto.setAnswerBoolean(isAnsweredCorrectly); +// } +// +// // required for markandpenalty area and if it's on - on question's summary page +// List questionResults = assessmentService.getAssessmentQuestionResultList(assessment.getUid(), +// userId, questionDto.getUid()); +// questionDto.setQuestionResults(questionResults); +// } +// } +// } +// } + + return mapping.findForward("teams"); + } + +// /** +// * Used only for excell export (for getUserSummaryData() method). +// */ +// private static TBLAssessmentQuestionResult getAssessmentTBLQuestionResult(AssessmentQuestionResult questionResult) { +// AssessmentQuestion question = questionResult.getAssessmentQuestion(); +// String answer = ""; +// +// switch (question.getType()) { +// case AssessmentConstants.QUESTION_TYPE_ESSAY: +// answer = questionResult.getAnswerString(); +// +// case AssessmentConstants.QUESTION_TYPE_MATCHING_PAIRS: +// for (AssessmentQuestionOption option : question.getOptions()) { +// sb.append("[" + option.getQuestion() + ", " + option.getOptionString() + "] \n"); +// } +// return sb.toString(); +// +// case AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE: +// for (AssessmentQuestionOption option : question.getOptions()) { +// if (option.getGrade() == 100f) { +// return option.getOptionString(); +// } +// } +// +// case AssessmentConstants.QUESTION_TYPE_NUMERICAL: +// return question.getAnswerString(); +// +// case AssessmentConstants.QUESTION_TYPE_ORDERING: +// TreeSet correctOptionSet = new TreeSet( +// new SequencableComparator()); +// correctOptionSet.addAll(question.getOptions()); +// +// for (AssessmentQuestionOption option : question.getOptions()) { +// sb.append(option.getOptionString() + "\n"); +// } +// return sb.toString(); +// +// case AssessmentConstants.QUESTION_TYPE_SHORT_ANSWER: +// return question.getAnswerString(); +// +// case AssessmentConstants.QUESTION_TYPE_TRUE_FALSE: +// return new Boolean(question.getAnswerBoolean()).toString(); +// +// case AssessmentConstants.QUESTION_TYPE_MARK_HEDGING: +// for (AssessmentQuestionOption option : question.getOptions()) { +// if (option.isCorrect()) { +// return option.getOptionString(); +// } +// } +// +// default: +// return null; +// } +// +// TBLAssessmentQuestionResult tblQuestionResult = new TBLAssessmentQuestionResult(); +// String answer = AssessmentEscapeUtils.printResponsesForJqgrid(questionResult); +// tblQuestionResult.setAnswer(answer); +// boolean correct = (questionResult.getPenalty() + questionResult.getMark() + 0.1) >= questionResult.getMaxMark(); +// tblQuestionResult.setCorrect(correct); +// return tblQuestionResult; +// } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + private IAssessmentService initAssessmentService() { + if (assessmentService == null) { + WebApplicationContext wac = WebApplicationContextUtils + .getRequiredWebApplicationContext(getServlet().getServletContext()); + assessmentService = (IAssessmentService) wac.getBean(AssessmentConstants.ASSESSMENT_SERVICE); + } + return assessmentService; + } + +} Index: lams_tool_assessment/web/WEB-INF/struts-config.xml =================================================================== diff -u -ra7b248d0864feae179f5ffdbec7b1881259f6a23 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision a7b248d0864feae179f5ffdbec7b1881259f6a23) +++ lams_tool_assessment/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -357,7 +357,31 @@ type="org.lamsfoundation.lams.tool.assessment.web.action.MonitoringAction" parameter="statistic" > - + + + + + + + + Index: lams_tool_assessment/web/WEB-INF/web.xml =================================================================== diff -u -r2a70ed7d169b7c8fe70237c266eb6194f3392164 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/web/WEB-INF/web.xml (.../web.xml) (revision 2a70ed7d169b7c8fe70237c266eb6194f3392164) +++ lams_tool_assessment/web/WEB-INF/web.xml (.../web.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -248,6 +248,21 @@ SYSADMIN + + + TBL Monitor interface + /tblmonitoring.do + GET + POST + + + + MONITOR + GROUP ADMIN + GROUP MANAGER + SYSADMIN + + Index: lams_tool_assessment/web/common/taglibs.jsp =================================================================== diff -u -r9d26aaf34391eb58df037978365deda31de85c1b -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_assessment/web/common/taglibs.jsp (.../taglibs.jsp) (revision 9d26aaf34391eb58df037978365deda31de85c1b) +++ lams_tool_assessment/web/common/taglibs.jsp (.../taglibs.jsp) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -7,4 +7,5 @@ <%@ taglib uri="tags-fmt" prefix="fmt" %> <%@ taglib uri="tags-xml" prefix="x" %> <%@ taglib uri="tags-lams" prefix="lams" %> - + + Index: lams_tool_assessment/web/pages/tblmonitoring/assessment.jsp =================================================================== diff -u --- lams_tool_assessment/web/pages/tblmonitoring/assessment.jsp (revision 0) +++ lams_tool_assessment/web/pages/tblmonitoring/assessment.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,193 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + +
+
+

+ + + + + + + + +

+
+
+ + + +
+
+
+
+

+ + : ${assessmentDtos[0].attemptedLearnersNumber}/ +

+
+
+
+ + +
+ +
+ + + + + + +
+
+ + + +
+ +
active"> + +
+
+
+
+

+ Q${i.index+1}) +

+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ${ALPHABET[j.index]}. + + +
+ + Possible answers +
+ ${ALPHABET[j.index]}. + + + + +
+ a. + + +
+ b. + + +
+ ${ALPHABET[j.index]}. + + +
+
+
+
+
+
+
+
+
+
+ Index: lams_tool_assessment/web/pages/tblmonitoring/assessmentStudentChoices.jsp =================================================================== diff -u --- lams_tool_assessment/web/pages/tblmonitoring/assessmentStudentChoices.jsp (revision 0) +++ lams_tool_assessment/web/pages/tblmonitoring/assessmentStudentChoices.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,122 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + iraAssessment + + + aes + + + + + + + +
+
+

+ + + + + + + + +

+
+
+ + + +
+
+
+ + +
+
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ${i.index + 1} +
Question type + ${questionDto.questionTypeLabel} +
Correct answer + ${questionDto.correctAnswer} +
+ ${session.sessionName} + success" > + ${questionResultDto.answer} +
+
+
+
+
+ Index: lams_tool_assessment/web/pages/tblmonitoring/teams.jsp =================================================================== diff -u --- lams_tool_assessment/web/pages/tblmonitoring/teams.jsp (revision 0) +++ lams_tool_assessment/web/pages/tblmonitoring/teams.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,37 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + +
+
+

+ Q${i.index+1}) + +

+
+ +
+
+ + + + + + +
+ <%@ include file="userresponse.jsp"%> + + +
+
+
+
+
Index: lams_tool_assessment/web/pages/tblmonitoring/userresponse.jsp =================================================================== diff -u --- lams_tool_assessment/web/pages/tblmonitoring/userresponse.jsp (revision 0) +++ lams_tool_assessment/web/pages/tblmonitoring/userresponse.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,92 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + ${option.optionString} + + + + + + + +
+
+ ${option.question} +
+
+ - + + + + + ${questionOption2.optionString} + + + + +
+
+
+
+
+ + + ${fn:escapeXml(questionResult.answerString)} + + + + ${questionResult.answerString} + + + + + ${questionResult.answerBoolean} + + + + + ${questionResult.answerString} + + + + + + + + + ${option.optionString} + + + + + + + + + +
'; +
+ ${option.optionString} +
+
+ - + + + ${optionAnswer.answerInt} + + +
+
+
+
+ + + ${questionResult.answerString} + +
+ +
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUserDAO.java =================================================================== diff -u -r3c88fe83de7aaf7bd9dbe9ea6e1cb0e43d099ffa -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUserDAO.java (.../IMcUserDAO.java) (revision 3c88fe83de7aaf7bd9dbe9ea6e1cb0e43d099ffa) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/IMcUserDAO.java (.../IMcUserDAO.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -47,6 +47,8 @@ * @return the persistent instance of a McQueUsr or null if not found */ McQueUsr getMcUserByUID(Long uid); + + McQueUsr getMcUserByContentId(Long userId, Long contentId); McQueUsr getMcUserBySession(Long userId, Long sessionUid); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUserDAO.java =================================================================== diff -u -r3c88fe83de7aaf7bd9dbe9ea6e1cb0e43d099ffa -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUserDAO.java (.../McUserDAO.java) (revision 3c88fe83de7aaf7bd9dbe9ea6e1cb0e43d099ffa) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/dao/hibernate/McUserDAO.java (.../McUserDAO.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -72,6 +72,15 @@ public McQueUsr getMcUserByUID(Long uid) { return (McQueUsr) this.getSession().get(McQueUsr.class, uid); } + + @Override + public McQueUsr getMcUserByContentId(Long userId, Long contentId) { + final String GET_USER_BY_USER_ID_AND_CONTENT_ID = "from " + McQueUsr.class.getName() + + " user where user.queUsrId=:userId and user.mcSession.mcContent.mcContentId=:contentId"; + + return (McQueUsr) getSessionFactory().getCurrentSession().createQuery(GET_USER_BY_USER_ID_AND_CONTENT_ID) + .setLong("userId", userId).setLong("contentId", contentId).uniqueResult(); + } @SuppressWarnings("rawtypes") @Override Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java =================================================================== diff -u -rb6b28d32fe5b2923cbb30a6c9b889c02e1ba29cf -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision b6b28d32fe5b2923cbb30a6c9b889c02e1ba29cf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/IMcService.java (.../IMcService.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -89,6 +89,14 @@ void saveUserAttempt(McQueUsr user, List answerDtos); void updateMcUsrAttempt(McUsrAttempt mcUsrAttempt) throws McApplicationException; + + /** + * Count how many attempts done to this option + * + * @param optionUid + * @return + */ + int getAttemptsCountPerOption(Long optionUid); void removeMcQueContent(McQueContent mcQueContent) throws McApplicationException; @@ -108,6 +116,8 @@ McQueContent getQuestionByUid(Long uid); McQueUsr getMcUserByUID(Long uid) throws McApplicationException; + + McQueUsr getMcUserByContentId(Long userId, Long contentId); List getPagedUsersBySession(Long sessionId, int page, int size, String sortBy, String sortOrder, String searchString); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java =================================================================== diff -u -r5e36aad06f5b9c4fe8551ddc8af5a734ba8058bf -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision 5e36aad06f5b9c4fe8551ddc8af5a734ba8058bf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -377,14 +377,14 @@ } @Override - public McQueUsr getMcUserByUID(Long uid) throws McApplicationException { - try { - return mcUserDAO.getMcUserByUID(uid); - } catch (DataAccessException e) { - throw new McApplicationException( - "Exception occured when lams is getting the mc QueUsr by uid." + e.getMessage(), e); - } + public McQueUsr getMcUserByUID(Long uid) { + return mcUserDAO.getMcUserByUID(uid); } + + @Override + public McQueUsr getMcUserByContentId(Long userId, Long contentId) { + return mcUserDAO.getMcUserByContentId(userId, contentId); + } @Override public Long getPortraitId(Long userId) { @@ -473,6 +473,11 @@ e); } } + + @Override + public int getAttemptsCountPerOption(Long optionUid) { + return mcUsrAttemptDAO.getAttemptsCountPerOption(optionUid); + } @Override public List getAnswersFromDatabase(McContent mcContent, McQueUsr user) { Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/TblMonitoringAction.java =================================================================== diff -u --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/TblMonitoringAction.java (revision 0) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/action/TblMonitoringAction.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,135 @@ +package org.lamsfoundation.lams.tool.mc.web.action; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONException; +import org.lamsfoundation.lams.tool.mc.dto.McOptionDTO; +import org.lamsfoundation.lams.tool.mc.dto.McQuestionDTO; +import org.lamsfoundation.lams.tool.mc.pojos.McContent; +import org.lamsfoundation.lams.tool.mc.pojos.McOptsContent; +import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; +import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; +import org.lamsfoundation.lams.tool.mc.pojos.McSession; +import org.lamsfoundation.lams.tool.mc.pojos.McUsrAttempt; +import org.lamsfoundation.lams.tool.mc.service.IMcService; +import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; + +public class TblMonitoringAction extends LamsDispatchAction { + private static Logger logger = Logger.getLogger(TblMonitoringAction.class.getName()); + + /** + * Shows iRA page in case of MCQ activity + */ + public ActionForward iraMcq(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + McContent mcContent = mcService.getMcContent(toolContentId); + + int attemptedLearnersNumber = 0; + for (McSession session : (Set) mcContent.getMcSessions()) { + attemptedLearnersNumber += session.getMcQueUsers().size(); + } + request.setAttribute("attemptedLearnersNumber", attemptedLearnersNumber); + + request.setAttribute("questions", mcContent.getMcQueContents()); + return mapping.findForward("mcq"); + } + + /** + * Shows ira StudentChoices page + */ + public ActionForward mcqStudentChoices(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + McContent mcContent = mcService.getMcContent(toolContentId); + + // ======================================================= Report by question IRA page + // ======================================= + + Set questions = mcContent.getMcQueContents(); + int maxOptionsInQuestion = 0; + for (McQueContent question : questions) { + if (question.getMcOptionsContents().size() > maxOptionsInQuestion) { + maxOptionsInQuestion = question.getMcOptionsContents().size(); + } + } + request.setAttribute("maxOptionsInQuestion", maxOptionsInQuestion); + + int totalNumberOfUsers = 0; + for (McSession session : (Set) mcContent.getMcSessions()) { + totalNumberOfUsers += session.getMcQueUsers().size(); + } + + ArrayList questionDtos = new ArrayList(); + for (McQueContent question : questions) { + + // build candidate dtos + List optionDtos = new LinkedList(); + Long totalPercentage = 0L; + for (McOptsContent option : (Set) question.getMcOptionsContents()) { + int optionAttemptCount = mcService.getAttemptsCountPerOption(option.getUid()); + + Long percentage = (long) ((optionAttemptCount * 100) / totalNumberOfUsers); + totalPercentage += percentage; + + McOptionDTO optionDTO = new McOptionDTO(option); +// optionDTO.setCandidateAnswer(StringEscapeUtils.escapeJavaScript(option.getMcQueOptionText())); + optionDTO.setUid(percentage); + optionDtos.add(optionDTO); + } + + McQuestionDTO questionDto = new McQuestionDTO(); + questionDto.setUid(question.getUid()); + questionDto.setQuestion(question.getQuestion()); +// questionDto.setFeedback(StringEscapeUtils.escapeJavaScript(question.getQuestion())); + questionDto.setMark("" + (100 - totalPercentage)); + questionDto.setOptionDtos(optionDtos); + + questionDtos.add(questionDto); + } + request.setAttribute("questionDtos", questionDtos); + + request.setAttribute("questions", questions); + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentId); + return mapping.findForward("mcqStudentChoices"); + } + + /** + * Get ModalDialog for Teams tab. + * + * @throws JSONException + */ + public ActionForward getModalDialogForTeamsTab(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException { + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); + + McQueUsr user = mcService.getMcUserByContentId(userId, toolContentId); + List finalizedUserAttempts = user == null ? new LinkedList() + : mcService.getFinalizedUserAttempts(user); + request.setAttribute("userAttempts", finalizedUserAttempts); + + return mapping.findForward("teams"); + } + +} Index: lams_tool_lamc/web/WEB-INF/struts-config.xml =================================================================== diff -u -r4170df8bc66e658ef4dcd47e99eceddec3c2673a -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 4170df8bc66e658ef4dcd47e99eceddec3c2673a) +++ lams_tool_lamc/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -303,6 +303,30 @@
+ + + + + + + Index: lams_tool_lamc/web/WEB-INF/web.xml =================================================================== diff -u -r2a70ed7d169b7c8fe70237c266eb6194f3392164 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/web/WEB-INF/web.xml (.../web.xml) (revision 2a70ed7d169b7c8fe70237c266eb6194f3392164) +++ lams_tool_lamc/web/WEB-INF/web.xml (.../web.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -290,6 +290,21 @@ SYSADMIN + + + TBL Monitor interface + /tblmonitoring.do + GET + POST + + + + MONITOR + GROUP ADMIN + GROUP MANAGER + SYSADMIN + + Index: lams_tool_lamc/web/common/taglibs.jsp =================================================================== diff -u -r9d26aaf34391eb58df037978365deda31de85c1b -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_lamc/web/common/taglibs.jsp (.../taglibs.jsp) (revision 9d26aaf34391eb58df037978365deda31de85c1b) +++ lams_tool_lamc/web/common/taglibs.jsp (.../taglibs.jsp) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -8,4 +8,7 @@ <%@ taglib uri="tags-xml" prefix="x" %> <%@ taglib uri="tags-lams" prefix="lams" %> + + + Index: lams_tool_lamc/web/tblmonitoring/mcq.jsp =================================================================== diff -u --- lams_tool_lamc/web/tblmonitoring/mcq.jsp (revision 0) +++ lams_tool_lamc/web/tblmonitoring/mcq.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,80 @@ +<%@ include file="/common/taglibs.jsp"%> + + + +
+
+

+ +

+
+
+ + + +
+
+
+
+

+ + : ${attemptedLearnersNumber}/ +

+
+
+
+ + + + +
+ + + +
+
+ + +
+
+

+ Q${i.index + 1}) +

+
+ +
+
+ + + + + + + + + +
+ ${ALPHABET[j.index]}. + + +
+
+
+
+
+ +
+
+ + Index: lams_tool_lamc/web/tblmonitoring/mcqStudentChoices.jsp =================================================================== diff -u --- lams_tool_lamc/web/tblmonitoring/mcqStudentChoices.jsp (revision 0) +++ lams_tool_lamc/web/tblmonitoring/mcqStudentChoices.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,156 @@ +<%@ include file="/common/taglibs.jsp"%> + + + +
+
+

+ +

+
+
+ + + +
+
+
+ + +
+
+ + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + ${ALPHABET_CAPITAL_LETTERS[i]} + + +
+ + ${i.index+1} + + success"> + ${optionDto.uid}% + ${questionDto.mark}%
+
+
+
+
+
+ + + + + + + Index: lams_tool_lamc/web/tblmonitoring/teams.jsp =================================================================== diff -u --- lams_tool_lamc/web/tblmonitoring/teams.jsp (revision 0) +++ lams_tool_lamc/web/tblmonitoring/teams.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,38 @@ +<%@ include file="/common/taglibs.jsp"%> + + +
+
+

+ Q${i.index+1}) + +

+
+ +
+
+ + + + + + + +
+ ${ALPHABET[userAttempt.mcOptionsContent.displayOrder-1]}. + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dao/ILeaderselectionUserDAO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dao/ILeaderselectionUserDAO.java (.../ILeaderselectionUserDAO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dao/ILeaderselectionUserDAO.java (.../ILeaderselectionUserDAO.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -41,6 +41,8 @@ * @return */ LeaderselectionUser getByUserIdAndSessionId(Long userId, Long toolSessionId); + + LeaderselectionUser getByUserIdAndContentId(Long userId, Long toolContentId); void saveOrUpdate(LeaderselectionUser leaderselectionUser); Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dao/hibernate/LeaderselectionUserDAO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dao/hibernate/LeaderselectionUserDAO.java (.../LeaderselectionUserDAO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dao/hibernate/LeaderselectionUserDAO.java (.../LeaderselectionUserDAO.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -37,10 +37,10 @@ @Repository public class LeaderselectionUserDAO extends LAMSBaseDAO implements ILeaderselectionUserDAO { - public static final String SQL_QUERY_FIND_BY_USER_ID_SESSION_ID = "from " + LeaderselectionUser.class.getName() + private static final String SQL_QUERY_FIND_BY_USER_ID_SESSION_ID = "from " + LeaderselectionUser.class.getName() + " as f" + " where user_id=? and f.leaderselectionSession.sessionId=?"; - public static final String SQL_QUERY_FIND_BY_LOGIN_NAME_SESSION_ID = "from " + LeaderselectionUser.class.getName() + private static final String SQL_QUERY_FIND_BY_LOGIN_NAME_SESSION_ID = "from " + LeaderselectionUser.class.getName() + " as f where login_name=? and f.leaderselectionSession.sessionId=?"; private static final String SQL_QUERY_FIND_BY_UID = "from " + LeaderselectionUser.class.getName() + " where uid=?"; @@ -51,13 +51,23 @@ @Override public LeaderselectionUser getByUserIdAndSessionId(Long userId, Long toolSessionId) { List list = doFind(SQL_QUERY_FIND_BY_USER_ID_SESSION_ID, new Object[] { userId, toolSessionId }); - if (list == null || list.isEmpty()) { return null; } - return (LeaderselectionUser) list.get(0); } + + @Override + public LeaderselectionUser getByUserIdAndContentId(Long userId, Long toolContentId) { + final String SQL_QUERY_FIND_BY_USER_ID_CONTENT_ID = "from " + LeaderselectionUser.class.getName() + + " as user where user.userId=? and user.leaderselectionSession.leaderselection.toolContentId=?"; + + List list = doFind(SQL_QUERY_FIND_BY_USER_ID_CONTENT_ID, new Object[] { userId, toolContentId }); + if (list == null || list.isEmpty()) { + return null; + } + return (LeaderselectionUser) list.get(0); + } @Override public void saveOrUpdate(LeaderselectionUser leaderselectionUser) { @@ -68,11 +78,9 @@ @Override public LeaderselectionUser getByUID(Long uid) { List list = doFind(SQL_QUERY_FIND_BY_UID, new Object[] { uid }); - if (list == null || list.isEmpty()) { return null; } - return (LeaderselectionUser) list.get(0); } Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/ILeaderselectionService.java =================================================================== diff -u -r2abc3485dc2d24ea02044a64271f3ee0d3b8c11b -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/ILeaderselectionService.java (.../ILeaderselectionService.java) (revision 2abc3485dc2d24ea02044a64271f3ee0d3b8c11b) +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/ILeaderselectionService.java (.../ILeaderselectionService.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -52,10 +52,11 @@ * * @param userId * @param toolSessionId + * @return * @throws IOException * @throws JSONException */ - void setGroupLeader(Long userId, Long toolSessionId) throws JSONException, IOException; + boolean setGroupLeader(Long userId, Long toolSessionId) throws JSONException, IOException; /** * Makes a copy of the default content and assigns it a newContentID @@ -109,6 +110,8 @@ * @return */ LeaderselectionUser getUserByUserIdAndSessionId(Long userId, Long toolSessionId); + + LeaderselectionUser getUserByUserIdAndContentId(Long userId, Long toolContentId); /** * Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java =================================================================== diff -u -r64ee69765400783a3e284e7856aa91cdd01f4831 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java (.../LeaderselectionService.java) (revision 64ee69765400783a3e284e7856aa91cdd01f4831) +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java (.../LeaderselectionService.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -338,21 +338,22 @@ /* ********** ILeaderselectionService Methods ********************************* */ @Override - public void setGroupLeader(Long userUid, Long toolSessionId) throws JSONException, IOException { + public boolean setGroupLeader(Long userUid, Long toolSessionId) throws JSONException, IOException { if ((userUid == null) || (toolSessionId == null)) { - return; + return false; } LeaderselectionSession session = getSessionBySessionId(toolSessionId); LeaderselectionUser newLeader = getUserByUID(userUid); if ((session == null) || (newLeader == null)) { LeaderselectionService.logger .error("Wrong parameters supplied. SessionId=" + toolSessionId + " UserId=" + userUid); - return; + return false; } session.setGroupLeader(newLeader); saveOrUpdateSession(session); + return true; } @Override @@ -452,6 +453,11 @@ public LeaderselectionUser getUserByUserIdAndSessionId(Long userId, Long toolSessionId) { return leaderselectionUserDAO.getByUserIdAndSessionId(userId, toolSessionId); } + + @Override + public LeaderselectionUser getUserByUserIdAndContentId(Long userId, Long toolContentId) { + return leaderselectionUserDAO.getByUserIdAndContentId(userId, toolContentId); + } @Override public LeaderselectionUser getUserByUID(Long uid) { Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/TblMonitoringAction.java =================================================================== diff -u --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/TblMonitoringAction.java (revision 0) +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/TblMonitoringAction.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,64 @@ +package org.lamsfoundation.lams.tool.leaderselection.web.actions; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONException; +import org.apache.tomcat.util.json.JSONObject; +import org.lamsfoundation.lams.tool.leaderselection.model.LeaderselectionUser; +import org.lamsfoundation.lams.tool.leaderselection.service.ILeaderselectionService; +import org.lamsfoundation.lams.tool.leaderselection.service.LeaderselectionServiceProxy; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; + +public class TblMonitoringAction extends LamsDispatchAction { + + private static Logger log = Logger.getLogger(TblMonitoringAction.class); + + private ILeaderselectionService leaderselectionService; + + /** + * Save selected user as a leader + * @throws IOException + * @throws JSONException + */ + public ActionForward changeLeader(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws JSONException, IOException { + initService(); + + Long leaderUserId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); + Long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + LeaderselectionUser user = leaderselectionService.getUserByUserIdAndContentId(leaderUserId, toolContentId); + + // save selected user as a leader + boolean isSuccessful = false; + if (user != null) { + Long toolSessionId = user.getLeaderselectionSession().getSessionId(); + log.info("Changing group leader for toolSessionId=" + toolSessionId + ". New leader's userUid=" + + leaderUserId); + isSuccessful = leaderselectionService.setGroupLeader(user.getUid(), toolSessionId); + } + + // build JSON + JSONObject responseJSON = new JSONObject(); + responseJSON.put("isSuccessful", isSuccessful); + writeResponse(response, "text/json", LamsDispatchAction.ENCODING_UTF8, responseJSON.toString()); + return null; + } + + /** + * set up service + */ + private void initService() { + if (leaderselectionService == null) { + leaderselectionService = LeaderselectionServiceProxy.getLeaderselectionService(this.getServlet().getServletContext()); + } + } +} \ No newline at end of file Index: lams_tool_leader/web/WEB-INF/struts-config.xml =================================================================== diff -u -r65efb0abb529cafc1977e284e2c9a4ed33722334 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_leader/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 65efb0abb529cafc1977e284e2c9a4ed33722334) +++ lams_tool_leader/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -97,6 +97,16 @@ redirect="false" /> + + Index: lams_tool_leader/web/WEB-INF/web.xml =================================================================== diff -u -r2a70ed7d169b7c8fe70237c266eb6194f3392164 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_leader/web/WEB-INF/web.xml (.../web.xml) (revision 2a70ed7d169b7c8fe70237c266eb6194f3392164) +++ lams_tool_leader/web/WEB-INF/web.xml (.../web.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -248,6 +248,21 @@ SYSADMIN + + + TBL Monitor interface + /tblmonitoring.do + GET + POST + + + + MONITOR + GROUP ADMIN + GROUP MANAGER + SYSADMIN + + Index: lams_tool_scratchie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.hbm.xml =================================================================== diff -u -r8620cb3f29c4710a0ddfd597fdc1b676d4b2b4b0 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.hbm.xml (.../ScratchieUser.hbm.xml) (revision 8620cb3f29c4710a0ddfd597fdc1b676d4b2b4b0) +++ lams_tool_scratchie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.hbm.xml (.../ScratchieUser.hbm.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -71,16 +71,6 @@ column="session_uid" /> - - getBySessionID(Long sessionId); + + int countUsersByContentId(Long contentId); } Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieUserDAOHibernate.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieUserDAOHibernate.java (.../ScratchieUserDAOHibernate.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dao/hibernate/ScratchieUserDAOHibernate.java (.../ScratchieUserDAOHibernate.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -34,7 +34,7 @@ public class ScratchieUserDAOHibernate extends LAMSBaseDAO implements ScratchieUserDAO { private static final String FIND_BY_USER_ID_CONTENT_ID = "from " + ScratchieUser.class.getName() - + " as u where u.userId =? and u.scratchie.contentId=?"; + + " as u where u.userId =? and u.session.scratchie.contentId=?"; private static final String FIND_BY_USER_ID_SESSION_ID = "from " + ScratchieUser.class.getName() + " as u where u.userId =? and u.session.sessionId=?"; private static final String FIND_BY_SESSION_ID = "from " + ScratchieUser.class.getName() @@ -63,5 +63,17 @@ public List getBySessionID(Long sessionId) { return (List) this.doFind(FIND_BY_SESSION_ID, sessionId); } - + + @Override + public int countUsersByContentId(Long contentId) { + final String COUNT_USERS_BY_CONTENT_ID = "SELECT COUNT(*) FROM " + ScratchieUser.class.getName() + + " as user WHERE user.session.scratchie.contentId = :contentId "; + + List list = getSession().createQuery(COUNT_USERS_BY_CONTENT_ID).setLong("contentId", contentId).list(); + if (list == null || list.size() == 0) { + return 0; + } else { + return ((Number) list.get(0)).intValue(); + } + } } Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20180223.sql =================================================================== diff -u --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20180223.sql (revision 0) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/dbupdates/patch20180223.sql (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,17 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3224 Ability to change, add, remove questions even after student have reached it +ALTER TABLE tl_lascrt11_user DROP FOREIGN KEY FK_NEW_610529188_30113BFC309ED320; +ALTER TABLE tl_lascrt11_user DROP COLUMN scratchie_uid, DROP INDEX FK_NEW_610529188_30113BFC309ED320; + +UPDATE lams_tool SET tool_version='20180223' WHERE tool_signature='lascrt11'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.java =================================================================== diff -u -r83ca314c18ea866bb79570b6e7da25eb8729b3b4 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.java (.../ScratchieUser.java) (revision 83ca314c18ea866bb79570b6e7da25eb8729b3b4) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/model/ScratchieUser.java (.../ScratchieUser.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -46,7 +46,6 @@ private Long portraitId; private ScratchieSession session; - private Scratchie scratchie; public ScratchieUser() { } @@ -58,7 +57,6 @@ this.loginName = user.getLogin(); this.portraitId = user.getPortraitUuid(); this.session = session; - this.scratchie = null; this.sessionFinished = false; } @@ -174,18 +172,6 @@ * * @return */ - public Scratchie getScratchie() { - return scratchie; - } - - public void setScratchie(Scratchie content) { - this.scratchie = content; - } - - /** - * - * @return - */ public boolean isSessionFinished() { return sessionFinished; } Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/IScratchieService.java =================================================================== diff -u -r3d40a7e98de7bcd2cb744cdb8dc13c0022fb7bdb -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/IScratchieService.java (.../IScratchieService.java) (revision 3d40a7e98de7bcd2cb744cdb8dc13c0022fb7bdb) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/IScratchieService.java (.../IScratchieService.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -155,10 +155,14 @@ /** * Get users by given toolSessionId. * - * @param long1 + * @param toolSessionId * @return */ List getUsersBySession(Long toolSessionId); + + ScratchieUser getUserByUserIDAndContentID(Long userId, Long contentId); + + int countUsersByContentId(Long contentId); /** * Save specified user. @@ -197,6 +201,14 @@ * @return */ ScratchieSession getScratchieSessionBySessionId(Long sessionId); + + /** + * Return all sessions realted to the specified toolContentId. + * + * @param toolContentId + * @return + */ + int countSessionsByContentId(Long toolContentId); /** * Save or update scratchie session. Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java =================================================================== diff -u -re2f4b14e2d8f0ef1feef10abdc21f3d446fca2a5 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision e2f4b14e2d8f0ef1feef10abdc21f3d446fca2a5) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/service/ScratchieServiceImpl.java (.../ScratchieServiceImpl.java) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -202,9 +202,13 @@ @Override public ScratchieUser getUserByIDAndSession(Long userId, Long sessionId) { - return scratchieUserDao.getUserByUserIDAndSessionID(userId, sessionId); } + + @Override + public int countUsersByContentId(Long contentId) { + return scratchieUserDao.countUsersByContentId(contentId); + } @Override public void saveOrUpdateScratchie(Scratchie scratchie) { @@ -405,6 +409,11 @@ public ScratchieSession getScratchieSessionBySessionId(Long sessionId) { return scratchieSessionDao.getSessionBySessionId(sessionId); } + + @Override + public int countSessionsByContentId(Long toolContentId) { + return scratchieSessionDao.getByContentId(toolContentId).size(); + } @Override public void saveOrUpdateScratchieSession(ScratchieSession resSession) { @@ -628,6 +637,11 @@ public List getUsersBySession(Long toolSessionId) { return scratchieUserDao.getBySessionID(toolSessionId); } + + @Override + public ScratchieUser getUserByUserIDAndContentID(Long userId, Long contentId) { + return scratchieUserDao.getUserByUserIDAndContentID(userId, contentId); + } @Override public void saveUser(ScratchieUser user) { @@ -1893,7 +1907,6 @@ user.setLastName(sysUser.getLastName()); user.setLoginName(sysUser.getLogin()); user.setUserId(new Long(newUserUid.longValue())); - user.setScratchie(toolContentObj); } scratchieDao.saveObject(toolContentObj); Index: lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/TblMonitorAction.java =================================================================== diff -u --- lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/TblMonitorAction.java (revision 0) +++ lams_tool_scratchie/src/java/org/lamsfoundation/lams/tool/scratchie/web/action/TblMonitorAction.java (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,274 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + +package org.lamsfoundation.lams.tool.scratchie.web.action; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONException; +import org.apache.tomcat.util.json.JSONObject; +import org.lamsfoundation.lams.tool.scratchie.ScratchieConstants; +import org.lamsfoundation.lams.tool.scratchie.dto.BurningQuestionDTO; +import org.lamsfoundation.lams.tool.scratchie.dto.BurningQuestionItemDTO; +import org.lamsfoundation.lams.tool.scratchie.model.Scratchie; +import org.lamsfoundation.lams.tool.scratchie.model.ScratchieItem; +import org.lamsfoundation.lams.tool.scratchie.model.ScratchieUser; +import org.lamsfoundation.lams.tool.scratchie.service.IScratchieService; +import org.lamsfoundation.lams.tool.scratchie.util.ScratchieItemComparator; +import org.lamsfoundation.lams.util.AlphanumComparator; +import org.lamsfoundation.lams.util.ExcelCell; +import org.lamsfoundation.lams.util.ExcelUtil; +import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +public class TblMonitorAction extends LamsDispatchAction { + private static Logger log = Logger.getLogger(TblMonitorAction.class); + + private static IScratchieService scratchieService; + + /** + * Shows tra page + */ + public ActionForward tra(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initializeScratchieService(); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Scratchie scratchie = scratchieService.getScratchieByContentId(toolContentId); + + int attemptedLearnersNumber = scratchieService.countUsersByContentId(toolContentId); + request.setAttribute("attemptedLearnersNumber", attemptedLearnersNumber); + + Set items = new TreeSet(new ScratchieItemComparator()); + items.addAll(scratchie.getScratchieItems()); + request.setAttribute("items", items); + + if (attemptedLearnersNumber != 0) { + // find first page in excel file + LinkedHashMap excelDoc = scratchieService.exportExcel(toolContentId); + ExcelCell[][] firstPageData = null; + for (String key : excelDoc.keySet()) { + firstPageData = excelDoc.get(key); + break; + } + + int groupsSize = scratchieService.countSessionsByContentId(toolContentId); + ArrayList groupRows = new ArrayList(); + for (int groupCount = 0; groupCount < groupsSize; groupCount++) { + ExcelCell[] groupRow = firstPageData[5 + groupCount]; + + String[] groupRow2 = new String[2]; + groupRow2[0] = (String) groupRow[1].getCellValue(); + groupRow2[1] = ((String) groupRow[groupRow.length - 1].getCellValue()).replaceAll("%", ""); + groupRows.add(groupRow2); + } + request.setAttribute("groupRows", groupRows); + } + + return mapping.findForward("tra"); + } + + /** + * Shows tra StudentChoices page + */ + public ActionForward traStudentChoices(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initializeScratchieService(); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Scratchie scratchie = scratchieService.getScratchieByContentId(toolContentId); + + //find second page in excel file + LinkedHashMap excelDoc = scratchieService.exportExcel(toolContentId); + ExcelCell[][] secondPageData = null; + for (ExcelCell[][] excelPage : excelDoc.values()) { + //check last row string starts with "*" (i.e. the string "*- Denotes the correct answer") + if (excelPage.length > 0) { + ExcelCell lastRow = excelPage[excelPage.length - 1][0]; + if (lastRow != null && ((String) lastRow.getCellValue()).startsWith("*")) { + secondPageData = excelPage; + break; + } + } + } + + ExcelCell[] correctAnswersRow = secondPageData[4]; + request.setAttribute("correctAnswers", correctAnswersRow); + + int groupsSize = scratchieService.countSessionsByContentId(toolContentId); + ArrayList groupRows = new ArrayList(); + for (int groupCount = 0; groupCount < groupsSize; groupCount++) { + ExcelCell[] groupRow = secondPageData[6 + groupCount]; + groupRows.add(groupRow); + } + request.setAttribute("groupRows", groupRows); + + Set items = new TreeSet(new ScratchieItemComparator()); + items.addAll(scratchie.getScratchieItems()); + request.setAttribute("items", items); + + request.setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID, toolContentId); + return mapping.findForward("traStudentChoices"); + } + + /** + * Exports tool results into excel. + * + * Had to move it from the tool as tool uses SessionMap + * + * @throws IOException + */ + public ActionForward exportExcel(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException { + initializeScratchieService(); + + Long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + LinkedHashMap dataToExport = scratchieService.exportExcel(toolContentId); + + String fileName = "scratchie_export.xlsx"; + fileName = FileUtil.encodeFilenameForDownload(request, fileName); + + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName); + + // Code to generate file and write file contents to response + ServletOutputStream out = response.getOutputStream(); + ExcelUtil.createExcel(out, dataToExport, null, false); + + return null; + } + + /** + * Shows Teams page + * @throws JSONException + */ + public ActionForward isBurningQuestionsEnabled(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, JSONException { + initializeScratchieService(); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Scratchie scratchie = scratchieService.getScratchieByContentId(toolContentId); + + // build JSON + JSONObject responseJSON = new JSONObject(); + responseJSON.put("isBurningQuestionsEnabled", scratchie.isBurningQuestionsEnabled()); + writeResponse(response, "text/json", LamsDispatchAction.ENCODING_UTF8, responseJSON.toString()); + return null; + } + + /** + * Shows Teams page + */ + public ActionForward burningQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initializeScratchieService(); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Scratchie scratchie = scratchieService.getScratchieByContentId(toolContentId); + + //find available burningQuestionDtos, if any + if (scratchie.isBurningQuestionsEnabled()) { + List burningQuestionItemDtos = scratchieService.getBurningQuestionDtos(scratchie, + null, true); + + //unescape previously escaped session names + for (BurningQuestionItemDTO burningQuestionItemDto : burningQuestionItemDtos) { + List burningQuestionDtos = burningQuestionItemDto.getBurningQuestionDtos(); + + for (BurningQuestionDTO burningQuestionDto : burningQuestionItemDto.getBurningQuestionDtos()) { + + String escapedBurningQuestion = StringEscapeUtils + .unescapeJavaScript(burningQuestionDto.getEscapedBurningQuestion()); + burningQuestionDto.setEscapedBurningQuestion(escapedBurningQuestion); + + String sessionName = StringEscapeUtils.unescapeJavaScript(burningQuestionDto.getSessionName()); + burningQuestionDto.setSessionName(sessionName); + } + + Collections.sort(burningQuestionDtos, new Comparator() { + @Override + public int compare(BurningQuestionDTO o1, BurningQuestionDTO o2) { + return new AlphanumComparator().compare(o1.getSessionName(), o2.getSessionName()); + } + }); + } + + request.setAttribute(ScratchieConstants.ATTR_BURNING_QUESTION_ITEM_DTOS, burningQuestionItemDtos); + } + + return mapping.findForward("burningQuestions"); + } + + /** + * Shows Teams page + */ + public ActionForward getModalDialogForTeamsTab(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + initializeScratchieService(); + + long toolContentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Long userId = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID); + + ScratchieUser user = scratchieService.getUserByUserIDAndContentID(userId, toolContentId); + Collection scratchieItems = user == null ? new LinkedList() + : scratchieService.getItemsWithIndicatedScratches(user.getSession().getSessionId()); + + request.setAttribute("scratchieItems", scratchieItems); + return mapping.findForward("teams"); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + private void initializeScratchieService() { + if (scratchieService == null) { + WebApplicationContext wac = WebApplicationContextUtils + .getRequiredWebApplicationContext(getServlet().getServletContext()); + scratchieService = (IScratchieService) wac.getBean(ScratchieConstants.SCRATCHIE_SERVICE); + } + } +} Index: lams_tool_scratchie/web/WEB-INF/struts-config.xml =================================================================== diff -u -re2f4b14e2d8f0ef1feef10abdc21f3d446fca2a5 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision e2f4b14e2d8f0ef1feef10abdc21f3d446fca2a5) +++ lams_tool_scratchie/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -299,8 +299,17 @@ type="org.lamsfoundation.lams.tool.scratchie.web.action.MonitoringAction" parameter="statistic" > - + + + + + + + + SYSADMIN + + + TBL Monitor interface + /tblmonitoring.do + GET + POST + + + + MONITOR + GROUP ADMIN + GROUP MANAGER + SYSADMIN + + Index: lams_tool_scratchie/web/common/taglibs.jsp =================================================================== diff -u -r6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18 -r5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d --- lams_tool_scratchie/web/common/taglibs.jsp (.../taglibs.jsp) (revision 6aaee4b2fe2caa08b0c63a0de11f05042d5a3e18) +++ lams_tool_scratchie/web/common/taglibs.jsp (.../taglibs.jsp) (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -9,4 +9,7 @@ <%@ taglib uri="tags-xml" prefix="x" %> <%@ taglib uri="tags-lams" prefix="lams" %> + + + Index: lams_tool_scratchie/web/pages/tblmonitoring/burningQuestions.jsp =================================================================== diff -u --- lams_tool_scratchie/web/pages/tblmonitoring/burningQuestions.jsp (revision 0) +++ lams_tool_scratchie/web/pages/tblmonitoring/burningQuestions.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,72 @@ +<%@ include file="/common/taglibs.jsp"%> + + +
+
+

+ +

+
+
+ + + +
+
+ + + + + +
+
+

+ + + + + + Q${i.index+1}) + + + + + + + [${burningQsCount}] +

+
+ + +
+
+
+ + + + + + + + + + +
+ + + ${burningQuestionDto.escapedBurningQuestion} + + ${burningQuestionDto.likeCount} +
+
+
+
+
+ +
+
+ +
+
Index: lams_tool_scratchie/web/pages/tblmonitoring/teams.jsp =================================================================== diff -u --- lams_tool_scratchie/web/pages/tblmonitoring/teams.jsp (revision 0) +++ lams_tool_scratchie/web/pages/tblmonitoring/teams.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,46 @@ +<%@ include file="/common/taglibs.jsp"%> + + +
+ +
+

+ Q${i.index+1}) + +

+
+ +
+
+ + + + + + + + + + + + + +
+ ${ALPHABET[j.index]}. + + + + + + + + + + + +
+
+
+ +
+
Index: lams_tool_scratchie/web/pages/tblmonitoring/tra.jsp =================================================================== diff -u --- lams_tool_scratchie/web/pages/tblmonitoring/tra.jsp (revision 0) +++ lams_tool_scratchie/web/pages/tblmonitoring/tra.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,123 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + +
+
+

+ +

+
+
+ + + +
+
+
+
+

+ + : ${attemptedLearnersNumber}/ +

+
+
+
+ + + + +
+ + + + +
+
+
+
+

+ Q${i.index+1}) +

+
+ +
+
+ + + + + + + + + +
+ ${ALPHABET[j.index]}. + + +
+
+
+
+
+
+
+ + + +
+
+
+
+ () +
+ +
+ +
+
+
+
+ Index: lams_tool_scratchie/web/pages/tblmonitoring/traStudentChoices.jsp =================================================================== diff -u --- lams_tool_scratchie/web/pages/tblmonitoring/traStudentChoices.jsp (revision 0) +++ lams_tool_scratchie/web/pages/tblmonitoring/traStudentChoices.jsp (revision 5d1d1bc2d08ed13455ca34ceb5ab94e5f918855d) @@ -0,0 +1,174 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + +
+
+

+ +

+
+
+ + + +
+
+
+ + +
+
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + ${i.index + 1} + + + + + % +
+ + + + + ${correctAnswers[i].cellValue} +
+ +
+ ${groupRow[0].cellValue} + success" + > + ${groupRow[j].cellValue} +
+
+
+
+
+ + + + + +