mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
adds dataAsJSON (#212)
This commit is contained in:
parent
4ce36b8460
commit
9a9b7bba7a
@ -3,6 +3,7 @@ The following people have contributed to the development of jsPsych by writing c
|
|||||||
* Josh de Leeuw - https://github.com/jodeleeuw
|
* Josh de Leeuw - https://github.com/jodeleeuw
|
||||||
* Jonas Lambers
|
* Jonas Lambers
|
||||||
* Shane Martin - https://github.com/shamrt
|
* Shane Martin - https://github.com/shamrt
|
||||||
|
* Adrian Oesch - https://github.com/adrianoesch
|
||||||
* Marian Sauter - https://github.com/mariansauter
|
* Marian Sauter - https://github.com/mariansauter
|
||||||
* Tim Vergenz - https://github.com/vergenzt
|
* Tim Vergenz - https://github.com/vergenzt
|
||||||
* Erik Weitnauer - https://github.com/eweitnauer
|
* Erik Weitnauer - https://github.com/eweitnauer
|
||||||
|
@ -97,6 +97,29 @@ Generate a CSV formatted string containing all of the data generated in the expe
|
|||||||
var csvString = jsPsych.data.dataAsCSV();
|
var csvString = jsPsych.data.dataAsCSV();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
## jsPsych.data.dataAsJSON
|
||||||
|
|
||||||
|
```
|
||||||
|
jsPsych.data.dataAsJSON()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Return value
|
||||||
|
|
||||||
|
Returns a string in JSON format
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
Generate a JSON formatted string containing all of the data generated in the experiment.
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
#### Basic example
|
||||||
|
```javascript
|
||||||
|
var jsonString = jsPsych.data.dataAsJSON();
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## jsPsych.data.displayData
|
## jsPsych.data.displayData
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ Every jsPsych experiment utilizes the core library (contained in the `jspsych.js
|
|||||||
* [jsPsych.data.addDataToLastTrial](jspsych-data.md#jspsychdataadddatatolasttrial)
|
* [jsPsych.data.addDataToLastTrial](jspsych-data.md#jspsychdataadddatatolasttrial)
|
||||||
* [jsPsych.data.addProperties](jspsych-data.md#jspsychdataaddproperties)
|
* [jsPsych.data.addProperties](jspsych-data.md#jspsychdataaddproperties)
|
||||||
* [jsPsych.data.dataAsCSV](jspsych-data.md#jspsychdatadataascsv)
|
* [jsPsych.data.dataAsCSV](jspsych-data.md#jspsychdatadataascsv)
|
||||||
|
* [jsPsych.data.dataAsJSON](jspsych-data.md#jspsychdatadataasjson)
|
||||||
* [jsPsych.data.displayData](jspsych-data.md#jspsychdatadisplaydata)
|
* [jsPsych.data.displayData](jspsych-data.md#jspsychdatadisplaydata)
|
||||||
* [jsPsych.data.getData](jspsych-data.md#jspsychdatagetdata)
|
* [jsPsych.data.getData](jspsych-data.md#jspsychdatagetdata)
|
||||||
* [jsPsych.data.getLastChunkData](jspsych-data.md#jspsychdatagetlastchunkdata)
|
* [jsPsych.data.getLastChunkData](jspsych-data.md#jspsychdatagetlastchunkdata)
|
||||||
|
@ -645,6 +645,11 @@ jsPsych.data = (function() {
|
|||||||
return JSON2CSV(dataObj);
|
return JSON2CSV(dataObj);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.dataAsJSON = function() {
|
||||||
|
var dataObj = module.getData();
|
||||||
|
return JSON.stringify(dataObj);
|
||||||
|
};
|
||||||
|
|
||||||
module.localSave = function(filename, format) {
|
module.localSave = function(filename, format) {
|
||||||
|
|
||||||
var data_string;
|
var data_string;
|
||||||
|
Loading…
Reference in New Issue
Block a user