Compare commits

...

3 Commits

Author SHA1 Message Date
e8ba82bcb0 fixed order 2026-03-02 19:17:59 +01:00
9fab8f2181 fixed consent 2026-02-28 00:13:39 +01:00
e5cea96416 fixed survey 2026-02-28 00:03:43 +01:00
2 changed files with 116 additions and 67 deletions

158
index.js
View File

@@ -27,13 +27,13 @@ function delayed_redirect(url) {
} }
const jsPsych = initJsPsych({ const jsPsych = initJsPsych({
on_finish: function() { on_finish: function () {
jsPsych.getDisplayElement().innerHTML = textStimuli.complete; jsPsych.getDisplayElement().innerHTML = textStimuli.complete;
}, },
on_close: function() { on_close: function () {
delayed_redirect(import.meta.env.VITE_CLOSED_URL); delayed_redirect(import.meta.env.VITE_CLOSED_URL);
}, },
on_data_update: function() { on_data_update: function () {
if (debug) { if (debug) {
console.log(jsPsych.data.get().json()); console.log(jsPsych.data.get().json());
} }
@@ -75,20 +75,20 @@ switch (COND) {
probe_order = 'die_first'; probe_order = 'die_first';
break; break;
case 2: case 2:
probe_condition = 'difficulty'; probe_condition = 'die';
probe_order = 'die_first'; probe_order = 'difficulty_first';
break; break;
case 3: case 3:
probe_condition = 'die';
probe_order = 'difficulty_first';
break;
case 4:
probe_condition = 'difficulty'; probe_condition = 'difficulty';
probe_order = 'die_first'; probe_order = 'die_first';
break; break;
case 4:
probe_condition = 'die';
probe_order = 'difficulty_first';
break;
case 5: case 5:
probe_condition = 'die'; probe_condition = 'difficulty';
probe_order = 'difficulty_first'; probe_order = 'die_first';
break; break;
case 6: case 6:
probe_condition = 'difficulty'; probe_condition = 'difficulty';
@@ -149,7 +149,7 @@ const consent_form = {
type: jsPsychHtmlButtonResponse, type: jsPsychHtmlButtonResponse,
stimulus: stimulusMap.get('consent'), stimulus: stimulusMap.get('consent'),
choices: ['Exit', 'Continue'], choices: ['Exit', 'Continue'],
on_finish: function(data) { on_finish: function (data) {
if (data.response === 0) { if (data.response === 0) {
jsPsych.abortExperiment(stimulusMap.get('no_consent')); jsPsych.abortExperiment(stimulusMap.get('no_consent'));
} }
@@ -242,22 +242,10 @@ const captcha_trials = Array.from({ length: CAPTCHA_TRIAL_COUNT }, (_, index) =>
create_captcha_trial(index) create_captcha_trial(index)
); );
const die_probe_row = {
text:
'I suspected that the die roll was not random, or the number I received was pre-determined.',
value: 'SuspicionDie',
};
const difficulty_probe_row = {
text:
'I suspected that, contrary to what I was told, the captcha task difficulty was not determined by the die roll.',
value: 'SuspicionDifficulty',
};
const survey_function = survey => { const survey_function = survey => {
survey.onAfterRenderPage.add(function(sender, options) { survey.onAfterRenderPage.add(function (sender, options) {
console.log('Survey page rendered:', sender.currentPage); console.log('Survey page rendered:', sender.currentPage);
if (survey.activePage.name === 'page2') { if (survey.activePage.name === 'page2' || survey.activePage.name === 'page1') {
const nextButton = document.querySelector('#sv-nav-next > div > input'); const nextButton = document.querySelector('#sv-nav-next > div > input');
if (nextButton) { if (nextButton) {
let seconds = 20; let seconds = 20;
@@ -334,7 +322,7 @@ const survey_1 = {
}, },
], ],
}, },
{ {
name: 'page2', name: 'page2',
elements: [ elements: [
{ {
@@ -408,6 +396,54 @@ const pre_manip_info = {
}, },
}; };
const die_probe_rows = [{
text:
'I suspected that the die roll that determined captcha difficulty was rigged',
value: 'SuspicionDie1',
}, {
text:
'I suspected that the number I rolled on the die roll was predetermined',
value: 'SuspicionDie2',
}];
const difficulty_probe_rows = [{
text:
'I suspected that the captcha difficulty was unrelated to the die roll',
value: 'SuspicionDifficulty1',
}, {
text:
'I suspected that the number I rolled did not determine the captcha difficulty',
value: 'SuspicionDifficulty2',
}];
//shuffle the probe rows:
die_probe_rows.sort(() => Math.random() - 0.5);
difficulty_probe_rows.sort(() => Math.random() - 0.5);
let page_1_probe
let page_2_probe
const catch_row = {
text: 'Attention check: please select "Disagree for this statement.',
value: 'AttentionCheck',
};
if (Math.random() < 0.5) {
die_probe_rows.splice(1, 0, catch_row);
} else {
difficulty_probe_rows.splice(1, 0, catch_row);
}
if (probe_order === 'die_first') {
page_1_probe = die_probe_rows
page_2_probe = difficulty_probe_rows
} else {
page_1_probe = difficulty_probe_rows
page_2_probe = die_probe_rows
}
const survey_2 = { const survey_2 = {
type: jsPsychSurvey, type: jsPsychSurvey,
survey_function: survey_function, survey_function: survey_function,
@@ -427,18 +463,7 @@ const survey_2 = {
alternateRows: true, alternateRows: true,
isAllRowRequired: debug ? false : true, isAllRowRequired: debug ? false : true,
rowOrder: 'random', rowOrder: 'random',
rows: [ rows: page_1_probe,
probe_order === 'die_first'
? die_probe_row
: difficulty_probe_row,
{
text: `There's no question here. Select 'Disagree' to show that you're paying attention.`,
value: 'AttentionCheck',
},
probe_order === 'die_first'
? difficulty_probe_row
: die_probe_row,
],
columns: [ columns: [
{ {
value: 5, value: 5,
@@ -464,23 +489,58 @@ const survey_2 = {
}, },
], ],
}, },
{ {
name: 'page2', name: 'page2',
elements: [ elements: [
{ {
type: 'comment', type: 'matrix',
title: `Please write a sentence or two on what you thought the study was about.`, name: "Please indicate your agreement with the following statements.",
isRequired: debug == true ? false : true, alternateRows: true,
isAllRowRequired: debug ? false : true,
rowOrder: 'random',
rows: page_2_probe,
columns: [
{
value: 5,
text: 'Strongly agree',
},
{
value: 4,
text: 'Agree',
},
{
value: 3,
text: 'Neutral',
},
{
value: 2,
text: 'Disagree',
},
{
value: 1,
text: 'Strongly disagree',
},
],
}, },
{
type: 'comment',
title: ` Indicate any other thoughts or suspicions you had about the study. \n`,
isRequired: debug == true ? false : true,
}
], ],
}, },
{ {
name: 'page3', name: 'page3',
elements: [
{
type: 'comment',
title: `Please write a sentence or two on what you thought the study was about.`,
isRequired: debug == true ? false : true,
},
{
type: 'comment',
title: ` Indicate any other thoughts or suspicions you had about the study. \n`,
isRequired: debug == true ? false : true,
}
],
},
{
name: 'page4',
elements: [ elements: [
{ {
type: 'radiogroup', type: 'radiogroup',
@@ -531,7 +591,7 @@ const main_experiment_timeline = [
if (debug) { if (debug) {
timeline.push(die_roll_trial); timeline.push(survey_2);
timeline.push(...main_experiment_timeline); timeline.push(...main_experiment_timeline);
} }

View File

@@ -58,15 +58,10 @@ function getStimulusMap() {
General Participant Information and Consent General Participant Information and Consent
</h1> </h1>
<h2 class="text-xl font-bold mt-2"> <h2 class="text-xl font-bold mt-2">
Title of the study: Decision-making with Others Title of the study: Solving captchas
</h2> </h2>
<p class="font-semibold mt-2">1. Description of the research project</p> <p class="font-semibold mt-2">1. Description of the research project</p>
Welcome to our study on Decision-making with Others. We are Welcome to our study on how people solve captchas. In this study, you will be asked to solve captchas of random difficulty as quickly and accurately as possible.
investigating how people choose courses of action when working with
others. The experiment will take less than 20 minutes, with short pauses
in between. However, since this is a multi-participant study, we ask
that you complete the task fully without taking additional breaks. If
you have any further questions, please contact the investigator.
<p class="font-semibold mt-2"> <p class="font-semibold mt-2">
2. Voluntary participation and anonymity 2. Voluntary participation and anonymity
</p> </p>
@@ -81,9 +76,7 @@ function getStimulusMap() {
<p class="font-semibold mt-2"> <p class="font-semibold mt-2">
4. Scope of data collection and processing 4. Scope of data collection and processing
</p> </p>
We will save your responses and judgements to the questions and stimuli We will save your responses to the captchas and how long you took to solve them. We also ask for your gender, age, and thoughts about the
presented in this study. We will also collect information about your
response times. We also ask for your gender, age, and thoughts about the
study following completion. These data will be de-identified, so that study following completion. These data will be de-identified, so that
your responses are not saved in a way that one could identify you from your responses are not saved in a way that one could identify you from
your responses (or which responses are yours). The results and data of your responses (or which responses are yours). The results and data of
@@ -141,7 +134,7 @@ function getStimulusMap() {
</p> </p>
By clicking continue, I hereby voluntarily consent to the collection and By clicking continue, I hereby voluntarily consent to the collection and
processing of my personal data as part of the research project processing of my personal data as part of the research project
Decision-making with others. I have read the data protection Solving captchas. . I have read the data protection
declaration for the project in question, have been adequately informed declaration for the project in question, have been adequately informed
and have had the opportunity to ask questions. I have been informed of and have had the opportunity to ask questions. I have been informed of
the consequences of revoking my consent under data protection law at any the consequences of revoking my consent under data protection law at any
@@ -223,7 +216,7 @@ function getStimulusMap() {
<div class="text-left leading-relaxed"> <div class="text-left leading-relaxed">
<h1 class="text-2xl font-bold">Debriefing statement</h1> <h1 class="text-2xl font-bold">Debriefing statement</h1>
<h2 class="text-xl font-bold mt-2"> <h2 class="text-xl font-bold mt-2">
Title of the study: Decision-making with others Title of the study: Solving captchas
</h2> </h2>
<p class="mt-2"> <p class="mt-2">
Thank you for participating in our study. In this study, we seek to Thank you for participating in our study. In this study, we seek to
@@ -232,14 +225,10 @@ function getStimulusMap() {
report such suspicions. report such suspicions.
</p> </p>
<p class="mt-2"> <p class="mt-2">
To this end, we created the appearance of additional participants in To this end, we created the appearance that your die roll would determine the difficulty of the captcha task. In reality, the number you received on the die roll was pre-determined.
the experiment in reality, you performed the task alone with your
'partner's' actions being peformed by a computer.
</p> </p>
<p class="mt-2"> <p class="mt-2">
You may have also read in the post-experiment questionnaire that your You may have also read in the post-experiment questionnaire that we indeed rigged the die roll, or that the captcha difficulty was unrelated to its result. This was designed to examine whether peoples suspicions are biased by the way in which they are asked about them.
partner was either an AI agent this was to examine whether peoples
suspicions are biased by the way in which they are asked about them.
</p> </p>
<p class="mt-2"> <p class="mt-2">
Should you have any additional questions, you may contact Dr Shaheed Should you have any additional questions, you may contact Dr Shaheed