forked from EVOgeek/Vmeda.Online
commit
0fd3c1d479
|
@ -23280,9 +23280,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mathjax": {
|
"mathjax": {
|
||||||
"version": "2.7.7",
|
"version": "2.7.9",
|
||||||
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.7.tgz",
|
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.9.tgz",
|
||||||
"integrity": "sha512-OOl0B2/0tSJAtAZarXnQuLDBLgTNRqiI9VqHTQzPsxf4okT2iIpDrvaklK9x2QEMD1sDj4yRn11Ygci41DxMAQ=="
|
"integrity": "sha512-NOGEDTIM9+MrsqnjPEjVGNx4q0GQxqm61yQwSK+/5S59i26wId5IC5gNu9/bu8+CCVl5p9G2IHcAl/wJa+5+BQ=="
|
||||||
},
|
},
|
||||||
"md5-file": {
|
"md5-file": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
"es6-promise-plugin": "^4.2.2",
|
"es6-promise-plugin": "^4.2.2",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"jszip": "^3.7.1",
|
"jszip": "^3.7.1",
|
||||||
"mathjax": "2.7.7",
|
"mathjax": "2.7.9",
|
||||||
"moment": "^2.29.2",
|
"moment": "^2.29.2",
|
||||||
"moment-timezone": "^0.5.34",
|
"moment-timezone": "^0.5.34",
|
||||||
"nl.kingsquare.cordova.background-audio": "^1.0.1",
|
"nl.kingsquare.cordova.background-audio": "^1.0.1",
|
||||||
|
|
|
@ -291,13 +291,18 @@ export class CoreQuestionHelperProvider {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
matches.forEach((match: string) => {
|
matches.forEach((scriptCode) => {
|
||||||
|
if (scriptCode.match(/<script[^>]+type="math\/tex"/m)) {
|
||||||
|
// Don't remove math/tex scripts, they're needed to render the math expressions.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Add the script to scriptsCode and remove it from html.
|
// Add the script to scriptsCode and remove it from html.
|
||||||
question.scriptsCode += match;
|
question.scriptsCode += scriptCode;
|
||||||
question.html = question.html.replace(match, '');
|
question.html = question.html.replace(scriptCode, '');
|
||||||
|
|
||||||
// Search init_question functions for this type.
|
// Search init_question functions for this type.
|
||||||
const initMatches = match.match(new RegExp('M.qtype_' + question.type + '.init_question\\(.*?}\\);', 'mg'));
|
const initMatches = scriptCode.match(new RegExp('M.qtype_' + question.type + '.init_question\\(.*?}\\);', 'mg'));
|
||||||
if (initMatches) {
|
if (initMatches) {
|
||||||
let initMatch = initMatches.pop()!;
|
let initMatch = initMatches.pop()!;
|
||||||
|
|
||||||
|
@ -312,7 +317,7 @@ export class CoreQuestionHelperProvider {
|
||||||
const amdRegExp = new RegExp('require\\(\\[["\']qtype_' + question.type + '/question["\']\\],[^f]*' +
|
const amdRegExp = new RegExp('require\\(\\[["\']qtype_' + question.type + '/question["\']\\],[^f]*' +
|
||||||
'function\\(amd\\)[^\\{]*\\{[^a]*amd\\.init\\((["\'](q|question-' + usageId + '-)' + question.slot +
|
'function\\(amd\\)[^\\{]*\\{[^a]*amd\\.init\\((["\'](q|question-' + usageId + '-)' + question.slot +
|
||||||
'["\'].*?)\\);', 'm');
|
'["\'].*?)\\);', 'm');
|
||||||
const amdMatch = match.match(amdRegExp);
|
const amdMatch = scriptCode.match(amdRegExp);
|
||||||
|
|
||||||
if (amdMatch) {
|
if (amdMatch) {
|
||||||
// Try to convert the arguments to an array and add them to the question.
|
// Try to convert the arguments to an array and add them to the question.
|
||||||
|
|
Loading…
Reference in New Issue