State Resource
Manages learner state for an activity.
Creates or merges into a state document by the agent, activity identifier and state identifier.
const agent: Agent = {
objectType: "Agent",
name: "Test Agent",
mbox: "mailto:[email protected]"
};
const activityId: string = "https://example.com/activities/test-activity";
const stateId: string = activityId + "/states/myStateId";
const state: DocumentJson = {
myKey: "myValue"
};
xapi.createState({
agent: agent,
activityId: activityId,
stateId: stateId,
state: state
});
The agent experiencing the AU.
The URI of the state to be created or merged into.
The state data to be stored.
The registration associated with this state.
The ETag of the original document if merging.
The ETag header type. Accepts "If-Match" or "If-None-Match".
This method returns an AxiosPromise with empty success data if successful.
Creates or overwrites a state document by the agent, activity identifier and state identifier.
The agent experiencing the AU.
The URI of the state to be created or overwritten.
The state data to be stored.
The registration associated with this state.
The ETag of the original document if overwriting.
The ETag header type. Accepts "If-Match" or "If-None-Match".
The content type of the state data.
This method returns an AxiosPromise with empty success data if successful.
Gets an array of state identifiers by the agent and activity identifier.
The agent experiencing the AU.
The registration associated with this state.
Only return States stored since specified Timestamp.
This method returns an AxiosPromise with the success data containing an array of state identifiers if successful.
Gets a state document by the agent, activity identifier and the state identifier.
The agent experiencing the AU.
The URI of the state to be retrieved.
The registration associated with this state.
This method returns an AxiosPromise with the success data containing the stored Document if successful.
Deletes a state document by the agent, activity identifier and the state identifier.
The agent experiencing the AU.
The URI of the state to be deleted.
The registration associated with this stage.
The ETag of the original document.
This method returns an AxiosPromise with empty success data if successful.
Deletes all state documents by the agent and activity identifier.
The agent experiencing the AU.
The registration associated with this stage.
The ETag of the original document if overwriting.
This method returns an AxiosPromise with empty success data if successful.