Merge pull request #2347 from dpalou/MOBILE-3407

MOBILE-3407 quiz: Fix drops in ddimageortext in Moodle 3.6
main
Juan Leyva 2020-04-27 17:53:51 +02:00 committed by GitHub
commit b54e7ddebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -275,10 +275,11 @@ export class CoreQuestionHelperProvider {
question.initObjects = this.textUtils.parseJSON(initMatch, null);
}
const amdRegExp = new RegExp('require\\(\\[["\']qtype_' + question.type + '/question["\']\\], ?' +
'function\\(amd\\) ?\\{ ?amd\\.init\\((["\'](q|question-' + usageId + '-)' + question.slot +
'["\'].*?)\\);', 'm');
const amdRegExp = new RegExp('require\\(\\[["\']qtype_' + question.type + '/question["\']\\],[^f]*' +
'function\\(amd\\)[^\\{]*\\{[^a]*amd\\.init\\((["\'](q|question-' + usageId + '-)' + question.slot +
'["\'].*)\\);', 'm');
const amdMatch = match.match(amdRegExp);
if (amdMatch) {
// Try to convert the arguments to an array and add them to the question.
question.amdArgs = this.textUtils.parseJSON('[' + amdMatch[1] + ']', null);