]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16263 Flagging questions during a quiz attempt. IE cannot cope with an object...
authortjhunt <tjhunt>
Wed, 3 Sep 2008 05:37:46 +0000 (05:37 +0000)
committertjhunt <tjhunt>
Wed, 3 Sep 2008 05:37:46 +0000 (05:37 +0000)
lib/questionlib.php

index e304dbb77f5ab0ab855f677d8da5a083d0774d0e..060cdb5b521e8b08164e681e44cbcb281eb51543 100644 (file)
@@ -1839,11 +1839,13 @@ function question_init_qenginejs_script() {
     );
 
     // Then generate the script tag.
-    $script = '<script type="text/javascript">qengine_config = {' . "\n";
+    $lines = array();
     foreach ($config as $property => $value) {
-        $script .= "    $property: '" . addslashes_js($value) . "',\n";
+        $lines[] = '    ' . $property . ': "' . addslashes_js($value) . '"';
     }
-    $script .= "};</script>\n";
+    $script = '<script type="text/javascript">qengine_config = {' . "\n" . 
+            implode(",\n", $lines) .
+            "\n};</script>\n";
     return $script;
 }