diff --git a/webapi/src/main/java/org/sakaiproject/webapi/controllers/RubricsRestController.java b/webapi/src/main/java/org/sakaiproject/webapi/controllers/RubricsRestController.java index 06dfcf9dc47a..721ea7590075 100644 --- a/webapi/src/main/java/org/sakaiproject/webapi/controllers/RubricsRestController.java +++ b/webapi/src/main/java/org/sakaiproject/webapi/controllers/RubricsRestController.java @@ -347,6 +347,7 @@ ResponseEntity patchEvaluation(@PathVariable String siteId, @PathVariable Long e return rubricsService.getEvaluation(evaluationId, siteId).map(evaluation -> { ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); try { JsonNode patched = patch.apply(objectMapper.convertValue(evaluation, JsonNode.class)); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-rubrics/src/SakaiRubricStudentButton.js b/webcomponents/tool/src/main/frontend/packages/sakai-rubrics/src/SakaiRubricStudentButton.js index 28cf6aeee50c..6814ac546756 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-rubrics/src/SakaiRubricStudentButton.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-rubrics/src/SakaiRubricStudentButton.js @@ -90,16 +90,16 @@ export class SakaiRubricStudentButton extends rubricsApiMixin(RubricsElement) { return null; }) - .then(async data => { - - const evaluation = data._embedded.evaluations[0]; + .then(async evaluation => { if (evaluation) { - evaluation.status = 2; + const evaluationStatus = 2; url = `/api/sites/${this.siteId}/rubric-evaluations/${evaluation.id}`; await fetch(url, { - body: JSON.stringify(evaluation), + body: JSON.stringify([ + { "op": "replace", "path": "/status", "value": evaluationStatus } + ]), credentials: "include", - headers: { "Content-Type": "application/json" }, + headers: { "Content-Type": "application/json-patch+json" }, method: "PATCH", }) .then(r => {