Skip to content

3. Finishing a test by LMS

This is a preferable method to finish a test when using a web app.

The client's system calls Constructor Proctor API for finishing the test by a POST request.

API URL:

https://[proctor-url]/api/v2/integration/simple/[integration_name]/sessions/[session_id]/finish/

Request method:

POST

Request headers:

Content-Type: application/json  
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTI5OTQxMzF9.PRzN

The JWT signature is used to verify that the request sender is the client’s system and that the token was generated exactly when the request was sent. In the payload the JWT contains the expiration date and time of the token in the numeric timestamp format. The time can be calculated using the formula “current time + 30 seconds”.

JWT payload example:

json
{
    "exp": 1234567890
}

Request body example:

json
{
    "sessionFinishUrl": "https://go.bananas.com/opentest/report/b3875623"
}
FieldTypeDescription
sessionFinishUrlstring (URL)The URL of the page where the test taker must be redirected to when the exam is over.

The JSON body of the request can be empty. If it is not, the value of the sessionFinishUrl parameter in this request overwrites the value sent at the start. If the parameter sessionFinishUrl has not been passed neither at the start nor at the finish, the test taker will stay at the Constructor Proctor page when the test is over.

For a started proctoring session Constructor Proctor responds with the 200 OK status meaning that the status of the session is set to finished. The JSON body of the response contains a message parameter with the finished value.

If for some reason a finish request is sent for a proctoring session that has already been finished, the response status is also 200 OK. In this case, the message value is not_changed.

If a test taker is signed up for a proctored test in Constructor Proctor calendar, but has not started the session yet, a finish request for such proctoring session cancels it. The response status is 200 OK, the message value is canceled.

If the connection between the LMS and Constructor Proctor was not established due to technical reasons, or the server responds with the 5xx status, the LMS has to repeatedly send the request after a certain time period, that is, implement the retry logic.