Update README.md

This commit is contained in:
kristiyip 2017-07-03 15:54:31 -04:00 committed by KristinDiep
parent 1b83f0f2d2
commit 500678a542

View File

@ -11,10 +11,10 @@ jsPsych is a JavaScript library for creating behavioral experiments that run in
```javascript
var test_stimuli = [
{ stimulus: "<<<<<", data: { stim_type: 'congruent', direction: 'left'} },
{ stimulus: ">>>>>", data: { stim_type: 'congruent', direction: 'right'} },
{ stimulus: "<<><<", data: { stim_type: 'incongruent', direction: 'right'} },
{ stimulus: ">><>>", data: { stim_type: 'incongruent', direction: 'left'} }
{ stimulus: "<<<<<", data: { stim_type: 'congruent'} },
{ stimulus: ">>>>>", data: { stim_type: 'congruent'} },
{ stimulus: "<<><<", data: { stim_type: 'incongruent'} },
{ stimulus: ">><>>", data: { stim_type: 'incongruent'} }
];
var test = {
@ -34,10 +34,14 @@ sample: {type: 'fixed-repetitions', size: 2}
var debrief = {
type: "text",
text: function() {
var congruent_rt = Math.round(jsPsych.data.get().filter({stim_type: 'congruent'}).select('rt').mean());
var incongruent_rt = Math.round(jsPsych.data.get().filter({stim_type: 'incongruent'}).select('rt').mean());
return "<p>Your average response time for congruent trials was <strong>" + congruent_rt + "ms</strong>.</p>"+
"<p>Your average response time for incongruent trials was <strong>" + incongruent_rt + "ms</strong>.</p>";
var congruent_rt = Math.round(jsPsych.data.get()
.filter({stim_type: 'congruent'}).select('rt').mean());
var incongruent_rt = Math.round(jsPsych.data.get()
.filter({stim_type: 'incongruent'}).select('rt').mean());
return "<p>Your average response time for congruent " +
"trials was <strong>" + congruent_rt + "ms</strong>.</p>"+
"<p>Your average response time for incongruent trials " +
"was <strong>" + incongruent_rt + "ms</strong>.</p>";
}
};
```