matching questions return error when there are many categories to match

Created on 1 November 2019, about 5 years ago
Updated 31 August 2024, 5 months ago

I wanted to add more than the standard number of rows for a matching question.
So I edited the content type to allow 8 rows.

When running the quiz, and encountering a matching question with a large number of rows, after hitting next button a large number of errors would display for 'undefined offset error'
Line 491, matching.classes.inc

I don't know PHP so can't address the underlying issue, but have found a workaround by suppressing error reporting.

error_reporting(0); //adedd by PT 1/11/19 to suppress spurious error messages in below

foreach ((array) $user_answers as $key => $value) {
if ($value != 0 && $correct_answers[$key]['answer'] == $correct_answers[$value]['answer']) {
$correct_answer++;
}
elseif ($value == 0 || $value == 'def') {

}
else {
$wrong_answer++;
}
}

error_reporting(1); //adedd by PT 1/11/19 to suppress spurious error messages in above

πŸ› Bug report
Status

Closed: outdated

Version

6.0

Component

Code - Matching

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024