Integrating Learnosity Feedback Aide API into your system is a simple process.
1. Prerequisites
In addition to some developer skills, you'll need the following:
- An OAuth key and secret to generate a security token. See Feedback Aide Security Tokens, and
- A rubric. You can grab a sample from here: Feedback Aide Rubrics.
2. Include the script to load Feedback Aide API
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 - LearnosityFeedbackAide.init()
In the JavaScript code of your app, create an instance of Feedback Aide.
const feedbackApp = await LearnosityFeedbackAide.init();
4. Create a feedback session using feedbackApp.feedbackSession()
rubric = "JSON formatted rubric";
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": JSON.parse(rubric),
"options": {"topiccheck":{"enabled":true}} // Optional options for session
}
);
5. Display the UI and evaluate the essay
We now use the feedbackSession
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 including this full UI, or a Headless mode, or a backend Restful API - this article gives more detail: Feedback Aide API Integration Options
Developer documentation for the JS API is here: Feedback Aide API JS Developer Documentation