remove dir_1

parent 18b3fd2c
participant,group,date,expName,psychopyVersion,frameRate,
This diff is collapsed.
File added
......@@ -33,9 +33,6 @@ psychoJS.scheduleCondition(function() { return (psychoJS.gui.dialogComponent.but
// flowScheduler gets run if the participants presses OK
flowScheduler.add(updateInfo); // add timeStamp
flowScheduler.add(experimentInit);
flowScheduler.add(dir_1RoutineBegin());
flowScheduler.add(dir_1RoutineEachFrame());
flowScheduler.add(dir_1RoutineEnd());
flowScheduler.add(setupRoutineBegin());
flowScheduler.add(setupRoutineEachFrame());
flowScheduler.add(setupRoutineEnd());
......@@ -108,11 +105,6 @@ function updateInfo() {
}
var dir_1Clock;
var mouse;
var polygon_border;
var polygon_fill;
var elapsedProp;
var setupClock;
var thisExp;
var win;
......@@ -164,32 +156,6 @@ var Debrief;
var globalClock;
var routineTimer;
function experimentInit() {
// Initialize components for Routine "dir_1"
dir_1Clock = new util.Clock();
mouse = new core.Mouse({
win: psychoJS.window,
});
mouse.mouseClock = new util.Clock();
polygon_border = new visual.Rect ({
win: psychoJS.window, name: 'polygon_border', units : 'norm',
width: [0.1, 0.035][0], height: [0.1, 0.035][1],
ori: 0, pos: [0.8, 0.9],
lineWidth: 3, lineColor: new util.Color([(- 1.0), (- 1.0), (- 1.0)]),
fillColor: new util.Color([1, 1, 1]),
opacity: 1, depth: -1, interpolate: true,
});
polygon_fill = new visual.Rect ({
win: psychoJS.window, name: 'polygon_fill', units : 'norm',
width: [0.1, 0.03][0], height: [0.1, 0.03][1],
ori: 0, pos: [0.8, 0.9],
lineWidth: 0, lineColor: new util.Color([(- 1.0), 1.0, (- 1.0)]),
fillColor: new util.Color([(- 1.0), 1.0, (- 1.0)]),
opacity: 1, depth: -2, interpolate: true,
});
elapsedProp = 2;
// Initialize components for Routine "setup"
setupClock = new util.Clock();
thisExp=psychoJS.experiment;
......@@ -413,148 +379,6 @@ function experimentInit() {
var t;
var frameN;
var continueRoutine;
var gotValidClick;
var elapsedTime;
var keyStart;
var colour;
var dir_1Components;
function dir_1RoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'dir_1'-------
t = 0;
dir_1Clock.reset(); // clock
frameN = -1;
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
// setup some python lists for storing info about the mouse
gotValidClick = false; // until a click is received
elapsedTime = 0;
keyStart = 0;
colour = "green";
// keep track of which components have finished
dir_1Components = [];
dir_1Components.push(mouse);
dir_1Components.push(polygon_border);
dir_1Components.push(polygon_fill);
dir_1Components.forEach( function(thisComponent) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
return Scheduler.Event.NEXT;
}
}
var keys;
function dir_1RoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'dir_1'-------
// get current time
t = dir_1Clock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
// update/draw components on each frame
// *polygon_border* updates
if (t >= 0.0 && polygon_border.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
polygon_border.tStart = t; // (not accounting for frame time here)
polygon_border.frameNStart = frameN; // exact frame index
polygon_border.setAutoDraw(true);
}
// *polygon_fill* updates
if (t >= 0.0 && polygon_fill.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
polygon_fill.tStart = t; // (not accounting for frame time here)
polygon_fill.frameNStart = frameN; // exact frame index
polygon_fill.setAutoDraw(true);
}
keys = kb.getKeys(["y"], {"waitRelease": false, "clear": true});
if ((t > 30)) {
continueRoutine = false;
} else {
if ((keys.length || (mouse.getPressed()[0] === 1))) {
if ((keyStart === 0)) {
keyStart = t;
}
elapsedProp = ((2 - ((elapsedTime + t) - keyStart)) / 2);
polygon_fill.setSize([(0.1 * elapsedProp), 0.03]);
polygon_fill.setPos([(0.75 + (0.05 * elapsedProp)), 0.9]);
if (((elapsedProp < 0.5) && (colour === "green"))) {
colour = "orange";
polygon_fill.setFillColor("orange");
} else {
if (((elapsedProp < 0.25) && (colour === "orange"))) {
colour = "red";
polygon_fill.setFillColor("red");
} else {
if ((elapsedProp <= 0)) {
continueRoutine = false;
}
}
}
} else {
if ((keyStart > 0)) {
elapsedTime += (t - keyStart);
keyStart = 0;
}
}
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
}
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
continueRoutine = false; // reverts to True if at least one component still running
dir_1Components.forEach( function(thisComponent) {
if ('status' in thisComponent && thisComponent.status !== PsychoJS.Status.FINISHED) {
continueRoutine = true;
}
});
// refresh the screen if continuing
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
} else {
return Scheduler.Event.NEXT;
}
};
}
function dir_1RoutineEnd(snapshot) {
return function () {
//------Ending Routine 'dir_1'-------
dir_1Components.forEach( function(thisComponent) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
});
// store data for thisExp (ExperimentHandler)
thisExp.addData("DisplayTime_1", t);
elapsedTime += (t - keyStart);
thisExp.addData("LookawayTime_1", elapsedTime);
// the Routine "dir_1" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
};
}
var _key_resp_allKeys;
var setupComponents;
function setupRoutineBegin(snapshot) {
......@@ -586,6 +410,7 @@ function setupRoutineBegin(snapshot) {
var _pj;
var keys;
function setupRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'setup'-------
......
......@@ -44,9 +44,6 @@ psychoJS.scheduleCondition(function() { return (psychoJS.gui.dialogComponent.but
// flowScheduler gets run if the participants presses OK
flowScheduler.add(updateInfo); // add timeStamp
flowScheduler.add(experimentInit);
flowScheduler.add(dir_1RoutineBegin());
flowScheduler.add(dir_1RoutineEachFrame());
flowScheduler.add(dir_1RoutineEnd());
flowScheduler.add(setupRoutineBegin());
flowScheduler.add(setupRoutineEachFrame());
flowScheduler.add(setupRoutineEnd());
......@@ -119,11 +116,6 @@ function updateInfo() {
}
var dir_1Clock;
var mouse;
var polygon_border;
var polygon_fill;
var elapsedProp;
var setupClock;
var thisExp;
var win;
......@@ -175,32 +167,6 @@ var Debrief;
var globalClock;
var routineTimer;
function experimentInit() {
// Initialize components for Routine "dir_1"
dir_1Clock = new util.Clock();
mouse = new core.Mouse({
win: psychoJS.window,
});
mouse.mouseClock = new util.Clock();
polygon_border = new visual.Rect ({
win: psychoJS.window, name: 'polygon_border', units : 'norm',
width: [0.1, 0.035][0], height: [0.1, 0.035][1],
ori: 0, pos: [0.8, 0.9],
lineWidth: 3, lineColor: new util.Color([(- 1.0), (- 1.0), (- 1.0)]),
fillColor: new util.Color([1, 1, 1]),
opacity: 1, depth: -1, interpolate: true,
});
polygon_fill = new visual.Rect ({
win: psychoJS.window, name: 'polygon_fill', units : 'norm',
width: [0.1, 0.03][0], height: [0.1, 0.03][1],
ori: 0, pos: [0.8, 0.9],
lineWidth: 0, lineColor: new util.Color([(- 1.0), 1.0, (- 1.0)]),
fillColor: new util.Color([(- 1.0), 1.0, (- 1.0)]),
opacity: 1, depth: -2, interpolate: true,
});
elapsedProp = 2;
// Initialize components for Routine "setup"
setupClock = new util.Clock();
thisExp=psychoJS.experiment;
......@@ -424,147 +390,6 @@ function experimentInit() {
var t;
var frameN;
var continueRoutine;
var gotValidClick;
var elapsedTime;
var keyStart;
var colour;
var dir_1Components;
function dir_1RoutineBegin(snapshot) {
return function () {
//------Prepare to start Routine 'dir_1'-------
t = 0;
dir_1Clock.reset(); // clock
frameN = -1;
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
// setup some python lists for storing info about the mouse
gotValidClick = false; // until a click is received
elapsedTime = 0;
keyStart = 0;
colour = "green";
// keep track of which components have finished
dir_1Components = [];
dir_1Components.push(mouse);
dir_1Components.push(polygon_border);
dir_1Components.push(polygon_fill);
for (const thisComponent of dir_1Components)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
return Scheduler.Event.NEXT;
}
}
var keys;
function dir_1RoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'dir_1'-------
// get current time
t = dir_1Clock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
// update/draw components on each frame
// *polygon_border* updates
if (t >= 0.0 && polygon_border.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
polygon_border.tStart = t; // (not accounting for frame time here)
polygon_border.frameNStart = frameN; // exact frame index
polygon_border.setAutoDraw(true);
}
// *polygon_fill* updates
if (t >= 0.0 && polygon_fill.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
polygon_fill.tStart = t; // (not accounting for frame time here)
polygon_fill.frameNStart = frameN; // exact frame index
polygon_fill.setAutoDraw(true);
}
keys = kb.getKeys(["y"], {"waitRelease": false, "clear": true});
if ((t > 30)) {
continueRoutine = false;
} else {
if ((keys.length || (mouse.getPressed()[0] === 1))) {
if ((keyStart === 0)) {
keyStart = t;
}
elapsedProp = ((2 - ((elapsedTime + t) - keyStart)) / 2);
polygon_fill.setSize([(0.1 * elapsedProp), 0.03]);
polygon_fill.setPos([(0.75 + (0.05 * elapsedProp)), 0.9]);
if (((elapsedProp < 0.5) && (colour === "green"))) {
colour = "orange";
polygon_fill.setFillColor("orange");
} else {
if (((elapsedProp < 0.25) && (colour === "orange"))) {
colour = "red";
polygon_fill.setFillColor("red");
} else {
if ((elapsedProp <= 0)) {
continueRoutine = false;
}
}
}
} else {
if ((keyStart > 0)) {
elapsedTime += (t - keyStart);
keyStart = 0;
}
}
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
}
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
continueRoutine = false; // reverts to True if at least one component still running
for (const thisComponent of dir_1Components)
if ('status' in thisComponent && thisComponent.status !== PsychoJS.Status.FINISHED) {
continueRoutine = true;
break;
}
// refresh the screen if continuing
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
} else {
return Scheduler.Event.NEXT;
}
};
}
function dir_1RoutineEnd(snapshot) {
return function () {
//------Ending Routine 'dir_1'-------
for (const thisComponent of dir_1Components) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
}
// store data for thisExp (ExperimentHandler)
thisExp.addData("DisplayTime_1", t);
elapsedTime += (t - keyStart);
thisExp.addData("LookawayTime_1", elapsedTime);
// the Routine "dir_1" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
};
}
var _key_resp_allKeys;
var setupComponents;
function setupRoutineBegin(snapshot) {
......@@ -595,6 +420,7 @@ function setupRoutineBegin(snapshot) {
var _pj;
var keys;
function setupRoutineEachFrame(snapshot) {
return function () {
//------Loop for each frame of Routine 'setup'-------
......
......@@ -842,7 +842,6 @@
</Routine>
</Routines>
<Flow>
<Routine name="dir_1"/>
<Routine name="setup"/>
<Routine name="embedded_form"/>
<Routine name="first_letter"/>
......
This diff is collapsed.
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