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

Commit 2f5e908

Browse files
committed
⚗️ Temporary code: Make execution based feedback consistent with normal execution
1 parent 25bfa18 commit 2f5e908

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

runestone/hparsons/js/SQLFeedback.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,12 @@ export default class SQLFeedback extends HParsonsFeedback {
167167
if (executionSuccessFlag) {
168168
this.results = this.executeIteratedStatements(this.hparsons.db.iterateStatements(query.input));
169169
// always render full execution results of student input regardless of success/failure
170-
this.visualizeResults(respDiv, this.results);
170+
// for lab study: to be consistent with code execution, only visualize last entry
171+
// this.visualizeResults(respDiv, this.results);
171172
if (this.results.at(-1).status == 'failure') {
172173
// if error occured in student input, stop executing suffix/unitttest
174+
// and visualize the error
175+
this.visualizeResults(respDiv, this.results);
173176
executionSuccessFlag = false;
174177
}
175178
}
@@ -182,6 +185,9 @@ export default class SQLFeedback extends HParsonsFeedback {
182185
if (this.suffixresults.at(-1).status == 'failure') {
183186
// if error occured in hidden suffix, visualize the results
184187
this.visualizeResults(respDiv, this.suffixresults, "Error executing hidden code in suffix");
188+
} else {
189+
// for study: visualize last result (suffix is always select *)
190+
this.visualizeResults(respDiv, this.suffixresults);
185191
}
186192
}
187193

0 commit comments

Comments
 (0)