From 50556e01cf101ad18b86ff08b0ad86e22370172c Mon Sep 17 00:00:00 2001 From: wasita mahaphanit Date: Fri, 7 Aug 2020 17:37:00 -0400 Subject: [PATCH] fix: REMOVE qualtrics from inlab timeline; feat: better separate mturk & prolific timelines for online timelines; fix: reset triggers to 0/send 0; fix: add back in any questions? text for rules review accidentally left in the qualtrics() ugh --- src/lib/markup/photodiode.js | 7 +++- src/timelines/main.js | 69 +++++++++++++++++++++++------------- src/trials/quizTrials.js | 8 ++--- 3 files changed, 54 insertions(+), 30 deletions(-) diff --git a/src/lib/markup/photodiode.js b/src/lib/markup/photodiode.js index 00e7459..7248c0a 100644 --- a/src/lib/markup/photodiode.js +++ b/src/lib/markup/photodiode.js @@ -48,7 +48,12 @@ const pdSpotEncode = (taskCode) => { let numBlinks = taskCode; if (taskCode < eventCodes.open_task) numBlinks = 1; repeat_pulse_for(blinkTime, numBlinks); - if (ipcRenderer) ipcRenderer.send("trigger", taskCode); + if (ipcRenderer) { + ipcRenderer.send("trigger", taskCode); + setTimeout(function () { + ipcRenderer.send("trigger", 0); + }, 5); + } } }; diff --git a/src/timelines/main.js b/src/timelines/main.js index ba667a0..cf4c9a8 100644 --- a/src/timelines/main.js +++ b/src/timelines/main.js @@ -1,15 +1,14 @@ import buildCountdown from "../trials/countdown"; import preamble from "./preamble"; import experimentStart from "../trials/experimentStart"; -import qualtrics from "../trials/qualtrics"; import experimentEnd from "../trials/experimentEnd"; import taskBlock from "./taskBlock"; import showPayment from "../trials/showPayment"; -import redirectToProlific from "../trials/redirectToProlific"; +// import redirectToProlific from "../trials/redirectToProlific"; import userId from "../trials/userId"; import relaxReminder from "../trials/relaxReminder"; import recordNow from "../trials/recordNow"; -import { ONLINE, lang } from "../config/main"; +import { ONLINE, lang, MTURK } from "../config/main"; import { practiceBlock1, practiceBlock2, @@ -43,31 +42,51 @@ const inLabTimeline = [ postPracticeInstructions(), buildCountdown(lang.countdown.expt1, 3), taskBlock(exptBlock1), - qualtrics(), showPayment(5000, exptBlock1), experimentEnd(5000), ]; -const onlineTimeline = [ - experimentStart(), - userId(), - preamble, - bluePracticeInstructions(), - buildCountdown(lang.countdown.practice1, 3), - taskBlock(practiceBlock1), - greenPracticeInstructions(), - buildCountdown(lang.countdown.practice2, 3), - taskBlock(practiceBlock2), - realPracticeInstructions(), - buildCountdown(lang.countdown.practice3, 3), - taskBlock(practiceBlock3), - quizTimeline(practiceBlock3), - postPracticeInstructions(), - buildCountdown(lang.countdown.expt1, 3), - taskBlock(exptBlock1), - showPayment(5000, exptBlock1), - buildCountdown(lang.countdown.redirect_to_prolific, 5), - redirectToProlific(lang.prolific.completion_code_url, 250), -]; +const onlineTimeline = MTURK + ? [ + experimentStart(), + userId(), + preamble, + bluePracticeInstructions(), + buildCountdown(lang.countdown.practice1, 3), + taskBlock(practiceBlock1), + greenPracticeInstructions(), + buildCountdown(lang.countdown.practice2, 3), + taskBlock(practiceBlock2), + realPracticeInstructions(), + buildCountdown(lang.countdown.practice3, 3), + taskBlock(practiceBlock3), + quizTimeline(practiceBlock3), + postPracticeInstructions(), + buildCountdown(lang.countdown.expt1, 3), + taskBlock(exptBlock1), + showPayment(5000, exptBlock1), + experimentEnd(2000), + ] + : // PROLIFIC VERSION OF THE TASK BELOW: + [ + experimentStart(), + userId(), + preamble, + bluePracticeInstructions(), + buildCountdown(lang.countdown.practice1, 3), + taskBlock(practiceBlock1), + greenPracticeInstructions(), + buildCountdown(lang.countdown.practice2, 3), + taskBlock(practiceBlock2), + realPracticeInstructions(), + buildCountdown(lang.countdown.practice3, 3), + taskBlock(practiceBlock3), + quizTimeline(practiceBlock3), + postPracticeInstructions(), + buildCountdown(lang.countdown.expt1, 3), + taskBlock(exptBlock1), + showPayment(5000, exptBlock1), + buildCountdown(lang.countdown.redirect_to_prolific, 5), + ]; export const tl = ONLINE ? onlineTimeline : inLabTimeline; diff --git a/src/trials/quizTrials.js b/src/trials/quizTrials.js index 89893c3..e2bb9e4 100644 --- a/src/trials/quizTrials.js +++ b/src/trials/quizTrials.js @@ -35,7 +35,7 @@ const quizRules = [ `${lang.quiz.rules.green_vary_bonus}`, `${lang.quiz.rules.twenty_five_secs_green}`, `${lang.quiz.rules.bonus_green_spike}`, - // `${lang.quiz.any_questions}`, + `${lang.quiz.any_questions}`, `${lang.quiz.retake}`, ]; @@ -131,9 +131,9 @@ const reshowRules = (blockSettings) => { "

" + quizRules[6] + "

" + - quizRules[7], - // "

" + - // quizRules[8], + quizRules[7] + + "

" + + quizRules[8], ]; return {