Explorar o código

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 %!s(int64=8) %!d(string=hai) anos
pai
achega
a91d0505b5
Modificáronse 1 ficheiros con 3 adicións e 7 borrados
  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.');';
             }
         }