Explorar o código

Implement empty output handling during automated assessment

Lucas de Souza %!s(int64=4) %!d(string=hai) anos
pai
achega
5bb066f884
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      js/assessment/output_matching/output_matching.js

+ 4 - 0
js/assessment/output_matching/output_matching.js

@@ -62,6 +62,9 @@ export class OutputMatching {
           const e_out = this.expected_output[i];
           result.push(new OutputResult.OutputMatchResult(e_out, null, 0, this.getPotentialOutputType(e_out)));
         }
+      } else if (this.expected_output.length == 0 && this.expected_output.length == gen_output.list.length) {
+        // no output expected....
+        result.push(new OutputResult.OutputMatchResult("", "", 1, "string"));
       }
       return new OutputAssessmentResult(this.name, 0,  input.input_list, result, sto, final_time);
     }).catch(error => {
@@ -175,3 +178,4 @@ export class OutputMatching {
     return LocalizedStrings.getError(errorID, args);
   }
 }
+