Index: lams_tool_preview/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r9f2c1f957570c3885c34d8d162a1f14d82e3aba2 -r0e69531f65529363399c5472a6c42bae1aa88408
--- lams_tool_preview/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9f2c1f957570c3885c34d8d162a1f14d82e3aba2)
+++ lams_tool_preview/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 0e69531f65529363399c5472a6c42bae1aa88408)
@@ -1,179 +1,102 @@
-appName = shareresources
+appName = peerreview
#language code: en
#locale code: AU
# CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Tue Jun 02 10:51:09 CST 2015
-#=================== labels for ShareResources =================#
+#=================== labels for PeerReview =================#
-activity.title =Peerreview
-activity.description =Sharing resources with others.
-activity.helptext =Uploading your resources to share with others.
-tool.display.name =Share Resources Tool
-tool.description =Tool for sharing resources.
-appName =Share Resources
+activity.title =Peer Review
+activity.description =Individual peer review.
+activity.helptext =Individual peer review.
+tool.display.name =Peer Review Tool
+tool.description =Tool for individual peer review.
+appName =Peer Review
errorPage.title =Error page
errorPage.heading =Some error occurs when handling your request
-label.authoring.heading =Share Resources Authoring
-label.author.title =Share Resources
+label.authoring.heading =Peer Review Authoring
+label.author.title =Peer Review
label.authoring.heading.basic =Basic
label.authoring.heading.advance =Advanced
-label.authoring.heading.basic.desc =Basic input information for shared resources
-label.authoring.heading.advance.desc =Please input advance options for shared resources
+label.authoring.heading.basic.desc =Basic input information for peer review
+label.authoring.heading.advance.desc =Please input advance options for peer review
label.authoring.basic.title =Title
label.authoring.basic.instruction =Instruction
-label.authoring.basic.add.url =Add URL
-label.authoring.basic.add.file =Add Single File
-label.authoring.basic.add.website =Add Zipped Website
-label.authoring.basic.add.learning.object =Add IMS Content Package
-label.authoring.basic.resource.list.title =Resource list
-label.authoring.basic.resource.url =URL
-label.authoring.basic.resource.file =File
-label.authoring.basic.resource.website =Website
-label.authoring.basic.resource.learning.object =IMS CP
-label.authoring.basic.resource.verify.url =Verify URL
label.authoring.basic.resource.preview =Preview
-label.authoring.basic.resource.edit =Edit
-label.authoring.basic.resource.delete =Delete
-label.authoring.basic.resource.add.instruction =Add Instruction
-label.authoring.basic.resource.instructions =Instructions
-label.authoring.basic.resource.title.input =Title
-label.authoring.basic.resource.url.input =URL
-label.authoring.basic.resource.file.input =File
-label.authoring.basic.resource.description.input =Description
-label.authoring.basic.resource.zip.file.input =Zip file:
-label.authoring.online.filelist =Online file list
-label.authoring.offline.filelist =Offline file list
label.authoring.advance.lock.on.finished =Lock when finished
-label.authoring.advance.run.content.auto =Run content automatically (only available if there is exactly one resource)
-label.authoring.advance.mini.number.resources.view =Minimum number of resources to view
-label.authoring.advance.allow.learner.add.urls =Allow learners to add URLs
-label.authoring.advance.allow.learner.add.files =Allow learners to add files
-label.next.instruction =Next Instruction
label.authoring.save.button =Save
label.authoring.cancel.button =Cancel
-label.description =Description:
-authoring.exception =There is a problem in shared resources authoring page, the reason is {0}
error.resource.item.title.blank =Title can not be blank.
-error.resource.item.url.blank =URL can not be blank.
-error.resource.item.file.blank =File can not be blank.
-error.resource.item.desc.blank =Comment/Instruction can not be blank
-error.resource.item.invalid.url =Invalid URL format.
-error.upload.failed =Upload file failed: {0}
-error.msg.upload.file.not.found =Could not find upload file {0}.
-error.msg.zip.file.exception =Could not handle zip file when uploading file.
-error.msg.file.not.found =File not found exception occurs when uploading file.
-error.msg.ims.package =Invalid IMS CP format.
-error.msg.ims.application =ImscpApplicationException occurs when uploading resource item file.
-error.msg.website.no.initial.file =Website zip can not find out initial file (index.htm/html or default.htm/html).
-error.msg.io.exception =IOException occurs when uploading file.
-error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File.
-error.msg.repository =A repository error occurred while trying to upload the file.
error.msg.default.content.not.find =Could not retrieve default content record for this tool.
-msg.no.instruction =No instruction available.
authoring.msg.cancel.save =Do you want to close this window without saving?
-label.learning.title =Share Resource Learning
-label.learning.heading =Share Resources
-label.resoruce.to.review =Resources to view
-label.learning.minimum.review =You must view at least {0} of the resources.
-lable.learning.minimum.view.number.less =You must view at least another {0} of the resources.
-label.check.for.new =Check for new
-label.suggest.new =Suggest a new
-label.learning.new.file =New file details:
-label.learning.new.url =New URL details:
-label.learning.comment.or.instruction =Comment/Instruction
+label.learning.title =Peer Review Learning
monitoring.tab.summary =Summary
monitoring.tab.statistics =Statistic
monitoring.tab.edit.activity =Edit Activity
monitoring.label.group =Group
monitoring.summary.note =Note: number of learners is the number of learners who have viewed the resource.
-monitoring.label.type =Type
-monitoring.label.title =Title
-monitoring.label.suggest =Suggested By
monitoring.label.number.learners =Number of Learners
-monitoring.label.hide =Hide
-monitoring.label.show =Show
-monitoring.label.user.loginname =Login name
monitoring.label.user.name =Name
-monitoring.label.hidden =Hidden
-label.monitoring.edit.activity.cancel =Cancel
-label.monitoring.edit.activity.update =Update
label.monitoring.edit.activity.edit =Edit
message.monitoring.edit.activity.not.editable =This Activity is no longer editable
-export.label.resource =Resource
-export.label.no.learning.object =No offline package available
-export.title =Export portfolio of Share Resource
-export.init.resource =Initial Resources
-errors.header =
-errors.footer =
-error.valueReqd =Value Required
-error.inputFileTooLarge =Input File size is too large!
-error.uploading =error uploading
-error.title.empty =Title can not be blank
-message.msg.maxFileSize =Max 250K
-label.open =Open
+export.title =Export portfolio of Peer Review
label.delete =Delete
-label.download =Download
-label.view =View
label.edit =Edit
label.finished =Next Activity
label.completed =Completed
label.finish =Finished
-button.upload =Upload
-button.add =Add
-button.cancel =Cancel
message.monitoring.summary.no.session =No Session Available
-label.show =Show
-label.hide =Hide
-label.save =Save
-label.cancel =Cancel
-monitoring.label.access.time =Started on
define.later.message =Please wait for the instructor to complete the contents of this activity.
message.monitoring.summary.no.resource.for.group =No resource available for this group.
button.try.again =Try again
-open.in.new.window =Open URL in pop-up
-label.up =Move Up
-label.down =Move down
-label.monitoring.heading.access =Learners list
-label.authoring.advanced.reflectOnActivity =Add a notebook at end of Shared Resources with the following instructions:
+label.authoring.advanced.reflectOnActivity =Add a notebook at end of Peer Review with the following instructions:
error.reflection.emtpy =Please input Notebook Entry
title.reflection =Notebook Entry
label.continue =Continue
-monitoring.user.fullname =Name
-monitoring.user.reflection =Notebook Entry
-page.title.monitoring.view.reflection =View Notebook Entries
-button.close =Close
-message.step.of =Step {0} of {1}
message.no.reflection.available =No notebook available
-button.edit =Edit
-errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes
-error.attachment.executable =The uploaded file is executable, please zip it before uploading.
message.alertContentEdit =Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information.
-message.warnLockOnFinish =Note: After you click on "Next Activity\u201d, if you come back to this Share Resource, you won\u2019t be able to share new resources.
-message.activityLocked =The instructor has set this activity not to allow you to view or share any more resources after you have finished it.
+message.warnLockOnFinish =Note: After you click on "Next Activity\u201d, if you come back to this Peer Review, you won\u2019t be able to rate new users.
+message.activityLocked =The instructor has set this activity not to allow you to view or rate any more users after you have finished it.
label.export.reflection =Notebook Entries
-monitoring.label.instructions =Instructions
label.on =On
label.off =Off
monitor.summary.th.advancedSettings =Advanced settings
-monitor.summary.td.addNotebook =Add a notebook at end of Shared Resources
+monitor.summary.td.addNotebook =Add a notebook at end of Peer Review
monitor.summary.td.notebookInstructions =Notebook instructions
-label.authoring.advanced.notify.onassigmentsubmit =Notify instructors when a learner submits a resource
-event.assigment.submit.subject =LAMS: A learner submitted an assignment in a Shared Resources tool
-event.assigment.submit.body =The learner {0} submitted an assignment in a Shared Resources tool.\n\nThis message was sent automatically, following the tool''s advanced settings.
-error.planner.no.resource.save =There has to be at least one resource to save.
-error.planner.url.blank =In resource {0} URL can not be blank.
-error.planner.file.blank =In resource {0} file can not be blank.
-label.authoring.up =Move up
-label.authoring.down =Move down
-monitoring.label.complete.time =Finished on
-monitoring.label.time.taken =Time taken
-output.desc.shared.items.output.definition.rsrc =Share Resources: Uploaded URLs and paths to files
label.submit =Finish
-monitoring.label.actions =Actions
-monitoring.label.views =Views
-label.monitoring.heading =Share Resources Monitoring
-open.file.in.new.window =Open file in a new window
+label.monitoring.heading =Peer Review Monitoring
+label.average.rating =Average rating {0}/{1} votes
+label.redo =Redo ratings
+label.rating.criterias =Rating criterias
+label.add.criteria =Add Criteria
+label.your.rating =Your rating is {0} Avg rating {1} out of {2} votes
+label.rate.limits.reminder =Rating limitation: Minimum {0} and Maximum {1}.
+label.rate.limits.topic.reminder =You have rated {0} users already.
+label.rate.limits.reminder.min = You must rate at least {0} users.
+label.rate.limits.reminder.max = You can only rate up to {0} users.
+js.warning.max.min.limit = There is an error with the minimum and/or maximum set for ratings. Please check and try again.
+label.minimum =Minimum:
+label.maximum =Maximum:
+label.no.minimum =No minimum
+label.no.maximum =No maximum
+label.minimum.number.words =Minimum number of words in a comment {0}
+warning.minimum.number.words =There is a minimum required number of words in a comment: {0}. So far you've entered {1} word(s).
+label.comment.textarea.tip =Please, provide some comment here...
+label.max.number.marks.each.user =Max number of marks for a each user.
+label.move.up =Move Up
+label.move.down =Move Down
+label.allow.comments =Allow learners to comment on other learners
+label.sort.by.user.name =Sort by user name
+label.user.name =User name
+label.rating =Rating
+label.comment =Comment
+label.show.ratings.left.for.user =After completion, show feedback left for student
+label.ratings.by.others =Ratings by other users
+label.comment.minimum.number.words =Minimum number of words in a comment{0}
+label.no.users =There is no users available for rating.
+label.no.ratings.left =No ratings left
+label.cant.rate =This user can't be rated as it attracted the maximum number of rates already.
+
#======= End labels: Exported 168 labels for en AU =====
Index: lams_tool_preview/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
diff -u -r9f2c1f957570c3885c34d8d162a1f14d82e3aba2 -r0e69531f65529363399c5472a6c42bae1aa88408
--- lams_tool_preview/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 9f2c1f957570c3885c34d8d162a1f14d82e3aba2)
+++ lams_tool_preview/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 0e69531f65529363399c5472a6c42bae1aa88408)
@@ -1,4 +1,4 @@
-appName = shareresources
+appName = peerreview
#language code: en
#locale code: AU
@@ -22,158 +22,49 @@
label.authoring.heading.advance.desc =Please input advance options for peer review
label.authoring.basic.title =Title
label.authoring.basic.instruction =Instruction
-label.authoring.basic.add.url =Add URL
-label.authoring.basic.add.file =Add Single File
-label.authoring.basic.add.website =Add Zipped Website
-label.authoring.basic.add.learning.object =Add IMS Content Package
-label.authoring.basic.resource.list.title =Resource list
-label.authoring.basic.resource.url =URL
-label.authoring.basic.resource.file =File
-label.authoring.basic.resource.website =Website
-label.authoring.basic.resource.learning.object =IMS CP
-label.authoring.basic.resource.verify.url =Verify URL
label.authoring.basic.resource.preview =Preview
-label.authoring.basic.resource.edit =Edit
-label.authoring.basic.resource.delete =Delete
-label.authoring.basic.resource.add.instruction =Add Instruction
-label.authoring.basic.resource.instructions =Instructions
-label.authoring.basic.resource.title.input =Title
-label.authoring.basic.resource.url.input =URL
-label.authoring.basic.resource.file.input =File
-label.authoring.basic.resource.description.input =Description
-label.authoring.basic.resource.zip.file.input =Zip file:
-label.authoring.online.filelist =Online file list
-label.authoring.offline.filelist =Offline file list
label.authoring.advance.lock.on.finished =Lock when finished
-label.authoring.advance.run.content.auto =Run content automatically (only available if there is exactly one resource)
-label.authoring.advance.mini.number.resources.view =Minimum number of resources to view
-label.authoring.advance.allow.learner.add.urls =Allow learners to add URLs
-label.authoring.advance.allow.learner.add.files =Allow learners to add files
-label.next.instruction =Next Instruction
label.authoring.save.button =Save
label.authoring.cancel.button =Cancel
-label.description =Description:
-authoring.exception =There is a problem in peer review authoring page, the reason is {0}
error.resource.item.title.blank =Title can not be blank.
-error.resource.item.url.blank =URL can not be blank.
-error.resource.item.file.blank =File can not be blank.
-error.resource.item.desc.blank =Comment/Instruction can not be blank
-error.resource.item.invalid.url =Invalid URL format.
-error.upload.failed =Upload file failed: {0}
-error.msg.upload.file.not.found =Could not find upload file {0}.
-error.msg.zip.file.exception =Could not handle zip file when uploading file.
-error.msg.file.not.found =File not found exception occurs when uploading file.
-error.msg.ims.package =Invalid IMS CP format.
-error.msg.ims.application =ImscpApplicationException occurs when uploading resource item file.
-error.msg.website.no.initial.file =Website zip can not find out initial file (index.htm/html or default.htm/html).
-error.msg.io.exception =IOException occurs when uploading file.
-error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File.
-error.msg.repository =A repository error occurred while trying to upload the file.
error.msg.default.content.not.find =Could not retrieve default content record for this tool.
-msg.no.instruction =No instruction available.
authoring.msg.cancel.save =Do you want to close this window without saving?
-label.learning.title =Share Resource Learning
-label.learning.heading =Peer Review
-label.resoruce.to.review =Resources to view
-label.learning.minimum.review =You must view at least {0} of the resources.
-lable.learning.minimum.view.number.less =You must view at least another {0} of the resources.
-label.check.for.new =Check for new
-label.suggest.new =Suggest a new
-label.learning.new.file =New file details:
-label.learning.new.url =New URL details:
-label.learning.comment.or.instruction =Comment/Instruction
+label.learning.title =Peer Review Learning
monitoring.tab.summary =Summary
monitoring.tab.statistics =Statistic
monitoring.tab.edit.activity =Edit Activity
monitoring.label.group =Group
monitoring.summary.note =Note: number of learners is the number of learners who have viewed the resource.
-monitoring.label.type =Type
-monitoring.label.title =Title
-monitoring.label.suggest =Suggested By
monitoring.label.number.learners =Number of Learners
-monitoring.label.hide =Hide
-monitoring.label.show =Show
-monitoring.label.user.loginname =Login name
monitoring.label.user.name =Name
-monitoring.label.hidden =Hidden
-label.monitoring.edit.activity.cancel =Cancel
-label.monitoring.edit.activity.update =Update
label.monitoring.edit.activity.edit =Edit
message.monitoring.edit.activity.not.editable =This Activity is no longer editable
-export.label.resource =Resource
-export.label.no.learning.object =No offline package available
-export.title =Export portfolio of Share Resource
-export.init.resource =Initial Resources
-errors.header =
-errors.footer =
-error.valueReqd =Value Required
-error.inputFileTooLarge =Input File size is too large!
-error.uploading =error uploading
-error.title.empty =Title can not be blank
-message.msg.maxFileSize =Max 250K
-label.open =Open
+export.title =Export portfolio of Peer Review
label.delete =Delete
-label.download =Download
-label.view =View
label.edit =Edit
label.finished =Next Activity
label.completed =Completed
label.finish =Finished
-button.upload =Upload
-button.add =Add
-button.cancel =Cancel
message.monitoring.summary.no.session =No Session Available
-label.show =Show
-label.hide =Hide
-label.save =Save
-label.cancel =Cancel
-monitoring.label.access.time =Started on
define.later.message =Please wait for the instructor to complete the contents of this activity.
message.monitoring.summary.no.resource.for.group =No resource available for this group.
button.try.again =Try again
-open.in.new.window =Open URL in pop-up
-label.up =Move Up
-label.down =Move down
-label.monitoring.heading.access =Learners list
label.authoring.advanced.reflectOnActivity =Add a notebook at end of Peer Review with the following instructions:
error.reflection.emtpy =Please input Notebook Entry
title.reflection =Notebook Entry
label.continue =Continue
-monitoring.user.fullname =Name
-monitoring.user.reflection =Notebook Entry
-page.title.monitoring.view.reflection =View Notebook Entries
-button.close =Close
-message.step.of =Step {0} of {1}
message.no.reflection.available =No notebook available
-button.edit =Edit
-errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes
-error.attachment.executable =The uploaded file is executable, please zip it before uploading.
message.alertContentEdit =Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information.
-message.warnLockOnFinish =Note: After you click on "Next Activity\u201d, if you come back to this Share Resource, you won\u2019t be able to share new resources.
-message.activityLocked =The instructor has set this activity not to allow you to view or share any more resources after you have finished it.
+message.warnLockOnFinish =Note: After you click on "Next Activity\u201d, if you come back to this Peer Review, you won\u2019t be able to rate new users.
+message.activityLocked =The instructor has set this activity not to allow you to view or rate any more users after you have finished it.
label.export.reflection =Notebook Entries
-monitoring.label.instructions =Instructions
label.on =On
label.off =Off
monitor.summary.th.advancedSettings =Advanced settings
monitor.summary.td.addNotebook =Add a notebook at end of Peer Review
monitor.summary.td.notebookInstructions =Notebook instructions
-label.authoring.advanced.notify.onassigmentsubmit =Notify instructors when a learner submits a resource
-event.assigment.submit.subject =LAMS: A learner submitted an assignment in a Peer Review tool
-event.assigment.submit.body =The learner {0} submitted an assignment in a Peer Review tool.\n\nThis message was sent automatically, following the tool''s advanced settings.
-error.planner.no.resource.save =There has to be at least one resource to save.
-error.planner.url.blank =In resource {0} URL can not be blank.
-error.planner.file.blank =In resource {0} file can not be blank.
-label.authoring.up =Move up
-label.authoring.down =Move down
-monitoring.label.complete.time =Finished on
-monitoring.label.time.taken =Time taken
-output.desc.shared.items.output.definition.rsrc =peer review: Uploaded URLs and paths to files
label.submit =Finish
-monitoring.label.actions =Actions
-monitoring.label.views =Views
label.monitoring.heading =Peer Review Monitoring
-open.file.in.new.window =Open file in a new window
label.average.rating =Average rating {0}/{1} votes
label.redo =Redo ratings
@@ -204,5 +95,7 @@
label.ratings.by.others =Ratings by other users
label.comment.minimum.number.words =Minimum number of words in a comment{0}
label.no.users =There is no users available for rating.
+label.no.ratings.left =No ratings left
+label.cant.rate =This user can't be rated as it attracted the maximum number of rates already.
#======= End labels: Exported 168 labels for en AU =====
Index: lams_tool_preview/conf/xdoclet/struts-actions.xml
===================================================================
diff -u -r9f2c1f957570c3885c34d8d162a1f14d82e3aba2 -r0e69531f65529363399c5472a6c42bae1aa88408
--- lams_tool_preview/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 9f2c1f957570c3885c34d8d162a1f14d82e3aba2)
+++ lams_tool_preview/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 0e69531f65529363399c5472a6c42bae1aa88408)
@@ -96,11 +96,6 @@
type="org.lamsfoundation.lams.tool.peerreview.web.action.MonitoringAction"
parameter="getSubgridData" >
-
-
- itemIds, boolean isCommentsByOtherUsersRequired, Long userId) method, added additional parameter
+ * isCountUsersRatedEachItem.
+ *
+ */
+ List getRatingCriteriaDtos(Long contentId, Collection itemIds, boolean isCommentsByOtherUsersRequired, Long userId, boolean isCountUsersRatedEachItem);
+
+ String getLocalisedMessage(String key, Object[] args);
}
Index: lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/service/PeerreviewServiceImpl.java
===================================================================
diff -u -r9f2c1f957570c3885c34d8d162a1f14d82e3aba2 -r0e69531f65529363399c5472a6c42bae1aa88408
--- lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/service/PeerreviewServiceImpl.java (.../PeerreviewServiceImpl.java) (revision 9f2c1f957570c3885c34d8d162a1f14d82e3aba2)
+++ lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/service/PeerreviewServiceImpl.java (.../PeerreviewServiceImpl.java) (revision 0e69531f65529363399c5472a6c42bae1aa88408)
@@ -26,10 +26,12 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -359,6 +361,11 @@
public boolean isGroupedActivity(long toolContentID) {
return toolService.isGroupedActivity(toolContentID);
}
+
+ @Override
+ public String getLocalisedMessage(String key, Object[] args) {
+ return messageService.getMessage(key, args);
+ }
// *******************************************************************************
// ToolContentManager, ToolSessionManager methods
@@ -579,6 +586,26 @@
public ItemRatingDTO getRatingCriteriaDtoWithActualRatings(Long contentId, Long itemId) {
return ratingService.getRatingCriteriaDtoWithActualRatings(contentId, itemId);
}
+
+ @Override
+ public List getRatingCriteriaDtos(Long contentId, Collection itemIds,
+ boolean isCommentsByOtherUsersRequired, Long userId, boolean isCountUsersRatedEachItem) {
+ List itemRatingDTOs = getRatingCriteriaDtos(contentId, itemIds, isCommentsByOtherUsersRequired,
+ userId);
+
+ if (isCountUsersRatedEachItem) {
+ Map itemIdToRatedUsersCountMap = ratingService.countUsersRatedEachItem(contentId, itemIds, userId.intValue());
+
+ for (ItemRatingDTO itemRatingDTO : itemRatingDTOs) {
+ Long itemId = itemRatingDTO.getItemId();
+
+ int countUsersRatedEachItem = itemIdToRatedUsersCountMap.get(itemId).intValue();
+ itemRatingDTO.setCountUsersRatedEachItem(countUsersRatedEachItem);
+ }
+ }
+
+ return itemRatingDTOs;
+ }
@Override
public int getCountItemsRatedByUser(Long toolContentId, Integer userId) {
Index: lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/LearningAction.java
===================================================================
diff -u -r9f2c1f957570c3885c34d8d162a1f14d82e3aba2 -r0e69531f65529363399c5472a6c42bae1aa88408
--- lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/LearningAction.java (.../LearningAction.java) (revision 9f2c1f957570c3885c34d8d162a1f14d82e3aba2)
+++ lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/LearningAction.java (.../LearningAction.java) (revision 0e69531f65529363399c5472a6c42bae1aa88408)
@@ -205,6 +205,7 @@
sessionMap.put("isDisabled", peerreview.getLockWhenFinished() && user.isSessionFinished() || (mode != null)
&& mode.isTeacher());
sessionMap.put(PeerreviewConstants.ATTR_USER_FINISHED, user.isSessionFinished());
+ sessionMap.put("isSessionCompleted", user.getSession().getStatus() == PeerreviewConstants.COMPLETED);
// show results page
if (user.isSessionFinished() && peerreview.isShowRatingsLeftForUser()) {
@@ -240,6 +241,7 @@
//markUserFinished if it hasn't been done previously
if (!mode.isTeacher() && !user.isSessionFinished()) {
service.markUserFinished(sessionId, user.getUserId());
+ sessionMap.put(PeerreviewConstants.ATTR_USER_FINISHED, true);
}
// ratings left by the user
@@ -305,6 +307,12 @@
HttpServletResponse res) throws IOException, ServletException, JSONException {
IPeerreviewService service = getPeerreviewService();
+ // get back SessionMap
+ String sessionMapID = request.getParameter(PeerreviewConstants.ATTR_SESSION_MAP_ID);
+ SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(
+ sessionMapID);
+ Peerreview peerreview = (Peerreview) sessionMap.get(PeerreviewConstants.ATTR_PEERREVIEW);
+
Long toolContentId = WebUtil.readLongParam(request, "toolContentId");
Long toolSessionId = WebUtil.readLongParam(request, "toolSessionId");
@@ -342,8 +350,9 @@
// all comments required only for monitoring
boolean isCommentsByOtherUsersRequired = isMonitoring;
+ boolean isCountUsersRatedEachItem = peerreview.getMaximumRatesPerUser() != 0;
itemRatingDtos = service.getRatingCriteriaDtos(toolContentId, itemIds, isCommentsByOtherUsersRequired,
- userId);
+ userId, isCountUsersRatedEachItem);
// store how many items are rated
int countRatedQuestions = service.getCountItemsRatedByUser(toolContentId, userId.intValue());
@@ -364,12 +373,13 @@
break;
}
}
+ userRow.put("ratesPerUser", itemRatingDto.getCountUsersRatedEachItem());
JSONArray criteriasRows = new JSONArray();
for (ItemRatingCriteriaDTO criteriaDto : itemRatingDto.getCriteriaDtos()) {
JSONObject criteriasRow = new JSONObject();
criteriasRow.put("ratingCriteriaId", criteriaDto.getRatingCriteria().getRatingCriteriaId());
- criteriasRow.put("title", criteriaDto.getRatingCriteria().getTitle());
+ criteriasRow.put("title", StringEscapeUtils.escapeCsv(criteriaDto.getRatingCriteria().getTitle()));
criteriasRow.put("averageRating", criteriaDto.getAverageRating());
criteriasRow.put("numberOfVotes", criteriaDto.getNumberOfVotes());
criteriasRow.put("userRating", criteriaDto.getUserRating());
@@ -382,7 +392,7 @@
userRow.put("commentsCriteriaId", itemRatingDto.getCommentsCriteriaId());
String commentPostedByUser = itemRatingDto.getCommentPostedByUser() == null ? "" : itemRatingDto
.getCommentPostedByUser().getComment();
- userRow.put("commentPostedByUser", commentPostedByUser);
+ userRow.put("commentPostedByUser", StringEscapeUtils.escapeCsv(commentPostedByUser));
if (itemRatingDto.getCommentDtos() != null) {
JSONArray comments = new JSONArray();
for (RatingCommentDTO commentDto : itemRatingDto.getCommentDtos()) {
@@ -418,7 +428,6 @@
sessionMapID);
// get mode and ToolSessionID from sessionMAP
- ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE);
Long sessionId = (Long) sessionMap.get(PeerreviewConstants.PARAM_TOOL_SESSION_ID);
IPeerreviewService service = getPeerreviewService();
@@ -461,11 +470,11 @@
refForm.setSessionMapID(sessionMapID);
// get the existing reflection entry
- IPeerreviewService submitFilesService = getPeerreviewService();
+ IPeerreviewService service = getPeerreviewService();
SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID);
Long toolSessionID = (Long) map.get(PeerreviewConstants.PARAM_TOOL_SESSION_ID);
- NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
+ NotebookEntry entry = service.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
PeerreviewConstants.TOOL_SIGNATURE, user.getUserID());
if (entry != null) {
Index: lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/MonitoringAction.java
===================================================================
diff -u -r9f2c1f957570c3885c34d8d162a1f14d82e3aba2 -r0e69531f65529363399c5472a6c42bae1aa88408
--- lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 9f2c1f957570c3885c34d8d162a1f14d82e3aba2)
+++ lams_tool_preview/src/java/org/lamsfoundation/lams/tool/peerreview/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 0e69531f65529363399c5472a6c42bae1aa88408)
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -58,8 +57,6 @@
import org.lamsfoundation.lams.tool.peerreview.model.PeerreviewSession;
import org.lamsfoundation.lams.tool.peerreview.model.PeerreviewUser;
import org.lamsfoundation.lams.tool.peerreview.service.IPeerreviewService;
-import org.lamsfoundation.lams.usermanagement.Organisation;
-import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
@@ -85,9 +82,6 @@
if (param.equals("getSubgridData")) {
return getSubgridData(mapping, form, request, response);
}
- if (param.equals("viewReflection")) {
- return viewReflection(mapping, form, request, response);
- }
return mapping.findForward(PeerreviewConstants.ERROR);
}
@@ -150,9 +144,9 @@
int sorting = PeerreviewConstants.SORT_BY_NO;
if (sortBy != null && sortBy.equals(PeerreviewConstants.PARAM_ROW_NAME)) {
if (sortOrder != null && sortOrder.equals(PeerreviewConstants.SORT_DESC)) {
- sorting = PeerreviewConstants.SORT_BY_USERNAME_ASC;
- } else {
sorting = PeerreviewConstants.SORT_BY_USERNAME_DESC;
+ } else {
+ sorting = PeerreviewConstants.SORT_BY_USERNAME_ASC;
}
}
@@ -163,9 +157,9 @@
JSONObject responcedata = new JSONObject();
JSONArray rows = new JSONArray();
- responcedata.put("total", "" + service.getCountUsersBySession(toolSessionId, userId));
- responcedata.put("page", "" + page);
- responcedata.put("records", "" + size);
+ responcedata.put("page", page+1);
+ responcedata.put("total", Math.ceil((float)service.getCountUsersBySession(toolSessionId, userId)/size));
+ responcedata.put("records", service.getCountUsersBySession(toolSessionId, userId));
// handle rating criterias
List itemRatingDtos = null;
@@ -197,18 +191,27 @@
}
}
- String criteriasString = "";
+ String criteriasString = "