Browse Source

Implement empty output handling during automated assessment

Lucas de Souza 4 years ago
parent
commit
5bb066f884
1 changed files with 4 additions and 0 deletions
  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);
   }
 }
+