diff --git a/package-lock.json b/package-lock.json index cbd3dfc..862368a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "task-effort", - "version": "1.3.0-beta", + "version": "1.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1b49966..079b80f 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "task-effort", - "description": "all-in-one app with jsPsych + React + Electron + psiturk", + "name": "effort-v1.3.2", + "description": "all-in-one app with jsPsych + React + Electron + psiTurk", "author": { - "name": "Wasita Mahaphanit & Rashi Dhar (Brown CCV)", + "name": "Wasita Mahaphanit (Brown) & Rashi Dhar (Brown CCV)", "email": "wasita@brown.edu", "url": "https://lnccbrown.com" }, - "version": "1.3.1", + "version": "1.3.2", "license": "MIT", "private": true, "main": "public/electron.js", diff --git a/public/config/trigger.js b/public/config/trigger.js index db1c0c5..7896d16 100644 --- a/public/config/trigger.js +++ b/public/config/trigger.js @@ -3,26 +3,27 @@ const comName = "COM7"; // NOTE - these event codes must match what is in src/config/trigger.js const eventCodes = { + practiceAndMainBlockDivider: 250, fixationStart: 1, // this is fixation dot onset - fixationEnd: 2, // this is fixation dot offset + // fixationEnd: 2, // this is fixation dot offset rewardProbabilityStart: 10, // reward probability (50% or 100%) onset - rewardProbabilityEnd: 11, // reward probability (50% of 100%) offset + // rewardProbabilityEnd: 11, // reward probability (50% of 100%) offset frameSpikeStart: 20, // frame and spike onset - frameSpikeEnd: 21, // frame and spike offset + // frameSpikeEnd: 21, // frame and spike offset costBenefitsStart: 30, // points and effort values for both options onset - costBenefitsEnd: 31, // points and effort values for both options offset + // costBenefitsEnd: 31, // points and effort values for both options offset choiceStart: 40, // frame + spike + balloons, when participant can choose blue or green - choiceEnd: 41, // frame + spike + balloons offset, once participant has made a choice + // choiceEnd: 41, // frame + spike + balloons offset, once participant has made a choice pressBalloonStart: 50, // once participant is able to pump the balloon by pressing a key - pressBalloonEnd: 51, // once the balloon has popped (once 25 secs from pressBalloonStart is over) + // pressBalloonEnd: 51, // once the balloon has popped (once 25 secs from pressBalloonStart is over) cumulativeRewardsStart: 60, // total points earned thus far onset - cumulativeRewardsEnd: 61, // total points earned thus far offse + // cumulativeRewardsEnd: 61, // total points earned thus far offse rewardFeedbackStart: 70, // trial reward feedback onset - rewardFeedbackEnd: 71, // trial reward feedback offset + // rewardFeedbackEnd: 71, // trial reward feedback offset showPaymentStart: 80, // end of task earnings screen onset - showPaymentEnd: 81, // end of task earnings screen offset + // showPaymentEnd: 81, // end of task earnings screen offset trialFinishStart: 90, // marks when trial starts (fixation onset) -- currently NOT in use - trialFinishEnd: 91, // marks when trial ends (reward feedback offset) + // trialFinishEnd: 91, // marks when trial ends (reward feedback offset) test_connect: 4, open_task: 5, // when the app is opened, send this code }; diff --git a/src/config/trigger.js b/src/config/trigger.js index fd090bb..0fc57ec 100644 --- a/src/config/trigger.js +++ b/src/config/trigger.js @@ -1,25 +1,26 @@ // NOTE - these event codes must match what is in public/config/trigger.js const eventCodes = { + practiceAndMainBlockDivider: 250, fixationStart: 1, // this is fixation dot onset - fixationEnd: 2, // this is fixation dot offset + // fixationEnd: 2, // this is fixation dot offset rewardProbabilityStart: 10, // reward probability (50% or 100%) onset - rewardProbabilityEnd: 11, // reward probability (50% of 100%) offset + // rewardProbabilityEnd: 11, // reward probability (50% of 100%) offset frameSpikeStart: 20, // frame and spike onset - frameSpikeEnd: 21, // frame and spike offset + // frameSpikeEnd: 21, // frame and spike offset costBenefitsStart: 30, // points and effort values for both options onset - costBenefitsEnd: 31, // points and effort values for both options offset + // costBenefitsEnd: 31, // points and effort values for both options offset choiceStart: 40, // frame + spike + balloons, when participant can choose blue or green - choiceEnd: 41, // frame + spike + balloons offset, once participant has made a choice + // choiceEnd: 41, // frame + spike + balloons offset, once participant has made a choice pressBalloonStart: 50, // once participant is able to pump the balloon by pressing a key - pressBalloonEnd: 51, // once the balloon has popped (once 25 secs from pressBalloonStart is over) + // pressBalloonEnd: 51, // once the balloon has popped (once 25 secs from pressBalloonStart is over) cumulativeRewardsStart: 60, // total points earned thus far onset - cumulativeRewardsEnd: 61, // total points earned thus far offse + // cumulativeRewardsEnd: 61, // total points earned thus far offse rewardFeedbackStart: 70, // trial reward feedback onset - rewardFeedbackEnd: 71, // trial reward feedback offset + // rewardFeedbackEnd: 71, // trial reward feedback offset showPaymentStart: 80, // end of task earnings screen onset - showPaymentEnd: 81, // end of task earnings screen offset + // showPaymentEnd: 81, // end of task earnings screen offset trialFinishStart: 90, // marks when trial starts (fixation onset) -- currently NOT in use - trialFinishEnd: 91, // marks when trial ends (reward feedback offset) + // trialFinishEnd: 91, // marks when trial ends (reward feedback offset) test_connect: 4, open_task: 5, // when the app is opened, send this code }; diff --git a/src/language/en_us.json b/src/language/en_us.json index 4ee16c0..3d1d76d 100644 --- a/src/language/en_us.json +++ b/src/language/en_us.json @@ -1,7 +1,8 @@ { "task": { "name": "Effort Task", - "end": "This experiment has ended." + "end": "This experiment has ended.", + "version": "v1.3.2" }, "prompt": { "continue": { diff --git a/src/timelines/main.js b/src/timelines/main.js index d5e4dfc..9ab6a5c 100644 --- a/src/timelines/main.js +++ b/src/timelines/main.js @@ -2,6 +2,7 @@ import buildCountdown from "../trials/countdown"; import preamble from "./preamble"; import experimentStart from "../trials/experimentStart"; import experimentEnd from "../trials/experimentEnd"; +import practiceAndMainBlockDivider from "../trials/practiceAndMainBlockDivider"; import taskBlock from "./taskBlock"; import showPayment from "../trials/showPayment"; import redirectToProlific from "../trials/redirectToProlific"; @@ -41,6 +42,7 @@ const inLabTimeline = [ recordNow(), postPracticeInstructions(), buildCountdown(lang.countdown.expt1, 3), + practiceAndMainBlockDivider(500), taskBlock(exptBlock1), showPayment(5000, exptBlock1), experimentEnd(5000), diff --git a/src/trials/experimentStart.js b/src/trials/experimentStart.js index 604e7c6..6c7ccc7 100644 --- a/src/trials/experimentStart.js +++ b/src/trials/experimentStart.js @@ -4,8 +4,7 @@ import { baseStimulus } from "../lib/markup/stimuli"; const experimentStart = () => { let stimulus = - baseStimulus(`

${lang.task.name}

`, true) + photodiodeGhostBox(); - + baseStimulus(`

${lang.task.name}
${lang.task.version}

`, true) + photodiodeGhostBox() return { type: "html_button_response", stimulus: stimulus, diff --git a/src/trials/practiceAndMainBlockDivider.js b/src/trials/practiceAndMainBlockDivider.js new file mode 100644 index 0000000..08f1bd5 --- /dev/null +++ b/src/trials/practiceAndMainBlockDivider.js @@ -0,0 +1,26 @@ +import { eventCodes } from "../config/main"; +import { jitter50, removeCursor } from "../lib/utils"; +import { pdSpotEncode } from "../lib/markup/photodiode"; +import { jsPsych } from "jspsych-react"; + +const practiceAndMainBlockDivider = (duration) => { + + const startCode = eventCodes.practiceAndMainBlockDivider; + + return { + type: "html_keyboard_response", + choices: jsPsych.NO_KEYS, + stimulus: '', + response_ends_trial: false, + trial_duration: jitter50(duration), + on_load: () => { + removeCursor("experiment"); + pdSpotEncode(startCode); + }, + on_finish: (data) => { + data.code = startCode; + }, + }; +}; + +export default practiceAndMainBlockDivider;