Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
N-back task with visual stimuli
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andrew Vu
N-back task with visual stimuli
Commits
25f89c78
Commit
25f89c78
authored
May 13, 2020
by
Ryan Cortez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
_
parent
d0bc2a62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
N-back-legacy-browsers.js
html/N-back-legacy-browsers.js
+27
-1
N-back.js
html/N-back.js
+27
-1
No files found.
html/N-back-legacy-browsers.js
View file @
25f89c78
...
...
@@ -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
...
...
html/N-back.js
View file @
25f89c78
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment