ProcessAndSaveCollectedData
These pages are not yet fully reviewed. The LUIDA team is continuing to review and improve them. If you find anything wrong on these pages, or have questions that aren't resolved by reading them, please ask or report to the LUIDA team.
ProcessAndSaveCollectedData()StableData Logging- Fires
- On State Start · During State · On State Exit · Always-on events
Description
Triggers LUIDA's Data Collector to snapshot the scratchpad into one queued upload row. Displayed in the State-listening Items editor as Save pushed data in collector. The CCK equivalent is the Save pushed data phase on LuidaDataCollectionGimmick.
Parameters
No parameters.
Side effects
- Sends the signal
exp_recordCustomDatato the item's own scope ($.sendSignalCompat("this", "exp_recordCustomData")). - The
LUIDA-DataCollectoritem listens for this signal. On receipt it runs the data calculator script generated by the Configure data collector window —calculateData()returning a record object, withCONDITION,PARTICIPANTS, andCOLLECTED_DATAavailable as globals. - The returned record is appended to
$.state.customData[], the in-instance upload queue. Nothing leaves the Cluster instance untilUploadCollectedData()is fired. - The same effect is produced by enabling the Save pushed data phase on a
LuidaDataCollectionGimmick(the merged data-collection gimmick used for the trigger-driven pattern in Tutorial 1). The legacyLuidaProcessDataAndSaveToCollectionGimmickcomponent is deprecated but still works.
Example
In Tutorial 3 (Stroop), the TimeRecorder × Trial - Start cell snapshots each trial's record on On State Exit, right after writing the timer to the scratchpad:
// On State Exit (Customized Action)
$.state.isInTrial = false;
SendDataToCollector("timer", $.state.timer);
// then the next action in the chain:
ProcessAndSaveCollectedData();The data calculator script (defined on LUIDA-DataCollector's Script Asset) is invoked for every fire of this signal and returns one record:
return {
stateLog: COLLECTED_DATA["stateLog"],
cond: CONDITION || {},
ans: $.getStateCompat("this", "isRed", "boolean") ? "R" : "B",
time: COLLECTED_DATA["timer"],
};In Tutorial 1 (Priming), the bridge checkpoints achieve the same thing through the trigger-driven equivalent (Luida Process Data And Save To Collection Gimmick).
Related
SendDataToCollector(label, value)— write into the scratchpad before snapshotting it.UploadCollectedData()— flush the queued records to the Web Console.- Configure data collector — the visual builder that owns the calculator schema this action triggers.
- Concepts → Data collection — full lifecycle (push → save → upload) with timing and batching internals.
- Tutorial 1 → Bridge checkpoints — the trigger-and-gimmick equivalent that fires
exp_recordCustomDataon collision.