Rubric Editor API Methods
getPractice()
Returns the current state of the Test panel, including the stimulus, sources, responses, and session state.
You would want to use this method to read back the current Test panel content and scoring results, for example, to persist the state in your own application after a test run has completed.
Examples
const practice = await editor.getPractice();
console.log(practice);
/* Example output:
{
stimulus: '<p>Write a short response about the water cycle.</p>',
sources: [
{ title: 'Reference material', content: '<p>The water cycle...</p>' }
],
sessionState: {
isAvailable: true,
isExhausted: false,
totalCreditsUsed: 2
},
responses: [
{
content: '<p>Water evaporates from the surface...</p>',
scoring: {
autoScores: [...],
manualComparison: [...],
creditsUsed: 1
}
}
]
}
*/
Arguments
None.
Return value
Type Promise
Resolves to an object with the following properties:
-
stimulus string
The current stimulus content set in the Test panel.
-
sources array[object]
The current list of sources set in the Test panel.
The following properties are supported.
-
title string
The title of the source.
-
content string
The HTML content of the source.
-
-
sessionState object
The current state of the rubric practice session.
The following properties are supported.
-
isAvailable boolean
Indicates whether the Test tab is available.
This will be
falsewhen norubric_practicehas been configured, or when the access token limit has been exhausted. -
isExhausted boolean
Indicates whether the rubric practice access token limit has been exhausted.
-
totalCreditsUsed number
The total number of credits consumed across all test runs in the current session.
-
-
responses array[object]
The current list of responses in the Test panel.
The following properties are supported.
-
content string
The HTML content of the response.
-
scoring object
The scoring results for this response.
The following properties are supported.
-
autoScores array[object]
The generated scores from the last test run for this response.
-
manualComparison array[object]
The expected scores set manually by the author using the comparison rubric in the Test panel.
-
creditsUsed number
The number of credits consumed by the last test run for this response.
-
error object
Present when the last test run for this response produced an error.
The following properties are supported.
-
message string
A description of the error.
-
code string
The error code.
-
-
-