Integrating Learnosity Feedback Aide API into your system is a simple process.
1. Prerequisites
In addition to some developer skills, you'll need to prepare the following before continuing:
- An OAuth key and secret to generate a security token. See Feedback Aide Security Tokens, and
- A rubric JSON. See Feedback Aide Rubrics for all available rubric types and examples.
2. Load the Feedback Aide API script
Include the following script in your HTML page, and also a DOM node where you want the UI to appear.
<script src="https://feedbackaide.learnosity.com/js"></script>
...
<div class="feedback-session-01"></div>
This script will add a LearnosityFeedbackAide object to the JavaScript runtime.
3. Create an instance of Feedback Aide
In the JavaScript code of your app, create an instance of Feedback Aide with the LearnosityFeedbackAide.init() method.
const feedbackApp = await LearnosityFeedbackAide.init();
4. Create a feedback session
Use the feedbackApp.feedbackSession() method to create a new feedback session.
From the Prerequisites section, this is where you will use your security token and rubric JSON.
const rubric = { /* your rubric JSON */ };
const security = { /* your security token */ };
const feedbackSession = await feedbackApp.feedbackSession(
security,
{
"session_uuid": "36eebda5-b6fd-4e74-ad06-8e69dfb89e3e",
"stimulus": "Write an essay about obesity and its impact on society",
"response": "Obesity is ...",
"rubric": rubric,
"options": { "topiccheck":{ "enabled": true } }, // Optional options for session
"sources": [] // Optional list of sources
}
);
5. Display the UI and evaluate the essay
We can now use the feedbackSession instance to create the UI and attach it to the page. Finally, we make a call to generate the feedback.
// Create the UI object
const sessionUI = await feedbackSession.createUI();
// Attach the UI to the DOM
await sessionUI.attach(document.querySelector('.feedback-session-01'));
// Generate the AI feedback
await sessionUI.generateFeedback({ "model": "standard-essay" });
Load this in the browser - and you will now have your first Feedback Aide session.
Next Steps
There are multiple ways to integrate Feedback Aide into your application including:
- using the default out-of-the-box UI,
- a headless mode where you can build your own UI, or
- a backend RESTful API.
This article explains the options in more detail: Feedback Aide API Integration Options.
Developer documentation for the JavaScript API: Feedback Aide API JS Developer Documentation.