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

These are the different keys of the reportOptions object.

keydatatypemeaningdefault
showProctoringSummaryboolShow proctoring reporttrue
proctoringSummaryDOMIdstrThe DOM element to load the proctoring table ontoap-report__proctor
showSessionRecordingboolShow session recording playback elementtrue
sessionRecordingDOMIdstrThe DOM element to load the session recording ontoap-report__session
groupReportsIntoTabsboolGroup both reports into separate tabsfalse
tabContainerDOMIdstrIf groupReportsIntoTabs is true, the ID of the DOM element to inject this intoap-report-tab-container
insertTestReportTabboolAllow 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, etcfalse
testReportDOMIdstrIf insertTestReportTab is true, the ID of the DOM element to inject this intoap-report__test-results
userDetails.namestrShow the user's name below their photonull
userDetails.emailstrShow the user's email below their photonull

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).

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",
}