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

Commit 8dbe014

Browse files
author
Xinying329
committed
Modified based on Review
- Removed async - Merged two click methods to the pure javascript version
1 parent 270f03e commit 8dbe014

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

runestone/activecode/js/activecode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,11 +1271,11 @@ Yet another is that there is an internal error. The internal error message is:
12711271
}
12721272
}
12731273

1274-
async toggleAlert(){
1274+
toggleAlert(){
12751275
if (this.is_toggle && this.runCount == 3) {
12761276
if (this.errinfo != "success" || this.unit_results.substring(8,11)!=100.0){
12771277
setTimeout(function() {alert("Help is Available Using the Toggle Question Selector! You can try the Mixed-up Question first."); }, 500);
1278-
await this.logBookEvent({
1278+
this.logBookEvent({
12791279
event: "togglealert",
12801280
act: "Help is Available Using the Toggle Question Selector",
12811281
div_id: this.divid,

runestone/selectquestion/js/selectone.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,22 +307,18 @@ export default class SelectOne extends RunestoneBase {
307307
let closeButton = document.createElement("button");
308308
$(closeButton).text("Close Preview");
309309
$(closeButton).addClass("btn btn-default");
310-
$(closeButton).click(
311-
async function () {
310+
closeButton.addEventListener("click",
311+
function () {
312312
$("#toggle-preview").html("");
313313
toggleQuestionSelect.value = $("#" + parentID).data(
314314
"toggle_current"
315315
);
316-
$("#component-preview").hide();
317-
}
318-
);
319-
closeButton.addEventListener("click",
320-
async function () {
321-
this.logBookEvent({
322-
event: "close_toggle",
323-
act: toggleQuestionSelect.value,
324-
div_id: toggleQuestionSelect.parentElement.id
325-
});
316+
$("#component-preview").hide();
317+
this.logBookEvent({
318+
event: "close_toggle",
319+
act: toggleQuestionSelect.value,
320+
div_id: toggleQuestionSelect.parentElement.id
321+
});
326322
}.bind(this)
327323
);
328324
$("#toggle-buttons").append(closeButton);

0 commit comments

Comments
 (0)