diff --git a/README.md b/README.md index 132b823a..6855dbf3 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ ![logo](http://www.jspsych.org/img/jspsych-logo-readme.jpg) -jsPsych is a JavaScript library for creating behavioral experiments that run in a web browser. jsPsych creates a framework for defining experiments and provides a set of flexible plugins that create different kinds of tasks a subject could complete during an experiment. By assembling different plugins together and customizing the parameters of each, it is possible to create many different types of experiments. +jsPsych is a JavaScript library for creating behavioral experiments that run in a web browser. jsPsych provides a framework for defining experiments using a set of flexible plugins that create different kinds of tasks a subject could complete during an experiment. By assembling these different plugins together it is possible to create many different types of experiments. - -Code Demos +Examples ---------- -[Demo 1](https://github.com/jspsych/jsPsych/tree/master/examples/demos/demo_1.html) with the instructions plugin: +These examples are intended to illustrate what jsPsych code and experiments look like. There is a larger set of example code in the [examples folder](/examples). + +#1: [Displaying instructions](https://github.com/jspsych/jsPsych/tree/master/examples/demos/demo_1.html)
-
@@ -44,25 +44,24 @@ Code Demos jsPsych.init({ timeline: [trial], }); - - - - - - - - - - - -``` + + + + + + + + + + +```
-[Demo 2](https://github.com/jspsych/jsPsych/tree/master/examples/demos/demo_2.html) with the image-keyboard-response plugin: +#2: [Displaying images and recording a response](https://github.com/jspsych/jsPsych/tree/master/examples/demos/demo_2.html)
@@ -103,23 +102,23 @@ Code Demos timeline: [trial_1, trial_2, trial_3], default_iti: 250 }); - - - - - - - + + + + + + + ```
-And for a slightly longer experiment example, [demo 3](https://github.com/jspsych/jsPsych/tree/master/examples/demos/demo_3.html) with the html-keyboard-response plugin. Also shows data after experiment ends: +#3: [A flanker task](https://github.com/jspsych/jsPsych/tree/master/examples/demos/demo_3.html) showing a few advanced features of the library +
-
@@ -129,7 +128,7 @@ var test_stimuli = [ { stimulus: ">>>>>", data: { stim_type: 'congruent'} }, { stimulus: "<<><<", data: { stim_type: 'incongruent'} }, { stimulus: ">><>>", data: { stim_type: 'incongruent'} } ]; - + var test = { timeline: [{ type: 'html-keyboard-response', @@ -141,7 +140,7 @@ var test = { timeline_variables: test_stimuli, sample: {type: 'fixed-repetitions', size: 2} }; - + var debrief = { type: "html-keyboard-response", stimulus: function() { @@ -153,7 +152,7 @@ var debrief = { "time for congruent trials was "+congruent_rt+ "ms.

"+ "

Your average response time for"+ - "incongruent trials was "incongruent_rt + + "incongruent trials was "+incongruent_rt+ "ms.

"; } }; @@ -163,12 +162,8 @@ timeline.push(test); timeline.push(debrief); jsPsych.init({ timeline: timeline, - on_finish: function() { - jsPsych.data.displayData(); - } }); ``` -