Display a questionnaire using psychtoolbox, and get input from keyboard, mouse, or gamepad
Changed:
- Mainloop: As you can see, the Mainloop.m file now contains almost nothing. And there is a new folder names "Mainloop parts". Choose the parts you want to use in experiment and paste the part into Mainloop.m. (Tired of switch command for different devices so I seperated the file for each devices available. The keyboard support is not completed now, though it's not difficult to implement it)
- Instruction: Since more than one input device may be used in an experiment, the old way in which I get the instructions with device name won't be useful any more. There will be a file named "instructions.txt" and the old getInstruc.m will try to locate it and read the instructions. And the rest remains same.
- Control: The way you get input changed a bit. See "Control keys" below for more details.
Added:
- Generate files to save experiment data. See the helperFuncs/savedata for more details.
- Also added some scripts to check input and release. All in helperFuncs/.
Changed:
- Keyboard: Instead of using left and right arrow to select answers, now I use number keys (1 to 9) to do selecting. This idea is from Yaguchi.
Also, the enter (or return) key now used as "go to next question", where up and down arrow are used for quick navigation. - Gamepad: Now I use left stick for select questions and answers. This idea is from Miyakawa.
Besides that, hold the stick will enable the quick navigation.
Added:
-
Support for gamepad
-
On my PC, the configuration is done for OS - Ubuntu and gamepad - Logitech Gamepad F310, the configuration file is uploaded too in "etc" folder. Read the >> help GamePad for more details about this file.
-
You may need to modify the configuration file to support for gamepad on your PC.
Added:
- Support for mouse
Set which device (mouse or keyboard for now) to use in the Mainloop.m
Also changed how the rects generate a bit to support mouse functions.
- About the memory insufficiency problem, it seems that when there are too many questions, the texture rect gets too big, and that would cause an error.
- I don't know the threshold that would cause this problem; but in later update, I will implement a page function which would contain multiple textures with a proper number of questions to avoid this problem
Added:
- Support for likert survey.
Now it is the 3rd version of the code. The code changed a bit at how the rects for identifying the selection are generated.
The 2nd version generates all rects in advance, which will break when there are too many questions which would cause a memory insufficiency.
In this new version, the rects will be generated real time. Which means the same time you pressed space. However, the code that draws the rects becomes very ugly. This need to be rewrote later.
Run a demo by executing Mainloop.m
the loop will automatically quit after all questions been answered
however, you need to use sca manually to clean the screen, for now
- Arrow keys -- Up, down for quickly navigate question;
- Number keys -- Select an answer;
- Return -- Go to next question
- Any key click would do.
- Move mouse to the top edge or bottom edge to scroll. (I use this because that linux don't support GetMouseWheel function ORZ)
- B to make choice
- LB for previous question; RB for next; press still for quick navigation
- Left stick -- for questionnaires in those the answers align vertically, move up or down would do the select; for those horizontally, left and right; hold still for quick navigation
- save selections to a file
- Is there a way to register key-press instead of the ugly(?) "
if elseif endswtich". Support for mouse and gamepadRewrote the code that draws rects- Deal with large file
- Mouse click on an answer would trigger scroll event and goes to next question automatically.
For personal practice or learning, play with it freely;)
For scientific research or experiment, please reference this using:
TOSHINAKI et al.. (2016). MATLAB_PTB_Questionnaire: 2016/08/06 first release. Zenodo. 10.5281/zenodo.59760
For other purpose, do contact me!