Open
Conversation
Turns out the triggers are tied specifically to public>electron.js. the code chunk called //TRIGGER PORT HELPERS
are where electron looks for EEG ports to enable triggers. It creates a pop-up if EEG is not connected. Commenting out
this code will remove this pop-up and stop triggers from happening:
// TRIGGER PORT HELPERS
// let triggerPort;
// let portAvailable;
// let SKIP_SENDING_DEV = false;
// const setUpPort = async () => {
// p = await getPort(activeComName);
// if (p) {
// triggerPort = p;
// portAvailable = true;
// triggerPort.on("error", (err) => {
// log.error(err);
// let buttons = ["OK", "Continue Anyway"];
// // if (process.env.ELECTRON_START_URL) {
// // buttons.push("Continue Anyway")
// // }
// dialog
// .showMessageBox(mainWindow, {
// type: "error",
// message: "Error communicating with event marker.",
// title: "Task Error",
// buttons: buttons,
// defaultId: 0,
// })
// .then((opt) => {
// if (opt.response == 0) {
// app.exit();
// } else {
// SKIP_SENDING_DEV = true;
// portAvailable = false;
// triggerPort = false;
// }
// });
// });
// } else {
// triggerPort = false;
// portAvailable = false;
// }
// };
In the interest of reducing any major changes to the code, I am leaving both files named trigger.js in the code.
They are useless now but I would rather keep them for reversibility.
DELETING ALL MENTION OF EEG WITHIN INSTRUCTIONS
Commented out RecordNow qihn src/timelines/main.js to circumvent any EEG prompts
This should encompass all of the EEG related changes.
SESSION NUMBER INCLUSION
Added text in src/language/en_us.json between "set" and ""get_prolific": "sessionNum": "Please enter the <i>Session #</i>. <br><span class='text-smoll'>(The file will automatically be named <i>Subject ID</i>_<i>Session</i>_Effort.)</span>",
Added chunk of code after line 59 in src/trials/userId.js
Added code in src/lib/utils.js
added a const within const getUserId
const sessionNum = JSON.parse(data.responses)["Q1"];
jsPsych.data.addProperties({ sessionNum: sessionNum, timestamp: Date.now() });
console.log("session", sessionNum);
Added code in public/electron.js
Added let sessionNum = ""
Added sessionNum = args.sessionNum;
changed line 205 to: fileName = `${patientID}_${sessionNum}_${Effort}.json`; from fileName = `${patientID}_${Effort}.json`;
changed line 303 to const copyPath = path.join(desktop, dataDir, `${patientID}_${sessionNum}_${Effort}`); from const copyPath = path.join(desktop, dataDir, `${patientID}_${Effort}`);
There should now be a prompt on the participant ID screen that asks for the
…tch 1.3.4.2 release
…e or two. Denying anything else. Added checkSess to the timeline removed baseStimulus from userID, reformatted userID prompts to show closely stacked instead of on seperate pages.
Commented out lines 14-20 and 272-274. These lines pertained to triggers and event codes. Given lines 102-186 were commented out, the pop-up for eeg connection would not appear, and the aforementioned code would fail, causing the package version of the task to be suspended as a background process in windows. Commentig out these lines solved the issue and the app will run as expected.
Commenting out lines 47 and 48 as they are no longer relevant for RT collection, streamlining the task slightly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.