diff --git a/docs/demos/external_page.html b/docs/demos/external_page.html
new file mode 100644
index 00000000..525e75bf
--- /dev/null
+++ b/docs/demos/external_page.html
@@ -0,0 +1,12 @@
+
+
+ This is a demo experiment, with this minimal consent form being loaded
+ as an external html document. To continue, click the checkbox below
+ and hit "Start Experiment".
+
+
+
+ I agree to take part in this study.
+
+
+
\ No newline at end of file
diff --git a/docs/demos/eye-tracking-with-webgazer.html b/docs/demos/eye-tracking-with-webgazer.html
new file mode 100644
index 00000000..e6e8b294
--- /dev/null
+++ b/docs/demos/eye-tracking-with-webgazer.html
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/img/1.gif b/docs/demos/img/1.gif
new file mode 100644
index 00000000..f4511d92
Binary files /dev/null and b/docs/demos/img/1.gif differ
diff --git a/docs/demos/img/10.gif b/docs/demos/img/10.gif
new file mode 100644
index 00000000..1f25f1a2
Binary files /dev/null and b/docs/demos/img/10.gif differ
diff --git a/docs/demos/img/11.gif b/docs/demos/img/11.gif
new file mode 100644
index 00000000..f54b3d68
Binary files /dev/null and b/docs/demos/img/11.gif differ
diff --git a/docs/demos/img/12.gif b/docs/demos/img/12.gif
new file mode 100644
index 00000000..053ecf66
Binary files /dev/null and b/docs/demos/img/12.gif differ
diff --git a/docs/demos/img/2.gif b/docs/demos/img/2.gif
new file mode 100644
index 00000000..89000901
Binary files /dev/null and b/docs/demos/img/2.gif differ
diff --git a/docs/demos/img/3.gif b/docs/demos/img/3.gif
new file mode 100644
index 00000000..b6205d1b
Binary files /dev/null and b/docs/demos/img/3.gif differ
diff --git a/docs/demos/img/4.gif b/docs/demos/img/4.gif
new file mode 100644
index 00000000..1d2de35a
Binary files /dev/null and b/docs/demos/img/4.gif differ
diff --git a/docs/demos/img/5.gif b/docs/demos/img/5.gif
new file mode 100644
index 00000000..0c8ce98f
Binary files /dev/null and b/docs/demos/img/5.gif differ
diff --git a/docs/demos/img/6.gif b/docs/demos/img/6.gif
new file mode 100644
index 00000000..59149da1
Binary files /dev/null and b/docs/demos/img/6.gif differ
diff --git a/docs/demos/img/7.gif b/docs/demos/img/7.gif
new file mode 100644
index 00000000..6b3ea1b1
Binary files /dev/null and b/docs/demos/img/7.gif differ
diff --git a/docs/demos/img/8.gif b/docs/demos/img/8.gif
new file mode 100644
index 00000000..723ab759
Binary files /dev/null and b/docs/demos/img/8.gif differ
diff --git a/docs/demos/img/9.gif b/docs/demos/img/9.gif
new file mode 100644
index 00000000..dabe68de
Binary files /dev/null and b/docs/demos/img/9.gif differ
diff --git a/docs/demos/img/backwardN.gif b/docs/demos/img/backwardN.gif
new file mode 100644
index 00000000..38a21647
Binary files /dev/null and b/docs/demos/img/backwardN.gif differ
diff --git a/docs/demos/img/blue.png b/docs/demos/img/blue.png
new file mode 100644
index 00000000..820bdce8
Binary files /dev/null and b/docs/demos/img/blue.png differ
diff --git a/docs/demos/img/card.png b/docs/demos/img/card.png
new file mode 100644
index 00000000..ca8de4f2
Binary files /dev/null and b/docs/demos/img/card.png differ
diff --git a/docs/demos/img/elephant.png b/docs/demos/img/elephant.png
new file mode 100644
index 00000000..b38c53d9
Binary files /dev/null and b/docs/demos/img/elephant.png differ
diff --git a/docs/demos/img/fixation.gif b/docs/demos/img/fixation.gif
new file mode 100644
index 00000000..ff76c92a
Binary files /dev/null and b/docs/demos/img/fixation.gif differ
diff --git a/docs/demos/img/happy_face_1.jpg b/docs/demos/img/happy_face_1.jpg
new file mode 100644
index 00000000..3e8e8911
Binary files /dev/null and b/docs/demos/img/happy_face_1.jpg differ
diff --git a/docs/demos/img/happy_face_2.jpg b/docs/demos/img/happy_face_2.jpg
new file mode 100644
index 00000000..6fe9ef2b
Binary files /dev/null and b/docs/demos/img/happy_face_2.jpg differ
diff --git a/docs/demos/img/happy_face_3.jpg b/docs/demos/img/happy_face_3.jpg
new file mode 100644
index 00000000..6c111970
Binary files /dev/null and b/docs/demos/img/happy_face_3.jpg differ
diff --git a/docs/demos/img/happy_face_4.jpg b/docs/demos/img/happy_face_4.jpg
new file mode 100644
index 00000000..3e939c8c
Binary files /dev/null and b/docs/demos/img/happy_face_4.jpg differ
diff --git a/docs/demos/img/lion.png b/docs/demos/img/lion.png
new file mode 100644
index 00000000..b1cc466e
Binary files /dev/null and b/docs/demos/img/lion.png differ
diff --git a/docs/demos/img/monkey.png b/docs/demos/img/monkey.png
new file mode 100644
index 00000000..461fcf00
Binary files /dev/null and b/docs/demos/img/monkey.png differ
diff --git a/docs/demos/img/navarro_burst_03.jpg b/docs/demos/img/navarro_burst_03.jpg
new file mode 100644
index 00000000..5fed5eda
Binary files /dev/null and b/docs/demos/img/navarro_burst_03.jpg differ
diff --git a/docs/demos/img/normalN.gif b/docs/demos/img/normalN.gif
new file mode 100644
index 00000000..dc5593dd
Binary files /dev/null and b/docs/demos/img/normalN.gif differ
diff --git a/docs/demos/img/orange.png b/docs/demos/img/orange.png
new file mode 100644
index 00000000..108e6e57
Binary files /dev/null and b/docs/demos/img/orange.png differ
diff --git a/docs/demos/img/sad_face_1.jpg b/docs/demos/img/sad_face_1.jpg
new file mode 100644
index 00000000..7a210963
Binary files /dev/null and b/docs/demos/img/sad_face_1.jpg differ
diff --git a/docs/demos/img/sad_face_2.jpg b/docs/demos/img/sad_face_2.jpg
new file mode 100644
index 00000000..b3dbb611
Binary files /dev/null and b/docs/demos/img/sad_face_2.jpg differ
diff --git a/docs/demos/img/sad_face_3.jpg b/docs/demos/img/sad_face_3.jpg
new file mode 100644
index 00000000..ab3aa2cb
Binary files /dev/null and b/docs/demos/img/sad_face_3.jpg differ
diff --git a/docs/demos/img/sad_face_4.jpg b/docs/demos/img/sad_face_4.jpg
new file mode 100644
index 00000000..6be58cce
Binary files /dev/null and b/docs/demos/img/sad_face_4.jpg differ
diff --git a/docs/demos/jspsych-animation-demo.html b/docs/demos/jspsych-animation-demo.html
new file mode 100644
index 00000000..32bbbedc
--- /dev/null
+++ b/docs/demos/jspsych-animation-demo.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-audio-button-response-demo-1.html b/docs/demos/jspsych-audio-button-response-demo-1.html
new file mode 100644
index 00000000..042a1d12
--- /dev/null
+++ b/docs/demos/jspsych-audio-button-response-demo-1.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-audio-button-response-demo-2.html b/docs/demos/jspsych-audio-button-response-demo-2.html
new file mode 100644
index 00000000..320e5362
--- /dev/null
+++ b/docs/demos/jspsych-audio-button-response-demo-2.html
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-audio-keyboard-response-demo-1.html b/docs/demos/jspsych-audio-keyboard-response-demo-1.html
new file mode 100644
index 00000000..052183e8
--- /dev/null
+++ b/docs/demos/jspsych-audio-keyboard-response-demo-1.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-audio-keyboard-response-demo-2.html b/docs/demos/jspsych-audio-keyboard-response-demo-2.html
new file mode 100644
index 00000000..09aab83f
--- /dev/null
+++ b/docs/demos/jspsych-audio-keyboard-response-demo-2.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-audio-slider-response-demo-1.html b/docs/demos/jspsych-audio-slider-response-demo-1.html
new file mode 100644
index 00000000..f53447a6
--- /dev/null
+++ b/docs/demos/jspsych-audio-slider-response-demo-1.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-audio-slider-response-demo-2.html b/docs/demos/jspsych-audio-slider-response-demo-2.html
new file mode 100644
index 00000000..e50b32ad
--- /dev/null
+++ b/docs/demos/jspsych-audio-slider-response-demo-2.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-call-function-demo1.html b/docs/demos/jspsych-call-function-demo1.html
new file mode 100644
index 00000000..f91628b8
--- /dev/null
+++ b/docs/demos/jspsych-call-function-demo1.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-call-function-demo2.html b/docs/demos/jspsych-call-function-demo2.html
new file mode 100644
index 00000000..b77766eb
--- /dev/null
+++ b/docs/demos/jspsych-call-function-demo2.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-call-function-demo3.html b/docs/demos/jspsych-call-function-demo3.html
new file mode 100644
index 00000000..9e0721db
--- /dev/null
+++ b/docs/demos/jspsych-call-function-demo3.html
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-button-response-demo1.html b/docs/demos/jspsych-canvas-button-response-demo1.html
new file mode 100644
index 00000000..8442f5ed
--- /dev/null
+++ b/docs/demos/jspsych-canvas-button-response-demo1.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-button-response-demo2.html b/docs/demos/jspsych-canvas-button-response-demo2.html
new file mode 100644
index 00000000..12ca3230
--- /dev/null
+++ b/docs/demos/jspsych-canvas-button-response-demo2.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-button-response-demo3.html b/docs/demos/jspsych-canvas-button-response-demo3.html
new file mode 100644
index 00000000..20377d2c
--- /dev/null
+++ b/docs/demos/jspsych-canvas-button-response-demo3.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-keyboard-response-demo1.html b/docs/demos/jspsych-canvas-keyboard-response-demo1.html
new file mode 100644
index 00000000..d8d9212d
--- /dev/null
+++ b/docs/demos/jspsych-canvas-keyboard-response-demo1.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-keyboard-response-demo2.html b/docs/demos/jspsych-canvas-keyboard-response-demo2.html
new file mode 100644
index 00000000..696bdd39
--- /dev/null
+++ b/docs/demos/jspsych-canvas-keyboard-response-demo2.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-slider-response-demo1.html b/docs/demos/jspsych-canvas-slider-response-demo1.html
new file mode 100644
index 00000000..37197c3f
--- /dev/null
+++ b/docs/demos/jspsych-canvas-slider-response-demo1.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-canvas-slider-response-demo2.html b/docs/demos/jspsych-canvas-slider-response-demo2.html
new file mode 100644
index 00000000..41804372
--- /dev/null
+++ b/docs/demos/jspsych-canvas-slider-response-demo2.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-categorize-animation-demo1.html b/docs/demos/jspsych-categorize-animation-demo1.html
new file mode 100644
index 00000000..f28ca694
--- /dev/null
+++ b/docs/demos/jspsych-categorize-animation-demo1.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-categorize-animation-demo2.html b/docs/demos/jspsych-categorize-animation-demo2.html
new file mode 100644
index 00000000..2e3e1a0e
--- /dev/null
+++ b/docs/demos/jspsych-categorize-animation-demo2.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-categorize-html-demo1.html b/docs/demos/jspsych-categorize-html-demo1.html
new file mode 100644
index 00000000..71bccd1f
--- /dev/null
+++ b/docs/demos/jspsych-categorize-html-demo1.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-categorize-image-demo1.html b/docs/demos/jspsych-categorize-image-demo1.html
new file mode 100644
index 00000000..1d8e1f3c
--- /dev/null
+++ b/docs/demos/jspsych-categorize-image-demo1.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-cloze-demo1.html b/docs/demos/jspsych-cloze-demo1.html
new file mode 100644
index 00000000..a99f508d
--- /dev/null
+++ b/docs/demos/jspsych-cloze-demo1.html
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-cloze-demo2.html b/docs/demos/jspsych-cloze-demo2.html
new file mode 100644
index 00000000..2d8fd3f1
--- /dev/null
+++ b/docs/demos/jspsych-cloze-demo2.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-external-html-demo1.html b/docs/demos/jspsych-external-html-demo1.html
new file mode 100644
index 00000000..3ae8811c
--- /dev/null
+++ b/docs/demos/jspsych-external-html-demo1.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-free-sort-demo1.html b/docs/demos/jspsych-free-sort-demo1.html
new file mode 100644
index 00000000..95a70b17
--- /dev/null
+++ b/docs/demos/jspsych-free-sort-demo1.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-fullscreen-demo1.html b/docs/demos/jspsych-fullscreen-demo1.html
new file mode 100644
index 00000000..aad0cd83
--- /dev/null
+++ b/docs/demos/jspsych-fullscreen-demo1.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-html-button-response-demo1.html b/docs/demos/jspsych-html-button-response-demo1.html
new file mode 100644
index 00000000..73351b5b
--- /dev/null
+++ b/docs/demos/jspsych-html-button-response-demo1.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-html-keyboard-response-demo1.html b/docs/demos/jspsych-html-keyboard-response-demo1.html
new file mode 100644
index 00000000..ac533f23
--- /dev/null
+++ b/docs/demos/jspsych-html-keyboard-response-demo1.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-html-keyboard-response-demo2.html b/docs/demos/jspsych-html-keyboard-response-demo2.html
new file mode 100644
index 00000000..dcc42e6b
--- /dev/null
+++ b/docs/demos/jspsych-html-keyboard-response-demo2.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-html-slider-response-demo1.html b/docs/demos/jspsych-html-slider-response-demo1.html
new file mode 100644
index 00000000..de6f1814
--- /dev/null
+++ b/docs/demos/jspsych-html-slider-response-demo1.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-iat-html-demo1.html b/docs/demos/jspsych-iat-html-demo1.html
new file mode 100644
index 00000000..d4264ee3
--- /dev/null
+++ b/docs/demos/jspsych-iat-html-demo1.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-iat-image-demo1.html b/docs/demos/jspsych-iat-image-demo1.html
new file mode 100644
index 00000000..2c147aa8
--- /dev/null
+++ b/docs/demos/jspsych-iat-image-demo1.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-image-button-response-demo1.html b/docs/demos/jspsych-image-button-response-demo1.html
new file mode 100644
index 00000000..6c5d74c8
--- /dev/null
+++ b/docs/demos/jspsych-image-button-response-demo1.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-image-keyboard-response-demo1.html b/docs/demos/jspsych-image-keyboard-response-demo1.html
new file mode 100644
index 00000000..e39de7a6
--- /dev/null
+++ b/docs/demos/jspsych-image-keyboard-response-demo1.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-image-keyboard-response-demo2.html b/docs/demos/jspsych-image-keyboard-response-demo2.html
new file mode 100644
index 00000000..06cd7520
--- /dev/null
+++ b/docs/demos/jspsych-image-keyboard-response-demo2.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-image-slider-response-demo1.html b/docs/demos/jspsych-image-slider-response-demo1.html
new file mode 100644
index 00000000..eeca33c2
--- /dev/null
+++ b/docs/demos/jspsych-image-slider-response-demo1.html
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-instructions-demo-1.html b/docs/demos/jspsych-instructions-demo-1.html
new file mode 100644
index 00000000..a9df6dce
--- /dev/null
+++ b/docs/demos/jspsych-instructions-demo-1.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-instructions-demo-2.html b/docs/demos/jspsych-instructions-demo-2.html
new file mode 100644
index 00000000..172449d9
--- /dev/null
+++ b/docs/demos/jspsych-instructions-demo-2.html
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-instructions-demo-3.html b/docs/demos/jspsych-instructions-demo-3.html
new file mode 100644
index 00000000..1b15666f
--- /dev/null
+++ b/docs/demos/jspsych-instructions-demo-3.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-maxdiff-demo1.html b/docs/demos/jspsych-maxdiff-demo1.html
new file mode 100644
index 00000000..46ef84a8
--- /dev/null
+++ b/docs/demos/jspsych-maxdiff-demo1.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-preload-demo1.html b/docs/demos/jspsych-preload-demo1.html
new file mode 100644
index 00000000..cb2d234e
--- /dev/null
+++ b/docs/demos/jspsych-preload-demo1.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-preload-demo2.html b/docs/demos/jspsych-preload-demo2.html
new file mode 100644
index 00000000..60530deb
--- /dev/null
+++ b/docs/demos/jspsych-preload-demo2.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-preload-demo3.html b/docs/demos/jspsych-preload-demo3.html
new file mode 100644
index 00000000..806c702c
--- /dev/null
+++ b/docs/demos/jspsych-preload-demo3.html
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-preload-demo4.html b/docs/demos/jspsych-preload-demo4.html
new file mode 100644
index 00000000..6511b8ae
--- /dev/null
+++ b/docs/demos/jspsych-preload-demo4.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-rdk-demo1.html b/docs/demos/jspsych-rdk-demo1.html
new file mode 100644
index 00000000..02a2f7a0
--- /dev/null
+++ b/docs/demos/jspsych-rdk-demo1.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-rdk-demo2.html b/docs/demos/jspsych-rdk-demo2.html
new file mode 100644
index 00000000..76450f22
--- /dev/null
+++ b/docs/demos/jspsych-rdk-demo2.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-rdk-demo3.html b/docs/demos/jspsych-rdk-demo3.html
new file mode 100644
index 00000000..9b6aaa34
--- /dev/null
+++ b/docs/demos/jspsych-rdk-demo3.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-reconstruction-demo1.html b/docs/demos/jspsych-reconstruction-demo1.html
new file mode 100644
index 00000000..251568f3
--- /dev/null
+++ b/docs/demos/jspsych-reconstruction-demo1.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-resize-demo1.html b/docs/demos/jspsych-resize-demo1.html
new file mode 100644
index 00000000..aad30967
--- /dev/null
+++ b/docs/demos/jspsych-resize-demo1.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-same-different-html-demo1.html b/docs/demos/jspsych-same-different-html-demo1.html
new file mode 100644
index 00000000..eb75c910
--- /dev/null
+++ b/docs/demos/jspsych-same-different-html-demo1.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-same-different-image-demo1.html b/docs/demos/jspsych-same-different-image-demo1.html
new file mode 100644
index 00000000..438ab0fd
--- /dev/null
+++ b/docs/demos/jspsych-same-different-image-demo1.html
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-serial-reaction-time-demo1.html b/docs/demos/jspsych-serial-reaction-time-demo1.html
new file mode 100644
index 00000000..d368565f
--- /dev/null
+++ b/docs/demos/jspsych-serial-reaction-time-demo1.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-serial-reaction-time-demo2.html b/docs/demos/jspsych-serial-reaction-time-demo2.html
new file mode 100644
index 00000000..30b98f32
--- /dev/null
+++ b/docs/demos/jspsych-serial-reaction-time-demo2.html
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-serial-reaction-time-mouse-demo1.html b/docs/demos/jspsych-serial-reaction-time-mouse-demo1.html
new file mode 100644
index 00000000..45e0858a
--- /dev/null
+++ b/docs/demos/jspsych-serial-reaction-time-mouse-demo1.html
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-serial-reaction-time-mouse-demo2.html b/docs/demos/jspsych-serial-reaction-time-mouse-demo2.html
new file mode 100644
index 00000000..593a329e
--- /dev/null
+++ b/docs/demos/jspsych-serial-reaction-time-mouse-demo2.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-html-form-demo1.html b/docs/demos/jspsych-survey-html-form-demo1.html
new file mode 100644
index 00000000..5e7441d0
--- /dev/null
+++ b/docs/demos/jspsych-survey-html-form-demo1.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-html-form-demo2.html b/docs/demos/jspsych-survey-html-form-demo2.html
new file mode 100644
index 00000000..640b23dc
--- /dev/null
+++ b/docs/demos/jspsych-survey-html-form-demo2.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-likert-demo1.html b/docs/demos/jspsych-survey-likert-demo1.html
new file mode 100644
index 00000000..d8b195d7
--- /dev/null
+++ b/docs/demos/jspsych-survey-likert-demo1.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-likert-demo2.html b/docs/demos/jspsych-survey-likert-demo2.html
new file mode 100644
index 00000000..1d064594
--- /dev/null
+++ b/docs/demos/jspsych-survey-likert-demo2.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-multi-choice-demo1.html b/docs/demos/jspsych-survey-multi-choice-demo1.html
new file mode 100644
index 00000000..28a5fc81
--- /dev/null
+++ b/docs/demos/jspsych-survey-multi-choice-demo1.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-multi-choice-demo2.html b/docs/demos/jspsych-survey-multi-choice-demo2.html
new file mode 100644
index 00000000..fa928b96
--- /dev/null
+++ b/docs/demos/jspsych-survey-multi-choice-demo2.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-multi-select-demo1.html b/docs/demos/jspsych-survey-multi-select-demo1.html
new file mode 100644
index 00000000..0aaa05b3
--- /dev/null
+++ b/docs/demos/jspsych-survey-multi-select-demo1.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-text-demo1.html b/docs/demos/jspsych-survey-text-demo1.html
new file mode 100644
index 00000000..558b2807
--- /dev/null
+++ b/docs/demos/jspsych-survey-text-demo1.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-text-demo2.html b/docs/demos/jspsych-survey-text-demo2.html
new file mode 100644
index 00000000..dd91e310
--- /dev/null
+++ b/docs/demos/jspsych-survey-text-demo2.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-text-demo3.html b/docs/demos/jspsych-survey-text-demo3.html
new file mode 100644
index 00000000..bf96fb43
--- /dev/null
+++ b/docs/demos/jspsych-survey-text-demo3.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-survey-text-demo4.html b/docs/demos/jspsych-survey-text-demo4.html
new file mode 100644
index 00000000..db257469
--- /dev/null
+++ b/docs/demos/jspsych-survey-text-demo4.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-video-button-response-demo1.html b/docs/demos/jspsych-video-button-response-demo1.html
new file mode 100644
index 00000000..1048fdc4
--- /dev/null
+++ b/docs/demos/jspsych-video-button-response-demo1.html
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-video-keyboard-response-demo1.html b/docs/demos/jspsych-video-keyboard-response-demo1.html
new file mode 100644
index 00000000..7d19d251
--- /dev/null
+++ b/docs/demos/jspsych-video-keyboard-response-demo1.html
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-video-slider-response-demo1.html b/docs/demos/jspsych-video-slider-response-demo1.html
new file mode 100644
index 00000000..36d21f16
--- /dev/null
+++ b/docs/demos/jspsych-video-slider-response-demo1.html
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-virtual-chinrest-demo1.html b/docs/demos/jspsych-virtual-chinrest-demo1.html
new file mode 100644
index 00000000..9acd7d3c
--- /dev/null
+++ b/docs/demos/jspsych-virtual-chinrest-demo1.html
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-virtual-chinrest-demo2.html b/docs/demos/jspsych-virtual-chinrest-demo2.html
new file mode 100644
index 00000000..f4d198d2
--- /dev/null
+++ b/docs/demos/jspsych-virtual-chinrest-demo2.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-virtual-chinrest-demo3.html b/docs/demos/jspsych-virtual-chinrest-demo3.html
new file mode 100644
index 00000000..189a7bec
--- /dev/null
+++ b/docs/demos/jspsych-virtual-chinrest-demo3.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-visual-search-circle-demo1.html b/docs/demos/jspsych-visual-search-circle-demo1.html
new file mode 100644
index 00000000..821b6285
--- /dev/null
+++ b/docs/demos/jspsych-visual-search-circle-demo1.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-visual-search-circle-demo2.html b/docs/demos/jspsych-visual-search-circle-demo2.html
new file mode 100644
index 00000000..ae7b9307
--- /dev/null
+++ b/docs/demos/jspsych-visual-search-circle-demo2.html
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-vsl-animate-occlusion-demo1.html b/docs/demos/jspsych-vsl-animate-occlusion-demo1.html
new file mode 100644
index 00000000..0fb1564d
--- /dev/null
+++ b/docs/demos/jspsych-vsl-animate-occlusion-demo1.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/jspsych-vsl-grid-scene-demo1.html b/docs/demos/jspsych-vsl-grid-scene-demo1.html
new file mode 100644
index 00000000..5143edb9
--- /dev/null
+++ b/docs/demos/jspsych-vsl-grid-scene-demo1.html
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/demos/sound/roar.mp3 b/docs/demos/sound/roar.mp3
new file mode 100644
index 00000000..a1b66add
Binary files /dev/null and b/docs/demos/sound/roar.mp3 differ
diff --git a/docs/demos/video/fish.mp4 b/docs/demos/video/fish.mp4
new file mode 100644
index 00000000..8d2fba01
Binary files /dev/null and b/docs/demos/video/fish.mp4 differ
diff --git a/docs/overview/data.md b/docs/overview/data.md
index b4531837..378f19c0 100644
--- a/docs/overview/data.md
+++ b/docs/overview/data.md
@@ -141,45 +141,53 @@ jsPsych.data.get().select('rt').count();
This is one of the simplest methods for saving jsPsych data on the server that is running the experiment. It involves a short PHP script and a few lines of JavaScript code. This method will save each participant's data as a CSV file on the server. **This method will only work if you are running on a web server with PHP installed, or a local server with PHP (e.g., [XAMPP](https://www.apachefriends.org/index.html)).**
-This method uses a simple PHP script to write files to the server:
+This method uses a short PHP script to write files to the server:
```php
```
-The `file_put_contents($filename, $data)` method requires permission to write new files. An easy way to solve this is to create a directory on the server that will store the data and use the chmod command to give all users write permission to that directory. In the above example, the directory `data/` is used to store files.
+The `file_put_contents($name, $data)` method requires permission to write new files. An easy way to solve this is to create a directory on the server that will store the data and use the chmod command to give all users write permission to that directory. In the above example, the directory `data/` is used to store files.
-To use the PHP script, the JavaScript that runs jsPsych needs to send the `filename` and `filedata` information. This is done through an [AJAX](http://www.w3schools.com/xml/ajax_intro.asp) call.
+To use the PHP script, the JavaScript that runs jsPsych needs to send the `filedata` information. This is done through an [AJAX](http://www.w3schools.com/xml/ajax_intro.asp) call.
```javascript
function saveData(name, data){
var xhr = new XMLHttpRequest();
xhr.open('POST', 'write_data.php'); // 'write_data.php' is the path to the php file described above.
xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.send(JSON.stringify({filename: name, filedata: data}));
+ xhr.send(JSON.stringify({filedata: data}));
}
// call the saveData function after the experiment is over
jsPsych.init({
// code to define the experiment structure would go here...
- on_finish: function(){ saveData("experiment_data", jsPsych.data.get().csv()); }
+ on_finish: function(){ saveData(jsPsych.data.get().csv()); }
});
```
-To use this in an actual experiment, it would be important to tie the filename to some unique identifier like a subject number. Otherwise the file may be overwritten by collecting new data.
+!!! danger
+ The example above has minimal security and should probably not be used without additional security measures put in place. The risk is that someone can write arbitrary data using the `saveData()` function and store it to a file on your webserver. If they can guess the file name generated by the PHP script, or access a directory listing containing all of the filenames, then they can potentially write executable code to your server and run it.
-Note that, depending on file permissions, storing the CSV files this way may make them publicly accessible. One fix is to store the CSV files outside the web directory on the server. This requires changing the path in the PHP script above from `/data` to a non-accessible folder. You should only use this solution if you have access to more than just the web directory on your server.
+ One fix is to store the CSV files outside the web directory on the server. This requires changing the path in the PHP script above from `/data` to a folder that is not accessible on the web. You should only use this solution if you have access to more than just the web directory on your server.
+
+ You can also [configure your web server to block access to the folder you are storing data in](https://stackoverflow.com/q/5046100/3726673).
+
+ The MySQL option below is more secure.
## Storing data permanently in a MySQL database
-The ideal solution for storing data generated by jsPsych is to write it to a database.
+Another solution for storing data generated by jsPsych is to write it to a database.
There are dozens of database options. MySQL is one of the most popular [relational databases](http://en.wikipedia.org/wiki/Relational_database), is free to use, and relatively easy [to install](https://www.google.com/search?q=how+to+install+mysql). This code will assume that you have a MySQL database installed on your server that is hosting the jsPsych experiment, and that your server is able to execute PHP code. If you are trying to run on a local machine, you'll need to install a local server environment like [XAMPP](https://www.apachefriends.org/index.html).
@@ -249,7 +257,7 @@ $conn = null;
?>
```
-To send the data, we use an AJAX request in JavaScript.
+To send the data, we use an `XMLHttpRequest` request in JavaScript.
```JavaScript
function saveData() {
var xhr = new XMLHttpRequest();
@@ -265,17 +273,24 @@ function saveData() {
}
```
-You can call the `saveData()` function using the `on_finish` handler for the experiment, or by using the `call-function` plugin.
+It's important that the `XMLHttpRequest` is able to complete before the experiment is closed. If you invoke the `saveData()` function at the end of your experiment and the subject closes the window before all of the data has been transferred you will lose that data. To mitigate this risk, you can use the `call-function` plugin's `async` option to prevent the experiment from progressing until the request is complete.
```javascript
-// with on_finish handler
-jsPsych.init({
- on_finish: saveData
-});
-
-// with call-function plugin
-timeline.push({
+var trial = {
type: 'call-function',
- func: saveData
-});
+ async: true,
+ func: function(done){
+ var xhr = new XMLHttpRequest();
+ xhr.open('POST', 'write_data.php');
+ xhr.setRequestHeader('Content-Type', 'application/json');
+ xhr.onload = function() {
+ if(xhr.status == 200){
+ var response = JSON.parse(xhr.responseText);
+ console.log(response.success);
+ }
+ done(); // invoking done() causes experiment to progress to next trial.
+ };
+ xhr.send(jsPsych.data.get().json());
+ }
+}
```
diff --git a/docs/overview/eye-tracking.md b/docs/overview/eye-tracking.md
index 5cd76380..5537bc7e 100644
--- a/docs/overview/eye-tracking.md
+++ b/docs/overview/eye-tracking.md
@@ -43,10 +43,6 @@ jsPsych.init({
})
```
-
-!!! tip
- Example experiments using WebGazer are available in the **/examples** folder of the jsPsych release. See `webgazer.html`, `webgazer_image.html`, and `webgazer_audio.html`.
-
### Initialize the camera
To help the participant position their face correctly for eye tracking you can use the [jspsych-webgazer-init-camera plugin](/plugins/jspsych-webgazer-init-camera.ms). This will show the participant what the camera sees, including facial feature landmarks, and prevent the participant from continuing until their face is in good position for eye tracking. This plugin will also trigger the experiment to request permission to access the user's webcam if it hasn't already been granted.
@@ -155,117 +151,234 @@ If you have tips based on your own experience please consider sharing them on ou
## Example
-The code below shows a basic example of what it looks like when you put all of these things together in your experiment's HTML file.
+!!! tip
+ Additional example experiments using WebGazer are available in the **/examples** folder of the jsPsych release. See `webgazer.html`, `webgazer_image.html`, and `webgazer_audio.html`.
-```html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+