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

Commit b39b6e4

Browse files
committed
fix sizing with lots of paired distractors
1 parent 5653ec7 commit b39b6e4

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

runestone/parsons/js/parsons.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,6 @@ export default class Parsons extends RunestoneBase {
491491
//areaHeight += (blocks.length);
492492
}
493493
// + 40 to areaHeight to provide some additional buffer in case any text overflow still happens - Vincent Qiu (September 2020)
494-
this.areaHeight = areaHeight + 40;
495-
$(this.sourceArea).css({
496-
width: this.areaWidth + 2,
497-
height: areaHeight,
498-
});
499-
$(this.answerArea).css({
500-
width: this.options.pixelsPerIndent * indent + this.areaWidth + 2,
501-
height: areaHeight,
502-
});
503494
if (indent > 0 && indent <= 4) {
504495
$(this.answerArea).addClass("answer" + indent);
505496
} else {
@@ -558,6 +549,19 @@ export default class Parsons extends RunestoneBase {
558549
} else {
559550
pairedBins = [];
560551
}
552+
areaHeight += pairedBins.length * 10; // the paired bins take up extra space which can
553+
// cause the blocks to spill out. This
554+
// corrects that by adding a little extra
555+
this.areaHeight = areaHeight + 40;
556+
$(this.sourceArea).css({
557+
width: this.areaWidth + 2,
558+
height: areaHeight,
559+
});
560+
$(this.answerArea).css({
561+
width: this.options.pixelsPerIndent * indent + this.areaWidth + 2,
562+
height: areaHeight,
563+
});
564+
561565
this.pairedBins = pairedBins;
562566
this.pairedDivs = pairedDivs;
563567
if (this.options.numbered != undefined) {

0 commit comments

Comments
 (0)