Skip to content

Commit 58f4887

Browse files
committed
update the html demos to be more illustrative
1 parent 3f150a3 commit 58f4887

7 files changed

+39
-23
lines changed

docs/demos/jspsych-html-button-response-demo1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
var trial = {
3434
type: jsPsychHtmlButtonResponse,
35-
stimulus: '<p>Running</p>',
36-
choices: ['Healthy', 'Unhealthy'],
37-
prompt: "<p>Is this activity healthy or unhealthy?</p>"
35+
stimulus: '<p style="font-size:48px; color:red;">GREEN</p>',
36+
choices: ['Red', 'Green', 'Blue'],
37+
prompt: "<p>What color is the ink?</p>"
3838
};
3939

4040
var trial_loop = {

docs/demos/jspsych-html-keyboard-response-demo1.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
};
3333

3434
var trial = {
35-
type: jsPsychHtmKeyboardResponse,
36-
stimulus: '<p>Running</p>',
37-
choices: ['e', 'i'],
38-
prompt: "<p>Is this activity healthy or unhealthy?</p><p>Press 'e' for healthy and 'i' for unhealthy.</p>"
35+
type: jsPsychHtmlKeyboardResponse,
36+
stimulus: '<p style="font-size:48px; color:green;">BLUE</p>',
37+
choices: ['r', 'g', 'b'],
38+
prompt: "<p>Is the ink color (r)ed, (g)reen, or (b)lue?</p>"
3939
};
4040

4141
var trial_loop = {

docs/demos/jspsych-html-keyboard-response-demo2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
};
3333

3434
var trial = {
35-
type: jsPsychHtmKeyboardResponse,
35+
type: jsPsychHtmlKeyboardResponse,
3636
stimulus: '<p style="font-size: 48px;">+</p>',
3737
choices: jsPsych.NO_KEYS,
3838
trial_duration: 1000,

docs/demos/jspsych-html-slider-response-demo1.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,20 @@
3232
};
3333

3434
var trial = {
35-
type: jsPsychHtmSliderResponse,
36-
stimulus: '<p>Running</p>',
35+
type: jsPsychHtmlSliderResponse,
36+
stimulus: `<div style="width:500px;">
37+
<p>How likely is it that team A will win this match?</p>
38+
<div style="width:240px; float: left;">
39+
<p>TEAM A</p>
40+
<p>10 wins, 5 losses, 6 draws</p>
41+
</div>
42+
<div style="width:240px; float: right;">
43+
<p>TEAM B</p>
44+
<p>6 wins, 4 losses, 11 draws</p>
45+
</div>
46+
</div>`,
3747
require_movement: true,
38-
labels: ['healthy', 'unhealthy'],
39-
prompt: "<p>How healthy/unhealthy is this activity?</p>"
48+
labels: ['100% chance that team A wins', '50% chance that team A wins', '0% chance that team A wins']
4049
};
4150

4251
var trial_loop = {

docs/plugins/html-button-response.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ stimulus | string | The HTML content that was displayed on the screen.
3232

3333
???+ example "Displaying question until subject gives a response"
3434
=== "Code"
35-
3635
```javascript
3736
var trial = {
3837
type: jsPsychHtmlButtonResponse,
39-
stimulus: '<p>Running</p>',
40-
choices: ['Healthy', 'Unhealthy'],
41-
prompt: "<p>Is this activity healthy or unhealthy?</p>"
38+
stimulus: '<p style="font-size:48px; color:red;">GREEN</p>',
39+
choices: ['Red', 'Green', 'Blue'],
40+
prompt: "<p>What color is the ink?</p>"
4241
};
4342
```
44-
4543
=== "Demo"
4644
<div style="text-align:center;">
4745
<iframe src="../../demos/jspsych-html-button-response-demo1.html" width="90%;" height="600px;" frameBorder="0"></iframe>

docs/plugins/html-keyboard-response.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ In addition to the [default data collected by all plugins](../overview/plugins.m
3333
```javascript
3434
var trial = {
3535
type: jsPsychHtmlKeyboardResponse,
36-
stimulus: '<p>Running</p>',
37-
choices: ['e', 'i'],
38-
prompt: "<p>Is this activity healthy or unhealthy?</p><p>Press 'e' for healthy and 'i' for unhealthy.</p>"
36+
stimulus: '<p style="font-size:48px; color:green;">BLUE</p>',
37+
choices: ['r', 'g', 'b'],
38+
prompt: "<p>Is the ink color (r)ed, (g)reen, or (b)lue?</p>"
3939
};
4040
```
4141
=== "Demo"

docs/plugins/html-slider-response.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,19 @@ slider_start | numeric | The starting value of the slider.
4141
```javascript
4242
var trial = {
4343
type: jsPsychHtmlSliderResponse,
44-
stimulus: '<p>Running</p>',
44+
stimulus: `<div style="width:500px;">
45+
<p>How likely is it that team A will win this match?</p>
46+
<div style="width:240px; float: left;">
47+
<p>TEAM A</p>
48+
<p>10 wins, 5 losses, 6 draws</p>
49+
</div>
50+
<div style="width:240px; float: right;">
51+
<p>TEAM B</p>
52+
<p>6 wins, 4 losses, 11 draws</p>
53+
</div>
54+
</div>`,
4555
require_movement: true,
46-
labels: ['healthy', 'unhealthy'],
47-
prompt: "<p>How healthy/unhealthy is this activity?</p>"
56+
labels: ['100% chance that team A wins', '50% chance that team A wins', '0% chance that team A wins']
4857
};
4958
```
5059

0 commit comments

Comments
 (0)