Help
putData
Launches an asynchronous request to save the learner's data for this activity. You check the operation success status in a callback function. putData is not additive: whatever data you "put" replaces existing activity data for the learner. To preserve existing data, include data retrieved from getData in the "put". To update the BrainHoney gradebook with scores, completion status, or time spent, you specify SCORM-defined variable names in the data you pass to putData. (See SetValue for more details about the variables to set.)
Syntax
putData(Object options) : Boolean
Parameters
Returns
True on successful request launch; otherwise false. You get completion status in callback.
Example
This example calls putData to both save some activity variables and to update the BrainHoney gradebook with a score. It assumes DEJS_API.initialize has successfully been called.

// We assume that myData is populated with data from the getData call before calling putData, 
// although we do not show that code here.
var myData = [];

function putDataHandler(options, success) {
  if (success) {
    alert('in callback; putdata completed successfully');
  } else {
    alert('in callback: putdata failed!');
  }
}

// Record a score and time spent in the gradebook
// Note: a robust implementation would check for duplicate variable entries
myData.push({name: 'cmi.completion_status', value: 'completed'});
myData.push({name: 'cmi.score.scaled', value: '0.98'});
myData.push({name: 'cmi.session_time', value: 'PT5M'});
// Save some question responses.
myData.push({name: 'cmi.interactions.0.id', value: 'Q1'});
myData.push({name: 'cmi.interactions.0.type', value: 'other'});
myData.push({name: 'cmi.interactions.0.displaytype', value: 'Experiment'});
myData.push({name: 'cmi.interactions.0.result', value: '1.0'});
myData.push({name: 'cmi.interactions.0.learner_response', 
            value: 'The beaker caught fire'});
myData.push({name: 'cmi.interactions.0.weighting', value: '1.0'});
myData.push({name: 'cmi.interactions.0.tag', 
            value: 'sample question seed data 1'});
	
myData.push({name: 'cmi.interactions.1.id', value: 'Q2'});
myData.push({name: 'cmi.interactions.1.type', value: 'other'});
myData.push({name: 'cmi.interactions.1.displaytype', value: 'Experiment'});
myData.push({name: 'cmi.interactions.1.result', value: '0.95'});
myData.push({name: 'cmi.interactions.1.learner_response', 
              value: 'The fire burned green, blue, then yellow.'});
myData.push({name: 'cmi.interactions.1.weighting', value: '1.0'});
myData.push({name: 'cmi.interactions.1.tag', 
              value: 'sample question seed data 2'});
	
DEJS_API.putData({callback: putDataHandler, timeout: 15000,  data: myData }));			
			
See Also
asyncHandler getData