Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r5e1548fd8c9caed9a861784801054363e2efb400 -rebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2 --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5e1548fd8c9caed9a861784801054363e2efb400) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2) @@ -324,6 +324,7 @@ label.attendance =Attendance label.show.students.choices =Show students' choices label.hide.students.choices =Hide students' choices +label.student.choices =Student's choices label.print =Print label.excel.export =Excel export label.teams =Teams Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/MonitoringController.java =================================================================== diff -u -r8ea1e40c1667699690a4f1047e31dfaa0f372c76 -rebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 8ea1e40c1667699690a4f1047e31dfaa0f372c76) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/MonitoringController.java (.../MonitoringController.java) (revision ebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2) @@ -50,6 +50,7 @@ import org.lamsfoundation.lams.tool.assessment.dto.UserSummary; 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; @@ -132,7 +133,7 @@ //show only questions from question list otherwise } else { - for (QuestionReference reference : (Set) assessment.getQuestionReferences()) { + for (QuestionReference reference : assessment.getQuestionReferences()) { questionList.add(reference.getQuestion()); } } @@ -156,6 +157,37 @@ sessionMap.put(AssessmentConstants.ATTR_TOOL_CONTENT_ID, contentId); sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); + + // display student choices only if all questions are multiple choice + boolean displayStudentChoices = true; + int maxOptionsInQuestion = 0; + for (AssessmentQuestion question : assessment.getQuestions()) { + if (question.getType() == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) { + int optionsInQuestion = question.getOptions().size(); + if (optionsInQuestion > maxOptionsInQuestion) { + maxOptionsInQuestion = optionsInQuestion; + } + } else { + displayStudentChoices = false; + break; + } + } + + request.setAttribute("displayStudentChoices", displayStudentChoices); + if (displayStudentChoices) { + request.setAttribute("maxOptionsInQuestion", maxOptionsInQuestion); + + int totalNumberOfUsers = service.getCountUsersByContentId(contentId); + for (AssessmentQuestion question : assessment.getQuestions()) { + // build candidate dtos + for (AssessmentQuestionOption option : question.getOptions()) { + int optionAttemptCount = service.countAttemptsPerOption(option.getUid()); + float percentage = (float) (optionAttemptCount * 100) / totalNumberOfUsers; + option.setPercentage(percentage); + } + } + } + return "pages/monitoring/monitoring"; } @@ -602,12 +634,12 @@ + " and question ID " + questionUid); } } - + @SuppressWarnings("unchecked") private SessionMap getSessionMap(HttpServletRequest request) { String sessionMapID = WebUtil.readStrParam(request, AssessmentConstants.ATTR_SESSION_MAP_ID); request.setAttribute(AssessmentConstants.ATTR_SESSION_MAP_ID, sessionMapID); return (SessionMap) request.getSession().getAttribute(sessionMapID); - } + } } Index: lams_tool_assessment/web/pages/monitoring/parts/mcqStudentChoices.jsp =================================================================== diff -u --- lams_tool_assessment/web/pages/monitoring/parts/mcqStudentChoices.jsp (revision 0) +++ lams_tool_assessment/web/pages/monitoring/parts/mcqStudentChoices.jsp (revision ebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2) @@ -0,0 +1,100 @@ +<%@ include file="/common/taglibs.jsp"%> + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + ${ALPHABET_CAPITAL_LETTERS[i]} +
+ + ${i.index+1} + + + % +
+
+
+
+
+
+ + + + + + + Index: lams_tool_assessment/web/pages/monitoring/summary.jsp =================================================================== diff -u -r3317bc79e858810750b2d6aacbcb4a0a6d36b841 -rebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2 --- lams_tool_assessment/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 3317bc79e858810750b2d6aacbcb4a0a6d36b841) +++ lams_tool_assessment/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision ebe7b8f43ffb5c0a69b930b307ff9eaf9baf8dc2) @@ -326,6 +326,13 @@ + +
+ + + <%@ include file="/pages/monitoring/parts/mcqStudentChoices.jsp" %> +
+