Commit f9fac340 authored by HSINYUAN CHEN's avatar HSINYUAN CHEN

_

parent 3c8abc96
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.8),
on Mon Dec 7 17:06:28 2020
on Mon Dec 7 21:09:48 2020
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019)
......@@ -51,7 +51,7 @@ filename = _thisDir + os.sep + u'data' + os.sep + '%s_%s' % (expInfo['participan
# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
extraInfo=expInfo, runtimeInfo=None,
originPath='/Users/thomaschen/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/IncorrectStopEXP_lastrun.py',
originPath='/Users/chenhsinyuan/Documents/EXP/OLEXP/PsychopyTPL/RepeatIncorrectTPL/IncorrectStopEXP_lastrun.py',
savePickle=True, saveWideText=True,
dataFileName=filename)
# save a log file for detail verbose info
......
trials2.thisRepN,trials2.thisTrialN,trials2.thisN,trials2.thisIndex,trials1.thisRepN,trials1.thisTrialN,trials1.thisN,trials1.thisIndex,text,letterColor,corrAns,congruent,instrText.started,instrText.stopped,session,participant,date,expName,psychopyVersion,frameRate,
,,,,,,,,,,,,19.388234661997558,None,,,,,,,
1.1312 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
1.1314 WARNING Requested audio device 'DisplayPort' that is not available on this hardware. The 'audioDevice' preference should be one of ['Screenflick Loopback']
13.9498 WARNING User requested fullscreen with size [2560 1440], but screen is actually [1440, 900]. Using actual size
16.3558 WARNING Couldn't measure a consistent frame rate.
- Is your graphics card set to sync to vertical blank?
- Are you running other processes on your computer?
16.6751 WARNING t of last frame was 23.12ms (=1/43)
16.7414 WARNING t of last frame was 20.56ms (=1/48)
16.7743 WARNING t of last frame was 21.15ms (=1/47)
16.8741 WARNING t of last frame was 20.02ms (=1/49)
16.9247 WARNING Multiple dropped frames have occurred - I'll stop bothering you about them!
18.1920 WARNING Couldn't measure a consistent frame rate.
- Is your graphics card set to sync to vertical blank?
- Are you running other processes on your computer?
text,letterColor,corrAns,congruent,trials2.thisRepN,trials2.thisTrialN,trials2.thisN,trials2.thisIndex,trials1.thisRepN,trials1.thisTrialN,trials1.thisN,trials1.thisIndex,instrText.started,instrText.stopped,word.started,word.stopped,resp.keys,resp.corr,resp.rt,resp.started,resp.stopped,thanksText.started,thanksText.stopped,session,participant,date,expName,psychopyVersion,frameRate,
blue,blue,right,1,0,0,0,0,0,0,0,4,42.632160864999605,None,64.73822622399894,None,right,1,3.3784859379993577,64.73822622399894,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
green,blue,right,0,0,0,0,0,0,1,1,3,,,68.64856464200057,None,down,0,3.343980620000366,68.64856464200057,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
blue,red,left,0,0,0,0,0,0,2,2,5,,,72.5078614539998,None,left,1,6.578415218998998,72.5078614539998,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
green,green,down,1,0,0,0,0,0,3,3,2,,,79.61089517100118,None,down,1,3.050961491000635,79.61089517100118,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
red,green,down,0,0,0,0,0,0,4,4,1,,,83.17061787800048,None,down,1,3.5350086860016745,83.17061787800048,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
red,red,left,1,0,0,0,0,0,5,5,0,,,87.21573450600044,None,left,1,2.7654890140001953,87.21573450600044,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
,,,,0,0,0,0,,,,,,,,,,,,,,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
blue,blue,right,1,1,0,1,0,0,0,0,4,90.06478542200057,None,100.48425634600062,None,right,1,3.424523257999681,100.48425634600062,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
green,blue,right,0,1,0,1,0,0,1,1,3,,,104.42526654099856,None,right,1,2.012969627001439,104.42526654099856,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
red,green,down,0,1,0,1,0,0,2,2,1,,,106.95445438200113,None,down,1,2.342806387001474,106.95445438200113,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
blue,red,left,0,1,0,1,0,0,3,3,5,,,109.80815282500043,None,left,1,2.1222408499997982,109.80815282500043,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
red,red,left,1,1,0,1,0,0,4,4,0,,,112.43187545800174,None,left,1,2.3590844759964966,112.43187545800174,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
green,green,down,1,1,0,1,0,0,5,5,2,,,115.2900041799985,None,down,1,1.6545379970011709,115.2900041799985,None,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
,,,,1,0,1,0,,,,,,,,,,,,,,,,01,,2020_Dec_07_2110,IncorrectStopEXP,2020.2.8,None,
,,,,,,,,,,,,,,,,,,,,,117.07827647700105,None,,,,,,,
1.3922 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
1.3925 WARNING Requested audio device 'DisplayPort' that is not available on this hardware. The 'audioDevice' preference should be one of ['Screenflick Loopback']
37.1253 WARNING User requested fullscreen with size [2560 1440], but screen is actually [1440, 900]. Using actual size
39.6555 WARNING Couldn't measure a consistent frame rate.
- Is your graphics card set to sync to vertical blank?
- Are you running other processes on your computer?
40.0098 WARNING t of last frame was 20.30ms (=1/49)
40.3613 WARNING t of last frame was 20.92ms (=1/47)
40.4275 WARNING t of last frame was 20.95ms (=1/47)
40.4595 WARNING t of last frame was 20.06ms (=1/49)
40.5281 WARNING Multiple dropped frames have occurred - I'll stop bothering you about them!
41.4946 WARNING Couldn't measure a consistent frame rate.
- Is your graphics card set to sync to vertical blank?
- Are you running other processes on your computer?
......@@ -19,7 +19,6 @@ psychoJS.openWindow({
let expName = 'IncorrectStopEXP'; // from the Builder filename that created this script
let expInfo = {'session': '01', 'participant': ''};
// Start code blocks for 'Before Experiment'
// schedule the experiment:
psychoJS.schedule(psychoJS.gui.DlgFromDict({
dictionary: expInfo,
......@@ -50,14 +49,12 @@ psychoJS.start({
expInfo: expInfo,
});
psychoJS.experimentLogger.setLevel(core.Logger.ServerLevel.WARNING);
var frameDur;
function updateInfo() {
expInfo['date'] = util.MonotonicClock.getDateStr(); // add a simple timestamp
expInfo['expName'] = expName;
expInfo['psychopyVersion'] = '2020.2.8';
expInfo['psychopyVersion'] = '2020.1.3';
expInfo['OS'] = window.navigator.platform;
// store frame rate of monitor if we can measure it successfully
......@@ -138,7 +135,7 @@ function experimentInit() {
var trials2;
var currentLoop;
function trials2LoopBegin(trials2LoopScheduler) {
function trials2LoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trials2 = new TrialHandler({
psychoJS: psychoJS,
......@@ -154,15 +151,15 @@ function trials2LoopBegin(trials2LoopScheduler) {
trials2.forEach(function() {
const snapshot = trials2.getSnapshot();
trials2LoopScheduler.add(importConditions(snapshot));
trials2LoopScheduler.add(instructRoutineBegin(snapshot));
trials2LoopScheduler.add(instructRoutineEachFrame(snapshot));
trials2LoopScheduler.add(instructRoutineEnd(snapshot));
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(instructRoutineBegin(snapshot));
thisScheduler.add(instructRoutineEachFrame(snapshot));
thisScheduler.add(instructRoutineEnd(snapshot));
const trials1LoopScheduler = new Scheduler(psychoJS);
trials2LoopScheduler.add(trials1LoopBegin, trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopEnd);
trials2LoopScheduler.add(endLoopIteration(trials2LoopScheduler, snapshot));
thisScheduler.add(trials1LoopBegin, trials1LoopScheduler);
thisScheduler.add(trials1LoopScheduler);
thisScheduler.add(trials1LoopEnd);
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
});
return Scheduler.Event.NEXT;
......@@ -170,7 +167,7 @@ function trials2LoopBegin(trials2LoopScheduler) {
var trials1;
function trials1LoopBegin(trials1LoopScheduler) {
function trials1LoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trials1 = new TrialHandler({
psychoJS: psychoJS,
......@@ -186,11 +183,11 @@ function trials1LoopBegin(trials1LoopScheduler) {
trials1.forEach(function() {
const snapshot = trials1.getSnapshot();
trials1LoopScheduler.add(importConditions(snapshot));
trials1LoopScheduler.add(trialRoutineBegin(snapshot));
trials1LoopScheduler.add(trialRoutineEachFrame(snapshot));
trials1LoopScheduler.add(trialRoutineEnd(snapshot));
trials1LoopScheduler.add(endLoopIteration(trials1LoopScheduler, snapshot));
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(trialRoutineBegin(snapshot));
thisScheduler.add(trialRoutineEachFrame(snapshot));
thisScheduler.add(trialRoutineEnd(snapshot));
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
});
return Scheduler.Event.NEXT;
......@@ -215,7 +212,7 @@ var t;
var frameN;
var _ready_allKeys;
var instructComponents;
function instructRoutineBegin(snapshot) {
function instructRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'instruct'-------
t = 0;
......@@ -234,16 +231,14 @@ function instructRoutineBegin(snapshot) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
return Scheduler.Event.NEXT;
};
}
var continueRoutine;
function instructRoutineEachFrame(snapshot) {
function instructRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'instruct'-------
let continueRoutine = true; // until we're told otherwise
......@@ -312,7 +307,7 @@ function instructRoutineEachFrame(snapshot) {
}
function instructRoutineEnd(snapshot) {
function instructRoutineEnd(trials) {
return function () {
//------Ending Routine 'instruct'-------
instructComponents.forEach( function(thisComponent) {
......@@ -331,7 +326,7 @@ function instructRoutineEnd(snapshot) {
var _resp_allKeys;
var number_correct;
var trialComponents;
function trialRoutineBegin(snapshot) {
function trialRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'trial'-------
t = 0;
......@@ -356,15 +351,13 @@ function trialRoutineBegin(snapshot) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
return Scheduler.Event.NEXT;
};
}
function trialRoutineEachFrame(snapshot) {
function trialRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'trial'-------
let continueRoutine = true; // until we're told otherwise
......@@ -439,7 +432,7 @@ function trialRoutineEachFrame(snapshot) {
}
function trialRoutineEnd(snapshot) {
function trialRoutineEnd(trials) {
return function () {
//------Ending Routine 'trial'-------
trialComponents.forEach( function(thisComponent) {
......@@ -490,7 +483,7 @@ function trialRoutineEnd(snapshot) {
var thanksComponents;
function thanksRoutineBegin(snapshot) {
function thanksRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'thanks'-------
t = 0;
......@@ -506,16 +499,14 @@ function thanksRoutineBegin(snapshot) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
return Scheduler.Event.NEXT;
};
}
var frameRemains;
function thanksRoutineEachFrame(snapshot) {
function thanksRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'thanks'-------
let continueRoutine = true; // until we're told otherwise
......@@ -534,7 +525,7 @@ function thanksRoutineEachFrame(snapshot) {
}
frameRemains = 0.0 + 2.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if ((thanksText.status === PsychoJS.Status.STARTED || thanksText.status === PsychoJS.Status.FINISHED) && t >= frameRemains) {
if (thanksText.status === PsychoJS.Status.STARTED && t >= frameRemains) {
thanksText.setAutoDraw(false);
}
// check for quit (typically the Esc key)
......@@ -564,7 +555,7 @@ function thanksRoutineEachFrame(snapshot) {
}
function thanksRoutineEnd(snapshot) {
function thanksRoutineEnd(trials) {
return function () {
//------Ending Routine 'thanks'-------
thanksComponents.forEach( function(thisComponent) {
......@@ -577,21 +568,21 @@ function thanksRoutineEnd(snapshot) {
}
function endLoopIteration(scheduler, snapshot) {
function endLoopIteration(thisScheduler, loop) {
// ------Prepare for next entry------
return function () {
if (typeof snapshot !== 'undefined') {
if (typeof loop !== 'undefined') {
// ------Check if user ended loop early------
if (snapshot.finished) {
if (loop.finished) {
// Check for and save orphaned data
if (psychoJS.experiment.isEntryEmpty()) {
psychoJS.experiment.nextEntry(snapshot);
psychoJS.experiment.nextEntry(loop);
}
scheduler.stop();
thisScheduler.stop();
} else {
const thisTrial = snapshot.getCurrentTrial();
const thisTrial = loop.getCurrentTrial();
if (typeof thisTrial === 'undefined' || !('isTrials' in thisTrial) || thisTrial.isTrials) {
psychoJS.experiment.nextEntry(snapshot);
psychoJS.experiment.nextEntry(loop);
}
}
return Scheduler.Event.NEXT;
......@@ -600,9 +591,9 @@ function endLoopIteration(scheduler, snapshot) {
}
function importConditions(currentLoop) {
function importConditions(trials) {
return function () {
psychoJS.importAttributes(currentLoop.getCurrentTrial());
psychoJS.importAttributes(trials.getCurrentTrial());
return Scheduler.Event.NEXT;
};
}
......
......@@ -2,16 +2,13 @@
* Incorrectstopexp Test *
*************************/
import { PsychoJS } from './lib/core-2020.2.js';
import * as core from './lib/core-2020.2.js';
import { TrialHandler } from './lib/data-2020.2.js';
import { Scheduler } from './lib/util-2020.2.js';
import * as visual from './lib/visual-2020.2.js';
import * as sound from './lib/sound-2020.2.js';
import * as util from './lib/util-2020.2.js';
//some handy aliases as in the psychopy scripts;
const { abs, sin, cos, PI: pi, sqrt } = Math;
const { round } = util;
import { PsychoJS } from './lib/core-2020.1.js';
import * as core from './lib/core-2020.1.js';
import { TrialHandler } from './lib/data-2020.1.js';
import { Scheduler } from './lib/util-2020.1.js';
import * as util from './lib/util-2020.1.js';
import * as visual from './lib/visual-2020.1.js';
import * as sound from './lib/sound-2020.1.js';
// init psychoJS:
const psychoJS = new PsychoJS({
......@@ -30,7 +27,6 @@ psychoJS.openWindow({
let expName = 'IncorrectStopEXP'; // from the Builder filename that created this script
let expInfo = {'session': '01', 'participant': ''};
// Start code blocks for 'Before Experiment'
// schedule the experiment:
psychoJS.schedule(psychoJS.gui.DlgFromDict({
dictionary: expInfo,
......@@ -61,14 +57,12 @@ psychoJS.start({
expInfo: expInfo,
});
psychoJS.experimentLogger.setLevel(core.Logger.ServerLevel.WARNING);
var frameDur;
function updateInfo() {
expInfo['date'] = util.MonotonicClock.getDateStr(); // add a simple timestamp
expInfo['expName'] = expName;
expInfo['psychopyVersion'] = '2020.2.8';
expInfo['psychopyVersion'] = '2020.1.3';
expInfo['OS'] = window.navigator.platform;
// store frame rate of monitor if we can measure it successfully
......@@ -149,7 +143,7 @@ function experimentInit() {
var trials2;
var currentLoop;
function trials2LoopBegin(trials2LoopScheduler) {
function trials2LoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trials2 = new TrialHandler({
psychoJS: psychoJS,
......@@ -164,15 +158,15 @@ function trials2LoopBegin(trials2LoopScheduler) {
// Schedule all the trials in the trialList:
for (const thisTrials2 of trials2) {
const snapshot = trials2.getSnapshot();
trials2LoopScheduler.add(importConditions(snapshot));
trials2LoopScheduler.add(instructRoutineBegin(snapshot));
trials2LoopScheduler.add(instructRoutineEachFrame(snapshot));
trials2LoopScheduler.add(instructRoutineEnd(snapshot));
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(instructRoutineBegin(snapshot));
thisScheduler.add(instructRoutineEachFrame(snapshot));
thisScheduler.add(instructRoutineEnd(snapshot));
const trials1LoopScheduler = new Scheduler(psychoJS);
trials2LoopScheduler.add(trials1LoopBegin, trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopScheduler);
trials2LoopScheduler.add(trials1LoopEnd);
trials2LoopScheduler.add(endLoopIteration(trials2LoopScheduler, snapshot));
thisScheduler.add(trials1LoopBegin, trials1LoopScheduler);
thisScheduler.add(trials1LoopScheduler);
thisScheduler.add(trials1LoopEnd);
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
}
return Scheduler.Event.NEXT;
......@@ -180,7 +174,7 @@ function trials2LoopBegin(trials2LoopScheduler) {
var trials1;
function trials1LoopBegin(trials1LoopScheduler) {
function trials1LoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trials1 = new TrialHandler({
psychoJS: psychoJS,
......@@ -195,11 +189,11 @@ function trials1LoopBegin(trials1LoopScheduler) {
// Schedule all the trials in the trialList:
for (const thisTrials1 of trials1) {
const snapshot = trials1.getSnapshot();
trials1LoopScheduler.add(importConditions(snapshot));
trials1LoopScheduler.add(trialRoutineBegin(snapshot));
trials1LoopScheduler.add(trialRoutineEachFrame(snapshot));
trials1LoopScheduler.add(trialRoutineEnd(snapshot));
trials1LoopScheduler.add(endLoopIteration(trials1LoopScheduler, snapshot));
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(trialRoutineBegin(snapshot));
thisScheduler.add(trialRoutineEachFrame(snapshot));
thisScheduler.add(trialRoutineEnd(snapshot));
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
}
return Scheduler.Event.NEXT;
......@@ -224,7 +218,7 @@ var t;
var frameN;
var _ready_allKeys;
var instructComponents;
function instructRoutineBegin(snapshot) {
function instructRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'instruct'-------
t = 0;
......@@ -242,16 +236,14 @@ function instructRoutineBegin(snapshot) {
for (const thisComponent of instructComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
return Scheduler.Event.NEXT;
};
}
var continueRoutine;
function instructRoutineEachFrame(snapshot) {
function instructRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'instruct'-------
let continueRoutine = true; // until we're told otherwise
......@@ -320,7 +312,7 @@ function instructRoutineEachFrame(snapshot) {
}
function instructRoutineEnd(snapshot) {
function instructRoutineEnd(trials) {
return function () {
//------Ending Routine 'instruct'-------
for (const thisComponent of instructComponents) {
......@@ -339,7 +331,7 @@ function instructRoutineEnd(snapshot) {
var _resp_allKeys;
var number_correct;
var trialComponents;
function trialRoutineBegin(snapshot) {
function trialRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'trial'-------
t = 0;
......@@ -363,15 +355,13 @@ function trialRoutineBegin(snapshot) {
for (const thisComponent of trialComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
return Scheduler.Event.NEXT;
};
}
function trialRoutineEachFrame(snapshot) {
function trialRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'trial'-------
let continueRoutine = true; // until we're told otherwise
......@@ -446,7 +436,7 @@ function trialRoutineEachFrame(snapshot) {
}
function trialRoutineEnd(snapshot) {
function trialRoutineEnd(trials) {
return function () {
//------Ending Routine 'trial'-------
for (const thisComponent of trialComponents) {
......@@ -497,7 +487,7 @@ function trialRoutineEnd(snapshot) {
var thanksComponents;
function thanksRoutineBegin(snapshot) {
function thanksRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'thanks'-------
t = 0;
......@@ -512,16 +502,14 @@ function thanksRoutineBegin(snapshot) {
for (const thisComponent of thanksComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
return Scheduler.Event.NEXT;
};
}
var frameRemains;
function thanksRoutineEachFrame(snapshot) {
function thanksRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'thanks'-------
let continueRoutine = true; // until we're told otherwise
......@@ -540,7 +528,7 @@ function thanksRoutineEachFrame(snapshot) {
}
frameRemains = 0.0 + 2.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if ((thanksText.status === PsychoJS.Status.STARTED || thanksText.status === PsychoJS.Status.FINISHED) && t >= frameRemains) {
if (thanksText.status === PsychoJS.Status.STARTED && t >= frameRemains) {
thanksText.setAutoDraw(false);
}
// check for quit (typically the Esc key)
......@@ -570,7 +558,7 @@ function thanksRoutineEachFrame(snapshot) {
}
function thanksRoutineEnd(snapshot) {
function thanksRoutineEnd(trials) {
return function () {
//------Ending Routine 'thanks'-------
for (const thisComponent of thanksComponents) {
......@@ -583,21 +571,21 @@ function thanksRoutineEnd(snapshot) {
}
function endLoopIteration(scheduler, snapshot) {
function endLoopIteration(thisScheduler, loop) {
// ------Prepare for next entry------
return function () {
if (typeof snapshot !== 'undefined') {
if (typeof loop !== 'undefined') {
// ------Check if user ended loop early------
if (snapshot.finished) {
if (loop.finished) {
// Check for and save orphaned data
if (psychoJS.experiment.isEntryEmpty()) {
psychoJS.experiment.nextEntry(snapshot);
psychoJS.experiment.nextEntry(loop);
}
scheduler.stop();
thisScheduler.stop();
} else {
const thisTrial = snapshot.getCurrentTrial();
const thisTrial = loop.getCurrentTrial();
if (typeof thisTrial === 'undefined' || !('isTrials' in thisTrial) || thisTrial.isTrials) {
psychoJS.experiment.nextEntry(snapshot);
psychoJS.experiment.nextEntry(loop);
}
}
return Scheduler.Event.NEXT;
......@@ -606,9 +594,9 @@ function endLoopIteration(scheduler, snapshot) {
}
function importConditions(currentLoop) {
function importConditions(trials) {
return function () {
psychoJS.importAttributes(currentLoop.getCurrentTrial());
psychoJS.importAttributes(trials.getCurrentTrial());
return Scheduler.Event.NEXT;
};
}
......
......@@ -8,7 +8,7 @@
<!-- styles -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
<link rel="stylesheet" href="https://lib.pavlovia.org/psychojs-2020.2.css">
<link rel="stylesheet" href="https://lib.pavlovia.org/psychojs-2020.1.css">
</head>
<body>
......@@ -18,12 +18,12 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.1/seedrandom.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/5.3.3/pixi.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.7/pixi.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/PreloadJS/1.0.1/preloadjs.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.14.2/xlsx.full.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/log4javascript/1.4.9/log4javascript.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.7.61/Tone.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tone/13.8.6/Tone.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.2/howler.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.10/pako.min.js"></script>
......@@ -33,7 +33,7 @@
<!-- legacy browsers -->
<script nomodule type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.6.0/polyfill.min.js"></script>
<script nomodule type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/url-search-params/1.1.0/url-search-params.js"></script>
<script nomodule type="text/javascript" src="https://lib.pavlovia.org/psychojs-2020.2.js"></script>
<script nomodule type="text/javascript" src="https://lib.pavlovia.org/psychojs-2020.1.js"></script>
<script nomodule type="text/javascript" src="./IncorrectStopEXP-legacy-browsers.js"></script>
</body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment