diff --git a/gradebookng/tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeSummaryTablePanel.java b/gradebookng/tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeSummaryTablePanel.java index 9bb38a02af0a..b1499410b9ae 100644 --- a/gradebookng/tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeSummaryTablePanel.java +++ b/gradebookng/tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeSummaryTablePanel.java @@ -48,6 +48,9 @@ import org.sakaiproject.service.gradebook.shared.GradebookInformation; import org.sakaiproject.service.gradebook.shared.GradingType; +import lombok.extern.slf4j.Slf4j; + +@Slf4j public class GradeSummaryTablePanel extends BasePanel { private static final long serialVersionUID = 1L; @@ -334,7 +337,6 @@ public boolean isVisible() { gradeScore.add(sakaiRubricPreview); } else { - gradeScore.add( new Label("grade", FormatHelper.convertEmptyGradeToDash(FormatHelper.formatGradeForDisplay(rawGrade)))); gradeScore.add(new Label("outOf", @@ -342,8 +344,6 @@ public boolean isVisible() { final WebMarkupContainer sakaiRubricPreview = new WebMarkupContainer("sakai-rubric-student-button"); sakaiRubricPreview.add(AttributeModifier.append("display", "icon")); - sakaiRubricPreview.add(AttributeModifier.append("tool-id", RubricsConstants.RBCS_TOOL_GRADEBOOKNG)); - sakaiRubricPreview.add(AttributeModifier.append("evaluated-item-id", assignment.getId() + "." + studentUuid)); sakaiRubricPreview.add(AttributeModifier.append("token", rubricsService.generateJsonWebToken(RubricsConstants.RBCS_TOOL_GRADEBOOKNG))); if (!showingStudentView && (GradeSummaryTablePanel.this.getUserRole() == GbRole.INSTRUCTOR @@ -351,8 +351,23 @@ public boolean isVisible() { sakaiRubricPreview.add(AttributeModifier.append("instructor", true)); } - if (assignment.getId() != null) { - sakaiRubricPreview.add(AttributeModifier.append("entity-id", assignment.getId())); + if (assignment.isExternallyMaintained()) { + sakaiRubricPreview.add(AttributeModifier.append("tool-id", RubricsConstants.RBCS_TOOL_ASSIGNMENT)); + String[] bits = assignment.getExternalId().split("/"); + if (bits != null && bits.length >= 1) { + String assignmentId = bits[bits.length-1]; + sakaiRubricPreview.add(AttributeModifier.append("evaluated-item-id", studentUuid)); + sakaiRubricPreview.add(AttributeModifier.append("entity-id", assignmentId));//this only works for Assignments atm + } else { + log.warn(assignment.getExternalId() + " is not a valid assignment reference"); + } + } else { + sakaiRubricPreview.add(AttributeModifier.append("tool-id", RubricsConstants.RBCS_TOOL_GRADEBOOKNG)); + sakaiRubricPreview.add(AttributeModifier.append("evaluated-item-id", assignment.getId() + "." + studentUuid)); + + if (assignment.getId() != null) { + sakaiRubricPreview.add(AttributeModifier.append("entity-id", assignment.getId())); + } } gradeScore.add(sakaiRubricPreview); diff --git a/rubrics/tool/src/main/frontend/webcomponents/sakai-rubric-criterion-student.js b/rubrics/tool/src/main/frontend/webcomponents/sakai-rubric-criterion-student.js index a752e8c2467a..243fdc068d30 100644 --- a/rubrics/tool/src/main/frontend/webcomponents/sakai-rubric-criterion-student.js +++ b/rubrics/tool/src/main/frontend/webcomponents/sakai-rubric-criterion-student.js @@ -74,7 +74,6 @@ export class SakaiRubricCriterionStudent extends SakaiElement { ${!this.preview ? html` -   ${c.selectedvalue} ${!c.selectedRatingId ? "0" : ""}   @@ -105,8 +104,10 @@ export class SakaiRubricCriterionStudent extends SakaiElement { var selectedRatingItem; c.ratings.forEach(r => { - r.selected = (r.id == ed.selectedRatingId); - selectedRatingItem = r; + if (r.id == ed.selectedRatingId) { + r.selected = true; + selectedRatingItem = r; + } }); c.selectedRatingId = ed.selectedRatingId; @@ -126,13 +127,13 @@ export class SakaiRubricCriterionStudent extends SakaiElement { this.updateTotalPoints(); } - isOverridden(ovrdvl, selected) { + isOverridden(pointoverride, selected) { if (!this.rubricAssociation.parameters.fineTunePoints) { return false; } - if ((ovrdvl || ovrdvl === 0) && (parseInt(ovrdvl) !== parseInt(selected))) { + if ((pointoverride || pointoverride === 0) && (parseInt(pointoverride) !== parseInt(selected))) { return true; } else { return false;