Skip to content

Commit

Permalink
modified "hpNewFunction" to allow Rottmeier quizze (Find-It, Dropdown…
Browse files Browse the repository at this point in the history
…) s to run on Safari (Mac)
  • Loading branch information
gbateson committed May 7, 2007
1 parent 712d500 commit f503b2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mod/hotpot/hotpot-full.js
Expand Up @@ -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)');
Expand All @@ -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 + '}');
Expand Down

0 comments on commit f503b2e

Please sign in to comment.