Members
lmsConnected :boolean
Indicates whether a true SCORM connection to an LMS exists.
Type:
mode
Mode the session started in:
ab-initio
- starting a new attempt;resume
- loaded attempt in progress.
partIndices :Object.<number>
Dictionary mapping Numbas.parts.partpath
ids to cmi.interaction
indices.
Type:
questionIndices :Object.<number>
Dictionary mapping question ids (of the form qN
) to cmi.objective
indices.
Type:
Methods
adviceDisplayed(question)
Record that the student displayed question advice.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
answerRevealed(question)
Record that the student revealed the answers to a question.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
changeQuestion(question)
Call this when the student moves to a different question.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
end()
Call this when the exam ends.
get(key) → {string}
Get a SCORM data model element.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Element name. This is prepended with |
Returns:
Type | Description |
---|---|
string |
|
getDurationExtension() → {object}
Get an externally-set extension to the exam duration.
Returns:
Type | Description |
---|---|
object |
getMode() → {string}
Get viewing mode:
browse
- see exam info, not questions;normal
- sit exam;review
- look at completed exam.
Returns:
Type | Description |
---|---|
string |
getPartId(part) → {string}
Make an id string corresponding to a part, of the form qNpXgYsZ
.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |
Returns:
Type | Description |
---|---|
string |
getQuestionId(question) → {string}
Make an id string corresponding to a question, of the form qN
, where N
is the question's number.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
Returns:
Type | Description |
---|---|
string |
getSuspendData() → {Numbas.storage.exam_suspend_data}
Get the suspend data from the SCORM data model.
Returns:
Type | Description |
---|---|
Numbas.storage.exam_suspend_data |
init(exam)
Initialise the SCORM data model and this storage object.
Parameters:
Name | Type | Description |
---|---|---|
exam |
Numbas.Exam |
initPart(p)
Initialise a part - make an interaction for it, and set up correct responses.
Parameters:
Name | Type | Description |
---|---|---|
p |
Numbas.parts.Part |
initQuestion(q)
Initialise a question - make an objective for it, and initialise all its parts.
Parameters:
Name | Type | Description |
---|---|---|
q |
Numbas.Question |
load(exam) → {Numbas.storage.exam_suspend_data}
Get suspended exam info.
Parameters:
Name | Type | Description |
---|---|---|
exam |
Numbas.Exam |
Returns:
Type | Description |
---|---|
Numbas.storage.exam_suspend_data |
loadPart(part) → {Numbas.storage.part_suspend_data}
Get suspended info for a part.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |
Returns:
Type | Description |
---|---|
Numbas.storage.part_suspend_data |
loadQuestion(question) → {Numbas.storage.question_suspend_data}
Get suspended info for a question.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
Returns:
Type | Description |
---|---|
Numbas.storage.question_suspend_data |
partAnswered(part)
Call this when a part is answered.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |
partPath(part) → {string}
The 'interactions.N.' prefix for the given part's datamodel elements.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |
Returns:
Type | Description |
---|---|
string |
pause()
Call this when the exam is paused.
questionSubmitted(question)
Record that a question has been submitted.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
resume()
Call this when the exam is resumed.
save()
Save SCORM data - call the SCORM commit method to make sure the data model is saved to the server.
saveQuestion(question)
Save details about a question - save score and success status.
Parameters:
Name | Type | Description |
---|---|---|
question |
Numbas.Question |
set(key, value) → {boolean}
Set a SCORM data model element.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Element name. This is prepended with |
value |
string | Element value. |
Returns:
Type | Description |
---|---|
boolean |
|
setSessionTime()
Record duration of the current session.
setSuspendData()
Save the exam suspend data using the cmi.suspend_data
string.
start()
Call this when the exam is started (when Numbas.Exam#begin
runs, not when the page loads).
stepsHidden(part)
Record that the student hid the steps for a part.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |
stepsShown(part)
Record that the student showed the steps for a part.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |
storeStagedAnswer(part)
Save the staged answer for a part. Note: this is not part of the SCORM standard, so can't rely on this being saved.
Parameters:
Name | Type | Description |
---|---|---|
part |
Numbas.parts.Part |