Skip to main content

Tutoring

The tutoring object provides methods and properties that can be used in tutoring mode.

1. Methods

⚠️ All tutoring methods can only be used when accessing external content registered through the Elice platform's tutoring mode.

getAccountList (Account List)

The getAccountList method allows you to retrieve the list of accounts enrolled in a course. You can pass the parameters offset and count. The offset indicates the starting position of the account list, and count indicates the number of accounts to retrieve.

For example, if offset is 0 and count is 40, it retrieves the first 40 accounts starting from position 0. To retrieve the next list of accounts, set offset to 40 and count to 40. By combining offset and count, you can retrieve the account list page by page.

Parameters

VariableTypeDescription
offsetnumberThe starting position of the account list to retrieve. The minimum value is 0.
countnumberThe number of accounts to retrieve. The minimum value is 0, and the maximum value is 40.
import { eliceContents } from 'src/constants';

const getAccountList = async () => {
const accountList = await eliceContents.tutoring.getAccountList();
console.log(accountList); // [{ fullname: 'elice', uid: 123 }, ...]
};

getAccountKvstore (Account Kvstore)

Use the getAccountKvstore method to retrieve the learning history of a specific enrolled account.

The required parameters are:

  • uid: The unique identifier of the account.
  • key: The key for the kvstore.
import { eliceContents } from 'src/constants';

const getAccountKvstore = async () => {
const kvstore = await eliceContents.tutoring.getAccountKvstore({
uid: 123,
key: 'quiz01.answer',
});
console.log(kvstore); // 'Elice'
};

getAccountKvstoreList (Account Kvstore List)

When you want to get the kv store list of the specific accounts, you can use this method. You can pass the parameters key and filterUids. The key indicates the key of the kvstore, and filterUids indicates the list of unique identifiers of the accounts. The response includes the list of kvstore objects. Each object has uid and value. The maximum number of filterUids is 10 and you can not pass more than 10 unique identifiers.

Parameters
NameTypeDescription
keystringThe key of the kvstore.
filterUidsnumber[]The list of unique identifiers of the accounts. Maximum number of filterUids is 10.
import { eliceContents } from 'src/constants';

const getAccountKvstoreList = async () => {
const kvstoreList = await eliceContents.tutoring.getAccountKvstoreList({
key: 'quiz01.answer',
filterUids: [123, 456],
});
console.log(kvstoreList); // [{ uid: 123, value: 'Elice' }, { uid: 456, value: 'Elice' }]
};

2. Properties

isTutoringMode (Tutoring Mode)

⚠️ The isTutoringMode property will be removed in version v1.0.0. Instead, please use eliceContents.tutoring.isEnabled.

import { eliceContents } from 'src/constants';

console.log(eliceContents.isTutoringMode); // false or true

isEnabled (Tutoring Mode Activation Status)

The isEnabled property is used to check whether tutoring mode is activated. If tutoring mode is active, the value will be true, and if not, it will be false.

import { eliceContents } from 'src/constants';

eliceContents.init().then(() => {
console.log(eliceContents.tutoring.isEnabled); // false or true
});

⚠️ Tutoring mode is activated when all of the following conditions are met:

  • The user accessed external content registered through the Elice platform's tutoring mode.
  • The external content SDK has been initialized.