xAPI-vle / moodle-logstore_xapi

A Moodle plugin to send xAPI statements to an LRS using events in the Moodle logstore.
GNU General Public License v3.0
76 stars 84 forks source link

mod_quiz passing null multichoice responsesummary to transformer/utils/get_string_html_removed #838

Closed mikehenry1979-bah closed 1 year ago

mikehenry1979-bah commented 1 year ago

Description After upgrading Moodle from 3.9.17 to 3.9.19 with no changes to logstore_xapi, in the cron logs the following error is observed:

Execution started at 2023-03-01 10:42:02 Execute scheduled task: Emit records to LRS (logstore_xapi\task\emit_task) !!! Exception - Argument 1 passed to src\transformer\utils\get_string_html_remov ed() must be of the type string, null given, called in [dirroot]\admin\tool\log\ store\xapi\src\transformer\events\mod_quiz\question_answered\multichoice.php on line 48 !!! !! Error code: generalexceptionmessage !! !! Stack trace: * line 35 of \admin\tool\log\store\xapi\src\transformer\utils\ge t_string_html_removed.php: TypeError thrown

Version 2022101800 on Moodle 3.9.19 (20230116)

Steps to reproduce the bug cron runs in background

Expected behaviour Should not generate cron errors

Actual behaviour Generates cron errors

Server information MSSQL 2016 with password authentication

Client information OS: Windows 10 Browser: N/A

Additional information Might just need to update transformer/utils/get_string_html_removed to handle null input, or handle null instead of string before calling it?

davidpesce commented 1 year ago

Fixed in #839