Questions API Methods
offline()
Returns an object, containing two methods: getSession
and push
.
Note This method can only be used in Local Device Assessment.
Examples
const offlineMethods = LearnosityApp.offline();
Arguments
None.
Return value
Type object
-
push function
Synchronize the unsynchronized local device assessment responses stored inside the current device's
indexedDB
based on the providedsessionId
argument.LearnosityApp.offline().push(securityObject, '73b93d80-481d-4c50-b2ed-6596c49e037a') .then(() => console.log('Synchronization completed'));
-
securityObject object
The security object that is used to initialize the Questions API.
-
sessionId string
The session ID we want to synchronize.
-
-
getSession function
Return responses stored inside the current device's
indexedDB
based on the providedsessionId
argument.LearnosityApp.offline().getSession(securityObject, '73b93d80-481d-4c50-b2ed-6596c49e037a') .then((data) => console.log('session responses data', data));
-
securityObject object
The security object that is used to initialize the Questions API.
-
sessionId string
The session ID we want to retrieve the stored responses from.
-