Skip to content

Commit

Permalink
SAK-50694 LTI Fix Outcomes for LTI 1.1 only Portlet (sakaiproject#13034)
Browse files Browse the repository at this point in the history
  • Loading branch information
csev authored Nov 22, 2024
1 parent fc3b112 commit 6e53388
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions lti/lti-common/src/java/org/sakaiproject/lti/util/SakaiLTIUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -905,28 +905,22 @@ public static void addPlacementInfo(Properties props, String placementId) {
setProperty(props, "ext_sakai_eid", user.getEid());
}

String allowRoster = (String) normalProps.get(LTIService.LTI_ALLOWROSTER);
String result_sourcedid = getSourceDID(user, placement, config);
String theRole = props.getProperty(LTIConstants.ROLES);

// If the server configuration says "no" that is it
// If the server configuration says "yes" and the tool configuration says "no" then it is "no"
String allowOutcomes = "false";
String gradebookColumn = null;
// TODO: Figure this out
// It is a little tricky - the tool configuration on/off decides whether
// We check the serverCongigurationService true/false
// We use the tool configuration to force outcomes off regardless of
// server settings (i.e. an external tool never wants the outcomes
// UI shown because it simply does not handle outcomes).
String allowOutcomes = toNull(getCorrectProperty(config, LTIService.LTI_ALLOWOUTCOMES, placement));
if (!LTI_PORTLET_OFF.equals(allowOutcomes)) {

String allowOutcomesTool = toNull(getCorrectProperty(config, LTIService.LTI_ALLOWOUTCOMES, placement));
if ( outcomesEnabled() && !LTI_PORTLET_OFF.equals(allowOutcomesTool) ) {
allowOutcomes = "true";
gradebookColumn = toNull(getCorrectProperty(config, "assignment", placement));
if (!outcomesEnabled()) {
allowOutcomes = null;
}
}

String allowRoster = (String) normalProps.get(LTIService.LTI_ALLOWROSTER);

String result_sourcedid = getSourceDID(user, placement, config);

String theRole = props.getProperty(LTIConstants.ROLES);
if (result_sourcedid != null) {

if ("true".equals(allowOutcomes) && gradebookColumn != null) {
if (theRole.contains(LTICustomVars.MEMBERSHIP_ROLE_LEARNER)) {
setProperty(props, LTIConstants.LIS_RESULT_SOURCEDID, result_sourcedid);
Expand Down

0 comments on commit 6e53388

Please sign in to comment.