Getting started
Letβs get startedTrack activityAdd studentsAdd resourcesGuides
WidgetWebhooksKnowledge base
LimitationsErrorsResourcesActivitiesF.A.Q.Legacy versions
Airlock 0.1Track activity in your LMS using Airlock SDK
Authorization
Generate a User Token by providing a college ID, user ID, and College Secret to a JWT signing library like jsonwebtoken
.
import jwt from "jsonwebtoken"
const COLLEGE_SECRET = "SECRET_KEY"
const token = jwt.sign(
{
id: "userId",
collegeId: "collegeId"
},
COLLEGE_SECRET
);
console.log("User Token", token)
You can use a generated token to authorize the SDK instance. If everything goes well, you will receive access to a user
property that contains information about the identified user. Additionally, the Woolf Widget will automatically become visible on the page.
import { Woolf } from "@wooluniversity/sdk"
const woolf = await Woolf.create('userToken')
console.log(woolf.user)
Track consumption
Our SDK automatically tracks resources consumed by students on your platform, such as PDFs, videos, audios, or plain markup and images. However, to enable tracking, you must add the data-woolf-resource="<ResourceId>"
attribute to the container that renders the related content. Make sure you add it as close to the content as possible. Otherwise, SDK scanning of the page may cause performance issues and downgrade the user experience.
You may split resources across different sections and pages. Ensure that all parts of the content are wrapped with the properly tagged containers. Our SDK will automatically grab those chunks and calculate the percentage of resource consumption.
<div data-woolf-resource="<ResourceId>">
Markup of accredited content or its sections.
</div>
<div data-woolf-resource="<ResourceId>">
Link to accredited assets such as PDFs, videos, audios, etc.
</div>
Alternatively, for links and asset tracking, you can add woolf-resource=<ResourceId>
as a URL parameter. Please ensure that all parts of a submitted resource are correctly tagged, including its markup content and any related assets.
<a href="https://cdn.example?woolf-resource=<ResourceId>">...</a>
<audio src="https://cdn.example?woolf-resource=<ResourceId>">...</video>
<video src="https://cdn.example?woolf-resource=<ResourceId>">...</video>
Enable tracking without data attributes
By default, our SDK only tracks specific parts of a page that are tagged with data attributes. However, you can enable full page tracking by passing a custom tracking function to the SDK during initialization. This function receives a URL object and must return the resource ID. Since each LMS has its own URL structure, you will need to implement the URL parsing on your side.
If you decide to implement full page tracking, make sure that you render a single resource per page and that the page URL includes its ID. If a page is overloaded with data or complex components, full page tracking may cause performance issues. In such cases, it is better to use a tagging approach. When you enable full page tracking, data attributes will be ignored.
import { Woolf } from "@wooluniversity/sdk"
const woolf = await Woolf.create('userToken', {
tracker: { trackPage: (url) => url.pathname.split('/').pop() }
})
Track submission
When students submit their assignments on your platform, you must manually call the trackSubmission
method and pass the related resourceId
to it.
When students attend meetings or watch recordings on your platform, you must manually call the trackAttendance
method and pass the related resourceId
to it.
Both methods collect information about the place, time, and author of attribution. Our SDK enhances this information with confirmation screenshots and additional metadata.
import { Woolf } from "@wooluniversity/sdk"
const woolf = await Woolf.create('userToken')
const submissionId = await woolf.trackSubmission('resourceId')
const attendanceId = await woolf.trackAttendance('resourceId')
In addition to logging submission activity using the SDK, you need to pass actual data to the AMS using the API. Be sure to pass the activity ID generated by the trackSubmission
method to your server, as it will be used during data synchronization. Data synchronization may occur within 12 hours of the event, but it must be associated with the relevant activity ID. If you lose the activity ID, you can browse all activity events using the activities
query.
The vast majority of events must be real-time and actor-based. In rare cases, exceptions are allowed, such as off-platform meetings or exams. However, these exceptions must be supported by proctoring and strong evidence, and the percentage of their occurrence must be agreed upon with our Accreditation Team during college onboarding. The default quota is 0%.
Submit assignments
Here is how you can submit assignments data. For on-platform submissions, you need to provide the activityId
. For off-platform events, you need to provide the resourceId
and studentId
.
mutation {
addSubmission(
submission: {
activityId: $activityId
resourceId: $resourceId
studentId: $studentId
content: $content # student's assignment markup if any
assets: [{
fileName: $fileName
contentType: $contentType
# if you provide a URL, we will automatically fetch an asset. Otherwise, we will return a signed URL and headers so you can upload it yourself.
importUrl: "https://cdn.example/asset1.ext"
}]
}
) {
activityId
assets {
headers
uploadUrl
}
}
}
Submit meetings
Here is how you can track meetings and their off-platform attendances.
# upload meeting recording
mutation {
modifyResource(
resourceId: $resourceId
resource: {
assets: [{
fileName: $fileName
contentType: $contentType
# if you provide a URL, we will automatically fetch an asset. Otherwise, we will return a signed URL and headers so you can upload it yourself.
importUrl: "https://cdn.example/asset1.ext"
}]
}
) {
resource { id }
assets {
headers
uploadUrl
}
}
}
# track off-platform attendance
mutation {
addAttendance(
attendance: {
studentId: $studentId
resourceId: $resourceId
}
) {
activityId
}
}
Track grades and feedback
Just as students, faculty members must be authorized in the SDK and given access to the Woolf Widget if their registered in the AMS. You must call the trackGrade
or trackFeedback
methods with the related resourceId
and studentId
each time they provide grades or feedback to students.
import { Woolf } from "@wooluniversity/sdk"
const woolf = await Woolf.create('userToken')
const gradeId = await woolf.trackGrade('resourceId', 'studentId')
const feedbackId = await woolf.trackFeedback('resourceId', 'studentId')
mutation {
addGrade(
grade: {
activityId: $activityId
weightId: $weightId
value: $value
}
) {
activityId
}
}
mutation {
addFeedback(
feedback: {
activityId: $activityId
content: $feedback
assets: [{
fileName: $fileName
contentType: $contentType
# if you provide a URL, we will automatically fetch an asset. Otherwise, we will return a signed URL and headers so you can upload it yourself.
importUrl: "https://cdn.example/asset1.ext"
}]
}
) {
activityId
assets {
headers
uploadUrl
}
}
}
Sometimes, you may need to submit grades and feedback on behalf of a college without using an SDK. This is helpful for automatically graded assignments, such as quizzes. However, if the submitted assessments are not 100% actor-based and real-time, teachers will need to manually review and confirm each gradebook at the end of the course. If 100% of the assessments were tracked by an SDK, you could automatically submit compliant students for board approval using an API.
Verify tracked events
To verify whether any of the described events were or were not tracked in the AMS, you can monitor the educational activity of any student using the activities
query.
query {
activities(
userId: $userId
courseId: $courseId
) {
id
kind
data
created
userId
resourceId
assets
evidenceAssets
}
}