Questionnaire Toolkit optimized for HoloLens using standard MRTK components. Easily administer questionnaires in HoloLens-related studies.
This repo is based on VRQuestionnaireToolkit by MartinFk and features the same toolkit, just optimized for Microsoft HoloLens. I've replaced the toolkit's components with MRTK-specific replacements and optimized the setup for HoloLens.
Code-wise, it includes some minor QOL additions and, first and foremost, fixes and specific additions for UWP builds. I've tried to mostly leave the existing code from the original VRQuestionnaireToolkit as is, so that existing support- and Wiki-docs remain valid.
Movable, resizable, and rotatable view | Near and far MRTK interactions | Swapped native interaction components |
- Replaced all
UnityEngine.UI
components with their MRTK counterparts. If there's no one-to-one replacement (e.g.LinearGrid
), I've combined multiple components into one. - Wrapped the questionnaire container into a standard MRTK slate with 6-DOF, variable user-defined scaling at runtime, and "Follow Me" functionality.
- Added helper scripts to sync values between MRTK components and the underlying UI components, so that the VRQuestionnaireToolkit source code stays untouched (for the most part); e.g.:
- MRTK's slider is only defined for a fixed value range of 0..1. My
SliderSyncer.cs
script takes the MRTK slider's value and syncs it to a baseUnityEngine.UI.Slider
(i.e. maps the value range and updates both accordingly).
- MRTK's slider is only defined for a fixed value range of 0..1. My
- All components are both near ("touch") and far (ray + "air tap") interactable.
- Added a small
ThemeSwitcher
component which simply toggles between the original VRQuestionnaireToolkit by MartinFk color scheme and a more HoloLens-native one. - If you don't want to use either of them, feel free to specify your own color theme within the
ThemeSwitcher
component (split into header, main, footer, and text color attributes).
- Added new subscribable events:
GenerateQuestionnaire.OnQuestionnaireGenerated
- invoked when the JSON files have been parsed and the questionnaire container has been filled.ExportToCSV.OnQuestionnaireDataSaved
- invoked once the .CSV answers have been stored locally.ExportToCSV.OnQuestionnaireDataSentToServer
- invoked once the answers have been successfully sent to the server.
- Customizable themes.
- Movable, resizable questionnaire container for easier user-directed interactions.
- Removed hardcoded positioning of questionnaire container.
- Had to remove tactile feedback and the
FeedbackManager
for obvious reasons. - Audio feedback is still present and gets automatically generated within the MRTK components.
All MRTK dependencies refer to v2.8.3. I have not tested alternative MRTK versions (yet).
- MRTK Foundation
- MRTK Standard Assets
- MRTK Examples
If you want to use this repo as is, as standalone, or as a base for a fresh Unity project:
- Clone this repo.
- Include the dependencies mentioned above via Microsoft's
MixedRealityFeatureTool
and make sure to use OpenXR when asked by MRTK. - Open the project within Unity and load the
SampleScene
inAssets > Scenes > SampleScene
. - Run the sample scene via Holographic Remoting or build the project and install the
.appx
.
Alternatively, if you want to use this in your existing project:
- Download the latest release
.unitypackage
and make sure that your project meets the dependency requirements. - Import the package via
Assets > Import Package
. - Include the
Questionnaire Container
prefab fromAssets > Prefabs > Questionnaire Container
into your own MRTK-enabled scene.
Within the Questionnaire Container
, you will find the ThemeSwitcher
class, but more importantly, the HoloLensQuestionnaireToolkit
(= VRQuestionnaireToolkit
) in which you can specify your questionnaire data.
For setting up the questionnaire itself, please refer to the VRQuestionnaireToolkit-Wiki.
Where to store your questionnaires' .JSON files:
- HoloLens build:
- If you want to administer your questionnaires in a UWP build running on HoloLens, include your .JSON files within the
Resources
folder. Specify the same subdirectory minus "Assets/Resources/" as path in theGenerateQuestionnaire
component. - Example:
- Your questionnaire
questionnaire.json
is stored inAssets/Resources/questionnaire.json
⇒ specifyquestionnaire.json
as input path withinGenerateQuestionnaire
. - Your questionnaire
questionnaire.json
is stored inAssets/Resources/some/subdirectories/questionnaire.json
⇒ specifysome/subdirectories/questionnaire.json
as input path withinGenerateQuestionnaire
.
- Your questionnaire
- If you want to administer your questionnaires in a UWP build running on HoloLens, include your .JSON files within the
- Holographic Remoting:
- If you conduct your study via remoting, simply include your .JSON files somewhere within your Assets folder and specify the path as is in the
GenerateQuestionnaire
component. - Example:
- Your questionnaire
questionnaire.json
is stored inAssets/questionnaire.json
⇒ specifyAssets/questionnaire.json
as input path withinGenerateQuestionnaire
. - Your questionnaire
questionnaire.json
is stored inAssets/again/some/subdirectories/questionnaire.json
⇒ specifyAssets/again/some/subdirectories/questionnaire.json
as input path withinGenerateQuestionnaire
.
- Your questionnaire
- If you conduct your study via remoting, simply include your .JSON files somewhere within your Assets folder and specify the path as is in the
Once again there's a discrepancy between running the questionnaire on-device opposed to via remoting.
- HoloLens build:
- Once the questionnaire has been submitted, the
.csv
can be found inLocalAppData/<your app ID>/LocalState/
. Access via the file manager within the device portal, for example. The subdirectory cannot be changed.
- Once the questionnaire has been submitted, the
- Holographic Remoting:
- Since the toolkit runs on your PC in this case, the
.csv
can be found inAssets/Questionnaires/Data/Answers
within Unity. You can edit this path to your liking within theExportToCSV
component.
- Since the toolkit runs on your PC in this case, the
This project is mostly an extension to the original VRQuestionnaireToolkit by MartinFk, so special thanks to them for their work and efforts!
I made sure that all base functions work as expected (tested with Unity v2022.3.19f1), but you still have to extensively test this toolkit with your own setup before conducting a study. Test your integration, the workflow, whether your input .JSONs are correctly read, and the output .CSVs are accessible and readable. Neither I nor the original authors of the VRQuestionnaireToolkit are responsible if you lose questionnaire responses, so please ensure everything is working as expected on your end. 😊