Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
I
IncorrectStopEXP
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
HSINYUAN CHEN
IncorrectStopEXP
Commits
3c8abc96
Commit
3c8abc96
authored
Dec 07, 2020
by
HSINYUAN CHEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move coder component
move the coder from top to bottom
parent
f9880d16
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
81 deletions
+81
-81
IncorrectStopEXP.psyexp
IncorrectStopEXP.psyexp
+17
-17
IncorrectStopEXP_lastrun.py
IncorrectStopEXP_lastrun.py
+18
-18
IncorrectStopEXP-legacy-browsers.js
html/IncorrectStopEXP-legacy-browsers.js
+23
-23
IncorrectStopEXP.js
html/IncorrectStopEXP.js
+23
-23
No files found.
IncorrectStopEXP.psyexp
View file @
3c8abc96
...
...
@@ -35,23 +35,6 @@
</Settings>
<Routines>
<Routine
name=
"trial"
>
<CodeComponent
name=
"code"
>
<Param
name=
"Before Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Before JS Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Begin Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Begin JS Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Begin JS Routine"
updates=
"constant"
val=
"if ((trials1.thisN === 0)) {&#10; number_correct = 0;&#10;}&#10;"
valType=
"extendedCode"
/>
<Param
name=
"Begin Routine"
updates=
"constant"
val=
"if trials1.thisN == 0:&#10; number_correct = 0"
valType=
"extendedCode"
/>
<Param
name=
"Code Type"
updates=
"None"
val=
"Auto->JS"
valType=
"str"
/>
<Param
name=
"Each Frame"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Each JS Frame"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"End Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"End JS Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"End JS Routine"
updates=
"constant"
val=
"if (resp.corr) {&#10; number_correct = (number_correct + 1);&#10; console.log(("Correct: " + number_correct.toString()));&#10;} else {&#10; console.log("Not correct");&#10;}&#10;if (((trials1.thisN + 1) === trials1.nTotal)) {&#10; if (((number_correct / (trials1.nTotal + 1)) >= 0.5)) {&#10; trials2.finished = true;&#10; console.log("Finished.");&#10; } else {&#10; console.log(("Score: " + (number_correct / (trials1.nTotal + 1)).toString()));&#10; }&#10;} else {&#10; console.log(("Trial: " + trials1.thisN.toString()));&#10;}&#10;"
valType=
"extendedCode"
/>
<Param
name=
"End Routine"
updates=
"constant"
val=
"if resp.corr:&#10; number_correct = number_correct + 1&#10; print('Correct: ' + str(number_correct))&#10;else:&#10; print('Not correct')&#10;&#10;if trials1.thisN + 1 == trials1.nTotal:&#10; if number_correct/(trials1.nTotal + 1) >= 0.5:&#10; trials2.finished = True&#10; print('Finished.')&#10; else:&#10; print('Score: ' + str(number_correct/(trials1.nTotal + 1)))&#10;else:&#10; print('Trial: ' + str(trials1.thisN))"
valType=
"extendedCode"
/>
<Param
name=
"disabled"
updates=
"None"
val=
"False"
valType=
"bool"
/>
<Param
name=
"name"
updates=
"None"
val=
"code"
valType=
"code"
/>
</CodeComponent>
<TextComponent
name=
"word"
>
<Param
name=
"color"
updates=
"set every repeat"
val=
"$letterColor"
valType=
"str"
/>
<Param
name=
"colorSpace"
updates=
"constant"
val=
"rgb"
valType=
"str"
/>
...
...
@@ -94,6 +77,23 @@
<Param
name=
"storeCorrect"
updates=
"constant"
val=
"True"
valType=
"bool"
/>
<Param
name=
"syncScreenRefresh"
updates=
"constant"
val=
"True"
valType=
"bool"
/>
</KeyboardComponent>
<CodeComponent
name=
"code"
>
<Param
name=
"Before Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Before JS Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Begin Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Begin JS Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Begin JS Routine"
updates=
"constant"
val=
"if ((trials1.thisN === 0)) {&#10; number_correct = 0;&#10;}&#10;"
valType=
"extendedCode"
/>
<Param
name=
"Begin Routine"
updates=
"constant"
val=
"if trials1.thisN == 0:&#10; number_correct = 0"
valType=
"extendedCode"
/>
<Param
name=
"Code Type"
updates=
"None"
val=
"Auto->JS"
valType=
"str"
/>
<Param
name=
"Each Frame"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"Each JS Frame"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"End Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"End JS Experiment"
updates=
"constant"
val=
""
valType=
"extendedCode"
/>
<Param
name=
"End JS Routine"
updates=
"constant"
val=
"if (resp.corr) {&#10; number_correct = (number_correct + 1);&#10; console.log(("Correct: " + number_correct.toString()));&#10;} else {&#10; console.log("Not correct");&#10;}&#10;if (((trials1.thisN + 1) === trials1.nTotal)) {&#10; if (((number_correct / (trials1.nTotal + 1)) >= 0.85)) {&#10; trials2.finished = true;&#10; console.log("Finished.");&#10; } else {&#10; console.log(("Score: " + (number_correct / (trials1.nTotal + 1)).toString()));&#10; }&#10;} else {&#10; console.log(("Trial: " + trials1.thisN.toString()));&#10;}&#10;"
valType=
"extendedCode"
/>
<Param
name=
"End Routine"
updates=
"constant"
val=
"if resp.corr:&#10; number_correct = number_correct + 1&#10; print('Correct: ' + str(number_correct))&#10;else:&#10; print('Not correct')&#10;&#10;if trials1.thisN + 1 == trials1.nTotal:&#10; if number_correct/(trials1.nTotal + 1) >= 0.85:&#10; trials2.finished = True&#10; print('Finished.')&#10; else:&#10; print('Score: ' + str(number_correct/(trials1.nTotal + 1)))&#10;else:&#10; print('Trial: ' + str(trials1.thisN))"
valType=
"extendedCode"
/>
<Param
name=
"disabled"
updates=
"None"
val=
"False"
valType=
"bool"
/>
<Param
name=
"name"
updates=
"None"
val=
"code"
valType=
"code"
/>
</CodeComponent>
</Routine>
<Routine
name=
"instruct"
>
<TextComponent
name=
"instrText"
>
...
...
IncorrectStopEXP_lastrun.py
View file @
3c8abc96
...
...
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2020.2.8),
on Mon Dec 7 17:0
2:05
2020
on Mon Dec 7 17:0
6:28
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)
...
...
@@ -99,7 +99,7 @@ word = visual.TextStim(win=win, name='word',
pos
=
[
0
,
0
],
height
=
0.2
,
wrapWidth
=
None
,
ori
=
0
,
color
=
'white'
,
colorSpace
=
'rgb'
,
opacity
=
1
,
languageStyle
=
'LTR'
,
depth
=
-
1
.0
);
depth
=
0
.0
);
resp
=
keyboard
.
Keyboard
()
# Initialize components for Routine "thanks"
...
...
@@ -244,13 +244,13 @@ for thisTrials2 in trials2:
# ------Prepare to start Routine "trial"-------
continueRoutine
=
True
# update component parameters for each repeat
if
trials1
.
thisN
==
0
:
number_correct
=
0
word
.
setColor
(
letterColor
,
colorSpace
=
'rgb'
)
word
.
setText
(
text
)
resp
.
keys
=
[]
resp
.
rt
=
[]
_resp_allKeys
=
[]
if
trials1
.
thisN
==
0
:
number_correct
=
0
# keep track of which components have finished
trialComponents
=
[
word
,
resp
]
for
thisComponent
in
trialComponents
:
...
...
@@ -332,20 +332,6 @@ for thisTrials2 in trials2:
for
thisComponent
in
trialComponents
:
if
hasattr
(
thisComponent
,
"setAutoDraw"
):
thisComponent
.
setAutoDraw
(
False
)
if
resp
.
corr
:
number_correct
=
number_correct
+
1
print
(
'Correct: '
+
str
(
number_correct
))
else
:
print
(
'Not correct'
)
if
trials1
.
thisN
+
1
==
trials1
.
nTotal
:
if
number_correct
/
(
trials1
.
nTotal
+
1
)
>=
0.5
:
trials2
.
finished
=
True
print
(
'Finished.'
)
else
:
print
(
'Score: '
+
str
(
number_correct
/
(
trials1
.
nTotal
+
1
)))
else
:
print
(
'Trial: '
+
str
(
trials1
.
thisN
))
trials1
.
addData
(
'word.started'
,
word
.
tStartRefresh
)
trials1
.
addData
(
'word.stopped'
,
word
.
tStopRefresh
)
# check responses
...
...
@@ -363,6 +349,20 @@ for thisTrials2 in trials2:
trials1
.
addData
(
'resp.rt'
,
resp
.
rt
)
trials1
.
addData
(
'resp.started'
,
resp
.
tStartRefresh
)
trials1
.
addData
(
'resp.stopped'
,
resp
.
tStopRefresh
)
if
resp
.
corr
:
number_correct
=
number_correct
+
1
print
(
'Correct: '
+
str
(
number_correct
))
else
:
print
(
'Not correct'
)
if
trials1
.
thisN
+
1
==
trials1
.
nTotal
:
if
number_correct
/
(
trials1
.
nTotal
+
1
)
>=
0.85
:
trials2
.
finished
=
True
print
(
'Finished.'
)
else
:
print
(
'Score: '
+
str
(
number_correct
/
(
trials1
.
nTotal
+
1
)))
else
:
print
(
'Trial: '
+
str
(
trials1
.
thisN
))
# the Routine "trial" was not non-slip safe, so reset the non-slip timer
routineTimer
.
reset
()
thisExp
.
nextEntry
()
...
...
html/IncorrectStopEXP-legacy-browsers.js
View file @
3c8abc96
...
...
@@ -110,7 +110,7 @@ function experimentInit() {
units
:
undefined
,
pos
:
[
0
,
0
],
height
:
0.2
,
wrapWidth
:
undefined
,
ori
:
0
,
color
:
new
util
.
Color
(
'white'
),
opacity
:
1
,
depth
:
-
1
.0
depth
:
0
.0
});
resp
=
new
core
.
Keyboard
({
psychoJS
:
psychoJS
,
clock
:
new
util
.
Clock
(),
waitForStart
:
true
});
...
...
@@ -328,8 +328,8 @@ function instructRoutineEnd(snapshot) {
}
var
number_correct
;
var
_resp_allKeys
;
var
number_correct
;
var
trialComponents
;
function
trialRoutineBegin
(
snapshot
)
{
return
function
()
{
...
...
@@ -338,15 +338,15 @@ function trialRoutineBegin(snapshot) {
trialClock
.
reset
();
// clock
frameN
=
-
1
;
// update component parameters for each repeat
if
((
trials1
.
thisN
===
0
))
{
number_correct
=
0
;
}
word
.
setColor
(
new
util
.
Color
(
letterColor
));
word
.
setText
(
text
);
resp
.
keys
=
undefined
;
resp
.
rt
=
undefined
;
_resp_allKeys
=
[];
if
((
trials1
.
thisN
===
0
))
{
number_correct
=
0
;
}
// keep track of which components have finished
trialComponents
=
[];
trialComponents
.
push
(
word
);
...
...
@@ -447,23 +447,6 @@ function trialRoutineEnd(snapshot) {
thisComponent
.
setAutoDraw
(
false
);
}
});
if
(
resp
.
corr
)
{
number_correct
=
(
number_correct
+
1
);
console
.
log
((
"Correct: "
+
number_correct
.
toString
()));
}
else
{
console
.
log
(
"Not correct"
);
}
if
(((
trials1
.
thisN
+
1
)
===
trials1
.
nTotal
))
{
if
(((
number_correct
/
(
trials1
.
nTotal
+
1
))
>=
0.5
))
{
trials2
.
finished
=
true
;
console
.
log
(
"Finished."
);
}
else
{
console
.
log
((
"Score: "
+
(
number_correct
/
(
trials1
.
nTotal
+
1
)).
toString
()));
}
}
else
{
console
.
log
((
"Trial: "
+
trials1
.
thisN
.
toString
()));
}
// was no response the correct answer?!
if
(
resp
.
keys
===
undefined
)
{
if
([
'None'
,
'none'
,
undefined
].
includes
(
corrAns
))
{
...
...
@@ -481,6 +464,23 @@ function trialRoutineEnd(snapshot) {
}
resp
.
stop
();
if
(
resp
.
corr
)
{
number_correct
=
(
number_correct
+
1
);
console
.
log
((
"Correct: "
+
number_correct
.
toString
()));
}
else
{
console
.
log
(
"Not correct"
);
}
if
(((
trials1
.
thisN
+
1
)
===
trials1
.
nTotal
))
{
if
(((
number_correct
/
(
trials1
.
nTotal
+
1
))
>=
0.85
))
{
trials2
.
finished
=
true
;
console
.
log
(
"Finished."
);
}
else
{
console
.
log
((
"Score: "
+
(
number_correct
/
(
trials1
.
nTotal
+
1
)).
toString
()));
}
}
else
{
console
.
log
((
"Trial: "
+
trials1
.
thisN
.
toString
()));
}
// the Routine "trial" was not non-slip safe, so reset the non-slip timer
routineTimer
.
reset
();
...
...
html/IncorrectStopEXP.js
View file @
3c8abc96
...
...
@@ -121,7 +121,7 @@ function experimentInit() {
units
:
undefined
,
pos
:
[
0
,
0
],
height
:
0.2
,
wrapWidth
:
undefined
,
ori
:
0
,
color
:
new
util
.
Color
(
'white'
),
opacity
:
1
,
depth
:
-
1
.0
depth
:
0
.0
});
resp
=
new
core
.
Keyboard
({
psychoJS
:
psychoJS
,
clock
:
new
util
.
Clock
(),
waitForStart
:
true
});
...
...
@@ -336,8 +336,8 @@ function instructRoutineEnd(snapshot) {
}
var
number_correct
;
var
_resp_allKeys
;
var
number_correct
;
var
trialComponents
;
function
trialRoutineBegin
(
snapshot
)
{
return
function
()
{
...
...
@@ -346,15 +346,15 @@ function trialRoutineBegin(snapshot) {
trialClock
.
reset
();
// clock
frameN
=
-
1
;
// update component parameters for each repeat
if
((
trials1
.
thisN
===
0
))
{
number_correct
=
0
;
}
word
.
setColor
(
new
util
.
Color
(
letterColor
));
word
.
setText
(
text
);
resp
.
keys
=
undefined
;
resp
.
rt
=
undefined
;
_resp_allKeys
=
[];
if
((
trials1
.
thisN
===
0
))
{
number_correct
=
0
;
}
// keep track of which components have finished
trialComponents
=
[];
trialComponents
.
push
(
word
);
...
...
@@ -454,23 +454,6 @@ function trialRoutineEnd(snapshot) {
thisComponent
.
setAutoDraw
(
false
);
}
}
if
(
resp
.
corr
)
{
number_correct
=
(
number_correct
+
1
);
console
.
log
((
"Correct: "
+
number_correct
.
toString
()));
}
else
{
console
.
log
(
"Not correct"
);
}
if
(((
trials1
.
thisN
+
1
)
===
trials1
.
nTotal
))
{
if
(((
number_correct
/
(
trials1
.
nTotal
+
1
))
>=
0.5
))
{
trials2
.
finished
=
true
;
console
.
log
(
"Finished."
);
}
else
{
console
.
log
((
"Score: "
+
(
number_correct
/
(
trials1
.
nTotal
+
1
)).
toString
()));
}
}
else
{
console
.
log
((
"Trial: "
+
trials1
.
thisN
.
toString
()));
}
// was no response the correct answer?!
if
(
resp
.
keys
===
undefined
)
{
if
([
'None'
,
'none'
,
undefined
].
includes
(
corrAns
))
{
...
...
@@ -488,6 +471,23 @@ function trialRoutineEnd(snapshot) {
}
resp
.
stop
();
if
(
resp
.
corr
)
{
number_correct
=
(
number_correct
+
1
);
console
.
log
((
"Correct: "
+
number_correct
.
toString
()));
}
else
{
console
.
log
(
"Not correct"
);
}
if
(((
trials1
.
thisN
+
1
)
===
trials1
.
nTotal
))
{
if
(((
number_correct
/
(
trials1
.
nTotal
+
1
))
>=
0.85
))
{
trials2
.
finished
=
true
;
console
.
log
(
"Finished."
);
}
else
{
console
.
log
((
"Score: "
+
(
number_correct
/
(
trials1
.
nTotal
+
1
)).
toString
()));
}
}
else
{
console
.
log
((
"Trial: "
+
trials1
.
thisN
.
toString
()));
}
// the Routine "trial" was not non-slip safe, so reset the non-slip timer
routineTimer
.
reset
();
...
...
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