Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modified "hpNewFunction" to allow Rottmeier quizze (Find-It, Dropdown…

…) s to run on Safari (Mac)
  • Loading branch information...
commit 7fd3f594da434c0900d35897c632543504d0b59b 1 parent 55904e4
gbateson authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/hotpot/hotpot-full.js
View
6 mod/hotpot/hotpot-full.js
@@ -2214,6 +2214,10 @@ function hpNewFunction(f, a, s) {
// special fix for "CheckAnswers" in JCloze
s = s.replace(/TotalChars-State\[i\]\.HintsAndChecks/g, '(TotalChars-State[i].HintsAndChecks)');
}
+ if (s.indexOf('TotalChars-GapList[x][1].HintsAndChecks/')>=0) {
+ // special fix for "CheckAnswers" in JCloze (Find-It)
+ s = s.replace(/TotalChars-GapList\[x\]\[1\]\.HintsAndChecks/g, '(TotalChars-GapList[x][1].HintsAndChecks)');
+ }
if (s.indexOf('CorrectLetters-Penalties/')>=0) {
// special fix for "CheckAnswers" in JMatch
s = s.replace(/CorrectLetters-Penalties/g, '(CorrectLetters-Penalties)');
@@ -2231,7 +2235,7 @@ function hpNewFunction(f, a, s) {
s = s.replace(/\\\[/g, '/\\[');
s = s.replace(/\\\]/g, '\\]/g');
}
- if (s.indexOf('for (i')>=0) {
+ if (s.indexOf('for (i')>=0 || s.indexOf('for (x')>=0) {
s = s.replace(/for \(/g, 'for (var ');
}
eval('window.' + f + '=function(' + getArgsStr(a) + '){' + s + '}');
Please sign in to comment.
Something went wrong with that request. Please try again.