Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…) s to run on Safari (Mac)
  • Loading branch information...
commit b4af3c2f481cb1bb4c21f0c39893f45bec8f3820 1 parent b3f9b5c
gbateson authored

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. +5 1 mod/hotpot/hotpot-full.js
6 mod/hotpot/hotpot-full.js
@@ -2214,6 +2214,10 @@ function hpNewFunction(f, a, s) {
2214 2214 // special fix for "CheckAnswers" in JCloze
2215 2215 s = s.replace(/TotalChars-State\[i\]\.HintsAndChecks/g, '(TotalChars-State[i].HintsAndChecks)');
2216 2216 }
  2217 + if (s.indexOf('TotalChars-GapList[x][1].HintsAndChecks/')>=0) {
  2218 + // special fix for "CheckAnswers" in JCloze (Find-It)
  2219 + s = s.replace(/TotalChars-GapList\[x\]\[1\]\.HintsAndChecks/g, '(TotalChars-GapList[x][1].HintsAndChecks)');
  2220 + }
2217 2221 if (s.indexOf('CorrectLetters-Penalties/')>=0) {
2218 2222 // special fix for "CheckAnswers" in JMatch
2219 2223 s = s.replace(/CorrectLetters-Penalties/g, '(CorrectLetters-Penalties)');
@@ -2231,7 +2235,7 @@ function hpNewFunction(f, a, s) {
2231 2235 s = s.replace(/\\\[/g, '/\\[');
2232 2236 s = s.replace(/\\\]/g, '\\]/g');
2233 2237 }
2234   - if (s.indexOf('for (i')>=0) {
  2238 + if (s.indexOf('for (i')>=0 || s.indexOf('for (x')>=0) {
2235 2239 s = s.replace(/for \(/g, 'for (var ');
2236 2240 }
2237 2241 eval('window.' + f + '=function(' + getArgsStr(a) + '){' + s + '}');

0 comments on commit b4af3c2

Please sign in to comment.
Something went wrong with that request. Please try again.