Yes, I think you are right.
In the meanwhile, I thought that I should just ask the questions on the PTB screen.
The experiment is comprised of 4 short experimental sessions. After each session, the participants just have to answer some questions.
reply=Ask(my_window, 'How much rapport do you feel with your partner?', white,[],'GetChar',RectLeft,RectTop);
reply=str2double(reply);
Ask(my_window,'My Question PlaceHolder', white,black,'GetChar',RectLeft,RectTop);
The function kind of works: it shows the question on the top left of the screen. If I type, I see the numbers appear on the screen and it puts the value into the var called reply.
There are some problems:
1) The function should go on by pressing enter. If I do press enter, it shows a white screen. I have to press enter 3 times, then it goes to the second 'ask', and creates a black screen. From there I have to click enter again, and the script goes on. Isn't there a way to just click enter and go on with the script?
2) I tried to use reply=eval('GetChar'), as it is suggested in the psychtoolbox page, but it is not working. I tried reply=eval(reply); and it seems to work better. Finally, I settled for what I posted above (str2double).
Finally, I have several questions. So, rather than writing them inside the function, I have created a variable with all the questions that I have to ask in different cells. Then, I wrote:
reply=Ask(my_window, questionsShuffled(questCounter), white,[],'GetChar',RectLeft,RectTop);
If I just type questionsShuffled(questCounter) inside the command window, it does access the text. But, if I use it in the function 'Ask', it says:
Error using Screen
Usage:
[normBoundsRect, offsetBoundsRect, textHeight, xAdvance] = Screen('TextBounds', windowPtr, text [,x] [,y] [,yPositionIsBaseline]
[,swapTextDirection]);
Error in Ask (line 71)
tbx = Screen('TextBounds', window, message);
Error in exp10 (line 242)
reply=Ask(my_window, questionsShuffled(questCounter), white,[],'GetChar',RectLeft,RectTop);
Any idea?
Thank you again.