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énement | Description |
|---|---|
startExam | Déclenché lorsque l'examen surveillé commence |
endExam | Déclenché lorsque l'examen se termine |
flags | Déclenché lorsque des alertes de sécurité sont détectées |
proctorInterrupted | Le surveillant en direct a interrompu l'examen |
proctorResumed | L'examen a repris après l'interruption |
proctorKickout | Candidat retiré par le surveillant en direct |
deskScan | Scan du bureau terminé |
breakStart | Le candidat a commencé une pause |
breakEnd | Le 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();