WeBWorK Problems

Broken problem?

Broken problem?

by Mike Daven -
Number of replies: 2
I am seeing some strange behaviors from '[TMPL]/Library/Rochester/instructiveProblems/NewProblems/Sets_2N.pg 

In this problem, three sets A, B, and C are given, and we have to find the intersection A \cap B, the union A \cup B, and another set (B \cup C) \cap A. 

The intersection A \cap B is fine, but the solutions for the other sets sets are wonky.  For A \cup B, the correct answer has 5 elements, but if your response has just 5 elements, the message says there should be more numbers in the set.  If you give 6 elements with repeats, exactly as the "Correct" answer does, then the message says there should be no repeated elements.  The same issue happens with (B \cup C) \cap A. 

See the screen snip at http://faculty.msmc.edu/daven/images/ww090214.png -- I was acting as a student to recreate the issue. 

Thanks for your help!  
In reply to Mike Daven

Re: Broken problem?

by Davide Cervone -
It is a bug in MathObjects. It turns out that set unions are not being reduced (to remove repeated elements). Since the defaults for students answers are to require students to enter reduced sets (and intervals and unions), the correct answer was not possible to produce (as you found out).

I am submitting a patch, which should be available shortly. Unfortunately, there isn't an easy solution in the meantime. You could use

    $A_U_B = ($SetA + $SetB)->without("isReduced")->reduce;
if you really wanted to, but it is a hack for now.

Thanks for reporting the problem.

In reply to Davide Cervone

Re: Broken problem?

by Mike Daven -

Thanks for your help with this, Davide. 

If anyone is interested, Library/NAU/setSet/Sets_2.pg  and Library/ASU-topics/setSets/ur_st_1_2.pg are similar problems which function as expected, but the code to create these problems is quite different.