updated survey
This commit is contained in:
94
index.js
94
index.js
@@ -18,8 +18,9 @@ const experiment_name = import.meta.env.VITE_EXPERIMENT_NAME;
|
||||
|
||||
|
||||
let prolific_id;
|
||||
let probe_condition; // P in the params, O = open, S = suspicion mentioned
|
||||
let probe_condition; // will be set to ai or human 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
|
||||
|
||||
@@ -49,33 +50,58 @@ prolific_id = jsPsych.data.getURLVariable('PROLIFIC_PID');
|
||||
|
||||
const COND = Number(jsPsych.data.getURLVariable('C'));
|
||||
|
||||
const probe_text_direct = 'Did you have any thoughts, observations, or suspicions about the experiment?'
|
||||
const probe_text_indirect = 'Did you have any thoughts or observations about the experiment?';
|
||||
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_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;
|
||||
|
||||
let together_colour;
|
||||
let probe_text;
|
||||
|
||||
|
||||
switch (COND) {
|
||||
case 0:
|
||||
probe_condition = 'direct';
|
||||
probe_condition = 'ai';
|
||||
together_colour = 'blue';
|
||||
probe_order = 'ai_first';
|
||||
break;
|
||||
case 1:
|
||||
probe_condition = 'direct';
|
||||
probe_condition = 'ai';
|
||||
together_colour = 'red';
|
||||
probe_order = 'ai_first';
|
||||
break;
|
||||
case 2:
|
||||
probe_condition = 'indirect';
|
||||
probe_condition = 'human';
|
||||
together_colour = 'blue';
|
||||
probe_order = 'ai_first';
|
||||
break;
|
||||
case 3:
|
||||
probe_condition = 'indirect';
|
||||
probe_condition = 'human';
|
||||
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 = 'human';
|
||||
together_colour = 'blue';
|
||||
probe_order = 'human_first';
|
||||
break;
|
||||
case 7:
|
||||
probe_condition = 'human';
|
||||
together_colour = 'red';
|
||||
probe_order = 'human_first';
|
||||
break;
|
||||
}
|
||||
|
||||
probe_text = probe_condition === 'direct' ? probe_text_direct : probe_text_indirect;
|
||||
|
||||
const stimulusMap = getStimulusMap(together_colour);
|
||||
|
||||
@@ -84,7 +110,8 @@ const props = {
|
||||
together_colour: together_colour,
|
||||
prolific_id: prolific_id,
|
||||
experiment_name: experiment_name,
|
||||
probe_text: probe_text,
|
||||
probe_text: probe_order,
|
||||
cond: COND,
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
@@ -201,12 +228,24 @@ 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 = 30;
|
||||
let seconds = 20;
|
||||
const originalText = nextButton.value.replace(/\s*\(\d+\)$/, '') || 'Continue';
|
||||
nextButton.disabled = true;
|
||||
nextButton.value = `${originalText} (${seconds})`;
|
||||
@@ -220,11 +259,11 @@ const survey_function = (survey) => {
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
console.log('Survey page rendered:', sender.currentPage);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const survey = {
|
||||
type: jsPsychSurvey,
|
||||
survey_function: survey_function,
|
||||
@@ -237,34 +276,23 @@ const survey = {
|
||||
pages: [
|
||||
{
|
||||
name: 'page1',
|
||||
elements: [
|
||||
{
|
||||
type: 'comment',
|
||||
title: probe_text,
|
||||
description: 'You may continue to the next page after 30 seconds.',
|
||||
name: 'probe',
|
||||
isRequired: debug ? false : true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'page2',
|
||||
elements: [
|
||||
{
|
||||
type: 'matrix',
|
||||
name:
|
||||
'To what extent do you agree with the following statements about your partner?',
|
||||
name: probe_condition === 'ai' ? probe_text_ai : probe_text_human,
|
||||
alternateRows: true,
|
||||
isAllRowRequired: debug ? false : true,
|
||||
rows: [
|
||||
{
|
||||
text: 'I did not believe that my partner was a real person.',
|
||||
value: 'SuspicionPartner',
|
||||
},
|
||||
{
|
||||
text: 'I believed that my partner was a real person.',
|
||||
text: 'I believed that my partner was another participant.',
|
||||
value: 'ConfidencePartner',
|
||||
},
|
||||
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,
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
@@ -292,7 +320,7 @@ const survey = {
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'page1',
|
||||
name: 'page2',
|
||||
elements: [
|
||||
{
|
||||
type: 'radiogroup',
|
||||
@@ -374,8 +402,8 @@ const object_moving_practice = {
|
||||
};
|
||||
|
||||
if (debug) {
|
||||
timeline.push(survey)
|
||||
timeline.push(debrief);
|
||||
|
||||
}
|
||||
|
||||
if (!debug) {
|
||||
|
||||
Reference in New Issue
Block a user