MOBILE-4081 lesson: Fix wrong feedback displayed in offline

main
Dani Palou 2022-12-14 14:37:01 +01:00
parent 4f630a5f72
commit f230c16b94
1 changed files with 3 additions and 3 deletions

View File

@ -811,13 +811,13 @@ export class AddonModLessonProvider {
const matches = studentAnswer.match(new RegExp(expectedAnswer, 'g' + ignoreCase));
if (matches) {
isMatch = true;
const nb = matches[0].length;
const nb = matches.length;
const original: string[] = [];
const marked: string[] = [];
for (let j = 0; j < nb; j++) {
original.push(matches[0][j]);
marked.push('<span class="incorrect matches">' + matches[0][j] + '</span>');
original.push(matches[j]);
marked.push('<span class="incorrect matches">' + matches[j] + '</span>');
}
for (let j = 0; j < original.length; j++) {