Afficher en Markdown

SDKs et bibliothèques

Proctorio fournit des bibliothèques clientes et des outils officiels pour l'intégration avec l'API.

SDKs officiels

SDK .NET

La bibliothèque cliente officielle Proctorio pour .NET dans les applications C#.

Installation

dotnet add package Proctorio.Client

Ou via le Package Manager :

Install-Package Proctorio.Client

Liens

Prérequis : .NET 8.0 ou supérieur


Observe.js

Observe.js est un SDK JavaScript pour surveiller les événements d'examens Proctorio en temps réel. Il permet aux plateformes d'apprentissage de s'abonner aux événements clés du cycle de vie pendant l'administration des examens et d'implémenter une logique personnalisée.

Installation

Via npm :

npm install @proctorio/observe

Via CDN :

<script src="https://cdn.jsdelivr.net/npm/@proctorio/observe@1/lib/index.min.js"></script>

Utilisation

import { Observe } from '@proctorio/observe';

const observe = new Observe();

// Listen for exam start
observe.startExam((data) => {
  console.log('Exam started at offset:', data.offset);
});

// Listen for security flags
observe.flags((data) => {
  console.log('Security flags detected:', data.flagsData);
});

// Listen for exam end
observe.endExam((data) => {
  console.log('Exam ended at offset:', data.offset);
});

// Listen for live proctor events
observe.proctorInterrupted((data) => {
  console.log('Exam interrupted at offset:', data.offset);
});

Événements pris en charge

ÉvénementDescription
startExamDéclenché lorsque l'examen surveillé commence
endExamDéclenché lorsque l'examen se termine
flagsDéclenché lorsque des alertes de sécurité sont détectées
proctorInterruptedLe surveillant en direct a interrompu l'examen
proctorResumedL'examen a repris après l'interruption
proctorKickoutCandidat retiré par le surveillant en direct
deskScanScan du bureau terminé
breakStartLe candidat a commencé une pause
breakEndLe candidat est revenu de la pause

Liens


Exemples de code

cURL

curl -X POST https://us1.proctorapi.com/v2/candidate/launch \
  -H "api_key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json

Python (requests)

import requests

response = requests.post(
    "https://us1.proctorapi.com/v2/candidate/launch",
    headers={"api_key": "YOUR_API_KEY"},
    json=payload
)
candidate_url = response.json()

Node.js (fetch)

const response = await fetch("https://us1.proctorapi.com/v2/candidate/launch", {
  method: "POST",
  headers: {
    "api_key": process.env.PROCTORIO_API_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify(payload)
});
const candidateUrl = await response.json();

C# (HttpClient)

using var client = new HttpClient();
client.DefaultRequestHeaders.Add("api_key", apiKey);

var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
    "https://us1.proctorapi.com/v2/candidate/launch", content);
var candidateUrl = await response.Content.ReadAsStringAsync();