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