Chapter 4 Addressing common issues

This section aims to address common issues that may arise during the implementation of graphical feedback in SoSci Survey. It covers topics like error resolution, debugging, handling missing values, PDF formatting, and more.

4.1 Common errors and their resolutions

Not all scales are on the same metric When dealing with multiple scales that are not on the same metric, one can either adjust them to a common metric manually or normalize the scales (see example section). This ensures that the graphical representation is not misleading.

Debugging Debugging in this context typically involves including statements such as debug($variable) in the PHP code to print values and warnings.

Missing values One approach to handling missing values is to set conditional rules for index calculation. If a response is missing or invalid, the index could be set to 0 or the mean calculation skipped altogether.

Plot size adjustment If the plot appears too large in the PDF file, its dimensions can be adjusted in the Chart.js configuration options by setting the height and width properties.

Changing plot types To change the type of plot, one needs to modify the type property in the Chart.js configuration. This will update the plot type for subsequent renderings.

4.2 FAQ Section

Q: I am encountering errors in my PHP code. How can I resolve them?
A: Consult the PHP error logs for in-depth information regarding the errors. Make sure that error reporting is enabled in your PHP settings for a comprehensive diagnostic overview. Note that some error messages appearing below the PHP code box may be benign and can be overlooked; however, exercise caution when interpreting error messages.

Q: Can I include both a radar plot and a bar plot in the same PDF?
A: Yes, it is possible to incorporate multiple plots within a single PDF. This can be achieved by creating separate canvas elements for each plot and rendering them individually. Be aware that this may require adjustments to the plot dimensions within the PDF or necessitate the creation of multiple PDF pages.

Q: Despite my efforts, my code still is not working. What should I do?
A: If troubleshooting proves ineffective, consider implementing the .xml file provided in the resource section and building your questionnaire from that foundation.

Q: How can I contribute to this project?
A: Contributions are welcome. Feel free to share your code examples and offer additional suggestions to enhance the project’s utility.