From 456bcee5b3942cc6d75879c931d537b64129a6b3 Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Wed, 29 Nov 2017 15:37:20 -0500 Subject: [PATCH] SAK-33663 - Problem with LRS Context in various tools (#5047) --- .../assignment/impl/AssignmentServiceImpl.java | 9 ++------- .../tool/messageforums/DiscussionForumTool.java | 5 +---- .../listener/delivery/DeliveryActionListener.java | 2 +- .../tool/assessment/util/SamigoLRSStatements.java | 13 ++++--------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/assignment/impl/src/java/org/sakaiproject/assignment/impl/AssignmentServiceImpl.java b/assignment/impl/src/java/org/sakaiproject/assignment/impl/AssignmentServiceImpl.java index dc17b808674a..e586d96d55fa 100644 --- a/assignment/impl/src/java/org/sakaiproject/assignment/impl/AssignmentServiceImpl.java +++ b/assignment/impl/src/java/org/sakaiproject/assignment/impl/AssignmentServiceImpl.java @@ -119,7 +119,6 @@ import org.sakaiproject.event.api.EventTrackingService; import org.sakaiproject.event.api.LearningResourceStoreService; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Actor; -import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Context; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Object; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Result; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Statement; @@ -3698,9 +3697,7 @@ private LRS_Statement getStatementForAssignmentGraded(String reference, Assignme lrsObject.setDescription(descMap); LRS_Actor student = new LRS_Actor(studentUser.getEmail()); student.setName(studentUser.getDisplayName()); - LRS_Context context = new LRS_Context(instructor); - context.setActivity("other", "assignment"); - return new LRS_Statement(student, verb, lrsObject, getLRS_Result(a, s, true), context); + return new LRS_Statement(student, verb, lrsObject, getLRS_Result(a, s, true), null); } private LRS_Result getLRS_Result(Assignment a, AssignmentSubmission s, boolean completed) { @@ -3731,9 +3728,7 @@ private LRS_Statement getStatementForUnsubmittedAssignmentGraded(String referenc lrsObject.setDescription(descMap); LRS_Actor student = new LRS_Actor(studentUser.getEmail()); student.setName(studentUser.getDisplayName()); - LRS_Context context = new LRS_Context(instructor); - context.setActivity("other", "assignment"); - return new LRS_Statement(student, verb, lrsObject, getLRS_Result(a, s, false), context); + return new LRS_Statement(student, verb, lrsObject, getLRS_Result(a, s, false), null); } private void sendGradeReleaseNotification(AssignmentSubmission submission) { diff --git a/msgcntr/messageforums-app/src/java/org/sakaiproject/tool/messageforums/DiscussionForumTool.java b/msgcntr/messageforums-app/src/java/org/sakaiproject/tool/messageforums/DiscussionForumTool.java index 8f6aca3be960..c2f785851b24 100644 --- a/msgcntr/messageforums-app/src/java/org/sakaiproject/tool/messageforums/DiscussionForumTool.java +++ b/msgcntr/messageforums-app/src/java/org/sakaiproject/tool/messageforums/DiscussionForumTool.java @@ -117,7 +117,6 @@ import org.sakaiproject.event.api.Event; import org.sakaiproject.event.api.LearningResourceStoreService; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Actor; -import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Context; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Object; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Result; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Statement; @@ -9893,9 +9892,7 @@ private LRS_Statement getStatementForGrade(String studentUid, String forumTitle, User studentUser = UserDirectoryService.getUser(studentUid); LRS_Actor student = new LRS_Actor(studentUser.getEmail()); student.setName(studentUser.getDisplayName()); - LRS_Context context = new LRS_Context(instructor); - context.setActivity("other", "assignment"); - LRS_Statement statement = new LRS_Statement(student, verb, lrsObject, getLRS_Result(score), context); + LRS_Statement statement = new LRS_Statement(student, verb, lrsObject, getLRS_Result(score), null); return statement; } diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java index b8aa32107e9e..022a07bbcac0 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java @@ -478,7 +478,7 @@ public void processAction(ActionEvent ae) throws } event = eventTrackingService.newEvent(SamigoConstants.EVENT_ASSESSMENT_TAKE, - "siteId=" + site_id + ", " + eventRef.toString(), "samigo",true,0,SamigoLRSStatements.getStatementForTakeAssessment(delivery.getAssessmentTitle(), delivery.getPastDue(), publishedAssessment.getReleaseTo(), false)); + "siteId=" + site_id + ", " + eventRef.toString(), site_id, true, 0, SamigoLRSStatements.getStatementForTakeAssessment(delivery.getAssessmentTitle(), delivery.getPastDue(), publishedAssessment.getReleaseTo(), false)); eventTrackingService.post(event); } else if (action == DeliveryBean.TAKE_ASSESSMENT_VIA_URL) { diff --git a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/util/SamigoLRSStatements.java b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/util/SamigoLRSStatements.java index 20f34d7d2907..725eeebb5cb6 100644 --- a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/util/SamigoLRSStatements.java +++ b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/util/SamigoLRSStatements.java @@ -21,7 +21,6 @@ import org.sakaiproject.component.cover.ComponentManager; import org.sakaiproject.event.api.EventTrackingService; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Actor; -import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Context; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Object; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Result; import org.sakaiproject.event.api.LearningResourceStoreService.LRS_Statement; @@ -85,8 +84,7 @@ public static LRS_Statement getStatementForGradedAssessment(AssessmentGradingDat "; Release To: "+ AgentFacade.getCurrentSiteId() + "; Submitted: " + (gradingData.getIsLate() ? "late" : "on time")); lrsObject.setDescription(descMap); - LRS_Context context = new LRS_Context("other", "assessment"); - LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), context); + LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), null); return statement; } @@ -111,8 +109,7 @@ public static LRS_Statement getStatementForTotalScoreUpdate(AssessmentGradingDat "; Release To: "+ AgentFacade.getCurrentSiteId() + "; Submitted: "+ (gradingData.getIsLate() ? "late" : "on time")); lrsObject.setDescription(descMap); - LRS_Context context = new LRS_Context("other", "assessment"); - LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), context); + LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), null); return statement; } @@ -138,8 +135,7 @@ public static LRS_Statement getStatementForStudentScoreUpdate(AssessmentGradingD "; Release To: "+ AgentFacade.getCurrentSiteId() + "; Submitted: " + (gradingData.getIsLate() ? "late" : "on time")); lrsObject.setDescription(descMap); - LRS_Context context = new LRS_Context("other", "assessment"); - LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), context); + LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), null); return statement; } @@ -167,8 +163,7 @@ public static LRS_Statement getStatementForQuestionScoreUpdate(AssessmentGrading "; Old Auto Score: " + oldAutoScore + "; New Auto Score: " + newAutoScore); lrsObject.setDescription(descMap); - LRS_Context context = new LRS_Context("other", "assessment"); - LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), context); + LRS_Statement statement = new LRS_Statement(null, verb, lrsObject, getLRS_Result(gradingData, publishedAssessment), null); return statement; }