Features & Development

Sets can't contain Points

Sets can't contain Points

by Christopher Heckman -
Number of replies: 1
Even though Sets are subclasses of Lists, WeBWorK complains about a Set that has a Point in it. It does not complain about a List that has a Point in it, though.

Yes, I know that you can override the order of the Points entered with the Context() command, but this doesn't get rid of duplicate entries in the List(Set). And it's something that authors shouldn't have to worry about; it should be fixed.

For instance, woe to the student whose problem says the correct answer is [(1,2), (1,2)], and when they enter [(1,2)], the answer is counted wrong.
In reply to Christopher Heckman

Re: Sets can't contain Points

by Davide Cervone -
The Set() object implements a finite set of Reals, not of arbitrary objects. See the wiki documentation for the Set Object for details.

Sets are intended for use in the Interval context to handle things like the intersection of the intervals (1,3] and [3,5) (without them, you would have to use something like [3,3]).

It is not an error for the Set object to complain about a set containing a point (or other object classes), since they are sets of reals.

If you want to implement a more general Set class that is a set of arbitrary objects, that would be great. We would welcome the contribution.