Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mental rotation mental rotation instructions #199

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion task-launcher/src/tasks/mental-rotation/trials/instructions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import jsPsychAudioMultiResponse from '@jspsych-contrib/plugin-audio-multi-response';
import { mediaAssets } from '../../..';
// @ts-ignore
import { taskStore } from '../../shared/helpers';
import { taskStore, replayButtonSvg, PageStateHandler, setupReplayAudio } from '../../shared/helpers';

const replayButtonHtmlId = 'replay-btn-revisited';

// Switch to HTMLMultiResponse when we have video with audio
export const videoInstructionsFit = {
Expand All @@ -16,6 +18,9 @@ export const videoInstructionsFit = {
prompt: () => {
return `
<div class="lev-stimulus-container">
<button id="${replayButtonHtmlId}" class="replay">
${replayButtonSvg}
</button>
<video class="instruction-video" autoplay>
<source src=${mediaAssets.video.mentalRotationExampleFit} type="video/mp4"/>
Your browser does not support the video tag.
Expand All @@ -36,6 +41,10 @@ export const videoInstructionsFit = {
// const wrapper = document.getElementById('jspsych-audio-multi-response-prompt');
// wrapper.style.display = 'flex';
// wrapper.style.justifyContent = 'center';

const pageStateHandler = new PageStateHandler('mental-rotation-training-instruct3');
setupReplayAudio(pageStateHandler);

},
};

Expand All @@ -50,6 +59,9 @@ export const videoInstructionsMisfit = {
prompt: () => {
return `
<div class="lev-stimulus-container">
<button id="${replayButtonHtmlId}" class="replay">
${replayButtonSvg}
</button>
<video class="instruction-video" autoplay>
<source src=${mediaAssets.video.mentalRotationExampleMisfit} type="video/mp4"/>
Your browser does not support the video tag.
Expand All @@ -66,6 +78,10 @@ export const videoInstructionsMisfit = {
keyboard_choices: 'NO_KEYS',
trial_ends_after_audio: false,
response_allowed_while_playing: false,
on_load: () => {
const pageStateHandler = new PageStateHandler('mental-rotation-training-instruct2');
setupReplayAudio(pageStateHandler);
}
};

export const imageInstructions = {
Expand All @@ -79,6 +95,9 @@ export const imageInstructions = {
prompt: () => {
return `
<div class="lev-stimulus-container">
<button id="${replayButtonHtmlId}" class="replay">
${replayButtonSvg}
</button>
<img src=${mediaAssets.images.mentalRotationExample} class="instruction-video" />
</div>
`;
Expand All @@ -92,4 +111,8 @@ export const imageInstructions = {
keyboard_choices: 'NO_KEYS',
trial_ends_after_audio: false,
response_allowed_while_playing: false,
on_load: () => {
const pageStateHandler = new PageStateHandler('mental-rotation-instruct1');
setupReplayAudio(pageStateHandler);
}
};
Loading