### unionLists not behaving as expected

by Murphy Waggoner -On the PREP course, the question behaves as expected. It seems that WebWork on our server doesn't have the same macros (?). This is probably related to a problem that John Travis has been working on with our system administrator (who is now on vacation until July 14th).

But if the problem is something I can address, please let me know.

## DESCRIPTION

## Complex Variables

## ENDDESCRIPTION

## KEYWORDS('Complex')

## Tagged by mewaggoner

## Date('3Jul2014')

## Author('Murphy Waggoner')

## Institution('Simpson')

DOCUMENT(); # This should be the first executable line in the problem.

######################################

# Preamble

#"PGchoicemacros.pl",

#"PGanswermacros.pl",

loadMacros(

"PG.pl",

"PGbasicmacros.pl",

"MathObjects.pl",

"PGauxiliaryFunctions.pl",

"PGcomplexmacros.pl",

"contextLimitedComplex.pl",

"unionLists.pl"

);

TEXT(beginproblem());

######################################

# Setup

# if I use Context("LimitedComplex"); here the question won't compile

Context("Complex");

# create four complex numbers

$a = Complex( non_zero_random( -5, 5, 1 ), random( 1, 10, 1 ));

$b = Complex( non_zero_random( -5, 5, 1 ), random( -10, -1, 1 ));

$c = Complex( 0, non_zero_random( -5, 5, 1 ));

$d = Complex( non_zero_random( -5, 5, 1 ), 0);

# Create four real numbers

$e = Real(non_zero_random(-5, 5, 1));

$f = Real(random(3, 7, 2));

$g = Real(non_zero_random(-5, 5, 1));

$h = Real(random(0, 9, 1));

# Create a list with the answers for checking later

$answer[0] = Complex("conj($a)");

$answer[1] = Complex("conj($b)");

$answer[2] = Complex("conj($c)");

$answer[3] = Complex("conj($d)");

$answer[4] = Complex("conj($e + (1 - sqrt($f) ) i)");

$answer[5] = Complex("conj($g* i + $h)");

$num_ans = @answer;

# If I put Context("LimitedComplex"); here the student can still

# get the answer right by entering conj(a + bi)

Context()->texStrings;

BEGIN_TEXT

The complex conjugate of a number \(z = a + bi\) is written with a bar over it and is \(\overline{z} = \overline{a + bi} = a - bi\).

$PAR

Find the complex conjugate of each of these numbers. $BR

\{ BeginList('OL', type=>'A') \}

$ITEM \( \overline{$a} = \) \{ans_rule(20)\}

$ITEMSEP

$ITEM \( \overline{$b} = \) \{ans_rule(20)\}

$ITEMSEP

$ITEM \( \overline{$c} = \) \{ans_rule(20)\}

$ITEMSEP

$ITEM \( \overline{$d} = \) \{ans_rule(20)\}

$ITEMSEP

$ITEM \( \overline{ $e + \left(1 - \sqrt{$f}\right)i} = \) \{ans_rule(20)\}

$ITEMSEP

$ITEM \( \overline{$g i + $h} = \) \{ans_rule(20)\}

\{ EndList('OL') \}

END_TEXT

######################################

# End game

# Don't let the students enter complex functions

# Context()->functions->disable('conj');

#Checking solutions

for ( $n = 0; $n <= $num_ans-1; $n++ )

{

ANS($answer[$n]->cmp);

}

#Show the students which answers were correct (...= 1)

$showPartialCorrectAnswers = 1;

######################################

# Done

ENDDOCUMENT(); # This should be the last executable line in the problem.

### Re: unionLists not behaving as expected

by Paul Pearson -### Re: unionLists not behaving as expected

by Murphy Waggoner -https://github.com/openwebwork/pg/blob/master/macros/unionLists.pl

copied the code and in the File Manager created a file. See image below for where I put the file to see if I got it in the right place.

Do I have to do anything else? Nothing seems to have changed. I opened the .pg file and saved it again - nothing changed. Then I got out of WebWork and back in and nothing changed.

Thanks for the suggestion. Thoughts on what I have done wrong?

### Re: unionLists not behaving as expected

by Davide Cervone -`unionLists.pl`

specifically. I think the CSS was corrected in 2.8 or 2.9. You could try the math3 theme and see if it works there. If so, then you know it is the theme issue, and you will need to update WeBWorK in order to resolve it.