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

⚠️ Important: You must authorize the Airlock SDK for all students already added to AMS when they log in to your LMS. Students must have permanent access to the Woolf Widget throughout their learning journey. Not complying with this requirement may lead to accreditation loss.

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.

 
💡 Note: User tokens ensure secure interactions between your LMS and Woolf AMS.

Then authorize the SDK instance:

import { Woolf } from "@woolfuniversity/sdk"
const woolf = await Woolf.create('userToken')
console.log(woolf.user)

Track Resource Consumption

⚠️ Important: The SDK only tracks resources that are submitted to Woolf and correctly tagged in your LMS. All other content is ignored.

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()
  }
})
⚠️ Important: Full page tracking disables data-attribute tracking and works best when one resource is rendered per page.

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:

💡 Note: Most events must be real-time and actor-based. Exceptions (like proctored exams) must be pre-approved and supported with strong evidence.

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:

⚠️ Important: Submitting grades without SDK tracking (e.g., auto-graded quizzes) requires manual confirmation by faculty in AMS.

Verify Tracked Events

To check which events were logged in the AMS, use the activities query:

 

Explore More