Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 5029251

Browse files
committed
Fix: not enough data == failed test
1 parent da90154 commit 5029251

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

runestone/activecode/js/activecode_sql.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ export default class SQLActiveCode extends ActiveCode {
304304
result += "\n";
305305
}
306306
let pct = (100 * this.passed) / (this.passed + this.failed);
307+
if (isNaN(pct)) {
308+
pct = 0.0;
309+
}
307310
pct = pct.toLocaleString(undefined, { maximumFractionDigits: 2 });
308311
result += `You passed ${this.passed} out of ${
309312
this.passed + this.failed
@@ -319,6 +322,7 @@ export default class SQLActiveCode extends ActiveCode {
319322
actual = result_table.values[row][col];
320323
} catch (e) {
321324
output = `Failed Not enough data to check row ${row} or column ${col}`;
325+
this.failed++;
322326
return output;
323327
}
324328
const operators = {

0 commit comments

Comments
 (0)