Skip to content

Commit cdcfffc

Browse files
committed
updated most questionnaires
1 parent d45e6ed commit cdcfffc

File tree

17 files changed

+70
-31
lines changed

17 files changed

+70
-31
lines changed

Diff for: bickel_titrator/config.json

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
"experiment_variables": "",
2929
"reference": "http://psycnet.apa.org/journals/pha/22/3/222.pdf",
3030
"publish":"True",
31+
"experiment_variables": [{
32+
"name":"credit_var",
33+
"type":"credit",
34+
"datatype": "boolean",
35+
"description":"True if avg_rt > 200"
36+
}],
3137
"deployment_variables":{"jspsych_init":
3238
{"fullscreen": true,
3339
"display_element": "getDisplayElement",

Diff for: bickel_titrator/experiment.js

+46-7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,47 @@ var getInstructFeedback = function() {
3232
'</p></div>'
3333
}
3434

35+
function assessPerformance() {
36+
/* Function to calculate the "credit_var", which is a boolean used to
37+
credit individual experiments in expfactory. */
38+
var experiment_data = jsPsych.data.getTrialsOfType('poldrack-single-stim')
39+
var missed_count = 0
40+
var trial_count = 0
41+
var rt_array = []
42+
var rt = 0
43+
//record choices participants made
44+
var choice_counts = {}
45+
choice_counts[-1] = 0
46+
for (var k = 0; k < choices.length; k++) {
47+
choice_counts[choices[k]] = 0
48+
}
49+
for (var i = 0; i < experiment_data.length; i++) {
50+
trial_count += 1
51+
rt = experiment_data[i].rt
52+
key = experiment_data[i].key_press
53+
choice_counts[key] += 1
54+
if (rt == -1) {
55+
missed_count += 1
56+
} else {
57+
rt_array.push(rt)
58+
}
59+
}
60+
//calculate average rt
61+
var sum = 0
62+
for (var j = 0; j < rt_array.length; j++) {
63+
sum += rt_array[j]
64+
}
65+
var avg_rt = sum / rt_array.length
66+
//calculate whether response distribution is okay
67+
var responses_ok = true
68+
Object.keys(choice_counts).forEach(function(key, index) {
69+
if (choice_counts[key] > trial_count * 0.85) {
70+
responses_ok = false
71+
}
72+
})
73+
credit_var = (avg_rt > 200) && responses_ok
74+
}
75+
3576
var getStim = function() {
3677
var immediate_stim;
3778
var delayed_stim;
@@ -148,7 +189,6 @@ var feedback_instruct_block = {
148189
timing_response: 180000
149190
};
150191
/// This ensures that the subject does not read through the instructions too quickly. If they do it too quickly, then we will go over the loop again.
151-
var instruction_trials = []
152192
var instructions_block = {
153193
type: 'poldrack-instructions',
154194
pages: [
@@ -161,11 +201,9 @@ var instructions_block = {
161201
show_clickable_nav: true,
162202
timing_post_trial: 1000
163203
};
164-
instruction_trials.push(feedback_instruct_block)
165-
instruction_trials.push(instructions_block)
166204

167205
var instruction_node = {
168-
timeline: instruction_trials,
206+
timeline: [feedback_instruct_block, instructions_block],
169207
/* This function defines stopping criteria */
170208
loop_function: function(data) {
171209
for (i = 0; i < data.length; i++) {
@@ -235,15 +273,16 @@ var end_block = {
235273
},
236274
text: '<div class = centerbox><p class = center-block-text>Thanks for completing this task!</p><p class = center-block-text>Press <strong>enter</strong> to continue.</p></div>',
237275
cont_key: [13],
238-
timing_post_trial: 0
276+
timing_post_trial: 0,
277+
on_finish: assessPerformance
239278
};
240279

241280

242281
//Set up experiment
243282
var bickel_titrator_experiment = []
244283
bickel_titrator_experiment.push(instruction_node);
245-
for (var i = 0; i < 1; i++) { //delays.length
246-
for (var j = 0; j < 3; j++) { //5
284+
for (var i = 0; i < delays.length; i++) {
285+
for (var j = 0; j < 5; j++) {
247286
bickel_titrator_experiment.push(test_block);
248287
}
249288
bickel_titrator_experiment.push(update_delay_block);

Diff for: bis11/experiment.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function fillArray(value, len) {
2727

2828
var welcome_block = {
2929
type: 'text',
30-
text: '<div class = centerbox><p class = block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
30+
text: '<div class = centerbox><p class = center-block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
3131
cont_key: [13],
3232
data: {
3333
exp_id: "bis11"
@@ -37,7 +37,7 @@ var welcome_block = {
3737
var instructions_block = {
3838
type: 'poldrack-instructions',
3939
pages: [
40-
'<div class = centerbox><p class = block-text>People differ in the ways they act and think in different situations. This is a test to measure some of the ways in which you act and think. Read each statement and click on the appropriate circle below the question. Do not spend too much time on any statement. Answer quickly and honestly.</p></div>',
40+
'<div class = centerbox><p class = block-text>People differ in the ways they act and think in different situations. This is a test to measure some of the ways in which you act and think. Read each statement and click on the appropriate circle below the question.</p></div>',
4141
],
4242
allow_keys: false,
4343
show_clickable_nav: true,

Diff for: bis_bas/experiment.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function fillArray(value, len) {
2727

2828
var welcome_block = {
2929
type: 'text',
30-
text: '<div class = centerbox><p class = block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
30+
text: '<div class = centerbox><p class = center-block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
3131
cont_key: [13],
3232
data: {
3333
exp_id: "bis_bas"
@@ -37,7 +37,7 @@ var welcome_block = {
3737
var instructions_block = {
3838
type: 'poldrack-instructions',
3939
pages: [
40-
'<div class = centerbox><p class = block-text>Each item of this questionnaire is a statement that a person may either agree with or disagree with. For each item, indicate how much you agree or disagree with what the item says. Please respond to all the items; do not leave any blank. Choose only one response to each statement. Please be as accurate and honest as you can be. Respond to each item as if it were the only item. That is, do not worry about being "consistent" in your responses.</p></div>',
40+
'<div class = centerbox><p class = block-text>Each item of this questionnaire is a statement that a person may either agree with or disagree with. For each item, indicate how much you agree or disagree with what the item says. Please respond to all the items; do not leave any blank. Choose only one response to each statement.</p></div>',
4141
],
4242
allow_keys: false,
4343
show_clickable_nav: true,

Diff for: brief_self_control/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function fillArray(value, len) {
2727

2828
var welcome_block = {
2929
type: 'text',
30-
text: '<div class = centerbox><p class = block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
30+
text: '<div class = centerbox><p class = center-block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
3131
cont_key: [13],
3232
data: {
3333
exp_id: "brief_self_control"

Diff for: dickman/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function fillArray(value, len) {
2626

2727
var welcome_block = {
2828
type: 'text',
29-
text: '<div class = centerbox><p class = block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
29+
text: '<div class = centerbox><p class = center-block-text>Welcome to this survey. Press <strong>enter</strong> to begin.</p></div>',
3030
cont_key: [13],
3131
data: {
3232
exp_id: "dickman"

Diff for: dospert_rp/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var welcome_block = {
3939
var instructions_block = {
4040
type: 'poldrack-instructions',
4141
pages: [
42-
'<div class = centerbox><p class = block-text>People often see some risk in situations that contain uncertainty about what the outcome or consequences will be and for which there is the possibility of negative consequences. However, riskiness is a very personal and intuitive notion, and we are interested in <strong>your gut level assessment of how risky</strong> each situation or behavior is.<br><br>For each of the following statements, please indicate <strong>how risky you perceive</strong> each situation.</p></div>',
42+
'<div class = centerbox><p class = block-text>People often see some risk in situations that contain uncertainty about what the outcome or consequences will be and for which there is the possibility of negative consequences. However, riskiness is a very personal and intuitive notion, and we are interested in <strong>your assessment of how risky</strong> each situation or behavior is.<br><br>For each of the following statements, please indicate <strong>how risky you perceive</strong> each situation.</p></div>',
4343
],
4444
allow_keys: false,
4545
show_clickable_nav: true,

Diff for: erq/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var welcome_block = {
3737
var instructions_block = {
3838
type: 'poldrack-instructions',
3939
pages: [
40-
'<div class = centerbox><p class = block-text>Please indicate to what degree you agree with each of the following statements.</p></div>',
40+
'<div class = centerbox><p class = center-block-text>Please indicate to what degree you agree with each of the following statements.</p></div>',
4141
],
4242
allow_keys: false,
4343
show_clickable_nav: true,

Diff for: future_time_perspective/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var welcome_block = {
3434
var instructions_block = {
3535
type: 'poldrack-instructions',
3636
pages: [
37-
'<div class = centerbox><p class = block-text>Read each item and, as honestly as you can, answer the questions: “How true is this of you?”</p></div>',
37+
'<div class = centerbox><p class = block-text>Read each item and answer the question: “How true is this of you?”</p></div>',
3838
],
3939
allow_keys: false,
4040
show_clickable_nav: true,

Diff for: holt_laury/experiment.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ var feedback_instruct_block = {
5252
timing_response: 6000
5353
};
5454
/// This ensures that the subject does not read through the instructions too quickly. If they do it too quickly, then we will go over the loop again.
55-
var instruction_trials = []
5655
var instructions_block = {
5756
type: 'poldrack-instructions',
5857
pages: [
@@ -62,11 +61,9 @@ var instructions_block = {
6261
show_clickable_nav: true,
6362
timing_post_trial: 1000
6463
};
65-
instruction_trials.push(feedback_instruct_block)
66-
instruction_trials.push(instructions_block)
6764

6865
var instruction_node = {
69-
timeline: instruction_trials,
66+
timeline: [feedback_instruct_block, instructions_block],
7067
/* This function defines stopping criteria */
7168
loop_function: function(data) {
7269
for (i = 0; i < data.length; i++) {

Diff for: impulsive_venture/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var welcome_block = {
3535
var instructions_block = {
3636
type: 'poldrack-instructions',
3737
pages: [
38-
'<div class = centerbox><p class = block-text>Please answer each question by clicking "Yes" or "No" following the questions. There are no right or wrong answers, and no trick questions. Work quickly and do not think too long about the exact meaning of the question.</p></div>',
38+
'<div class = centerbox><p class = block-text>Please answer each question by clicking "Yes" or "No" following the questions. There are no right or wrong answers, and no trick questions.</p></div>',
3939
],
4040
allow_keys: false,
4141
show_clickable_nav: true,

Diff for: ravens/experiment.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,11 @@ var feedback_instruct_block = {
281281
}
282282
};
283283
/// This ensures that the subject does not read through the instructions too quickly. If they do it too quickly, then we will go over the loop again.
284-
var instruction_trials = []
285284
var instructions_block = {
286285
type: 'poldrack-instructions',
287286
pages: [
288287
'<div class = centerbox><p class = block-text>This is a test of observation and clear thinking with 18 problems. The top part of each problem is a pattern with one part cut out of it. Your task is to look at the pattern, think of what the missing part must look like to complete the pattern correctly, both along the rows and the columns, and then find the right piece out of the eight shown. Only one of the answer choices is perfectly correct.<br><br>The following page will have an example trial.</p></div>',
289-
'<div class = centerbox><p class = block-text><strong>Look at the top part (the pattern) of this sample problem.</strong> Notice that going across the rows, the number of horizontal lines is equal. Going down the columns, the number of squares is equal.<div class="sample_img"><img src = "/static/experiments/ravens/images/practice/sample_matrix_top.jpg"</img></div><p class= "block-text"><strong>Look at the solution of this sample problem.</strong> The best completion of the missing cell is the alternative "E)" which is selected below.</p><div class="sample_img"><img src = "/static/experiments/ravens/images/practice/sample_matrix_bottom.jpg" id="bottom_img"</img></div><div class="sample_img"><img src = "/static/experiments/ravens/images/practice/Opt_E_selected.png"</img></div></p></div>',
288+
'<div class = centerbox><p class = block-text><strong>Look at the top part (the pattern) of this sample problem.</strong> Notice that going across the rows, the number of horizontal lines is equal. Going down the columns, the number of squares is equal.<div class="sample_img"><img src = "/static/experiments/ravens/images/practice/sample_matrix_top.jpg"</img></div><p class= "block-text"><strong>Look at the solution of this sample problem.</strong> The best completion of the missing cell is the alternative "E" which is selected below.</p><div class="sample_img"><img src = "/static/experiments/ravens/images/practice/sample_matrix_bottom.jpg" id="bottom_img"</img></div><div class="sample_img"><img src = "/static/experiments/ravens/images/practice/Opt_E_selected.png"</img></div></p></div>',
290289
'<div class = centerbox><p class = center-block-text>You will now complete two practice trials with feedback. The test trials will not include feedback.</p></div>'
291290
],
292291
allow_keys: false,
@@ -296,11 +295,9 @@ var instructions_block = {
296295
exp_id: "ravens"
297296
}
298297
};
299-
instruction_trials.push(feedback_instruct_block)
300-
instruction_trials.push(instructions_block)
301298

302299
var instruction_node = {
303-
timeline: instruction_trials,
300+
timeline: [feedback_instruct_block, instructions_block],
304301
/* This function defines stopping criteria */
305302
loop_function: function(data) {
306303
for (i = 0; i < data.length; i++) {

Diff for: selection_optimization_compensation/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var welcome_block = {
3636
var instructions_block = {
3737
type: 'poldrack-instructions',
3838
pages: [
39-
'<div class = centerbox><p class = block-text>Please select which of the two statements is more true for you.</p></div>',
39+
'<div class = centerbox><p class = center-block-text>Please select which of the two statements is more true for you.</p></div>',
4040
],
4141
allow_keys: false,
4242
show_clickable_nav: true,

Diff for: sensation_seeking/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var welcome_block = {
3636
var instructions_block = {
3737
type: 'poldrack-instructions',
3838
pages: [
39-
'<div class = centerbox><p class = block-text>Please indicate which of the following scenarios you would prefer.</p></div>',
39+
'<div class = centerbox><p class = center-block-text>Please indicate which of the following scenarios you would prefer.</p></div>',
4040
],
4141
allow_keys: false,
4242
show_clickable_nav: true,

Diff for: ten_item_personality/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var welcome_block = {
3636
var instructions_block = {
3737
type: 'poldrack-instructions',
3838
pages: [
39-
'<div class = centerbox><p class = block-text>Please indicate to what degree you agree with each of the following statements.</p></div>',
39+
'<div class = centerbox><p class = center-block-text>Please indicate to what degree you agree with each of the following statements.</p></div>',
4040
],
4141
allow_keys: false,
4242
show_clickable_nav: true,

Diff for: time_perspective/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var welcome_block = {
3434
var instructions_block = {
3535
type: 'poldrack-instructions',
3636
pages: [
37-
'<div class = centerbox><p class = block-text>Please read each item and answer the following question as honestly as you can: "How characteristic or true is this of you?"</p></div>',
37+
'<div class = centerbox><p class = block-text>Please read each item and answer the following question: "How characteristic or true is this of you?"</p></div>',
3838
],
3939
allow_keys: false,
4040
show_clickable_nav: true,

Diff for: upps_impulsivity/experiment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var welcome_block = {
3636
var instructions_block = {
3737
type: 'poldrack-instructions',
3838
pages: [
39-
'<div class = centerbox><p class = block-text>In the following pages you will be presented with a number of statements that describe ways in which people act and think. For each statement, please indicate how much you agree or disagree with the statement. Be sure to indicate your agreement or disagreement for every statement.</p></div>',
39+
'<div class = centerbox><p class = block-text>In the following pages you will be presented with a number of statements that describe ways in which people act and think. For each statement, please indicate how much you agree or disagree with the statement.</p></div>',
4040
],
4141
allow_keys: false,
4242
show_clickable_nav: true,

0 commit comments

Comments
 (0)