Create your own survey

When you are looking to gather data, you are looking for a simple solution to create a survey either for a post experimental questionnaire, comprehension questions or similar. You also need to to prepare a proper illustration of the data at some point, where group results are summarized.

To create surveys, we integrated the SurveyJS library. They provide a simple to use drag and drop survey builder, where you can create your survey in a short time, displayed in the screenshot below.

Survey Builder

Simply define your questions and as soon you are finished copy the code from the JSON Editor to our SurveyJS Step to display the survey in SoPHIE. The result in SoPHIE is displayed below.

Survey Illustration

Generate aggregated survey results

In addition to the Survey JS builder you can use our Survey API to display the results in a neat design. You can either use charts or tables to show the survey outcome to the participants. The code below is sufficient to get a proper graph illustrating the results.

Simply get the survey result API, define the possible answers and create the graph by stating the name of the variable, the stepgroup, the stepgrouploop and the possible answers. Keep in mind that there are different functions for different variable contexts.

$surveyResult = $api->get('sophielabs_surveyresult');
$answerOptions = array('classroom', 'research', 'both');

echo $surveyResult->pieChartForChoicePSL('rating', 'main', '*', $answerOptions);

The outcome for the code above is shown in the screenshot below.

Survey Pie Chart

The procedure to get a tabular visualization is fairly similar as shown below.

$surveyResult = $api->get('sophielabs_surveyresult');

echo $surveyResult->tableForOpenendedPSL('input', 'main', '*');