If I try to generate an H5PReport sometime I get an exception:
TypeError: Argument 1 passed to Drupal\opigno_h5p\TypeProcessors\FillInProcessor::processCRPs() must be of the type array, null given
The exception occurs viewing an answer that use an H5P Documentation Tool with a H5P Text input field (https://github.com/h5p/h5p-text-input-field) element inside.
This widget is defined with interactionType: fill-in but the FillInProcessor that generate the report doesn’t expect a response without a CRP and this widget doesn’t have this patterns.
This processor works fine with the Fill in blanks element https://github.com/h5p/h5p-blanks (this one also is defined as fill-in).

Comments

peximo created an issue. See original summary.

peximo’s picture

Issue summary: View changes
peximo’s picture

Issue summary: View changes
peximo’s picture

This patch adds a simple question/response report when CRPs are not available.

catch’s picture

Status: Active » Needs work
+++ b/ActivityTypes/opigno_h5p/src/TypeProcessors/FillInProcessor.php
@@ -36,23 +38,42 @@ class FillInProcessor extends TypeProcessor {
+        $description .

Does this need to be escaped?

peximo’s picture

Right, also the response need to be escaped.

peximo’s picture

This patch adds a better filtering

catch’s picture

Status: Needs work » Reviewed & tested by the community

Thanks, moving to RTBC to see what the maintainers think.

axelm’s picture

Thanks for raising that point and for the patch.
This will be fixed in the next release.

axelm’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
axelm’s picture

Status: Patch (to be ported) » Fixed
axelm’s picture

Status: Fixed » Closed (fixed)