Skip to content

Commit

Permalink
Updating packages
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieHFFF committed Nov 21, 2024
1 parent d2779c5 commit 14095fe
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 111 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ web_modules/
out

# Nuxt.js build / generate output
.nuxt
dist
.nuxt/
dist/

# Gatsby files
.cache/
Expand Down
4 changes: 2 additions & 2 deletions packages/n-back/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { createTimeline } from "@jspsych-timelines/n-back"
## Compatibility
`@jspsych-timelines/n-back` requires jsPsych v7.0.0 or later.
`@jspsych-timelines/n-back` requires jsPsych v8.0.0 or later.
## Documentation
Expand All @@ -36,7 +36,7 @@ This timeline describes an N-back task setup that is customizable based on sever
| Parameter | Type | Default | Description |
|---------------------|---------------------------|---------------|-----------------------------------------------------------------------------------------------|
| `stimuli` | `any` | | Stimuli array used in the N-back task, which can be customized based on the experiment needs. |
| `keyboard_response` | `string` | `"space"` | Key used by participants to respond during trials. |
| `keyboard_response` | `string` | `"n"` | Key used by participants to respond during trials. |
| `trial_duration` | `number` | `1000` ms | Duration of each trial in milliseconds. |
| `post_trial_gap` | `number` | `500` ms | Gap between trials in milliseconds. |
| `fixation_duration` | `number` | `500` ms | Duration of the fixation cross before each trial. |
Expand Down
87 changes: 54 additions & 33 deletions packages/n-back/dist/index.global.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/n-back/dist/index.global.js.map

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions packages/n-back/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/n-back/dist/index.js.map

Large diffs are not rendered by default.

54 changes: 11 additions & 43 deletions packages/n-back/docs/n-back.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,16 @@ Creating template for n-back experiments

## Parameters

### Initialization Parameters

Initialization parameters can be set when calling `initJsPsych()`

```js
initJsPsych({
timelines: [
{type: jsPsychTimelineNBack, params: {...}}
]
})
```

Parameter | Type | Default Value | Description
----------|------|---------------|------------
| | |

### Trial Parameters

Trial parameters can be set when adding the timeline to a trial object.

```js
var trial = {
type: jsPsych...,
timelines: [
{type: jsPsychTimelineNBack, params: {...}}
]
}
```

Parameter | Type | Default Value | Description
----------|------|---------------|------------
| | |

## Data Generated

Name | Type | Value
-----|------|------
| |

## Functions

If the timeline adds any static functions, list them here.

### function()

| `stimuli` | `any` | | Stimuli array used in the N-back task, which can be customized based on the experiment needs. |
| `keyboard_response` | `string` | `"space"` | Key used by participants to respond during trials. |
| `trial_duration` | `number` | `1000` ms | Duration of each trial in milliseconds. |
| `post_trial_gap` | `number` | `500` ms | Gap between trials in milliseconds. |
| `fixation_duration` | `number` | `500` ms | Duration of the fixation cross before each trial. |
| `n` | `number` | `2` | Level of N-back, determining how many trials back the participant should remember. |
| `num_trials` | `number` | `20` | Total number of trials in the experiment. |
| `rep_ratio` | `number` | `0.2` | Probability that a stimulus will repeat in the N-back sequence, affecting task difficulty. |
| `debrief` | `boolean` | `false` | Whether to show a debrief screen at the end of the task. |
| `return_accuracy` | `boolean` | `false` | Whether to return participant accuracy as part of the output data. |
| `data_output` | `"none"`, `"json"`, `"csv"` | `"none"` | Specifies the format for saving output data, if any. |
8 changes: 6 additions & 2 deletions packages/n-back/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@

const timeline = [];

const jsPsych = initJsPsych();
const jsPsych = initJsPsych({
on_finish: function() {
jsPsych.data.displayData();
}
});

const stimuli = ["b", "B", "d", "D", "g", "G", "p", "P", "t", "T", "v", "V"];

const timeline2Back = jsPsychTimelineNBack.createTimeline(jsPsych, stimuli, "space", 1000, 500, 500, 1, 12, 0.25);
const timeline2Back = jsPsychTimelineNBack.createTimeline(jsPsych, stimuli, "n", 1000, 500, 500, 1, 12, 0.8, data_output = "csv");

const instructions = {
type: jsPsychHtmlKeyboardResponse,
Expand Down
Loading

0 comments on commit 14095fe

Please sign in to comment.