浏览代码

Fix grade calc function parameter

Lucas de Souza 5 年之前
父节点
当前提交
0da1c0588e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      js/assessment/ivprogAssessment.js

+ 2 - 1
js/assessment/ivprogAssessment.js

@@ -22,6 +22,7 @@ export class IVProgAssessment {
   }
 
   runTest () {
+    console.log(this);
     try {
       const validTree = SemanticAnalyser.analyseFromSource(this.textCode);
       // loop test cases and show messages through domconsole
@@ -29,7 +30,7 @@ export class IVProgAssessment {
         return this.partialEvaluateTestCase(new IVProgProcessor(validTree), t.input, t.output, name);
       });
       const testResult = partialTests.reduce((acc, curr) => acc.then(curr), Promise.resolve(0));
-      return testResult.then(function (){
+      return testResult.then(function (total) {
         const grade = total / this.testCases.length;
         const channel = grade == 1 ? DOMConsole.INFO : DOMConsole.ERR;
         this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", grade * 100);