Commit 6d8fa280 authored by Dasoo Milton Yoon's avatar Dasoo Milton Yoon

fdas

parent a1804acc
......@@ -415,7 +415,7 @@
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="1.0" valType="code"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="You have finished a block of questions.&amp;#10;&amp;#10;You will now be presented with 3 questions, for which you will rate the difficulty of.&amp;#10;&amp;#10;Press 'space' to continue." valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
......@@ -459,12 +459,30 @@
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="1.0" valType="code"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Feeback" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="code"/>
</TextComponent>
<KeyboardComponent name="key_resp_9">
<Param name="allowedKeys" updates="constant" val="'1','2','3','4','5','6','7','8','9'" valType="code"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="key_resp_9" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="last key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
</Routines>
<Flow>
......
......@@ -111,6 +111,7 @@ var text_9;
var key_resp_8;
var FeedbackClock;
var text_10;
var key_resp_9;
var doneClock;
var text_5;
var key_resp_4;
......@@ -270,6 +271,8 @@ function experimentInit() {
depth: 0.0
});
key_resp_9 = new core.Keyboard({psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "blank_250"
blank_250Clock = new util.Clock();
text_2 = new visual.TextStim({
......@@ -1271,10 +1274,6 @@ function Instruction_for_FeedbackRoutineEachFrame() {
text_9.setAutoDraw(true);
}
frameRemains = 0.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (text_9.status === PsychoJS.Status.STARTED && t >= frameRemains) {
text_9.setAutoDraw(false);
}
// *key_resp_8* updates
if (t >= 0.0 && key_resp_8.status === PsychoJS.Status.NOT_STARTED) {
......@@ -1356,11 +1355,13 @@ function FeedbackRoutineBegin() {
t = 0;
FeedbackClock.reset(); // clock
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
key_resp_9.keys = undefined;
key_resp_9.rt = undefined;
// keep track of which components have finished
FeedbackComponents = [];
FeedbackComponents.push(text_10);
FeedbackComponents.push(key_resp_9);
for (const thisComponent of FeedbackComponents)
if ('status' in thisComponent)
......@@ -1386,10 +1387,34 @@ function FeedbackRoutineEachFrame() {
text_10.setAutoDraw(true);
}
frameRemains = 0.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (text_10.status === PsychoJS.Status.STARTED && t >= frameRemains) {
text_10.setAutoDraw(false);
// *key_resp_9* updates
if (t >= 0.0 && key_resp_9.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
key_resp_9.tStart = t; // (not accounting for frame time here)
key_resp_9.frameNStart = frameN; // exact frame index
// keyboard checking is just starting
psychoJS.window.callOnFlip(function() { key_resp_9.clock.reset(); }); // t=0 on next screen flip
psychoJS.window.callOnFlip(function() { key_resp_9.start(); }); // start on screen flip
psychoJS.window.callOnFlip(function() { key_resp_9.clearEvents(); });
}
if (key_resp_9.status === PsychoJS.Status.STARTED) {
let theseKeys = key_resp_9.getKeys({keyList: ['1', '2', '3', '4', '5', '6', '7', '8', '9'], waitRelease: false});
// check for quit:
if (theseKeys.length > 0 && theseKeys[0].name === 'escape') {
psychoJS.experiment.experimentEnded = true;
}
if (theseKeys.length > 0) { // at least one key was pressed
key_resp_9.keys = theseKeys[0].name; // just the last key pressed
key_resp_9.rt = theseKeys[0].rt;
// a response ends the routine
continueRoutine = false;
}
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return psychoJS.quit('The [Escape] key was pressed. Goodbye!', false);
......@@ -1408,7 +1433,7 @@ function FeedbackRoutineEachFrame() {
}
// refresh the screen if continuing
if (continueRoutine && routineTimer.getTime() > 0) {
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
}
else {
......@@ -1424,6 +1449,16 @@ function FeedbackRoutineEnd() {
thisComponent.setAutoDraw(false);
}
}
psychoJS.experiment.addData('key_resp_9.keys', key_resp_9.keys);
if (typeof key_resp_9.keys !== undefined) { // we had a response
psychoJS.experiment.addData('key_resp_9.rt', key_resp_9.rt);
routineTimer.reset();
}
key_resp_9.stop();
// the Routine "Feedback" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
}
......
......@@ -103,6 +103,7 @@ var text_9;
var key_resp_8;
var FeedbackClock;
var text_10;
var key_resp_9;
var doneClock;
var text_5;
var key_resp_4;
......@@ -262,6 +263,8 @@ function experimentInit() {
depth: 0.0
});
key_resp_9 = new core.Keyboard({psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "blank_250"
blank_250Clock = new util.Clock();
text_2 = new visual.TextStim({
......@@ -1273,10 +1276,6 @@ function Instruction_for_FeedbackRoutineEachFrame() {
text_9.setAutoDraw(true);
}
frameRemains = 0.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (text_9.status === PsychoJS.Status.STARTED && t >= frameRemains) {
text_9.setAutoDraw(false);
}
// *key_resp_8* updates
if (t >= 0.0 && key_resp_8.status === PsychoJS.Status.NOT_STARTED) {
......@@ -1356,11 +1355,13 @@ function FeedbackRoutineBegin() {
t = 0;
FeedbackClock.reset(); // clock
frameN = -1;
routineTimer.add(1.000000);
// update component parameters for each repeat
key_resp_9.keys = undefined;
key_resp_9.rt = undefined;
// keep track of which components have finished
FeedbackComponents = [];
FeedbackComponents.push(text_10);
FeedbackComponents.push(key_resp_9);
FeedbackComponents.forEach( function(thisComponent) {
if ('status' in thisComponent)
......@@ -1387,10 +1388,34 @@ function FeedbackRoutineEachFrame() {
text_10.setAutoDraw(true);
}
frameRemains = 0.0 + 1.0 - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (text_10.status === PsychoJS.Status.STARTED && t >= frameRemains) {
text_10.setAutoDraw(false);
// *key_resp_9* updates
if (t >= 0.0 && key_resp_9.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
key_resp_9.tStart = t; // (not accounting for frame time here)
key_resp_9.frameNStart = frameN; // exact frame index
// keyboard checking is just starting
psychoJS.window.callOnFlip(function() { key_resp_9.clock.reset(); }); // t=0 on next screen flip
psychoJS.window.callOnFlip(function() { key_resp_9.start(); }); // start on screen flip
psychoJS.window.callOnFlip(function() { key_resp_9.clearEvents(); });
}
if (key_resp_9.status === PsychoJS.Status.STARTED) {
let theseKeys = key_resp_9.getKeys({keyList: ['1', '2', '3', '4', '5', '6', '7', '8', '9'], waitRelease: false});
// check for quit:
if (theseKeys.length > 0 && theseKeys[0].name === 'escape') {
psychoJS.experiment.experimentEnded = true;
}
if (theseKeys.length > 0) { // at least one key was pressed
key_resp_9.keys = theseKeys[0].name; // just the last key pressed
key_resp_9.rt = theseKeys[0].rt;
// a response ends the routine
continueRoutine = false;
}
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return psychoJS.quit('The [Escape] key was pressed. Goodbye!', false);
......@@ -1408,7 +1433,7 @@ function FeedbackRoutineEachFrame() {
}});
// refresh the screen if continuing
if (continueRoutine && routineTimer.getTime() > 0) {
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
}
else {
......@@ -1423,6 +1448,16 @@ function FeedbackRoutineEnd() {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}});
psychoJS.experiment.addData('key_resp_9.keys', key_resp_9.keys);
if (typeof key_resp_9.keys !== undefined) { // we had a response
psychoJS.experiment.addData('key_resp_9.rt', key_resp_9.rt);
routineTimer.reset();
}
key_resp_9.stop();
// the Routine "Feedback" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
}
......
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