Browse Source

Merge pull request #1127 from jloguercio/8183

Fix bug when you set a value in in score field it show the default value if you editing it - Refs #8183
José Loguercio 8 years ago
parent
commit
a91d0505b5
1 changed files with 3 additions and 7 deletions
  1. 3 7
      main/exercice/fill_blanks.class.php

+ 3 - 7
main/exercice/fill_blanks.class.php

@@ -149,15 +149,11 @@ class FillBlanks extends Question
         if (isset($listAnswersInfo) && count($listAnswersInfo["tabweighting"]) > 0) {
 
             foreach ($listAnswersInfo["tabweighting"] as $i => $weighting) {
-                if (!empty($i)) {
-                    echo 'document.getElementById("weighting['.$i.']").value = "'.$weighting.'";';
-                }
+                echo 'document.getElementById("weighting['.$i.']").value = "'.$weighting.'";';
             }
             foreach ($listAnswersInfo["tabinputsize"] as $i => $sizeOfInput) {
-                if (!empty($i)) {
-                    echo 'document.getElementById("sizeofinput['.$i.']").value = "'.$sizeOfInput.'";';
-                    echo '$("#samplesize\\\['.$i.'\\\]").width('.$sizeOfInput.');';
-                }
+                echo 'document.getElementById("sizeofinput['.$i.']").value = "'.$sizeOfInput.'";';
+                echo '$("#samplesize\\\['.$i.'\\\]").width('.$sizeOfInput.');';
             }
         }