-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #527 from brown-ccv/feat-v3.4.2
Feat v3.4.2
- Loading branch information
Showing
6 changed files
with
39 additions
and
27 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import callFunction from "@jspsych/plugin-call-function"; | ||
|
||
/** | ||
* Trial to execute the callback function passed in | ||
* | ||
* @param {function} func callback function to execute | ||
* @returns JS object as a trial | ||
*/ | ||
export function buildCallFunctionTrial(func) { | ||
return { | ||
type: callFunction, | ||
func: func, | ||
}; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
import htmlButtonResponse from "@jspsych/plugin-html-button-response"; | ||
|
||
import { config, LANGUAGE } from "../../config/main"; | ||
import { eventCodes } from "../../config/trigger"; | ||
import { pdSpotEncode, photodiodeGhostBox } from "../../lib/markup/photodiode"; | ||
import { div, h1, p } from "../../lib/markup/tags"; | ||
import { LANGUAGE } from "../../config/main"; | ||
import { h1 } from "../../lib/markup/tags"; | ||
import { photodiodeGhostBox } from "../../lib/markup/photodiode"; | ||
|
||
// TODO @brown-ccv #330: Custom extension for EEG - this is initializeTriggerBox | ||
// TODO @brown-ccv #330: Need to ping the serial part - this isn't doing anything yet | ||
// TODO @brown-ccv: Prevent user from pressing continue until pdSpotEncode finishes (need to use jsPsych.pluginAPI.setTimeout) | ||
export const holdUpMarkerTrial = { | ||
type: htmlButtonResponse, | ||
stimulus: function () { | ||
const eventMarkerMarkup = h1(LANGUAGE.trials.eventMarker.connected, { | ||
style: "color: green;", | ||
}); | ||
return div(eventMarkerMarkup); | ||
}, | ||
prompt: function () { | ||
let holdUpMarkerPrompt = p(LANGUAGE.trials.holdUpMarker); | ||
|
||
// Conditionally add the photodiodeGhostBox | ||
if (config.USE_PHOTODIODE) holdUpMarkerPrompt += photodiodeGhostBox; | ||
|
||
return holdUpMarkerPrompt; | ||
}, | ||
stimulus: | ||
h1(LANGUAGE.trials.holdUpMarker) + | ||
photodiodeGhostBox, | ||
choices: [LANGUAGE.prompts.continue.button], | ||
on_load: function () { | ||
// Conditionally flash the photodiode when the trial first loads | ||
if (config.USE_PHOTODIODE) pdSpotEncode(eventCodes.test_connect); | ||
}, | ||
}; |