new QualifiedEmbeddedAssessment(config)
Creates a new embedded assessment.
If this assessment is created with
config.node
being an IFRAME
,
then that IFRAME is used directly. Otherwise, the
assessment will inject a new IFRAME as a child of the
node
passed in.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
Properties
|
- Tutorials:
Extends
Classes
Members
-
options :AssessmentOptions
-
Options on the current editor
Type:
-
assessmentData :AssessmentOptions~LoadData
-
Contains information about the loaded assessment, set after
AssessmentOptions#onLoaded
.Type:
-
node :HTMLElement
-
Node assigned to this editor. As a convenience, this node will have the property
QualifiedEmbed
set to this editor, so you can reference this editor vianode.QualifiedEmbed
.Type:
- HTMLElement
- Inherited From:
- Overrides:
-
iframe :HTMLIFrameElement
-
IFRAME node for this editor. May be the same as
node
Type:
- HTMLIFrameElement
- Inherited From:
- Overrides:
Methods
-
next()
-
Goes to the next challenge or review screen (if possible)
Returns:
- Type
- undefined
-
previous()
-
Goes to the previous challenge or welcome screen (if possible)
Returns:
- Type
- undefined
-
welcome()
-
Goes to the welcome screen if possible.
Returns:
- Type
- undefined
-
review()
-
Goes to the review screen if possible.
Returns:
- Type
- undefined
-
submit()
-
Submits the assessment. Will automatically switch to the review screen.
Returns:
- Type
- undefined
-
switchChallenge(challengeId)
-
Switches to a specific challenge, challenge index, welcome screen, or review screen, if possible.
If passed in a number,
0
means the welcome screen,1...n
is a given challenge, andn+1
is the review screen.You can pass in
'welcome'
or'review'
to go to those screens directly, or any challenge ID to go to that challenge.Parameters:
Name Type Description challengeId
string | number If a number, switches to that screen or challenge by index. If a string, attempts to switch by ID.
Returns:
The promise will reject if unable to find a matching stage.
- Type
- Promise
-
update(config)
-
Updates the iframe with new options, or reloads the iframe if the challenge ID has changed.
Parameters:
Name Type Description config
Object Properties
Name Type Argument Description options
AssessmentOptions <nullable>
Update the options for this editor (mixed in with the current ones).
reload
boolean <nullable>
If true, force a reload even if the challenge ID hasn't changed.
-
reload()
-
Reloads the editor. This could result in a loss of data.
-
destroy()
-
Destroys this embed and cleans up any resources associated with it.
- Inherited From:
- Overrides: