Fix the drag and drop "Add Bucket" button.#1429
Merged
Alex-Jordan merged 1 commit intoJun 7, 2026
Merged
Conversation
I accidentally removed the default value for the `indices` argument to the `htmlBucket` function in openwebwork#1394. That breaks the "Add Bucket" button because when it constructs a new `Bucket` there are no `indices`. This happened because I converted this JavaScript into TypeScript in a webpack built project for testing, and in the conversion back to JavaScript I deleted the typing that was added to the parameter, but was to aggressive in the deletion, and also deleted the default value. For a basic problem to test with you can use: ```Perl DOCUMENT(); loadMacros('PGstandard.pl', 'PGML.pl', 'MathObjects.pl', 'draggableSubsets.pl'); $draggable = DraggableSubsets( [ '\(e\)', '\(r\)', '\(r^2\)', '\(s\)', '\(sr\)', '\(sr^2\)' ], [ [ 0, 3 ], [ 1, 4 ], [ 2, 5 ] ], DefaultSubsets => [ { label => 'Coset 1', indices => [ 0 .. 3 ], removable => 0 }, { label => 'Coset 2', indices => [4], removable => 1 }, { label => 'Coset 3', indices => [5], removable => 1 } ], BucketLabelFormat => 'Coset %s', AddButtonText => 'Add Coset', RemoveButtonText => 'Remove Coset', ); BEGIN_PGML Let [``G = D_3 = \{ e,r,r^2, s,sr,sr^2 \}``] be the Dihedral group of order [`6`], where [`r`] is the counter-clockwise rotation by [`2\pi/3`], and [`s`] is the reflection across the [`x`]-axis. Partition [`G = D_3`] into *right* cosets of the subgroup [`H = \{ e, s \}`]. Give your result by dragging the following elements into separate buckets, each corresponding to a coset. [_]{$draggable} END_PGML ENDDOCUMENT(); ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I accidentally removed the default value for the
indicesargument to thehtmlBucketfunction in #1394. That breaks the "Add Bucket" button because when it constructs a newBucketthere are noindices. This happened because I converted this JavaScript into TypeScript in a webpack built project for testing, and in the conversion back to JavaScript I deleted the typing that was added to the parameter, but was to aggressive in the deletion, and also deleted the default value.For a basic problem to test with you can use: