Browse Source

Fix assessment type coerciong and info messages

Lucas de Souza 6 years ago
parent
commit
24647fa776
1 changed files with 6 additions and 6 deletions
  1. 6 6
      js/assessment/ivprogAssessment.js

+ 6 - 6
js/assessment/ivprogAssessment.js

@@ -52,25 +52,25 @@ export class IVProgAssessment {
         const millis = Date.now() - startTime;
         const millis = Date.now() - startTime;
         if (input.inputList.length !== input.index) {
         if (input.inputList.length !== input.index) {
           outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou, ainda restam entradas!`);
           outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou, ainda restam entradas!`);
-          outerThis.domConsole.err(`Levou ${millis}ms`);
+          outerThis.domConsole.info(`Levou ${millis}ms`);
           resolve(1 * (input.index/inputList.length));
           resolve(1 * (input.index/inputList.length));
         } else if (output.list.length < outputList.length) {
         } else if (output.list.length < outputList.length) {
           outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou <${inputList.join(", ")};${outputList.join(", ")};${output.list.join(", ")}>`);
           outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou <${inputList.join(", ")};${outputList.join(", ")};${output.list.join(", ")}>`);
-          outerThis.domConsole.err(`Levou ${millis}ms`);
+          outerThis.domConsole.info(`Levou ${millis}ms`);
           resolve(1 * (output.list.length/outputList.length));
           resolve(1 * (output.list.length/outputList.length));
         } else if (output.list.length > outputList.length) {
         } else if (output.list.length > outputList.length) {
           outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou <${inputList.join(", ")};${outputList.join(", ")};${output.list.join(", ")}>`);
           outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou <${inputList.join(", ")};${outputList.join(", ")};${output.list.join(", ")}>`);
-          outerThis.domConsole.err(`Levou ${millis}ms`);
+          outerThis.domConsole.info(`Levou ${millis}ms`);
           resolve(1 * (outputList.length/output.list.length));
           resolve(1 * (outputList.length/output.list.length));
         } else {
         } else {
           const isOk = outerThis.checkOutput(output.list, outputList);
           const isOk = outerThis.checkOutput(output.list, outputList);
           if(!isOk) {
           if(!isOk) {
             outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou <${inputList.join(", ")};${outputList.join(", ")};${output.list.join(", ")}>`);
             outerThis.domConsole.err(`Caso de teste ${name + 1}: Falhou <${inputList.join(", ")};${outputList.join(", ")};${output.list.join(", ")}>`);
-            outerThis.domConsole.err(`Levou ${millis}ms`);
+            outerThis.domConsole.info(`Levou ${millis}ms`);
             resolve(0);
             resolve(0);
           } else {
           } else {
             outerThis.domConsole.info(`Caso de teste ${name + 1}: OK!`);
             outerThis.domConsole.info(`Caso de teste ${name + 1}: OK!`);
-            outerThis.domConsole.err(`Levou ${millis}ms`);
+            outerThis.domConsole.info(`Levou ${millis}ms`);
             resolve(1);
             resolve(1);
           }
           }
         }
         }
@@ -81,7 +81,7 @@ export class IVProgAssessment {
   checkOutput (aList, bList) {
   checkOutput (aList, bList) {
     for (let i = 0; i < aList.length; i++) {
     for (let i = 0; i < aList.length; i++) {
       const outValue = aList[i];
       const outValue = aList[i];
-      if(outValue !== bList[i]) {
+      if(outValue != bList[i]) {
         return false;
         return false;
       }
       }
     }
     }