diff --git a/CHANGELOG.md b/CHANGELOG.md index 521b97e..0b1a119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [v0.17.0] - 2024-07-04 +### Added +* Added support for authoraide API. + ## [v0.16.5] - 2023-09-05 ### Fixed * Added support for expiry date in security object. diff --git a/REFERENCE.md b/REFERENCE.md index 7d56b0f..e525a14 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -326,7 +326,7 @@ Run ```mvn package``` in your root directory (where pom.xml is located). This wi 3.) Install the learnosity SDK with maven into that directory by running the following (modify locations as appropriate): ```bash -mvn deploy:deploy-file -DgroupId=learnositysdk -DartifactId=learnositysdk -Dversion=0.16.5 -Durl=file:./learnosity-sdk-repo/ -DrepositoryId=learnosity-sdk-repo -DupdateReleaseInfo=true -Dfile=/home/temp/learnositysdk-0.16.5.jar -DpomFile=/home/temp/pom.xml +mvn deploy:deploy-file -DgroupId=learnositysdk -DartifactId=learnositysdk -Dversion=0.17.0 -Durl=file:./learnosity-sdk-repo/ -DrepositoryId=learnosity-sdk-repo -DupdateReleaseInfo=true -Dfile=/home/temp/learnositysdk-0.17.0.jar -DpomFile=/home/temp/pom.xml ``` 4.) Add the directory as a file based repository in your project pom.xml: diff --git a/docs/quickstart/assessment/pom.xml b/docs/quickstart/assessment/pom.xml index f99d121..500c1eb 100644 --- a/docs/quickstart/assessment/pom.xml +++ b/docs/quickstart/assessment/pom.xml @@ -27,7 +27,7 @@ learnositysdk learnositysdk - 0.16.5 + 0.17.0 diff --git a/docs/quickstart/assessment/src/main/java/com/learnosity/quickstart/AuthoraideApp.java b/docs/quickstart/assessment/src/main/java/com/learnosity/quickstart/AuthoraideApp.java new file mode 100644 index 0000000..d6478fb --- /dev/null +++ b/docs/quickstart/assessment/src/main/java/com/learnosity/quickstart/AuthoraideApp.java @@ -0,0 +1,43 @@ +package com.learnosity.quickstart; + +import learnositysdk.request.Init; +import java.util.HashMap; +import java.util.Map; +import org.json.JSONObject; + +public class AuthoraideApp extends App +{ + public String initOptions(String domain) { + Map security = createSecurityObject(domain); + JSONObject request = createRequestObject(); + String secret = config.getProperty("consumerSecret"); + + try { + Init init = new Init("authoraide", security, secret, request); + return init.generate(); + } catch (Exception e) { + e.printStackTrace(); + return e.getMessage(); + } + } + + Map createSecurityObject(String domain) { + var security = new HashMap(); + security.put("domain", domain); + security.put("consumer_key", config.getProperty("consumer")); + return security; + } + + JSONObject createRequestObject() { + JSONObject request = new JSONObject(); + + JSONObject user = new JSONObject(); + user.put("id", "brianmoser"); + user.put("firstname", "Test"); + user.put("lastname", "Test"); + user.put("email", "test@test.com"); + request.put("user", user); + + return request; + } +} diff --git a/docs/quickstart/assessment/src/main/webapp/AuthoraideApi.jsp b/docs/quickstart/assessment/src/main/webapp/AuthoraideApi.jsp new file mode 100644 index 0000000..ed8263a --- /dev/null +++ b/docs/quickstart/assessment/src/main/webapp/AuthoraideApi.jsp @@ -0,0 +1,33 @@ +<%@ page + import="com.learnosity.quickstart.AuthoraideApp" + language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + +<%! + private AuthoraideApp app; + public void jspInit() { + app = new AuthoraideApp(); + } + public void jspDestroy() { + app = null; + } +%> + + + +

Standalone Assessment Example - Authoraide API

+ + +
+ + + + + + + diff --git a/docs/quickstart/assessment/src/main/webapp/index.jsp b/docs/quickstart/assessment/src/main/webapp/index.jsp index 8d0e02f..f804bbe 100644 --- a/docs/quickstart/assessment/src/main/webapp/index.jsp +++ b/docs/quickstart/assessment/src/main/webapp/index.jsp @@ -11,6 +11,7 @@
  • Questions API
  • Author API
  • Reports API
  • +
  • Authoraide API
  • diff --git a/pom.xml b/pom.xml index 68b3c7b..238009b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ learnositysdk learnositysdk - 0.16.5 + 0.17.0 Learnosity SDK https://github.com/Learnosity/learnosity-sdk-java diff --git a/src/main/java/learnositysdk/request/Init.java b/src/main/java/learnositysdk/request/Init.java index 8a3724a..33afdd6 100644 --- a/src/main/java/learnositysdk/request/Init.java +++ b/src/main/java/learnositysdk/request/Init.java @@ -108,7 +108,7 @@ public class Init { /** * Valid strings for service */ - private String[] validServices = new String[] {"assess", "author", "data", "items", "questions", "reports", "events"}; + private String[] validServices = new String[] {"assess", "author", "data", "items", "questions", "reports", "events", "authoraide"}; /** * Instantiate this class with all security and request data. It @@ -207,7 +207,8 @@ public String generate() this.service.equals("author") || this.service.equals("data") || this.service.equals("items") || - this.service.equals("reports")) { + this.service.equals("reports") || + this.service.equals("authoraide")) { // Add the security packet (with signature) to the output output.put("security", this.securityPacket);