Skip to content

Commit

Permalink
SAK-30362 - Fix small issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Feb 23, 2016
1 parent ced81ad commit b6acdbe
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,12 @@ public static String[] postLaunchHTML(Map<String, Object> content, Map<String,Ob
outcome_url = ServerConfigurationService.getString("basiclti.consumer."+BasicLTIConstants.LIS_OUTCOME_SERVICE_URL,null);
if ( outcome_url == null ) outcome_url = getOurServerUrl() + LTI1_PATH;
setProperty(ltiProps,BasicLTIConstants.LIS_OUTCOME_SERVICE_URL, outcome_url);
setProperty(lti2subst,LTI2Vars.BASICOUTCOME_URL, outcome_url);

if ( theRole.indexOf(LTI2Vars.MEMBERSHIP_ROLE_LEARNER) >= 0 ) {
setProperty(ltiProps,BasicLTIConstants.LIS_RESULT_SOURCEDID, result_sourcedid);
setProperty(lti2subst,LTI2Vars.RESULT_SOURCEDID, result_sourcedid);
setProperty(lti2subst,LTI2Vars.BASICOUTCOME_SOURCEDID, result_sourcedid);
String result_url = getOurServerUrl() + LTI2_PATH + SVC_Result + "/" + result_sourcedid;
setProperty(lti2subst, LTI2Vars.RESULT_URL, result_url);
}
Expand Down
12 changes: 5 additions & 7 deletions basiclti/tsugi-util/src/java/org/tsugi/lti2/LTI2Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static void filterLTI1LaunchProperties(Properties ltiProps,
{

// Get the non-standard mappings
Properties mapping = property2CapabilityMapping();
Properties mapping = property2CapabilityMapping();

// Loop through property names
Properties oldProps = new Properties(ltiProps);
Expand Down Expand Up @@ -471,8 +471,8 @@ public static String property2Capability(String propString) {
'Person.email.primary' => 'lis_person_contact_email_primary',
'Person.sourcedId' => 'lis_person_sourcedid',
'Membership.role' => 'roles',
'Result.sourcedId' => 'lis_result_sourcedid',
'Result.autocreate' => 'lis_outcome_service_url'
'BasicOutcome.sourcedId' => 'lis_result_sourcedid',
'BasicOutcome.url' => 'lis_outcome_service_url'
*/
public static Properties property2CapabilityMapping() {
Properties mapping = new Properties();
Expand All @@ -487,10 +487,8 @@ public static Properties property2CapabilityMapping() {
mapping.setProperty("lis_person_name_family", "Person.name.family");
mapping.setProperty("lis_person_contact_email_primary", "Person.email.primary");
mapping.setProperty("lis_person_sourcedid", "Person.sourcedId");
mapping.setProperty("lis_result_sourcedid", "Result.sourcedId");
// A bit of a weird one - might change
mapping.setProperty("lis_outcome_service_url", "Result.autocreate");
// Missing from Stephen's list methinks
mapping.setProperty("lis_result_sourcedid", LTI2Vars.BASICOUTCOME_SOURCEDID);
mapping.setProperty("lis_outcome_service_url", LTI2Vars.BASICOUTCOME_URL);
mapping.setProperty("roles", "Membership.role");
return mapping;
}
Expand Down
14 changes: 14 additions & 0 deletions basiclti/tsugi-util/src/java/org/tsugi/lti2/LTI2Vars.java
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,20 @@ public class LTI2Vars {
*/
public static final String RESULT_URL = "Result.url";

/**
* BASICOUTCOME_URL
*
* Enables the substitution variable $BasicOutcome.url
*/
public static final String BASICOUTCOME_URL = "BasicOutcome.url";

/**
* BASICOUTCOME_SOURCEDID
*
* Enables the substitution variable $BasicOutcome.sourcedId
*/
public static final String BASICOUTCOME_SOURCEDID = "BasicOutcome.sourcedId";

/**
* TOOLCONSUMERINFO_PRODUCTFAMILYCODE
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public class ToolConsumer {
LTI2Vars.COURSESECTION_LONGDESCRIPTION,
LTI2Vars.MEMBERSHIP_ROLE,
LTI2Vars.TOOLCONSUMERPROFILE_URL,
LTI2Vars.RESULT_SOURCEDID
LTI2Vars.RESULT_SOURCEDID,
LTI2Vars.BASICOUTCOME_URL,
LTI2Vars.BASICOUTCOME_SOURCEDID
} ;

// Constructor
Expand Down

0 comments on commit b6acdbe

Please sign in to comment.