From 55f927b564a0a05d1090ca8ccf2828ef4e977d26 Mon Sep 17 00:00:00 2001 From: Shaheed Azaad <4594-shaheedazaad@users.noreply.gitlab.pavlovia.org> Date: Wed, 2 Jul 2025 21:53:49 +0200 Subject: [PATCH] Updated for Experiment 2 --- index.js | 99 +++++++++++++---------------------------- scripts/text-stimuli.js | 2 +- 2 files changed, 33 insertions(+), 68 deletions(-) diff --git a/index.js b/index.js index 698655b..af3aa57 100644 --- a/index.js +++ b/index.js @@ -18,9 +18,9 @@ const experiment_name = import.meta.env.VITE_EXPERIMENT_NAME; 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 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 @@ -50,55 +50,30 @@ prolific_id = jsPsych.data.getURLVariable('PROLIFIC_PID'); 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_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_preamble = 'In this experiment, you worked together with a partner. '; +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_human = probe_preamble + 'an experimenter pretending to be a participant. ' + probe_closing_text; +const probe_text_neutral = probe_preamble + 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 probe_text; switch (COND) { case 0: - probe_condition = 'ai'; + probe_condition = 'neutral'; together_colour = 'blue'; - probe_order = 'ai_first'; break; case 1: - probe_condition = 'ai'; + probe_condition = 'neutral'; together_colour = 'red'; - probe_order = 'ai_first'; break; case 2: - probe_condition = 'experimenter'; + probe_condition = 'reveal'; together_colour = 'blue'; - probe_order = 'ai_first'; break; case 3: - probe_condition = 'experimenter'; + probe_condition = 'reveal'; 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; } @@ -110,7 +85,6 @@ const props = { together_colour: together_colour, prolific_id: prolific_id, experiment_name: experiment_name, - probe_order: probe_order, cond: COND, } @@ -228,38 +202,27 @@ const 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) => { survey.onAfterRenderPage.add(function (sender, options) { console.log('Survey page rendered:', sender.currentPage); if (survey.activePage.name === 'page1') { - const nextButton = document.querySelector('#sv-nav-next > div > input'); - if (nextButton) { - let seconds = 20; - const originalText = nextButton.value.replace(/\s*\(\d+\)$/, '') || 'Continue'; - nextButton.disabled = true; - nextButton.value = `${originalText} (${seconds})`; - const interval = setInterval(() => { - seconds--; + const nextButton = document.querySelector('#sv-nav-next > div > input'); + if (nextButton) { + let seconds = 15; + const originalText = nextButton.value.replace(/\s*\(\d+\)$/, '') || 'Continue'; + nextButton.disabled = true; nextButton.value = `${originalText} (${seconds})`; - if (seconds <= 0) { - clearInterval(interval); - nextButton.disabled = false; - nextButton.value = originalText; - } - }, 1000); + const interval = setInterval(() => { + seconds--; + nextButton.value = `${originalText} (${seconds})`; + if (seconds <= 0) { + clearInterval(interval); + nextButton.disabled = false; + nextButton.value = originalText; + } + }, 1000); + } } - } }); } @@ -279,20 +242,22 @@ const survey = { elements: [ { type: 'matrix', - name: probe_condition === 'ai' ? probe_text_ai : probe_text_human, + name: probe_condition === 'neutral' ? probe_text_neutral : probe_text_reveal, alternateRows: true, isAllRowRequired: debug ? false : true, rows: [ { - text: 'I believed that my partner was another participant.', - value: 'ConfidencePartner', + text: 'I believed that my partner was actually an AI agent or a bot.', + 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.`, 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: [ { diff --git a/scripts/text-stimuli.js b/scripts/text-stimuli.js index 1a07966..64d50b0 100644 --- a/scripts/text-stimuli.js +++ b/scripts/text-stimuli.js @@ -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.
- 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.
Should you have any additional questions, you may contact Dr Shaheed