Skip to content

Commit

Permalink
repeat instructions for matrix and mental rotation if 1st two answers…
Browse files Browse the repository at this point in the history
… are incorrect
  • Loading branch information
zwatson2001 committed Sep 27, 2024
1 parent fa747bf commit 926eb87
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions task-launcher/src/tasks/matrix-reasoning/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,18 @@ export default function buildMatrixTimeline(config: Record<string, any>, mediaAs
},
});

const repeatInstructions = {
timeline: instructions,
conditional_function: () => {
return taskStore().numIncorrect >= 2;
}
};

const numOfTrials = taskStore().totalTrials;
for (let i = 0; i < numOfTrials; i += 1) {
if(i === 4){
timeline.push(repeatInstructions);
}
timeline.push(setupStimulus);
timeline.push(stimulusBlock(trialConfig));
timeline.push(ifRealTrialResponse);
Expand Down
14 changes: 14 additions & 0 deletions task-launcher/src/tasks/mental-rotation/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ export default function buildMentalRotationTimeline(config: Record<string, any>,
layoutConfigMap,
};

const repeatInstructions = {
timeline: [
imageInstructions,
videoInstructionsMisfit,
videoInstructionsFit,
],
conditional_function: () => {
return taskStore().numIncorrect >= 2
}
}

const stimulusBlock = {
timeline: [
afcStimulusTemplate(trialConfig),
Expand All @@ -83,6 +94,9 @@ export default function buildMentalRotationTimeline(config: Record<string, any>,

const numOfTrials = taskStore().totalTrials;
for (let i = 0; i < numOfTrials; i++) {
if(i === 4){
timeline.push(repeatInstructions)
}
timeline.push(setupStimulus);
timeline.push(stimulusBlock);
}
Expand Down

0 comments on commit 926eb87

Please sign in to comment.