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
13554d07
Commit
13554d07
authored
May 13, 2020
by
Ryan Cortez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
_
parent
4f497ceb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
N-back-legacy-browsers.js
html/N-back-legacy-browsers.js
+7
-7
N-back.js
html/N-back.js
+7
-7
No files found.
html/N-back-legacy-browsers.js
View file @
13554d07
...
...
@@ -145,7 +145,7 @@ function experimentInit() {
name
:
'grid_lines'
,
units
:
undefined
,
image
:
'grid.png'
,
mask
:
undefined
,
ori
:
0.0
,
pos
:
[
0
,
0
],
size
:
[
0.6
,
0.6
],
color
:
new
util
.
Color
([
1
,
1
,
1
]),
opacity
:
1
,
color
:
new
util
.
Color
([
1
,
1
,
1
]),
opacity
:
1
.0
,
flipHoriz
:
false
,
flipVert
:
false
,
texRes
:
128
,
interpolate
:
true
,
depth
:
0.0
});
...
...
@@ -153,9 +153,9 @@ function experimentInit() {
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
,
lineColor
:
new
util
.
Color
(
undefined
),
lineWidth
:
1
.0
,
lineColor
:
new
util
.
Color
(
undefined
),
fillColor
:
new
util
.
Color
([
1.0
,
1.0
,
1.0
]),
opacity
:
1
,
depth
:
-
1
,
interpolate
:
true
,
opacity
:
1
.0
,
depth
:
-
1
,
interpolate
:
true
,
});
fixation_2
=
new
visual
.
TextStim
({
...
...
@@ -581,7 +581,7 @@ function N_back_1_TrialRoutineEachFrame(trials) {
grid_lines
.
setAutoDraw
(
true
);
}
frameRemains
=
0.0
+
2
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
frameRemains
=
0.0
+
2
.0
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
if
(
grid_lines
.
status
===
PsychoJS
.
Status
.
STARTED
&&
t
>=
frameRemains
)
{
grid_lines
.
setAutoDraw
(
false
);
}
...
...
@@ -595,13 +595,13 @@ function N_back_1_TrialRoutineEachFrame(trials) {
target_square
.
setAutoDraw
(
true
);
}
frameRemains
=
0.0
+
1
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
frameRemains
=
0.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
>=
1
&&
fixation_2
.
status
===
PsychoJS
.
Status
.
NOT_STARTED
)
{
if
(
t
>=
1
.0
&&
fixation_2
.
status
===
PsychoJS
.
Status
.
NOT_STARTED
)
{
// keep track of start time/frame for later
fixation_2
.
tStart
=
t
;
// (not accounting for frame time here)
fixation_2
.
frameNStart
=
frameN
;
// exact frame index
...
...
@@ -609,7 +609,7 @@ function N_back_1_TrialRoutineEachFrame(trials) {
fixation_2
.
setAutoDraw
(
true
);
}
frameRemains
=
1
+
1.0
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
frameRemains
=
1
.0
+
1.0
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
if
(
fixation_2
.
status
===
PsychoJS
.
Status
.
STARTED
&&
t
>=
frameRemains
)
{
fixation_2
.
setAutoDraw
(
false
);
}
...
...
html/N-back.js
View file @
13554d07
...
...
@@ -153,7 +153,7 @@ function experimentInit() {
name
:
'grid_lines'
,
units
:
undefined
,
image
:
'grid.png'
,
mask
:
undefined
,
ori
:
0.0
,
pos
:
[
0
,
0
],
size
:
[
0.6
,
0.6
],
color
:
new
util
.
Color
([
1
,
1
,
1
]),
opacity
:
1
,
color
:
new
util
.
Color
([
1
,
1
,
1
]),
opacity
:
1
.0
,
flipHoriz
:
false
,
flipVert
:
false
,
texRes
:
128
,
interpolate
:
true
,
depth
:
0.0
});
...
...
@@ -161,9 +161,9 @@ function experimentInit() {
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
,
lineColor
:
new
util
.
Color
(
undefined
),
lineWidth
:
1
.0
,
lineColor
:
new
util
.
Color
(
undefined
),
fillColor
:
new
util
.
Color
([
1.0
,
1.0
,
1.0
]),
opacity
:
1
,
depth
:
-
1
,
interpolate
:
true
,
opacity
:
1
.0
,
depth
:
-
1
,
interpolate
:
true
,
});
fixation_2
=
new
visual
.
TextStim
({
...
...
@@ -584,7 +584,7 @@ function N_back_1_TrialRoutineEachFrame(trials) {
grid_lines
.
setAutoDraw
(
true
);
}
frameRemains
=
0.0
+
2
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
frameRemains
=
0.0
+
2
.0
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
if
(
grid_lines
.
status
===
PsychoJS
.
Status
.
STARTED
&&
t
>=
frameRemains
)
{
grid_lines
.
setAutoDraw
(
false
);
}
...
...
@@ -598,13 +598,13 @@ function N_back_1_TrialRoutineEachFrame(trials) {
target_square
.
setAutoDraw
(
true
);
}
frameRemains
=
0.0
+
1
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
frameRemains
=
0.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
>=
1
&&
fixation_2
.
status
===
PsychoJS
.
Status
.
NOT_STARTED
)
{
if
(
t
>=
1
.0
&&
fixation_2
.
status
===
PsychoJS
.
Status
.
NOT_STARTED
)
{
// keep track of start time/frame for later
fixation_2
.
tStart
=
t
;
// (not accounting for frame time here)
fixation_2
.
frameNStart
=
frameN
;
// exact frame index
...
...
@@ -612,7 +612,7 @@ function N_back_1_TrialRoutineEachFrame(trials) {
fixation_2
.
setAutoDraw
(
true
);
}
frameRemains
=
1
+
1.0
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
frameRemains
=
1
.0
+
1.0
-
psychoJS
.
window
.
monitorFramePeriod
*
0.75
;
// most of one frame period left
if
(
fixation_2
.
status
===
PsychoJS
.
Status
.
STARTED
&&
t
>=
frameRemains
)
{
fixation_2
.
setAutoDraw
(
false
);
}
...
...
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