forked from jspsych/jsPsych
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begining docs and marking updates for metadata fetching
- Loading branch information
Showing
3 changed files
with
72 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Metadata Module | ||
|
||
The metadata module contains functions for interacting metadata according to [Psych-DS standards](https://psych-ds.github.io/). To interact with the metadata, we strongly recommend you call the generate method on the experiment data then adjust fields accordingly. The generate method uses documentation for plugins and extensions created in the main JsPsych repo to create default descriptions. This works best for experiments run in v8+, but will also work for old experimental data. | ||
|
||
--- | ||
|
||
## metadata.generate | ||
|
||
|
||
|
||
|
||
|
||
### Examples | ||
|
||
|
||
|
||
#### Calling metadata after running an experiment | ||
|
||
```javascript | ||
var metadata = new jsPsychMetadata(); | ||
|
||
const metadata_options = { | ||
randomField: "this is a field", | ||
author: { | ||
"John": { | ||
name: "John", | ||
givenName: "Johnathan", | ||
}, | ||
}, | ||
variables: { | ||
"trial_type" : { | ||
description: { | ||
"chat-plugin": "this chat plugin allows you to talk to gpt!", | ||
} | ||
}, | ||
"trial_index": { | ||
name: "index", | ||
}, | ||
}, | ||
} | ||
|
||
var jsPsych = initJsPsych({ | ||
on_finish: async function() { | ||
await metadata.generate(jsPsych.data.get().json()); | ||
}, | ||
default_iti: 250 | ||
}); | ||
``` | ||
|
||
#### Calling metadata on data loaded locally | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters