Merge pull request #2111 from dpalou/MOBILE-3173

MOBILE-3173 quiz: Fix get amd data in ddmarker questions
main
Juan Leyva 2019-10-01 12:42:44 +02:00 committed by GitHub
commit 3c905e4fbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -275,9 +275,9 @@ 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["\']\\], ?' +
'function\\(amd\\) ?\\{ ?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.