Skip to content

Commit

Permalink
SAK-33663 - Problem with LRS Context in various tools (sakaiproject#5047
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jonespm authored Nov 29, 2017
1 parent f71ef00 commit 456bcee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 456bcee

Please sign in to comment.