Commit 25f89c78 authored by Ryan Cortez's avatar Ryan Cortez

_

parent d0bc2a62
......@@ -94,6 +94,7 @@ var FixationClock;
var fixation_1;
var N_back_1_TrialClock;
var grid_lines;
var target_square;
var fixation_2;
var response;
var Instructions_2Clock;
......@@ -148,6 +149,15 @@ function experimentInit() {
flipHoriz : false, flipVert : false,
texRes : 128, interpolate : true, depth : 0.0
});
target_square = new visual.Rect ({
win: psychoJS.window, name: 'target_square',
width: [0.15, 0.15][0], height: [0.15, 0.15][1],
ori: 0.0, pos: [0, 0],
lineWidth: 1.0, lineColor: new util.Color(undefined),
fillColor: new util.Color([1.0, 1.0, 1.0]),
opacity: 1.0, depth: -1, interpolate: true,
});
fixation_2 = new visual.TextStim({
win: psychoJS.window,
name: 'fixation_2',
......@@ -156,7 +166,7 @@ function experimentInit() {
units: undefined,
pos: [0, 0], height: 0.05, wrapWidth: undefined, ori: 0.0,
color: new util.Color('white'), opacity: 1,
depth: -1.0
depth: -2.0
});
response = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
......@@ -532,12 +542,14 @@ function N_back_1_TrialRoutineBegin(trials) {
frameN = -1;
routineTimer.add(2.000000);
// update component parameters for each repeat
target_square.setPos(location);
response.keys = undefined;
response.rt = undefined;
_response_allKeys = [];
// keep track of which components have finished
N_back_1_TrialComponents = [];
N_back_1_TrialComponents.push(grid_lines);
N_back_1_TrialComponents.push(target_square);
N_back_1_TrialComponents.push(fixation_2);
N_back_1_TrialComponents.push(response);
......@@ -574,6 +586,20 @@ function N_back_1_TrialRoutineEachFrame(trials) {
grid_lines.setAutoDraw(false);
}
// *target_square* updates
if (t >= 1.0 && target_square.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
target_square.tStart = t; // (not accounting for frame time here)
target_square.frameNStart = frameN; // exact frame index
target_square.setAutoDraw(true);
}
frameRemains = 1.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (target_square.status === PsychoJS.Status.STARTED && t >= frameRemains) {
target_square.setAutoDraw(false);
}
// *fixation_2* updates
if (t >= 0.0 && fixation_2.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
......
......@@ -102,6 +102,7 @@ var FixationClock;
var fixation_1;
var N_back_1_TrialClock;
var grid_lines;
var target_square;
var fixation_2;
var response;
var Instructions_2Clock;
......@@ -156,6 +157,15 @@ function experimentInit() {
flipHoriz : false, flipVert : false,
texRes : 128, interpolate : true, depth : 0.0
});
target_square = new visual.Rect ({
win: psychoJS.window, name: 'target_square',
width: [0.15, 0.15][0], height: [0.15, 0.15][1],
ori: 0.0, pos: [0, 0],
lineWidth: 1.0, lineColor: new util.Color(undefined),
fillColor: new util.Color([1.0, 1.0, 1.0]),
opacity: 1.0, depth: -1, interpolate: true,
});
fixation_2 = new visual.TextStim({
win: psychoJS.window,
name: 'fixation_2',
......@@ -164,7 +174,7 @@ function experimentInit() {
units: undefined,
pos: [0, 0], height: 0.05, wrapWidth: undefined, ori: 0.0,
color: new util.Color('white'), opacity: 1,
depth: -1.0
depth: -2.0
});
response = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
......@@ -536,12 +546,14 @@ function N_back_1_TrialRoutineBegin(trials) {
frameN = -1;
routineTimer.add(2.000000);
// update component parameters for each repeat
target_square.setPos(location);
response.keys = undefined;
response.rt = undefined;
_response_allKeys = [];
// keep track of which components have finished
N_back_1_TrialComponents = [];
N_back_1_TrialComponents.push(grid_lines);
N_back_1_TrialComponents.push(target_square);
N_back_1_TrialComponents.push(fixation_2);
N_back_1_TrialComponents.push(response);
......@@ -577,6 +589,20 @@ function N_back_1_TrialRoutineEachFrame(trials) {
grid_lines.setAutoDraw(false);
}
// *target_square* updates
if (t >= 1.0 && target_square.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
target_square.tStart = t; // (not accounting for frame time here)
target_square.frameNStart = frameN; // exact frame index
target_square.setAutoDraw(true);
}
frameRemains = 1.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (target_square.status === PsychoJS.Status.STARTED && t >= frameRemains) {
target_square.setAutoDraw(false);
}
// *fixation_2* updates
if (t >= 0.0 && fixation_2.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
......
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