-
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 #388 from brown-ccv/ref-endBlock
ref: Add endBlock file and move trials into it
- Loading branch information
Showing
9 changed files
with
65 additions
and
44 deletions.
There are no files selected for viewing
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,29 @@ | ||
import { config } from "../config/main"; | ||
import { buildCameraEndTrial } from "../trials/camera"; | ||
import { conclusionTrial } from "../trials/conclusion"; | ||
import { exitFullscreenTrial } from "../trials/fullscreen"; | ||
|
||
/** | ||
* Builds the block of trials needed to end the experiment | ||
* 1) Trial used to complete the user's camera recording is displayed | ||
* 2) The experiment exits fullscreen | ||
* | ||
* @param {Object} jsPsych The jsPsych instance being used to run the task | ||
* @returns {Object} A jsPsych (nested) timeline object | ||
*/ | ||
function buildEndBlock(jsPsych) { | ||
const endBlock = []; | ||
|
||
// Conditionally add the camera breakdown trials | ||
if (config.USE_CAMERA) { | ||
endBlock.push(buildCameraEndTrial(jsPsych)); | ||
} | ||
|
||
// Add the other trials needed to end the experiment | ||
endBlock.push(exitFullscreenTrial, conclusionTrial); | ||
|
||
// Return the block as a nested timeline | ||
return { timeline: endBlock }; | ||
} | ||
|
||
export { buildEndBlock }; |
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 htmlKeyboardResponse from "@jspsych/plugin-html-keyboard-response"; | ||
|
||
import { LANGUAGE } from "../config/main"; | ||
import { h1 } from "../lib/markup/tags"; | ||
|
||
/** Trial that displays a completion message for 5 seconds */ | ||
const conclusionTrial = { | ||
type: htmlKeyboardResponse, | ||
stimulus: h1(LANGUAGE.trials.conclusion), | ||
choices: "NO_KEYS", | ||
trial_duration: 5000, | ||
}; | ||
|
||
export { conclusionTrial }; |
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