Skip to content

Commit

Permalink
Merge pull request #139 from lnccbrown/fix-remove-offset-triggers
Browse files Browse the repository at this point in the history
fix: remove offset triggers
  • Loading branch information
wasita authored Nov 17, 2020
2 parents 670e7a4 + 6a6d96c commit 433aed1
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 80 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/build_at_home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"email": "[email protected]",
"url": "https://lnccbrown.com"
},
"version": "1.3.0-beta",
"version": "1.3.1",
"license": "MIT",
"private": true,
"main": "public/electron.js",
Expand Down
4 changes: 1 addition & 3 deletions src/trials/choice.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const choice = (duration, blockSettings, opts) => {
`</div>`;

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;
Expand Down Expand Up @@ -195,8 +194,7 @@ const choice = (duration, blockSettings, opts) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/costBenefits.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const costBenefits = (duration, blockSettings, opts, trialDetails) => {
`</div>`;

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;
Expand Down Expand Up @@ -131,8 +130,7 @@ const costBenefits = (duration, blockSettings, opts, trialDetails) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/cumulativeReward.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const cumulativeReward = (
trialDetails
) => {
const startCode = eventCodes.cumulativeRewardsStart;
const endCode = eventCodes.cumulativeRewardsEnd;

return {
type: "call_function",
Expand Down Expand Up @@ -55,8 +54,7 @@ const cumulativeReward = (
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/fixation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const fixation = (duration) => {
let stimulus = fixationHTML + photodiodeGhostBox();

const startCode = eventCodes.fixationStart;
const endCode = eventCodes.fixationEnd;

return {
type: "html_keyboard_response",
Expand All @@ -21,8 +20,7 @@ const fixation = (duration) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/frameSpike.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const frameSpike = (duration, blockSettings, opts, trialDetails) => {
`</div>`;

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;
Expand Down Expand Up @@ -111,8 +110,7 @@ const frameSpike = (duration, blockSettings, opts, trialDetails) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/pressBalloon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -395,8 +394,7 @@ const pressBalloon = (duration, blockSettings, opts) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/rewardFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -43,8 +42,7 @@ const rewardFeedback = (duration, blockSettings, opts, trialDetails) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.code = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
4 changes: 1 addition & 3 deletions src/trials/rewardProbability.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const rewardProbability = (duration, blockSettings, opts, trialDetails) => {
`</div>`;

const startCode = eventCodes.rewardProbabilityStart;
const endCode = eventCodes.rewardProbabilityEnd;

let probability = blockSettings.is_practice ? opts : opts.prob;

Expand Down Expand Up @@ -59,8 +58,7 @@ const rewardProbability = (duration, blockSettings, opts, trialDetails) => {
pdSpotEncode(startCode);
},
on_finish: (data) => {
pdSpotEncode(endCode);
data.encode = [startCode, endCode];
data.code = startCode;
},
};
};
Expand Down
3 changes: 1 addition & 2 deletions src/trials/showPayment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
},
Expand Down
10 changes: 5 additions & 5 deletions src/trials/trialEnd.js
Original file line number Diff line number Diff line change
@@ -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: "",
Expand All @@ -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;
},
};
};
Expand Down

0 comments on commit 433aed1

Please sign in to comment.