]> git.mjollnir.org Git - moodle.git/commitdiff
modified "hpNewFunction" to allow Rottmeier quizze (Find-It, Dropdown) s to run on...
authorgbateson <gbateson>
Mon, 7 May 2007 02:49:56 +0000 (02:49 +0000)
committergbateson <gbateson>
Mon, 7 May 2007 02:49:56 +0000 (02:49 +0000)
mod/hotpot/hotpot-full.js

index 45d3651f9c6b1c65a633711a2fcb9cf609162ed7..a6ee9621b4597773847c1093df7e866fe3d0df87 100644 (file)
@@ -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 + '}');