log.debug("LRS Actor: No email set for user ({}), using generated one: {}", user.getId(), actorEmail); actor = new LRS_Actor(actorEmail); if (StringUtils.isNotEmpty(user.getDisplayName())) { actor.setName(user.getDisplayName()); actor.setAccount(user.getEid(), serverConfigurationService.getServerUrl());
private LRS_Statement getStatementForAssignmentGraded(LRS_Actor instructor, Event event, Assignment a, AssignmentSubmission s, User studentUser) { LRS_Verb verb = new LRS_Verb(SAKAI_VERB.scored); LRS_Object lrsObject = new LRS_Object(m_serverConfigurationService.getPortalUrl() + event.getResource(), "received-grade-assignment"); HashMap<String, String> nameMap = new HashMap<String, String>(); nameMap.put("en-US", "User received a grade"); lrsObject.setActivityName(nameMap); HashMap<String, String> descMap = new HashMap<String, String>(); descMap.put("en-US", "User received a grade for their assginment: " + a.getTitle() + "; Submission #: " + s.getResubmissionNum()); 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"); LRS_Statement statement = new LRS_Statement(student, verb, lrsObject, getLRS_Result(a, s, true), context); return statement; }
private LRS_Statement getStatementForUnsubmittedAssignmentGraded(LRS_Actor instructor, Event event, Assignment a, AssignmentSubmission s, User studentUser) { LRS_Verb verb = new LRS_Verb(SAKAI_VERB.scored); LRS_Object lrsObject = new LRS_Object(m_serverConfigurationService.getAccessUrl() + event.getResource(), "received-grade-unsubmitted-assignment"); HashMap<String, String> nameMap = new HashMap<String, String>(); nameMap.put("en-US", "User received a grade"); lrsObject.setActivityName(nameMap); HashMap<String, String> descMap = new HashMap<String, String>(); descMap.put("en-US", "User received a grade for an unsubmitted assginment: " + a.getTitle()); 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"); LRS_Statement statement = new LRS_Statement(student, verb, lrsObject, getLRS_Result(a, s, false), context); return statement; }
/** * Construct a simple LRS statement with Result * * @param actorEmail the user email address, "I" * @param verbStr a string indicating the action, "did" * @param objectURI URI indicating the object of the statement, "this" * @param resultSuccess true if the result was successful (pass) or false if not (fail), "well" * @param resultScaledScore Score from -1.0 to 1.0 where 0=0% and 1.0=100% */ public LRS_Statement(String actorEmail, String verbStr, String objectURI, boolean resultSuccess, float resultScaledScore) { this(new LRS_Actor(actorEmail), new LRS_Verb(verbStr), new LRS_Object(objectURI)); this.result = new LRS_Result(resultScaledScore, resultSuccess); } /**
/** * Construct a simple LRS statement with Result * * @param actorEmail the user email address, "I" * @param verbStr a string indicating the action, "did" * @param objectURI URI indicating the object of the statement, "this" * @param resultSuccess true if the result was successful (pass) or false if not (fail), "well" * @param resultScaledScore Score from -1.0 to 1.0 where 0=0% and 1.0=100% */ public LRS_Statement(String actorEmail, String verbStr, String objectURI, boolean resultSuccess, float resultScaledScore) { this(new LRS_Actor(actorEmail), new LRS_Verb(verbStr), new LRS_Object(objectURI)); this.result = new LRS_Result(resultScaledScore, resultSuccess); } /**
/** * Construct a simple LRS statement * * @param actorEmail the user email address, "I" * @param verbStr a string indicating the action, "did" * @param objectURI URI indicating the object of the statement, "this" */ public LRS_Statement(String actorEmail, String verbStr, String objectURI) { this(new LRS_Actor(actorEmail), new LRS_Verb(verbStr), new LRS_Object(objectURI)); } /**
/** * @param instructorEmail Instructor user email that the statement relates to */ public void setInstructor(String instructorEmail) { this.instructor = new LRS_Actor(instructorEmail); } /**
/** * @param email the user email address * @return an actor built using the given email address */ static LRS_Actor makeFromEmail(String email) { LRS_Actor actor = new LRS_Actor(email); return actor; } /**
/** * @param instructorEmail Instructor user email that the statement relates to */ public void setInstructor(String instructorEmail) { this.instructor = new LRS_Actor(instructorEmail); } /**
/** * Construct a simple LRS statement * * @param actorEmail the user email address, "I" * @param verbStr a string indicating the action, "did" * @param objectURI URI indicating the object of the statement, "this" */ public LRS_Statement(String actorEmail, String verbStr, String objectURI) { this(new LRS_Actor(actorEmail), new LRS_Verb(verbStr), new LRS_Object(objectURI)); } /**
/** * @param email the user email address * @return an actor built using the given email address */ static LRS_Actor makeFromEmail(String email) { LRS_Actor actor = new LRS_Actor(email); return actor; } /**