Interface: AssessmentOptions

AssessmentOptions

The available options for an assessment options hash.

Members


invitePath :string

Unique invitePath for this assessment retrieved from the AssessmentInvitation API.

Note: The invite path will be modified to provide a more secure integration to the embedded assessment. If the candidate attempts to open the iframe in a new tab, it will not work as a standalone assessment.

Type:
  • string

authToken :string

The authToken value from an AssessmentInvitation. This token is required to enable to candidate to gain access to the embedded assessment.

Type:
  • string

embedClientKey :string

The unique embed client key value set on your team.

Type:
  • string

baseURL :string

Override the base URL for testing and debugging.

Type:
  • string

mode :null|"normal"|"readonly"|"restricted"

Enables setting up the editor in different read-only modes.

  • null or "normal" The default, normal mode with full editing and saving.
  • "restricted" Means you can edit the code, but changes will never be saved, or sent back to the parent window.
  • "readonly" Means you cannot edit the code at all. Useful for reviewing-only, without making changes. This also disables running code.

Note 1: This feature works in conjunction with the property editMode set on the assessment itself via the API. If this property is set, the embedded editor can only make the assessment more restricted, it cannot make it editable again.

Note 2: If the assessment is normally editable, this feature only prevents saving changes at the client-level. It's still possible for a very clever user to make changes by accessing the API directly. It should not be considered a security feature.

Type:
  • null | "normal" | "readonly" | "restricted"

hideSidebar :boolean

The entire assessment navigation sidebar will not be shown. This also includes timer information.

Not recommended unless you are planning on recreating the built-in navigation externally.

Type:
  • boolean

hideWelcome :boolean

If true, the welcome screen is not shown at the beginning, and the assessment is auto-started immediately upon loading.

Type:
  • boolean

hideReview :boolean

If true, the review screen is not shown in the sidebar. It will still be shown after submission, or if the assessment becomes non-editable (post-submission or timeout).

NOTE: The assessment will not be submittable within the assessment editor! You must submit the assessment via QualifiedEmbeddedAssessment.submit(), an API call, or using timed assessments.

Type:
  • boolean

Methods


onLoaded(eventData)

Callback for when the editor has loaded.

This callback is always called at least once, and can be called multiple times.

  • Before an assessment result is found, it will be called with started set to false.
  • It will always be called when the assessment is ready to solve, with started set to true.
Parameters:
Name Type Description
eventData Object
Properties
Name Type Description
assessment QualifiedEmbeddedAssessment

Embedded Assessment for this event

data AssessmentOptions~LoadData

Information about the assessment, will also be stored in QualifiedEmbeddedAssessment#assessmentData for future access.


onUpdated(eventData)

Callback whenever the assessment result is updated (active challenge changed, score updated, etc).

Parameters:
Name Type Description
eventData Object
Properties
Name Type Description
assessment QualifiedEmbeddedAssessment

Embedded Assessment for this event

data AssessmentOptions~LoadData

Information about the assessment, will also be stored in QualifiedEmbeddedAssessment#assessmentData for future access.


onSolutionUpdated(eventData)

Callback as the candidate makes changes to a solution (runs code, answers questions, etc)

Parameters:
Name Type Description
eventData Object
Properties
Name Type Description
assessment QualifiedEmbeddedAssessment

Embedded Assessment for this event

data AssessmentOptions~ChallengeData

Information about the current challenge & solution


onSubmitted(eventData)

Callback with the results once the assessment has been submitted.

Parameters:
Name Type Description
eventData Object
Properties
Name Type Description
assessment QualifiedEmbeddedAssessment

Embedded Assessment for this event

data AssessmentOptions~SubmissionResult

Results of the submission


onError(eventData)

Callback when there is an unrecoverable error.

Parameters:
Name Type Description
eventData Object
Properties
Name Type Description
assessment QualifiedEmbeddedAssessment

Embedded Assessment for this event

data AssessmentOptions~ErrorData

Information about the error.

Type Definitions


LoadData

Data about the loaded assessment, challenges, and more.

Properties:
Name Type Description
error AssessmentOptions~ErrorData

If set, there was an error loading the challenge (invalid ID or restrictions)

assessmentId string

ID of the loaded assessment

title string

Title of assessment

summary string

Summary text on assessment, in Markdown

assessmentResultId string | null

ID of the current assessment result, or null if no assessment result

started boolean

True if the assessment is being solved.

submitted boolean

True if the assessment has been submitted.

startedAt string

Time when assessment was started as an ISO string. Can be used to set up an external timer.

timeLimit number

If a number greater than 0, strict time limit in seconds. Otherwise, no time limit.

cutOffTime string

If there's a time limit, the ISO string for when that time will end.

score number

current score on the assessment (as seen by the candidate)

challenges Array.<AssessmentOptions~ChallengeData>

Array of challenge details on the assessment

stageIndex number

Number of the active challenge, or -1 if not on a challenge

stageId string

ID of the active challenge if on a challenge


ChallengeData

Data about a specific challenge

Properties:
Name Type Description
id string

Challenge or Stage ID

index number

Index of challenge or stage

title string

Challenge or Stage title

type string

Challenge type

summary string

Challenge summary

started boolean

True if the challenge has been started

attempted boolean

True if the candidate has answered a question or attempted to run their code

completed boolean

True if the candidate has answered all questions or passed all example tests

score number

Current score for this challenge as seen by the candidate. This is not the actual score used to evaluate the candidate.

solutionId string

ID of solution if we have one

solutionLanguage string

If a code challenge, the language being used to solve


SubmissionResult

Data about the submission. This is only the same data visible to the candidate, so it does not include detailed scoring or detailed results.

If you want to see the actual scored results, you'll want to use the API or WebHooks to receive this data.

Properties:
Name Type Description
assessmentId string

ID of the loaded assessment

assessmentResultId string

ID of the current assessment result

score number

Current "score" on the assessment as seen by the candidate. This is not the actual score used to evaluate the candidate.

challenges Array.<AssessmentOptions~ChallengeData>

Array of challenge details on the assessment

timerRanOut boolean

If true, the timer ran out (causing automatic submission)

solutionsStarted number

Number of solutions started

solutionsAttempted number

Number of solutions attempted (submitted at least once)

solutionsCompleted number

Number of solutions that were fully completed (passed all example tests or answered all questions)


ErrorData

Information about errors that may occur, including unhandled JavaScript errors or network errors.

Properties:
Name Type Description
context ERROR_CONTEXTS

Provides a context for the error

message string

For JavaScript errors, the message of the error

status string

For network errors, the status code

statusText string

For network errors, the status text

data string

For network errors, the returned network data

Properties
Name Type Description
reason string

For 40x errors, the reason provided by the server for the error