The AutoProctor Report
Once a test attempt has been completed, you can render its proctoring report. A typical report looks like this. If the test hasn't been completed (because you haven't called the .stop()
method), you can still load the report. The different evidence will be visible, but the Submitted At and Trust Score fields will be blank.
Loading the report
Once the AutoProctor instance is initialized with the credentials, the showReport()
method fetches the violations and evidence and renders it as a table. For session recording, it creates a video playback element based on the different events it has recorded.
const apInst = new AutoProctor(credentials)
const reportOptions = {..};
apInst.showReport(reportOptions)
The reportOptions
object
reportOptions
objectThese are the different keys of the reportOptions
object.
key | datatype | meaning | default |
---|---|---|---|
showProctoringSummary | bool | Show proctoring report | true |
proctoringSummaryDOMId | str | The DOM element to load the proctoring table onto | ap-report__proctor |
showSessionRecording | bool | Show session recording playback element | true |
sessionRecordingDOMId | str | The DOM element to load the session recording onto | ap-report__session |
groupReportsIntoTabs | bool | Group both reports into separate tabs | false |
tabContainerDOMId | str | If groupReportsIntoTabs is true , the ID of the DOM element to inject this into | ap-report-tab-container |
insertTestReportTab | bool | Allow for an extra tab where you may want to show results of the test itself from your system. For example, points scored, questions got right, etc | false |
testReportDOMId | str | If insertTestReportTab is true , the ID of the DOM element to inject this into | ap-report__test-results |
userDetails.name | str | Show the user's name below their photo | null |
userDetails.email | str | Show the user's email below their photo | null |
User Details
If the user details were passed when the .setup()
method was called, the name and email that were initially passed are shown in the report. Otherwise, you can add an object with userDetails
as the key as shown above. These details are shown next to the test taker photo element (even if testTakerPhoto
isn't true
).
If the DOM ID's aren't specified, the SDK creates elements with the default ID's and inserts them at the end of the <body>
element. If they are specified and they aren't in the DOM, an error is thrown on the console, but no report is loaded.
Getting the results as a JSON
Instead of rendering the SDK's table, you may want to render the report using your own UI. For this, you can call the .getReport()
method like this
const results = apInst.getReport()
Calling this method returns the results in a JSON format. The response will look like the JSON below. You may then show the results using your own UI
{
"attemptDetails": {
"id": 39359,
"label": "CJhBzI6Mzi",
"testServerStartTime": "2024-06-24T06:44:49.162772Z",
"testClientStartTime": "2024-06-24T06:45:06.247687Z",
"testFinishTime": "2024-06-24T06:45:29.397770Z",
"trustScore": 0.65,
"uaString": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"numCreditsUsed": 1,
"lookupKey": null,
"miscData": {
"userDetails": {"name": "Tom Sawyer", "email": "tomsawyer@example.com"},
"sdkVersion": "4.1.0",
"evidenceCollectionWindow": 60, // can't be less than 60 seconds
"creditsRemaining": 68
},
"deviceType": "Chrome (desktop)",
"testAttemptUrl": "https://www.somecompany.com/?test-attempt-id=b659a4070a",
"testTakerPhotoUrl": "https://ap-core-ten-anomalies.s3.amazonaws.com/mock/random-photo-4.png",
"uniqueCode": null,
"allottedTime": null,
},
"proctorSettings": {
"track": {
"audio": true,
"numHumans": true,
"tabSwitch": true,
"photosAtRandom": true,
"numPhotosAtRandom": 10,
"captureSwitchedTab": true,
"detectMultipleScreens": true,
"testTakerPhoto": true,
"forceFullScreen": false,
"recordSession": true,
"auxiliaryDevice": false,
"forceDesktop": false,
"showCamPreview": false
},
"informUser": {
"testAdmin": true,
"testTaker": true
},
"proctorEnabled": true
},
"reportData": {
"evidence": [
{
"evidenceUrl": "https://ap-core-ten-anomalies.s3.amazonaws.com/mock/random-photo-4.png",
"label": "random-photo-taken",
"message": "Random Photo",
"violation": false,
"occurredAt": "2021-12-08T19:01:32Z",
},
{
"evidenceUrl": "https://ap-core-ten-anomalies.s3.amazonaws.com/nd/20240205/obkG9ZXZE3/anomalies/Jq3BTpELUI",
"label": "noise-detected",
"message": "Noise Detected",
"occurredAt": "2024-02-05T09:20:36Z",
"violation": true,
},
{
"evidenceUrl": null,
"label": "tab-focus-gained",
"message": "Returned to application",
"violation": false,
"occurredAt": "2021-12-08T19:01:20Z",
},
{
"evidenceUrl": "https://ap-ten-anomalies.s3.amazonaws.com/nd/20211208/MhNp9VEPEx/tab_switches/iBNr3fiwJp",
"label": "tab-focus-lost",
"message": "Changed application",
"violation": true,
"occurredAt": "2021-12-08T19:01:15Z",
}
]
},
"testAttemptStatus": "trust_score_calculated",
"evidenceStatus": "processed",
"testAttemptJwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MTkyMTE1NjgsIm5iZiI6MTcxOTIxMTU2OCwianRpIjoiMTc4Yzc5NmYtOWM5Yi00OThjLTg0Y2ItYzgzZTQ5MGQzNDlmIiwiaWRlbnRpdHkiOnsidGVuYW50SUQiOjI3LCJ0ZXN0QXR0ZW1wdElEIjozOTM1OX0sImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyJ9.jI7BJpY1VAxcPa1nEgToyBFyQcQ1SuCavFQGh6bsUJc",
}