immersivecognition / unity-experiment-framework

UXF - Framework for creating human behaviour experiments in Unity
https://immersivecognition.github.io/unity-experiment-framework/
MIT License
215 stars 41 forks source link

Support post session surveys #82

Closed songer1993 closed 3 years ago

songer1993 commented 3 years ago

The UI support is great for pre session data collection. It would also be nice to have that for post session questionnaires such as NASA-TLX.

jackbrookes commented 3 years ago

Its a great idea but I don't I'll have time personally to do a good job of this

To solve this problem, you could build your own UI, collect responses, then use the built-in data collection functionality to save the data. For example,

// have this method run after the final trial, but before the session ends
public void SaveSurvey()
{
    // show questions and get responses via the UI

    string exampleQuestion1 = "How difficult was the task";
    string exampleResponse1 = "Easy!";

    string exampleQuestion2 = "How are you feeling today on a scale of 1-7";
    int exampleResponse2 = 6;

    // questions are headers
    var headers = new string[]{ exampleQuestion1,  exampleQuestion2 };
    var surveyData = new UXF.UXFDataTable(headers); 

    // one row for the response
    var surveyResponse = new UXF.UXFDataRow();
    surveyResponse.Add((exampleQuestion1, exampleResponse1));
    surveyResponse.Add((exampleQuestion2, exampleResponse2));

    surveyData.AddCompleteRow(surveyResponse);

    // save output
    UXF.Session.instance.SaveDataTable(surveyData, "survey");
}
songer1993 commented 3 years ago

Thank you for the great example of custom datatable, it helps a lot.