Jump to navigation

Class: SCORMStorage

Numbas.storage.SCORMStorage

new SCORMStorage()

SCORM storage object - controls saving and loading of data from the LMS

Source:

Members

exam

reference to the Numbas.Exam object for the current exam

Source:

lmsConnected

Indicates whether a true SCORM connection to an LMS exists

Source:

mode

Mode the session started in:

  • ab-initio - starting a new attempt
  • resume - loaded attempt in progress
Source:

partIndices

Dictionary mapping Numbas.parts.partpath ids to cmi.interaction indices

Source:

questionIndices

Dictionary mapping question ids (of the form qN) to cmi.objective indices

Source:

Methods

adviceDisplayed(question)

Record that the student displayed question advice

Parameters:
Name Type Description
question Numbas.Question
Overrides:
Source:

answerRevealed(question)

Record that the student revealed the answers to a question

Parameters:
Name Type Description
question Numbas.Question
Overrides:
Source:

changeQuestion(question)

Call this when the student moves to a different question

Parameters:
Name Type Description
question Numbas.Question
Overrides:
Source:

end()

Call this when the exam ends (Numbas.Exam#end)

Overrides:
Source:

get(key) → {String}

Get a SCORM data model element

Parameters:
Name Type Description
key String

element name. This is prepended with cmi.

Returns:
Type Description
String
  • the value of the element
Source:

get_student_name()

Load student's name and ID

Source:

getEntry() → {String}

Get entry state: ab-initio, or resume

Returns:
Type Description
String
Overrides:
Source:

getMode() → {String}

Get viewing mode:

  • browse - see exam info, not questions
  • normal - sit exam
  • review - look at completed exam
Returns:
Type Description
String
Overrides:
Source:

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
Source:

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
Source:

getStudentID() → {String}

Get the student's ID

Returns:
Type Description
String
Overrides:
Source:

getSuspendData() → {Numbas.storage.exam_suspend_data}

Get the suspend data from the SCORM data model

Returns:
Type Description
Numbas.storage.exam_suspend_data
Source:

init(exam)

Initialise the SCORM data model and this storage object.

Parameters:
Name Type Description
exam Numbas.Exam
Overrides:
Source:

initPart(part)

Initialise a part - make an interaction for it, and set up correct responses.

Parameters:
Name Type Description
part Numbas.parts.Part
Source:

initQuestion(q)

Initialise a question - make an objective for it, and initialise all its parts.

Parameters:
Name Type Description
q Numbas.Question
Source:

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
Overrides:
Source:

loadExtensionPart(part) → {Numbas.storage.part_suspend_data}

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Inherited From:
Source:

loadJMEPart(part) → {Numbas.storage.part_suspend_data}

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Inherited From:
Source:

loadMatrixEntryPart(part) → {Numbas.storage.part_suspend_data}

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Inherited From:
Source:

loadMultipleResponsePart(part) → {Numbas.storage.part_suspend_data}

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Inherited From:
Source:

loadNumberEntryPart(part) → {Numbas.storage.part_suspend_data}

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Inherited From:
Source:

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
Overrides:
Source:

loadPatternMatchPart(part) → {Numbas.storage.part_suspend_data}

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Inherited From:
Source:

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
Overrides:
Source:

partAnswered(part)

Call this when a part is answered

Parameters:
Name Type Description
part Numbas.parts.Part
Overrides:
Source:

partSuspendData(part) → {Numbas.storage.part_suspend_data}

Create suspend data object for a part

Parameters:
Name Type Description
part Numbas.parts.Part
Returns:
Type Description
Numbas.storage.part_suspend_data
Source:
See:

pause()

Call this when the exam is paused (Numbas.Exam#pause)

Overrides:
Source:

questionSubmitted(question)

Record that a question has been submitted

Parameters:
Name Type Description
question Numbas.Question
Overrides:
Source:

questionSuspendData(question) → {Numbas.storage.question_suspend_data}

Create suspend data object for a question

Parameters:
Name Type Description
question Numbas.Question
Returns:
Type Description
Numbas.storage.question_suspend_data
Source:
See:

resume()

Call this when the exam is resumed (Numbas.Exam#resume)

Overrides:
Source:

save()

Save SCORM data - call the SCORM commit method to make sure the data model is saved to the server

Overrides:
Source:

saveExam(exam)

Save exam-level details (just score at the mo)

Parameters:
Name Type Description
exam Numbas.Exam
Overrides:
Source:

saveQuestion(question)

Save details about a question - save score and success status

Parameters:
Name Type Description
question Numbas.Question
Source:

set(key, value) → {Boolean}

Set a SCORM data model element.

Parameters:
Name Type Description
key String

element name. This is prepended with cmi.

value String

element value

Returns:
Type Description
Boolean
  • did the call succeed?
Source:

setSessionTime()

Record duration of the current session

Source:

setSuspendData()

Save all the other stuff that doesn't fit into the standard SCORM data model using the cmi.suspend_data string.

Source:

start()

Call this when the exam is started (when Numbas.Exam#begin runs, not when the page loads)

Overrides:
Source:

stepsHidden(part)

Record that the student hid the steps for a part

Parameters:
Name Type Description
part Numbas.parts.Part
Overrides:
Source:

stepsShown(part)

Record that the student showed the steps for a part

Parameters:
Name Type Description
part Numbas.parts.Part
Overrides:
Source: