WeBWorK Problems

Non-exclusive draggable subsets

Non-exclusive draggable subsets

by Steven Fiedler -
Number of replies: 2

This is an entry-level question, but I'm interested in designing a draggable problem that asks students to classify items that do not necessarily exclusively belong to any given subset. In my below MWE, "orange" can/should be classified as both a color and a fruit. Perhaps there is a mechanism to repopulate the full set after an item is dragged to a bucket? 


DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'draggableSubsets.pl', 'PGcourse.pl');

$draggable = DraggableSubsets(
    [        'orange','blue','apple',     ],
    [ [], [ 0,1 ], [ 0,2 ] ],
    DefaultSubsets => [
        { label => 'Drag each of the the below words to classify them as a color or a fruit.', indices => [ 0 .. 2 ] },
        { label => 'Color', indices => [] },
        { label => 'Fruit',   indices => [] },
    ],
    AllowNewBuckets => 0,
);

BEGIN_PGML
[_]{$draggable}
END_PGML

ENDDOCUMENT();


Attachment tags.png
In reply to Steven Fiedler

Re: Non-exclusive draggable subsets

by Danny Glin -

I'm pretty sure that this is not implemented currently, though it does sound like a useful variant.  I envision there being a flag to indicate whether an item can be dragged to more than one bucket (Maybe "AllowReusingItems => 1"?), which is leading me to think about all of the possible implications/variants:

  • There would need to be some way to specify which bucket should be replenished when items are dragged out of it.  Do we assume that it's the first bucket if this new flag is set?
  • Is there a use case where the same item can be dragged into a bucket more than once?
  • In your example you would want to set the "OrderedSubsets" flag, otherwise students can put all of the colours in the fruits bucket and all of the fruits in the colours bucket and get marked correct.  If you were creating a question where the order of the buckets didn't matter, you'd always have one bucket with all of the items (the one that is getting replenished).  The current default checker counts this first bucket as part of the answer, so that would have to be handled.

Any other things?

In reply to Danny Glin

Re: Non-exclusive draggable subsets

by Steven Fiedler -

Thank you Danny. I appreciate the heads-up on the OrderedSubsets flag.

The draggable problems I'm currently envisioning don't require a multiple of the same item in a given bucket but I would imagine it would be a nice feature to have, for say simple prime factorization problems. I would imagine that some caution would be needed to avoid complications with multiple of the same items being dragged back to the first bucket.