diff --git a/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java b/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java index c3d8f9c5aff3..a89783eb3d61 100644 --- a/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java +++ b/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java @@ -3839,7 +3839,6 @@ protected String build_instructor_grade_submission_context(VelocityPortlet portl String gradebookUid = toolManager.getCurrentPlacement().getContext(); // If the assignment reference is not equal to the associated gradebook item, then a custom gb item is being used if (!assignmentRef.equals(assignmentAssociateGradebook)) { - Optional assignmentOptional; try { org.sakaiproject.grading.api.Assignment gbAssignment = gradingService.getAssignment(gradebookUid, assignmentAssociateGradebook); diff --git a/rubrics/impl/src/main/java/org/sakaiproject/rubrics/impl/RubricsServiceImpl.java b/rubrics/impl/src/main/java/org/sakaiproject/rubrics/impl/RubricsServiceImpl.java index 56799756a296..7ebe05636538 100644 --- a/rubrics/impl/src/main/java/org/sakaiproject/rubrics/impl/RubricsServiceImpl.java +++ b/rubrics/impl/src/main/java/org/sakaiproject/rubrics/impl/RubricsServiceImpl.java @@ -875,7 +875,7 @@ public boolean hasAssociatedRubric(String tool, String id) { if (StringUtils.isBlank(id)) return false; - return associationRepository.findByToolIdAndItemId(tool, id).filter(canEvaluate.or(canEdit).or(isCreator)).isPresent(); + return getRubricAssociation(tool, id).isPresent(); } public Optional saveRubricAssociation(String toolId, String toolItemId, final Map params) { @@ -1017,7 +1017,7 @@ public Optional getRubricAssociation(String toolId, S @Transactional(readOnly = true) private Optional getRubricAssociationCheckPermission(String toolId, String associatedToolItemId) { - return getRubricAssociation(toolId, associatedToolItemId).filter(canEdit.or(isCreator)); + return getRubricAssociation(toolId, associatedToolItemId).filter(canEdit.or(isCreator).or(canEvaluate)); } @Transactional(readOnly = true) diff --git a/webcomponents/tool/src/main/frontend/js/rubrics/sakai-rubrics-api-mixin.js b/webcomponents/tool/src/main/frontend/js/rubrics/sakai-rubrics-api-mixin.js index 124d871e60e6..0793ce9cfbe7 100644 --- a/webcomponents/tool/src/main/frontend/js/rubrics/sakai-rubrics-api-mixin.js +++ b/webcomponents/tool/src/main/frontend/js/rubrics/sakai-rubrics-api-mixin.js @@ -31,13 +31,14 @@ export const rubricsApiMixin = Base => class extends Base { apiGetEvaluation() { - const url = new URL(`/api/sites/${this.siteId}/rubric-evaluations/tools/${this.toolId}/items/${this.entityId}/evaluations/${this.evaluatedItemId}`); + let url = `/api/sites/${this.siteId}/rubric-evaluations/tools/${this.toolId}/items/${this.entityId}/evaluations/${this.evaluatedItemId}`; + if (this.isPeerOrSelf) { - url.searchParams.append("isPeer", true); + url += "?isPeer=true"; } - return fetch(url.href, { credentials: "include" }) + return fetch(url, { credentials: "include" }) .then(r => { if (r.ok) {