Description of the problem:
hello, I designed an experiment which gives the feedback about response. The problem is the text “default text” appears briefly and the routines begins.
I searched similar problems and read this.
["default text" Flashing at Beginning of Routines with FeedBack]
the solution is that i manually insert setText() function to the top of the each frame code.
I tried to do. Perhaps because I didn’t understand it correctly, the problem was not solved.
Actually, I’m am beginner about psychopy and pavlovia. So, I don’t know where the top of the each frame code and exactly what to insert.
I inserted simplely setText(); on the first line in Each Frame code properties. What I did couldn’t be the answer.
If you set the msg text to “” or blank rather than undefined then you’ll briefly have a bank instead of “default text” while the variable catches up (a frame or two later).
Thank you for your reply.
The problem was solved by chance by various attempts.
When I modified the “default text” to blank in JS code, the “default text” disappeared.
I totally agree with you.
Is there any way I can modify it in the builder?
Before checking the code, please consider that this is a preliminary experiment.
this code is code before modification.
I don’t know code which related to the issue.
So, i copied code which containing msg.
// Initialize components for Routine “trial_2”
text = new visual.TextStim({
win: psychoJS.window,
name: ‘text’,
text: ‘default text’,
font: ‘Arial’,
units: undefined,
pos: [0, (- 0.25)], height: 0.1, wrapWidth: undefined, ori: 0,
color: new util.Color(‘red’), opacity: 1,
depth: -4.0
});
msg = " ";
//------Prepare to start Routine 'trial_2'-------
t = 0;
trial_2Clock.reset(); // clock
frameN = -1;
// update component parameters for each repeat
target.setText(word);
respond.keys = undefined;
respond.rt = undefined;
_respond_allKeys = [];
msg = " ";
// *text* updates
if (t >= 0.0 && text.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
text.tStart = t; // (not accounting for frame time here)
text.frameNStart = frameN; // exact frame index
text.setAutoDraw(true);
}
if (text.status === PsychoJS.Status.STARTED){ // only update if being drawn
text.setText(msg);
}
if (respond.keys) {
if ((respond.keys.slice((- 1))[0] !== cor)) {
msg = "X";
} else {
respond.corr = true;
continueRoutine = false;
}
}
That all looks fine. However, I suspect that your code component is below your text component in the same routine. You need to move the code component up so it gets processed first.
Thank you for reply…
Finally, the “default text” no longer appears.
The problem was solved by combining the solutions mentioned earlier.
Specially, your code was helpful.