diff --git a/.github/workflows/build_at_home.yaml b/.github/workflows/build_at_home.yaml index 8ffc391..4feba71 100644 --- a/.github/workflows/build_at_home.yaml +++ b/.github/workflows/build_at_home.yaml @@ -3,8 +3,8 @@ name: Build at home version (Windows) on: pull_request: paths: - - 'src/**' - - '.github/workflows/main.yml' + - "src/**" + - ".github/workflows/main.yml" jobs: build: @@ -13,34 +13,34 @@ jobs: strategy: fail-fast: false steps: - # Set up js package - - uses: actions/checkout@v1 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Set package version and name - uses: brown-ccv/gh-actions/get-package-info@master - id: package_info + # Set up js package + - uses: actions/checkout@v1 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Set package version and name + uses: brown-ccv/gh-actions/get-package-info@main + id: package_info - # install, test, build package - - name: npm install - run: npm install - - name: npm build:win:home - run: npm run build - - name: npm test - run: npm test - env: - CI: true - REACT_APP_AT_HOME: true + # install, test, build package + - name: npm install + run: npm install + - name: npm build:win:home + run: npm run build + - name: npm test + run: npm test + env: + CI: true + REACT_APP_AT_HOME: true - # Build electron app package installers - - name: package electron - windows - run: npm run package:windows + # Build electron app package installers + - name: package electron - windows + run: npm run package:windows - # Upload installers to github action - - name: upload win-installer-home - uses: actions/upload-artifact@master - with: - name: win-installer-home - path: dist/installers/${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }}-setup.exe + # Upload installers to github action + - name: upload win-installer-home + uses: actions/upload-artifact@master + with: + name: win-installer-home + path: dist/installers/${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }}-setup.exe diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1fee00f..e9f8f74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: with: node-version: 12.x - name: Set package version and name - uses: brown-ccv/gh-actions/get-package-info@master + uses: brown-ccv/gh-actions/get-package-info@main id: package_info # install, test, build package diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 086cb85..157da11 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -22,7 +22,7 @@ jobs: with: node-version: 12.x - name: Set package version and name - uses: brown-ccv/gh-actions/get-package-info@master + uses: brown-ccv/gh-actions/get-package-info@main id: package_info # install, test, build package diff --git a/package-lock.json b/package-lock.json index 499a3b2..cbd3dfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "task-effort", - "version": "1.2.3-alpha", + "version": "1.3.0-beta", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3405,9 +3405,9 @@ } }, "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -3705,12 +3705,12 @@ } }, "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, "buffer-alloc": { @@ -11317,9 +11317,9 @@ "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "node-gyp": { "version": "3.8.0", @@ -14721,11 +14721,11 @@ "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=" }, "selfsigned": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", - "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.8.tgz", + "integrity": "sha512-2P4PtieJeEwVgTU9QEcwIRDQ/mXJLX8/+I3ur+Pg16nS8oNbrGxEso9NyYWy8NAmXiNl4dlAp5MwoNeCWzON4w==", "requires": { - "node-forge": "0.9.0" + "node-forge": "^0.10.0" } }, "semver": { diff --git a/package.json b/package.json index b00212c..1b49966 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "email": "wasita@brown.edu", "url": "https://lnccbrown.com" }, - "version": "1.3.0-beta", + "version": "1.3.1", "license": "MIT", "private": true, "main": "public/electron.js", diff --git a/src/trials/choice.js b/src/trials/choice.js index 3f85f45..5640441 100644 --- a/src/trials/choice.js +++ b/src/trials/choice.js @@ -19,7 +19,6 @@ const choice = (duration, blockSettings, opts) => { ``; const startCode = eventCodes.choiceStart; - const endCode = eventCodes.choiceEnd; duration = blockSettings.is_practice ? 5000000 : duration; // make practice choices have no timeout let probability = blockSettings.is_practice ? opts : opts.prob; @@ -195,8 +194,7 @@ const choice = (duration, blockSettings, opts) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/costBenefits.js b/src/trials/costBenefits.js index e06f928..4aef027 100644 --- a/src/trials/costBenefits.js +++ b/src/trials/costBenefits.js @@ -20,7 +20,6 @@ const costBenefits = (duration, blockSettings, opts, trialDetails) => { ``; const startCode = eventCodes.costBenefitsStart; - const endCode = eventCodes.costBenefitsEnd; let probability = blockSettings.is_practice ? opts : opts.prob; let value = blockSettings.is_practice ? blockSettings.value : opts.value; @@ -131,8 +130,7 @@ const costBenefits = (duration, blockSettings, opts, trialDetails) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/cumulativeReward.js b/src/trials/cumulativeReward.js index 38e859a..1b5091a 100644 --- a/src/trials/cumulativeReward.js +++ b/src/trials/cumulativeReward.js @@ -12,7 +12,6 @@ const cumulativeReward = ( trialDetails ) => { const startCode = eventCodes.cumulativeRewardsStart; - const endCode = eventCodes.cumulativeRewardsEnd; return { type: "call_function", @@ -55,8 +54,7 @@ const cumulativeReward = ( pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/fixation.js b/src/trials/fixation.js index a90295d..6ec1476 100644 --- a/src/trials/fixation.js +++ b/src/trials/fixation.js @@ -8,7 +8,6 @@ const fixation = (duration) => { let stimulus = fixationHTML + photodiodeGhostBox(); const startCode = eventCodes.fixationStart; - const endCode = eventCodes.fixationEnd; return { type: "html_keyboard_response", @@ -21,8 +20,7 @@ const fixation = (duration) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/frameSpike.js b/src/trials/frameSpike.js index 42ad315..3fd01ac 100644 --- a/src/trials/frameSpike.js +++ b/src/trials/frameSpike.js @@ -20,7 +20,6 @@ const frameSpike = (duration, blockSettings, opts, trialDetails) => { ``; const startCode = eventCodes.frameSpikeStart; - const endCode = eventCodes.frameSpikeEnd; let probability = blockSettings.is_practice ? opts : opts.prob; let effort = blockSettings.is_practice ? blockSettings.effort : opts.effort; @@ -111,8 +110,7 @@ const frameSpike = (duration, blockSettings, opts, trialDetails) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/pressBalloon.js b/src/trials/pressBalloon.js index 50683cd..6600f79 100644 --- a/src/trials/pressBalloon.js +++ b/src/trials/pressBalloon.js @@ -26,7 +26,6 @@ const pressBalloon = (duration, blockSettings, opts) => { let is_practice = blockSettings.is_practice; const startCode = eventCodes.pressBalloonStart; - const endCode = eventCodes.pressBalloonEnd; let probability = blockSettings.is_practice ? opts : opts.prob; let value = blockSettings.is_practice ? blockSettings.value : opts.value; @@ -395,8 +394,7 @@ const pressBalloon = (duration, blockSettings, opts) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/rewardFeedback.js b/src/trials/rewardFeedback.js index 7fa792e..c9cb428 100644 --- a/src/trials/rewardFeedback.js +++ b/src/trials/rewardFeedback.js @@ -6,7 +6,6 @@ import { addData } from "../lib/taskUtils"; const rewardFeedback = (duration, blockSettings, opts, trialDetails) => { const startCode = eventCodes.rewardFeedbackStart; - const endCode = eventCodes.rewardFeedbackEnd; return { type: "call_function", @@ -43,8 +42,7 @@ const rewardFeedback = (duration, blockSettings, opts, trialDetails) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/rewardProbability.js b/src/trials/rewardProbability.js index 2cb6c9a..bf35084 100644 --- a/src/trials/rewardProbability.js +++ b/src/trials/rewardProbability.js @@ -19,7 +19,6 @@ const rewardProbability = (duration, blockSettings, opts, trialDetails) => { ``; const startCode = eventCodes.rewardProbabilityStart; - const endCode = eventCodes.rewardProbabilityEnd; let probability = blockSettings.is_practice ? opts : opts.prob; @@ -59,8 +58,7 @@ const rewardProbability = (duration, blockSettings, opts, trialDetails) => { pdSpotEncode(startCode); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.encode = [startCode, endCode]; + data.code = startCode; }, }; }; diff --git a/src/trials/showPayment.js b/src/trials/showPayment.js index f9e46ec..8f4b2af 100644 --- a/src/trials/showPayment.js +++ b/src/trials/showPayment.js @@ -73,8 +73,7 @@ const showPayment = (duration, blockSettings) => { ) + photodiodeGhostBox(); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = [startCode, endCode]; + data.code = startCode; data.total_earnings = total_earnings; data.subtrial_type = "show_payment"; }, diff --git a/src/trials/trialEnd.js b/src/trials/trialEnd.js index 4eaa7fa..d716760 100644 --- a/src/trials/trialEnd.js +++ b/src/trials/trialEnd.js @@ -1,9 +1,9 @@ -import { eventCodes, IS_ELECTRON, AT_HOME } from "../config/main"; -import { photodiodeGhostBox, pdSpotEncode } from "../lib/markup/photodiode"; +import { IS_ELECTRON, AT_HOME } from "../config/main"; +import { photodiodeGhostBox } from "../lib/markup/photodiode"; import { removeCursor } from "../lib/utils"; const trialEnd = (duration) => { - const endCode = eventCodes.trialFinishEnd; + // const endCode = eventCodes.trialFinishEnd; return { type: "html_keyboard_response", stimulus: "", @@ -16,8 +16,8 @@ const trialEnd = (duration) => { if (IS_ELECTRON && !AT_HOME) trial.stimulus += photodiodeGhostBox(); }, on_finish: (data) => { - pdSpotEncode(endCode); - data.code = endCode; + // pdSpotEncode(endCode); + // data.code = endCode; }, }; };