From 6c56a83edeeacacd7803c05f207329a85eefcf10 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 23 Sep 2019 10:16:42 +0200 Subject: [PATCH] MOBILE-3173 quiz: Fix get amd data in ddmarker questions --- src/core/question/providers/helper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/question/providers/helper.ts b/src/core/question/providers/helper.ts index e564a97d8..3f06e0929 100644 --- a/src/core/question/providers/helper.ts +++ b/src/core/question/providers/helper.ts @@ -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.