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

140
index.js
View File

@@ -27,13 +27,13 @@ function delayed_redirect(url) {
}
const jsPsych = initJsPsych({
on_finish: function() {
on_finish: function () {
jsPsych.getDisplayElement().innerHTML = textStimuli.complete;
},
on_close: function() {
on_close: function () {
delayed_redirect(import.meta.env.VITE_CLOSED_URL);
},
on_data_update: function() {
on_data_update: function () {
if (debug) {
console.log(jsPsych.data.get().json());
}
@@ -75,20 +75,20 @@ switch (COND) {
probe_order = 'die_first';
break;
case 2:
probe_condition = 'difficulty';
probe_order = 'die_first';
probe_condition = 'die';
probe_order = 'difficulty_first';
break;
case 3:
probe_condition = 'die';
probe_order = 'difficulty_first';
break;
case 4:
probe_condition = 'difficulty';
probe_order = 'die_first';
break;
case 4:
probe_condition = 'die';
probe_order = 'difficulty_first';
break;
case 5:
probe_condition = 'die';
probe_order = 'difficulty_first';
probe_condition = 'difficulty';
probe_order = 'die_first';
break;
case 6:
probe_condition = 'difficulty';
@@ -149,7 +149,7 @@ const consent_form = {
type: jsPsychHtmlButtonResponse,
stimulus: stimulusMap.get('consent'),
choices: ['Exit', 'Continue'],
on_finish: function(data) {
on_finish: function (data) {
if (data.response === 0) {
jsPsych.abortExperiment(stimulusMap.get('no_consent'));
}
@@ -242,22 +242,10 @@ const captcha_trials = Array.from({ length: CAPTCHA_TRIAL_COUNT }, (_, 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 => {
survey.onAfterRenderPage.add(function(sender, options) {
survey.onAfterRenderPage.add(function (sender, options) {
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');
if (nextButton) {
let seconds = 20;
@@ -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 = {
type: jsPsychSurvey,
survey_function: survey_function,
@@ -427,18 +463,7 @@ const survey_2 = {
alternateRows: true,
isAllRowRequired: debug ? false : true,
rowOrder: 'random',
rows: [
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,
],
rows: page_1_probe,
columns: [
{
value: 5,
@@ -466,6 +491,41 @@ const survey_2 = {
},
{
name: 'page2',
elements: [
{
type: 'matrix',
name: "Please indicate your agreement with the following statements.",
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',
},
],
},
],
},
{
name: 'page3',
elements: [
{
type: 'comment',
@@ -480,7 +540,7 @@ const survey_2 = {
],
},
{
name: 'page3',
name: 'page4',
elements: [
{
type: 'radiogroup',
@@ -531,7 +591,7 @@ const main_experiment_timeline = [
if (debug) {
timeline.push(die_roll_trial);
timeline.push(survey_2);
timeline.push(...main_experiment_timeline);
}

View File

@@ -58,15 +58,10 @@ function getStimulusMap() {
General Participant Information and Consent
</h1>
<h2 class="text-xl font-bold mt-2">
Title of the study: Decision-making with Others
Title of the study: Solving captchas
</h2>
<p class="font-semibold mt-2">1. Description of the research project</p>
Welcome to our study on Decision-making with Others. We are
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.
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.
<p class="font-semibold mt-2">
2. Voluntary participation and anonymity
</p>
@@ -81,9 +76,7 @@ function getStimulusMap() {
<p class="font-semibold mt-2">
4. Scope of data collection and processing
</p>
We will save your responses and judgements to the questions and stimuli
presented in this study. We will also collect information about your
response times. We also ask for your gender, age, and thoughts about the
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
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 (or which responses are yours). The results and data of
@@ -141,7 +134,7 @@ function getStimulusMap() {
</p>
By clicking continue, I hereby voluntarily consent to the collection and
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
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
@@ -223,7 +216,7 @@ function getStimulusMap() {
<div class="text-left leading-relaxed">
<h1 class="text-2xl font-bold">Debriefing statement</h1>
<h2 class="text-xl font-bold mt-2">
Title of the study: Decision-making with others
Title of the study: Solving captchas
</h2>
<p class="mt-2">
Thank you for participating in our study. In this study, we seek to
@@ -232,14 +225,10 @@ function getStimulusMap() {
report such suspicions.
</p>
<p class="mt-2">
To this end, we created the appearance of additional participants in
the experiment in reality, you performed the task alone with your
'partner's' actions being peformed by a computer.
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.
</p>
<p class="mt-2">
You may have also read in the post-experiment questionnaire that your
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.
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.
</p>
<p class="mt-2">
Should you have any additional questions, you may contact Dr Shaheed