Index: lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/LearningAction.java =================================================================== diff -u -r3b619df5e7e11dab1dc49859d23399a4b179c16f -r48c14c8aeedd10c8cc5fd8331e21f6478fba012c --- lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/LearningAction.java (.../LearningAction.java) (revision 3b619df5e7e11dab1dc49859d23399a4b179c16f) +++ lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/LearningAction.java (.../LearningAction.java) (revision 48c14c8aeedd10c8cc5fd8331e21f6478fba012c) @@ -417,9 +417,9 @@ if (criteria.isRankingStyleRating()) sorting = PeerreviewConstants.SORT_BY_AVERAGE_RESULT_ASC; allUsersDtos.add(service.getUsersRatingsCommentsByCriteriaIdDTO(peerreview.getContentId(), sessionId, criteria, - user.getUserId(), false, sorting, showAllUsers, true)); + user.getUserId(), false, sorting, null, showAllUsers, true)); currentUserDtos.add(service.getUsersRatingsCommentsByCriteriaIdDTO(peerreview.getContentId(), sessionId, criteria, - user.getUserId(), false, sorting, showAllUsers, false)); + user.getUserId(), false, sorting, null, showAllUsers, false)); } @@ -475,7 +475,7 @@ JSONObject responsedata = new JSONObject(); responsedata.put("total_rows", service.getCountUsersBySession(toolSessionId, userId)); responsedata.put("rows", service.getUsersRatingsCommentsByCriteriaIdJSON(toolContentId, toolSessionId, criteria, userId, - page, size, sorting, peerreview.isSelfReview(), true, peerreview.getMaximumRatesPerUser() > 0 )); + page, size, sorting, null, peerreview.isSelfReview(), true, peerreview.getMaximumRatesPerUser() > 0 )); int countRatedQuestions = service.getCountItemsRatedByUser(toolContentId, userId.intValue()); responsedata.put(AttributeNames.ATTR_COUNT_RATED_ITEMS, countRatedQuestions); @@ -534,7 +534,7 @@ Long userId = ( mode != null && mode.isTeacher() ) ? -1 : user.getUserId(); StyledCriteriaRatingDTO dto = service.getUsersRatingsCommentsByCriteriaIdDTO(toolContentId, toolSessionId, criteria, userId, - (criteria.isCommentRating() || criteria.isStarStyleRating()), PeerreviewConstants.SORT_BY_USERNAME_ASC, + (criteria.isCommentRating() || criteria.isStarStyleRating()), PeerreviewConstants.SORT_BY_USERNAME_ASC, null, peerreview.isSelfReview(), true ); // override the min/max for stars based on old settings if needed (original Peer Review kept one setting for all criteria ) Index: lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/MonitoringAction.java =================================================================== diff -u -re755d63f41781aa02a1fb97ae349019d01a58782 -r48c14c8aeedd10c8cc5fd8331e21f6478fba012c --- lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision e755d63f41781aa02a1fb97ae349019d01a58782) +++ lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 48c14c8aeedd10c8cc5fd8331e21f6478fba012c) @@ -189,27 +189,30 @@ } } + String searchString = WebUtil.readStrParam(request, "itemDescription", true); + // in case of monitoring we show all results. in case of learning - don't show results from the current user Long dummyUserId = -1L; JSONObject responcedata = new JSONObject(); + int numUsersInSession = service.getCountUsersBySession(toolSessionId, dummyUserId); responcedata.put("page", page + 1); - responcedata.put("total", Math.ceil((float) service.getCountUsersBySession(toolSessionId, dummyUserId) / size)); - responcedata.put("records", service.getCountUsersBySession(toolSessionId, dummyUserId)); + responcedata.put("total", Math.ceil((float) numUsersInSession / size)); + responcedata.put("records", numUsersInSession); JSONArray rows = new JSONArray(); if (criteria.isCommentRating()) { // special db lookup just for this - gets the user's & how many comments left for them List rawRows = service.getCommentsCounts(toolContentId, toolSessionId, criteria, page, size, - sorting); + sorting, searchString); for (int i = 0; i < rawRows.size(); i++) { Object[] rawRow = rawRows.get(i); JSONObject cell = new JSONObject(); cell.put("itemId", rawRow[0]); - cell.put("itemDescription", rawRow[3]); + cell.put("itemDescription", (String)rawRow[3]); Number numCommentsNumber = (Number) rawRow[1]; int numComments = numCommentsNumber != null ? numCommentsNumber.intValue() : 0; @@ -227,7 +230,7 @@ } else { // all other styles can use the "normal" routine and munge the JSON to suit jqgrid JSONArray rawRows = service.getUsersRatingsCommentsByCriteriaIdJSON(toolContentId, toolSessionId, criteria, - dummyUserId, page, size, sorting, true, true, false); + dummyUserId, page, size, sorting, searchString, true, true, false); for (int i = 0; i < rawRows.length(); i++) { @@ -236,23 +239,22 @@ String averageRating = (String) rawRow.get("averageRating"); Object numberOfVotes = rawRow.get("numberOfVotes"); - if (averageRating == null || averageRating.length() == 0) { - rawRow.put("rating", ""); - } else if (criteria.isStarStyleRating()) { - String starString = "
"; - starString += "
"; - starString += "
"; - starString += "
"; - String msg = service.getLocalisedMessage("label.average.rating", new Object[] { averageRating, - numberOfVotes }); - starString += msg; - starString += "
"; - rawRow.put("rating", starString); - } else { - rawRow.put("rating", averageRating); + if (averageRating != null && averageRating.length() > 0) { + if (criteria.isStarStyleRating()) { + String starString = "
"; + starString += "
"; + starString += "
"; + starString += "
"; + String msg = service.getLocalisedMessage("label.average.rating", new Object[] { averageRating, + numberOfVotes }); + starString += msg; + starString += "
"; + rawRow.put("rating", starString); + } else { + rawRow.put("rating", averageRating); + } } - JSONObject row = new JSONObject(); row.put("id", "" + rawRow.get("itemId")); row.put("cell", rawRow); @@ -367,7 +369,6 @@ .getAttribute(sessionMapID); request.setAttribute(PeerreviewConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - Long contentId = (Long) sessionMap.get(PeerreviewConstants.ATTR_TOOL_CONTENT_ID); Long toolSessionId = WebUtil.readLongParam(request, "toolSessionId"); // Getting the params passed in from the jqGrid