moodleou / moodle-qtype_pmatch

Pattern-match question type for Moodle
12 stars 23 forks source link

PHP8.0 issue in interpret_subcontents - with a particular question #61

Open nwp90 opened 2 years ago

nwp90 commented 2 years ago

[11-Apr-2022 08:13:54 Pacific/Auckland] PHP Warning: foreach() argument must be of type array|object, null given in /d1/srv/moodle/otagounifom/moodle/question/type/pmatch/pmatch/interpreter.php on line 178 [11-Apr-2022 08:13:54 Pacific/Auckland] Database transaction aborted automatically in /d1/srv/moodle/otagounifom/moodle/mod/quiz/processattempt.php [11-Apr-2022 08:13:54 Pacific/Auckland] Default exception handler: An error occurred while processing your responses (Coding error detected, it must be fixed by a programmer: Oops. You called matches for an expression that is not valid. You should call is_valid first. Interpreter error :Non recognized sub content in code fragment "match_mw (less*|smal".). Click continue to return to the page you were on and try again. Debug: Error code: errorprocessingresponses

  • line 2479 of /mod/quiz/attemptlib.php: moodle_exception thrown
  • line 89 of /mod/quiz/processattempt.php: call to quiz_attempt->process_attempt()

Not currently clear what has caused this - maybe an invalid match expression?

timhunt commented 2 years ago

I can't reproduce the error just by copying the bit of pmatch expression from the error message into a new question.

To progress this, we will need more information. Can you find the question that triggered this error? (Try searching in the question_answers table in the database for match_mw (less*| or something.

If you find the question, can you edit and/or preview it? If so, can you reproduce the error?

nwp90 commented 2 years ago

We're not yet able to reliably reproduce it either; working on it.