update the html demos to be more illustrative

This commit is contained in:
Josh de Leeuw 2021-10-04 11:02:17 -04:00
parent 3f150a3b77
commit 58f4887217
7 changed files with 39 additions and 23 deletions

View File

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

View File

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

View File

@ -32,7 +32,7 @@
}; };
var trial = { var trial = {
type: jsPsychHtmKeyboardResponse, type: jsPsychHtmlKeyboardResponse,
stimulus: '<p style="font-size: 48px;">+</p>', stimulus: '<p style="font-size: 48px;">+</p>',
choices: jsPsych.NO_KEYS, choices: jsPsych.NO_KEYS,
trial_duration: 1000, trial_duration: 1000,

View File

@ -32,11 +32,20 @@
}; };
var trial = { var trial = {
type: jsPsychHtmSliderResponse, type: jsPsychHtmlSliderResponse,
stimulus: '<p>Running</p>', stimulus: `<div style="width:500px;">
<p>How likely is it that team A will win this match?</p>
<div style="width:240px; float: left;">
<p>TEAM A</p>
<p>10 wins, 5 losses, 6 draws</p>
</div>
<div style="width:240px; float: right;">
<p>TEAM B</p>
<p>6 wins, 4 losses, 11 draws</p>
</div>
</div>`,
require_movement: true, require_movement: true,
labels: ['healthy', 'unhealthy'], labels: ['100% chance that team A wins', '50% chance that team A wins', '0% chance that team A wins']
prompt: "<p>How healthy/unhealthy is this activity?</p>"
}; };
var trial_loop = { var trial_loop = {

View File

@ -32,16 +32,14 @@ stimulus | string | The HTML content that was displayed on the screen.
???+ example "Displaying question until subject gives a response" ???+ example "Displaying question until subject gives a response"
=== "Code" === "Code"
```javascript ```javascript
var trial = { var trial = {
type: jsPsychHtmlButtonResponse, type: jsPsychHtmlButtonResponse,
stimulus: '<p>Running</p>', stimulus: '<p style="font-size:48px; color:red;">GREEN</p>',
choices: ['Healthy', 'Unhealthy'], choices: ['Red', 'Green', 'Blue'],
prompt: "<p>Is this activity healthy or unhealthy?</p>" prompt: "<p>What color is the ink?</p>"
}; };
``` ```
=== "Demo" === "Demo"
<div style="text-align:center;"> <div style="text-align:center;">
<iframe src="../../demos/jspsych-html-button-response-demo1.html" width="90%;" height="600px;" frameBorder="0"></iframe> <iframe src="../../demos/jspsych-html-button-response-demo1.html" width="90%;" height="600px;" frameBorder="0"></iframe>

View File

@ -33,9 +33,9 @@ In addition to the [default data collected by all plugins](../overview/plugins.m
```javascript ```javascript
var trial = { var trial = {
type: jsPsychHtmlKeyboardResponse, type: jsPsychHtmlKeyboardResponse,
stimulus: '<p>Running</p>', stimulus: '<p style="font-size:48px; color:green;">BLUE</p>',
choices: ['e', 'i'], choices: ['r', 'g', 'b'],
prompt: "<p>Is this activity healthy or unhealthy?</p><p>Press 'e' for healthy and 'i' for unhealthy.</p>" prompt: "<p>Is the ink color (r)ed, (g)reen, or (b)lue?</p>"
}; };
``` ```
=== "Demo" === "Demo"

View File

@ -41,10 +41,19 @@ slider_start | numeric | The starting value of the slider.
```javascript ```javascript
var trial = { var trial = {
type: jsPsychHtmlSliderResponse, type: jsPsychHtmlSliderResponse,
stimulus: '<p>Running</p>', stimulus: `<div style="width:500px;">
<p>How likely is it that team A will win this match?</p>
<div style="width:240px; float: left;">
<p>TEAM A</p>
<p>10 wins, 5 losses, 6 draws</p>
</div>
<div style="width:240px; float: right;">
<p>TEAM B</p>
<p>6 wins, 4 losses, 11 draws</p>
</div>
</div>`,
require_movement: true, require_movement: true,
labels: ['healthy', 'unhealthy'], labels: ['100% chance that team A wins', '50% chance that team A wins', '0% chance that team A wins']
prompt: "<p>How healthy/unhealthy is this activity?</p>"
}; };
``` ```