Skip to content

Commit 86bbe9b

Browse files
bnmnetpclaude
andcommitted
Clear timed-hidden on score reveal; assert fullwidth class in test
displayScore() now removes the timed-hidden class before showing the score, so the element isn't left with both timed-hidden and timed-visible (which only resolved correctly by CSS source order). Update the construction test to assert the timed-container-fullwidth class instead of the inline max-width style. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSYdBnh54WSQhG6Y4MAQ1x
1 parent c663a94 commit 86bbe9b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

bases/rsptx/interactives/runestone/timed/js/timed.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,10 @@ export default class Timed extends RunestoneBase {
12521252
);
12531253
}
12541254
displayScore() {
1255+
// Reveal the score, clearing the initial hidden state so the element
1256+
// isn't left with both timed-hidden and timed-visible (which only
1257+
// works by CSS source order).
1258+
this.scoreDiv.classList.remove("timed-hidden");
12551259
if (this.showResults) {
12561260
var scoreString = "";
12571261
var numQuestions;

bases/rsptx/interactives/runestone/timed/test/timed.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ describe("construction", () => {
9898
expect(isHidden(exam.timerContainer)).toBe(true);
9999
expect(exam.nopause).toBe(true);
100100
expect(exam.pauseBtn.parentElement).toBe(null);
101-
expect(exam.containerDiv.style.maxWidth).toBe("none");
101+
expect(
102+
exam.containerDiv.classList.contains("timed-container-fullwidth"),
103+
).toBe(true);
102104
expect(exam.showFeedback).toBe(false);
103105
});
104106
});

0 commit comments

Comments
 (0)