Updated for Experiment 2

This commit is contained in:
Shaheed Azaad
2025-07-02 21:53:49 +02:00
parent 7b525ff8fb
commit 55f927b564
2 changed files with 33 additions and 68 deletions
+18 -53
View File
@@ -18,9 +18,9 @@ const experiment_name = import.meta.env.VITE_EXPERIMENT_NAME;
let prolific_id; let prolific_id;
let probe_condition; // will be set to ai or human based on the condition. let probe_condition; // will be set to neutral or reveal based on the condition
let debug = false; let debug = false;
let probe_order; // will be set to ai_first or human_first based on the condition
const short_version = true; // just using the short version of the task const short_version = true; // just using the short version of the task
@@ -50,55 +50,30 @@ prolific_id = jsPsych.data.getURLVariable('PROLIFIC_PID');
const COND = Number(jsPsych.data.getURLVariable('C')); const COND = Number(jsPsych.data.getURLVariable('C'));
const probe_preamble = 'In this experiment, we told you that you were playing a game with a partner. However, due to the difficulty of implementing multi-participant online studies, your partner was actually '; const probe_preamble = 'In this experiment, you worked together with a partner. ';
const probe_closing_text = 'We would like to know what you thought about your partner. Please share your thoughts by indicating your agreement with the following statements.'; const probe_closing_text = 'Please share any suspicions you had about your partner during the experiment by indicating your agreement with the following statements.';
const probe_text_ai = probe_preamble + 'an AI agent trained to behave like a human participant. ' + probe_closing_text; const probe_text_neutral = probe_preamble + probe_closing_text;
const probe_text_human = probe_preamble + 'an experimenter pretending to be a participant. ' + probe_closing_text; const probe_text_reveal = probe_preamble + 'However, due to the difficulty of implementing multi-participant online studies, your partner was actually an AI agent trained to behave like a human participant. ' + probe_closing_text;
let together_colour; let together_colour;
let probe_text;
switch (COND) { switch (COND) {
case 0: case 0:
probe_condition = 'ai'; probe_condition = 'neutral';
together_colour = 'blue'; together_colour = 'blue';
probe_order = 'ai_first';
break; break;
case 1: case 1:
probe_condition = 'ai'; probe_condition = 'neutral';
together_colour = 'red'; together_colour = 'red';
probe_order = 'ai_first';
break; break;
case 2: case 2:
probe_condition = 'experimenter'; probe_condition = 'reveal';
together_colour = 'blue'; together_colour = 'blue';
probe_order = 'ai_first';
break; break;
case 3: case 3:
probe_condition = 'experimenter'; probe_condition = 'reveal';
together_colour = 'red'; together_colour = 'red';
probe_order = 'ai_first';
break;
case 4:
probe_condition = 'ai';
together_colour = 'blue';
probe_order = 'human_first';
break;
case 5:
probe_condition = 'ai';
together_colour = 'red';
probe_order = 'human_first';
break;
case 6:
probe_condition = 'experimenter';
together_colour = 'blue';
probe_order = 'human_first';
break;
case 7:
probe_condition = 'experimenter';
together_colour = 'red';
probe_order = 'human_first';
break; break;
} }
@@ -110,7 +85,6 @@ const props = {
together_colour: together_colour, together_colour: together_colour,
prolific_id: prolific_id, prolific_id: prolific_id,
experiment_name: experiment_name, experiment_name: experiment_name,
probe_order: probe_order,
cond: COND, cond: COND,
} }
@@ -228,24 +202,13 @@ const pre_survey_info = {
stimulus: stimulusMap.get('pre_survey_info'), stimulus: stimulusMap.get('pre_survey_info'),
}; };
const ai_probe_row = {
text: 'I believed that my partner was an AI agent or a bot.',
value: 'SuspicionAI',
}
const exprimenter_probe_row = {
text: 'I believed that my partner was an experimenter pretending to be a participant.',
value: 'SuspicionExperimenter',
}
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 === 'page1') { if (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 = 15;
const originalText = nextButton.value.replace(/\s*\(\d+\)$/, '') || 'Continue'; const originalText = nextButton.value.replace(/\s*\(\d+\)$/, '') || 'Continue';
nextButton.disabled = true; nextButton.disabled = true;
nextButton.value = `${originalText} (${seconds})`; nextButton.value = `${originalText} (${seconds})`;
@@ -279,20 +242,22 @@ const survey = {
elements: [ elements: [
{ {
type: 'matrix', type: 'matrix',
name: probe_condition === 'ai' ? probe_text_ai : probe_text_human, name: probe_condition === 'neutral' ? probe_text_neutral : probe_text_reveal,
alternateRows: true, alternateRows: true,
isAllRowRequired: debug ? false : true, isAllRowRequired: debug ? false : true,
rows: [ rows: [
{ {
text: 'I believed that my partner was another participant.', text: 'I believed that my partner was actually an AI agent or a bot.',
value: 'ConfidencePartner', value: 'SuspicionPartner',
}, },
probe_order === 'ai_first' ? ai_probe_row : exprimenter_probe_row,
{ {
text: `There's no question here. Select 'Disagree' to show that you're paying attention.`, text: `There's no question here. Select 'Disagree' to show that you're paying attention.`,
value: 'AttentionCheck', value: 'AttentionCheck',
}, },
probe_order === 'ai_first' ? exprimenter_probe_row : ai_probe_row, {
text: 'I believed that my partner was another, human, participant.',
value: 'ConfidencePartner',
},
], ],
columns: [ columns: [
{ {
+1 -1
View File
@@ -363,7 +363,7 @@ function getStimulusMap(together_colour) {
the experiment – in reality, you performed the task alone with your 'partner's' actions being peformed by a computer. 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 partner was either an AI agent or an experimenter – this was to examine whether people’s suspicions are biased by the way in which they are asked about them. You may have also read in the post-experiment questionnaire that your partner was either an AI agent – this was to examine whether people’s 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