Methods
checkBrowser() → (nullable) {trial}
Creates a trial to check if the subject is using one of the listed browsers, otherwise lets them know what browser
to use.
Usable browsers include:
-Chrome
-Firefox
-Edge Chromium
Returns:
A trial that checks for correct browser. !TODO
- Type
- trial
createAllSlides(slides_content) → {timeline}
Creates a jsPsychHtmlKeyboardResponse containing the content of each slide as stimulus for every slide.
Should be used to access the contained trials, not as a timeline on its own.
Parameters:
Name | Type | Description |
---|---|---|
slides_content |
Object.<key, string> | A mapping of slide names to html content. |
Returns:
A timeline containing multiple jsPsychHtmlKeyboardResponse objects.
- Type
- timeline
createCameraCalibration() → {timeline}
Creates a timeline containing the cameraCalibration trial.
Displays instructions for camera calibration.
Returns:
A timeline containing the cameraCalibration trial.
- Type
- timeline
createCloseUnity() → {timeline}
Creates a timeline containing the closeUnity trial.
Closes the Unity application.
Returns:
A timeline containing the closeUnity trial.
- Type
- timeline
createConsentAndUpload() → {timeline}
Creates a timeline to ask for consent and upload recorded video data.
The subject is asked for consent to upload the collected video data using jsPsychHtmlButtonResponse.
If they agree the data upload is defined using a jsPsychNextcloudFiledropPlugin.
If they decline, displays a jsPsychSurveyText block.
Returns:
A consent and upload timeline.
- Type
- timeline
createConsentBeforeCameraInit() → {timeline}
Creates a timeline containing the consentBeforeCameraInit trial.
Displays the consent_before_camera slide as a jsPsychHtmlButtonResponse
Returns:
A timeline containing the consentBeforeCameraInit trial.
- Type
- timeline
createCountDown() → {timeline}
Creates a timeline containing the countDown trial.
Displays a sequence of slides one after another, waiting a set amount of time between each slide.
Returns:
A timeline containing the countDown trial.
- Type
- timeline
createDebug_condition() → {timeline}
?
Returns:
A timeline containing a single debug helper trial.
- Type
- timeline
createEnterFullscreen() → {timeline}
Creates a timeline containing the enterFullscreen trial.
Enters fullscreen mode on a page.
Returns:
A timeline containing the enterFullscreen trial.
- Type
- timeline
createExitFullscreen() → {timeline}
Creates a timeline containing the exitFullscreen trial.
Exits fullscreen mode on a page.
Returns:
A timeline containing the exitFullscreen trial.
- Type
- timeline
createGeneralInstructions() → {timeline}
Creates a timeline containing the generalInstructions trial.
Displays a sequence of slides containing general instructions. The subject has to manually continue by pressing arrowright.
Returns:
A timeline containing the generalInstructions trial.
- Type
- timeline
createInitCamera() → {timeline}
Creates a timeline containing the initCamera trial.
Initializes the subjects camera.
Returns:
A timeline containing the initCamera trial.
- Type
- timeline
createInstruction_if_node() → {timeline}
Creates an instruction_if_node trial that contains a timeline based on what the subject pressed in the previous trial.
If the subject pressed arrowright, no timeline element is returned.
If the subject pressed arrowleft, the mainInstructions timeline (except for the first element) is returned.
Returns:
A timeline containing either a trial or nothing.
- Type
- timeline
createMOOTPhaseStartInstruction() → {timeline}
Creates a timeline containing the MOOTPhaseStartInstruction trial.
Displays a slide containing instructions about the moot phase and removes prompts and choices from it.
Returns:
A timeline containing the MOOTPhaseStartInstruction trial.
- Type
- timeline
createMainInstructions() → {timeline}
Creates a timeline containing the mainInstructions trial.
Displays a sequence of slides containing the main instructions. The subject has to manually continue by pressing arrowright.
Returns:
A timeline containing the mainInstructions trial.
- Type
- timeline
createMootTimeline() → {timeline}
Creates a random combination of moot and mimicry blocks.
This is for the main part of the experiment.
Returns:
A timeline containing 16 randomized moot blocks, followed by mimicry blocks.
- Type
- timeline
createPracticeInstruction() → {timeline}
Creates a timeline containing the practiceInstruction trial.
Displays a slide with a prompt.
Returns:
A timeline containing the practiceInstruction trial.
- Type
- timeline
createPracticePhaseEndInstruction() → {timeline}
Creates a timeline containing the practicePhaseEndInstruction trial.
Displays a slide containing instructions to be displayed after the practice phase and removes prompts and choices from it.
Returns:
A timeline containing the practicePhaseEndInstruction trial.
- Type
- timeline
createPracticePhaseStartInstruction() → {timeline}
Creates a timeline containing the practicePhaseStartInstruction trial.
Disaplys a slide containing start instructions for the practice phase and removes prompts and choices from it.
Returns:
A timeline containing the practicePhaseStartInstruction trial.
- Type
- timeline
createPracticeTimeline() → {timeline}
Creates a jsPsych trial for a practice moot block similar to the original experiment.
Returns:
A practice moot trial
- Type
- timeline
createPreloadMedia() → {timeline}
Creates a timeline containing the preloadMedia trial.
Preloads all existing media to avoid loading times during the experiment.
Returns:
A timeline containing the preloadMedia trial.
- Type
- timeline
createQuestionsAgencyOwnership() → {timeline}
Creates a timeline containing questions as jsPsychHtmlSliderResponses.
Displays questions from allSlides with a slider for response.
Returns:
A timeline containing multiple jsPsychHtmlSliderResponse trials.
- Type
- timeline
createQuestionsIOS() → {timeline}
Creates a timeline containing questions as jsPsychHtmlSliderResponses.
Displays questions from allSlides with a slider for response. Same as createQuestionsAgencyOwnership but with different sliders.
Returns:
A timeline containing a questionnaire instructions prompt and multiple jsPsychHtmlSliderResponse trials.
- Type
- timeline
createRepeatInstructionChoiceFirst() → {timeline}
Creates a timeline containing repeatInstructionChoiceFirst trial.
Displays a slide and prompts the subject to press left or right.
Returns:
A timeline containing repeatInstructionChoiceFirst trial.
- Type
- timeline
createRepeatInstructionChoiceSecond() → {timeline}
Creates a timeline containing repeatInstructionChoiceSecond trial.
Same as createRepeatInstructionChoiceFirst but displays a different slide.
Returns:
A timeline containing repeatInstructionChoiceSecond trial.
- Type
- timeline
createStartConsent() → {timeline}
Creates a timeline containing the startConsent trial.
Displays the start_consent slide as a jsPsychHtmlButtonResponse
Returns:
A timeline containing the startConsent trial.
- Type
- timeline
createSummaryInstruction() → {timeline}
Creates a timeline containing the summaryInstruction trial.
Disaplys a slide containing a summary of the instructions and a prompt.
Returns:
A timeline containing the summaryInstruction trial.
- Type
- timeline
createThankYou(link) → {timeline}
Creates a timeline containing the thankYou trial.
Displays a "Thank you" message as a jsPsychHtmlKeyboardResponse and returns the subject to the prolific website
with the given link.
Parameters:
Name | Type | Description |
---|---|---|
link |
String | The prolific link the subject should return to after the experiment. Can be found on the prolific website |
Returns:
A timeline containing the thankYou trial.
- Type
- timeline
createUsabilityQuestionnaire() → {timeline}
Creates a slice of elements from allSlides containing usabilityQuestions.
Like allSlides this should be used to access the contained trials and should not be used as a timeline on its own.
Returns:
A timeline containing a slice of trials from allSlides.
- Type
- timeline
createUsabilityQuestionnaireExtend() → {timeline}
Creates a timeline for usabilityQuestionnaireExtend containing multiple questionnaire slides
as jsPsychHtmlSliderResponses.
Displays questions from usabilityQuestionnairePlus with a slider for response.
Returns:
A timeline containing multiple usabilityQuestionnaire trials.
- Type
- timeline
createUsabilityQuestionnaireLatency() → {timeline}
Creates a timeline containing the usabilityQuestionnaireLatency trial.
Displays a slide with a slider for response
Returns:
A timeline containing the usabilityQuestionnaireLatency trial.
- Type
- timeline
createUsabilityQuestionnairePlus() → {timeline}
Creates a slice of elements from allSlides containing usabilityQuestionsPlus.
Like allSlides this should be used to access the contained trials and should not be used as a timeline on its own.
Returns:
A slice of trials from allSlides.
- Type
- timeline
createUsabilityQuestionnaireTextBox() → {timeline}
Creates a timeline containing two usabilityQuestionnaireTextBoxes as jsPsychSurveyTexts.
Displays a questionnaire prompt out of usabilityQuestionnairePlus with a free response text field.
Returns:
A timeline containing two usabilityQuestionnaire trials.
- Type
- timeline
createUsabilityQuestions() → {timeline}
Creates a timeline containing usability questions from usabilityQuestionnaire as usabilityQuestionnaires.
Displays questions with a slider for response. Also replaces stimulus to fit the experiment
based on doppelgaenger color.
Returns:
A timeline containing a prompt for usability instructions and the multiple jsPsychHtmlSliderResponse trials.
- Type
- timeline
createWarmupTimeline() → {timeline}
Creates a warmup timeline to get the subject to be more comfortable showing expressions.
The timeline consists of multiple jsPsychHtmlKeyboardResponse trials which show a stimulus and then prompt the
subject to press ArrowRight to continue.
Returns:
A warmup timeline.
- Type
- timeline
practiceFeedBack() → {timeline}
Creates a jsPsych timeline for subjects to practice the instructions.
This timeline includes the following trials:
-comboPracticeTrial
-cumulativeResponsePercentage
IF comboPracticeTrial FAILED : -another comboPracticeTrial
-secondFeedback
Returns:
A jsPsych timeline containing the mentioned trials
- Type
- timeline
prepare_html(slides_names, replacements) → {Object.<key, string>}
Gets the html content of the given file paths and performs replacements for given strings.
Parameters:
Name | Type | Description |
---|---|---|
slides_names |
Object.<key, string> | A mapping of slides to html file paths. |
replacements |
Object.<string, string> | Strings to be replaced in all html content and their replacements. |
Returns:
A mapping of slide names to html content.
- Type
- Object.<key, string>
shuffleArray(array) → {Array}
Shuffles an array using a random number generator.
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | The array to be shuffled. |
Returns:
Returns shuffled array.
- Type
- Array