Tracking Activities in LMS with Airlock SDK
The goal of this guide is to fully synchronize educational processes in your LMS with accreditation requirements in our AMS using the Airlock API and SDK. This ensures your platform meets all compliance rules, helping prevent accreditation loss and student complaints.
Authorization
Generate a User Token by providing a collegeId
, userId
, and your College Secret
using a JWT library like jsonwebtoken
:
import jwt from "jsonwebtoken";
const College_Secret = "YOUR_COLLEGE_SECRET_KEY";
const token = jwt.sign({
collegeId: "YOUR_COLLEGE_ID",
id: "USER_ID",
}, College_Secret);
console.log("User Token:", token);
Alternatively, you can also use the generateUserToken
mutation to generate it.
Then authorize the SDK instance:
import { Woolf } from "@woolfuniversity/sdk"
const woolf = await Woolf.create('userToken')
console.log(woolf.user)
Track Resource Consumption
To enable tracking, add the attribute data-woolf-resource="<ResourceId>"
to containers displaying content such as PDFs, videos, or HTML.
<div data-woolf-resource="resourceId">
Markup of accredited content or its sections.
</div>
<div data-woolf-resource="resourceId">
Links to accredited assets such as PDFs, videos, etc.
</div>
For links or asset tracking, you can append the resource ID using the woolf-resource
URL parameter:
<a href="https://cdn.example?woolf-resource=resourceId">Document</a>
<video src="https://cdn.example?woolf-resource=resourceId"></video>
Enable Full Page Tracking
You may implement full page tracking by providing a trackPage
function:
const woolf = await Woolf.create('userToken', {
tracker: {
trackPage: (url) => url.pathname.split('/').pop()
}
})
Track Submissions and Attendance
Call the SDK methods when students submit assignments or attend meetings:
const submissionId = await woolf.trackSubmission('resourceId')
const attendanceId = await woolf.trackAttendance('resourceId')
You must also sync data via the API using the activityId
generated above:
Track Grades and Feedback
Use the SDK to track faculty input:
const gradeId = await woolf.trackGrade('resourceId', 'studentId')
const feedbackId = await woolf.trackFeedback('resourceId', 'studentId')
Submit the values using API:
Verify Tracked Events
To check which events were logged in the AMS, use the activities
query: