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

Commit 19353fb

Browse files
Auto load history for activecode problems on page load
Remove "Load History" button completely Load historyscrubber on activecode problem initialization
1 parent 53ec301 commit 19353fb

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

runestone/activecode/js/activecode.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export class ActiveCode extends RunestoneBase {
288288
this.addDownloadButton(ctrlDiv);
289289
}
290290
if (!this.hidecode && !this.hidehistory) {
291-
this.addHistoryButton(ctrlDiv);
291+
this.addHistoryScrubber(true);
292292
}
293293
if ($(this.origElem).data("gradebutton") && !this.graderactive) {
294294
this.addFeedbackButton(ctrlDiv);
@@ -337,19 +337,6 @@ export class ActiveCode extends RunestoneBase {
337337
$(butt).click(this.createGradeSummary.bind(this));
338338
}
339339

340-
addHistoryButton(ctrlDiv) {
341-
let butt = document.createElement("button");
342-
$(butt).text($.i18n("msg_activecode_load_history"));
343-
$(butt).addClass("btn btn-default");
344-
$(butt).attr("type", "button");
345-
ctrlDiv.appendChild(butt);
346-
this.histButton = butt;
347-
$(butt).click(this.addHistoryScrubber.bind(this));
348-
if (this.graderactive) {
349-
this.addHistoryScrubber(true);
350-
}
351-
}
352-
353340
addDownloadButton(ctrlDiv) {
354341
let butt = document.createElement("button");
355342
$(butt).text("Download");
@@ -687,8 +674,6 @@ export class ActiveCode extends RunestoneBase {
687674
let outOf = this.history.length;
688675
let ts = this.timestamps[$(scrubber).slider("value")];
689676
$(this.timestampP).text(`${ts} - ${pos + 1} of ${outOf}`);
690-
$(this.histButton).remove();
691-
this.histButton = null;
692677
this.historyScrubber = scrubber;
693678
$(scrubberDiv).insertAfter(this.runButton);
694679
} // end definition of helper

runestone/activecode/js/timed_activecode.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ var TimedActiveCodeMixin = {
7878
this.runButton.disabled = false;
7979
$(this.codeDiv).removeClass("ac-disabled");
8080
this.editor.refresh();
81-
$(this.histButton).click(this.addHistoryScrubber.bind(this));
8281
if (this.historyScrubber !== null) {
8382
$(this.historyScrubber).slider({
8483
max: this.history.length - 1,

0 commit comments

Comments
 (0)