openwebwork/pg — pull request #159 by dpvc (2014-09-03 12:28:34+00:00)
Title: Reduce sets when they are added.  Fixes a problem reported on the forum.

There were two problems:

1. Unions of sets were not being reduced automatically, as they should have been.
2. Unions were being marked as reduced despite (1).

This fixes both problems, plus similar issues in the Union object.

A test would be

TEXT(Set(1,2,3)+Set(2,3,4));

You should get `{1,2,3,4}` not `{1,2,3,2,3,4}`.

Note that student answers are NOT reduced by default, since they are supposed to do the reductions themselves, so entering `{1,2,3} U {2,3,4}` as a student should produce a warning that you can't use repeated elements.