Home

Supervisor SDK

The JavaScript library is a software client of the ProctorEdu proctoring system and can be used for integration with e-learning system.

How to use

An example of using with JWT authorization:

<script src="https://demo.proctoring.online/sdk/supervisor.js"></script>
<script>
  // create Supervisor instance
  var supervisor = new Supervisor({ url: 'https://demo.proctoring.online' });
  // log in and initialize the session
  supervisor
    .init({
      provider: 'jwt',
      // get JWT string from your server
      token: fetch('/api/token').then(function(response) {
        if (response.ok) return response.text();
        else throw Error('Failed to get JWT');
      })
    })
    .then(function() {
      // start proctoring session
      return supervisor.start();
    })
    .catch(function(err) {
      // show alert with an error
      alert(err.toString());
      // redirect to home page
      location.href = '/';
    });
</script>

An example of using without changes on the side of your server (less secure):

<!-- Example of your DOM -->
<input
  id="username"
  type="hidden"
  value="377d4d85-6911-4a62-8168-8d7bff30f0c8"
/>
<div class="nickname">Ivan Ivanov</div>

<!-- Supervisor SDK -->
<script src="https://demo.proctoring.online/sdk/supervisor.js"></script>
<script>
  // create Supervisor instance
  var supervisor = new Supervisor({ url: 'https://demo.proctoring.online' });
  // log in and initialize the session
  supervisor
    .init({
      provider: 'plain',
      // unique session ID
      id: location.search.replace(/./g, function(c) {
        // convert URI to hex string
        return c.charCodeAt(0).toString(16);
      }),
      // any title of the session
      subject: document.title,
      // unique user ID
      username: document.getElementById('username').value,
      // any nickname of the user
      nickname: document.querySelector('.nickname').innerText
    })
    .then(function() {
      // start proctoring session
      return supervisor.start();
    })
    .catch(function(err) {
      // show alert with an error
      alert(err.toString());
      // redirect to home page
      location.href = '/';
    });
</script>

Do not forget to change URL "demo.proctoring.online" to your dedicated instance of the proctoring server.

Requirements and limitations

For correct operation of the system required to comply with the minimum system requirements listed below.

Parameter Minimum requirement
OS Windows 7, macOS 10.12 "Sierra", Linux
Browsers Chrome 72, Opera 59, Firefox 66, Yandex.Browser 19.3
Mobiles Android 4 (Chrome), iOS 11 (Safari)
Required protocols HTTPS, WebSockets, WebRTC
CPU 2 cores
RAM 256 MB
Network bandwidth 128 kbit/s
Camera 640x480, 15 fps
Microphone any

You should also consider the following limitations:

  1. Your e-learning system must be hosted on a server with valid SSL certificate (via HTTPS protocol). Otherwise the video and audio capture will not work.

  2. Your web page with SDK should not be fully reloaded while the library is running. For example, when switching between test questions. If the reload occurs in less than a minute, the proctoring results will not be saved.

supervisor.js