Tutoring

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

1. Methods

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

getAccountList (Account List)

Use the getAccountList method to retrieve a list of accounts taking the course.

The following parameters are required:

  • offset: Starting position of the account list page.

  • count: Number of account lists to retrieve.

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 account that is currently taking the course.

The required parameters are as follows:

  • uid: Unique identifier of the account.

  • key: Key of 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'
};

2. Attributes

isTutoringMode (Tutoring Mode)

⚠️ The isTutoringMode attribute is scheduled to be removed starting from version v1.0.0. Please use eliceContents.tutoring.isEnabled instead.

import { eliceContents } from 'src/constants';

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

isEnabled (Tutoring Mode Enabled)

The isEnabled attribute is used to check whether tutoring mode is enabled. If tutoring mode is enabled, the value is true; otherwise, it is 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 has accessed external content of an account registered through the Elice platform's tutoring mode.

  • The external content SDK has been initialized.

Last updated