The available options for an assessment options hash.
Members
-
invitePath :string
-
Unique
invitePathfor 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
authTokenvalue 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.
-
nullor"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
editModeset 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
startedset tofalse. -
It will always be called when the assessment is ready
to solve, with
startedset totrue.
Parameters:
Name Type Description eventDataObject Properties
Name Type Description assessmentQualifiedEmbeddedAssessment Embedded Assessment for this event
dataAssessmentOptions~LoadData Information about the assessment, will also be stored in
QualifiedEmbeddedAssessment#assessmentDatafor future access. -
Before an assessment result is found, it will be
called with
-
onUpdated(eventData)
-
Callback whenever the assessment result is updated (active challenge changed, score updated, etc).
Parameters:
Name Type Description eventDataObject Properties
Name Type Description assessmentQualifiedEmbeddedAssessment Embedded Assessment for this event
dataAssessmentOptions~LoadData Information about the assessment, will also be stored in
QualifiedEmbeddedAssessment#assessmentDatafor future access. -
onSolutionUpdated(eventData)
-
Callback as the candidate makes changes to a solution (runs code, answers questions, etc)
Parameters:
Name Type Description eventDataObject Properties
Name Type Description assessmentQualifiedEmbeddedAssessment Embedded Assessment for this event
dataAssessmentOptions~ChallengeData Information about the current challenge & solution
-
onSubmitted(eventData)
-
Callback with the results once the assessment has been submitted.
Parameters:
Name Type Description eventDataObject Properties
Name Type Description assessmentQualifiedEmbeddedAssessment Embedded Assessment for this event
dataAssessmentOptions~SubmissionResult Results of the submission
-
onError(eventData)
-
Callback when there is an unrecoverable error.
Parameters:
Name Type Description eventDataObject Properties
Name Type Description assessmentQualifiedEmbeddedAssessment Embedded Assessment for this event
dataAssessmentOptions~ErrorData Information about the error.
Type Definitions
-
LoadData
-
Data about the loaded assessment, challenges, and more.
Properties:
Name Type Description errorAssessmentOptions~ErrorData If set, there was an error loading the challenge (invalid ID or restrictions)
assessmentIdstring ID of the loaded assessment
titlestring Title of assessment
summarystring Summary text on assessment, in Markdown
assessmentResultIdstring | null ID of the current assessment result, or
nullif no assessment resultstartedboolean True if the assessment is being solved.
submittedboolean True if the assessment has been submitted.
startedAtstring Time when assessment was started as an ISO string. Can be used to set up an external timer.
timeLimitnumber If a number greater than
0, strict time limit in seconds. Otherwise, no time limit.cutOffTimestring If there's a time limit, the ISO string for when that time will end.
scorenumber current score on the assessment (as seen by the candidate)
challengesArray.<AssessmentOptions~ChallengeData> Array of challenge details on the assessment
stageIndexnumber Number of the active challenge, or -1 if not on a challenge
stageIdstring ID of the active challenge if on a challenge
-
ChallengeData
-
Data about a specific challenge
Properties:
Name Type Description idstring Challenge or Stage ID
indexnumber Index of challenge or stage
titlestring Challenge or Stage title
typestring Challenge type
summarystring Challenge summary
startedboolean True if the challenge has been started
attemptedboolean True if the candidate has answered a question or attempted to run their code
completedboolean True if the candidate has answered all questions or passed all example tests
scorenumber Current score for this challenge as seen by the candidate. This is not the actual score used to evaluate the candidate.
solutionIdstring ID of solution if we have one
solutionLanguagestring 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 assessmentIdstring ID of the loaded assessment
assessmentResultIdstring ID of the current assessment result
scorenumber Current "score" on the assessment as seen by the candidate. This is not the actual score used to evaluate the candidate.
challengesArray.<AssessmentOptions~ChallengeData> Array of challenge details on the assessment
timerRanOutboolean If true, the timer ran out (causing automatic submission)
solutionsStartednumber Number of solutions started
solutionsAttemptednumber Number of solutions attempted (submitted at least once)
solutionsCompletednumber 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 contextERROR_CONTEXTS Provides a context for the error
messagestring For JavaScript errors, the message of the error
statusstring For network errors, the status code
statusTextstring For network errors, the status text
datastring For network errors, the returned network data
Properties
Name Type Description reasonstring For 40x errors, the reason provided by the server for the error