stateproperty, and how it is used. State controls the startup modes of the API, to allow for different behaviors during an assessment.
state will determine the mode that the API should use to initialize.
Based on its value, you will be able to start/preview a new Activity or continue/review an existing Activity.
It is not always necessary to define state, because the API will intelligently choose a state for you based on the session id.
If you want to specify a state for Items API, there are two possible values:
When initialising Items API, the
state does not need to be set. Internally, the API will check whether a session exists for a given
session_id, then do one of the following:
- If an existing session is found the assessment will be initialized in "resume" mode.
- If no existing session is found, a new assessment will be created (in "initial" mode).
However, if you want to initialise an assessment in review or preview mode, the
state needs to be set using either
"preview" as required.