PREP 2014 Question Authoring - Archived

Differences in display between our WeBWork and the MAA's

Differences in display between our WeBWork and the MAA's

by Murphy Waggoner -
Number of replies: 5
I was putting some problems I had written on the Problem_Testing problem set in the PREP2014 course. I found that how the problems appear when you view one of the problems on the WeBWork version we host at Simspon and the PREP course are different.

It is Problem 4 of the Problem Testing problem set. More details below.

Ideas?

Way it looks on our WeBWork:


Way it looks on the PREP2014 course:


Source Code:
## DESCRIPTION
## Complex Variables
## ENDDESCRIPTION

## KEYWORDS('Complex')
## Tagged by mewaggoner

## DBsubject('Complex Analysis')
## DBchapter('Functions')
## DBsection('Limits')
## Date('14Jun2014')
## Author('Murphy Waggoner')
## Institution('Simpson')


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

######################################
# Preamble

loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"MathObjects.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
"PGauxiliaryFunctions.pl",
"PGcomplexmacros.pl"
);

TEXT(beginproblem());

######################################
# Setup

Context("Complex");

# Decide which problem will have which exponent
# Create one each of exponents 0, 1 and 2 and then an extra
# Randomize 0, 1, 2 for the first three parts so that students working
# together won't both have the same type problem in part 1, etc.

$exp1 = Real(random(0, 2, 1));
do { $exp2 = random(0,2,1); } until ( $exp2 != $exp1 );
do { $exp3 = random(0,2,1); } until ( ($exp3 != $exp1) &&( $exp3 != $exp2) );
$exp4 = Real(random(0, 2,1));

# Generate some random complex numbers to use below
# Choose coefficients of z to be non-zero

$a = Complex(random( -5, 5, 1 ) , non_zero_random( -5, 5, 1 ) );
$b = Complex( non_zero_random( -5, 5, 1 ) , random( -5, 5, 1 ) );
$c = Complex( non_zero_random( -5, 5, 1 ), 0);
$d = Complex( 0, non_zero_random( -5, 5, 1) );
$e = Complex(non_zero_random(-5,5,1), random(-5,5,1));
$f = Complex(random(-5, 5, 1), non_zero_random(-5,5,1));

# Create the expressions to take limits of
# The reduce eliminates 0 exponents, combines constants, etc.
# The TeX makes the fractions horizontal and eliminates * by
# creating TeX commands for the formulas

$f1 = Compute("($a z**$exp1 + $b)/($c z + $d )")->reduce->TeX;
$f2 = Compute("($a z^$exp2 + $b)/($c z + $d )")->reduce->TeX;
$f3 = Compute("($a z^$exp3 + $b)/($c z + $d )")->reduce->TeX;
$f4 = Compute("( $e z^$exp4 + $f)/($a z + $c )")->reduce->TeX;



######################################
# Calculate Solutions
# If the exponent is 2, the answer is infinity (higher exponent on top)
# If the exponent is 1, the answer is the ratio of lead coerficients (same exponent on top and bottom)
# If the exponent is 0, the answer is 0 (higher exponent on bottom)
# To get 0 for an exponent of 0, instead of another elsif just multiply
# by the exponent 0 or 1


$soln1a = Formula("($a z**(-$exp1) + $b)/($c z**(-1) + $d )");
if ( $exp1 == 2)
{ $soln1b = Compute(infinity);}
else {$soln1b = $a/$c*$exp1;}


$soln2a = Formula("($a z^(-$exp2) + $b)/($c z^(-1) + $d )");
if ( $exp2 == 2)
{ $soln2b = Compute(infinity);}
else {$soln2b = $a/$c*$exp2;}


$soln3a = Formula("($a z^(-$exp3) + $b) / ($c z^(-1) + $d)");
if ( $exp3 == 2)
{ $soln3b = Compute(infinity);}
else {$soln3b = $a/$c*$exp3;}


$soln4a = Formula("( $e z^(-$exp4) + $f)/($a z^(-1) + $c )");
if ( $exp4 == 2)
{ $soln4b = Compute(infinity);}
else {$soln4b = $e/$a*$exp4;}



######################################
# Question text

BEGIN_TEXT


Rewrite each of these limits in the form required and evaluate. Use 'inf' (with no quote marks) for infinity if needed.
$PAR

$PAR
Question 1: \(\displaystyle\lim_{z \to \infty}$f1 \ = \ \lim_{z \to 0}{\ \)\{ans_rule(20)\} \(\ = \ \)

\{ans_rule(10)\}

$PAR

Question 2: \(\displaystyle\lim_{z \to \infty}$f2 \ = \ \lim_{z \to 0}{\ \)\{ans_rule(20)\} \(\ = \ \)

\{ans_rule(10)\}

$PAR

Question 3: \(\displaystyle\lim_{z \to \infty} $f3 \ = \ \lim_{z \to 0}{\ \)\{ans_rule(20)\} \(\ = \ \)

\{ans_rule(10)\}

$PAR

Question 4: \(\displaystyle\lim_{z \to \infty}$f4 \ = \ \lim_{z \to 0}{\ \)\{ans_rule(20)\} \(\ = \ \)

\{ans_rule(10)\}

$PAR



$PAR
END_TEXT

######################################
# End game

#Checking solutions
ANS($soln1a->cmp);
ANS($soln1b->cmp);
ANS($soln2a->cmp);
ANS($soln2b->cmp);
ANS($soln3a->cmp);
ANS($soln3b->cmp);
ANS($soln4a->cmp);
ANS($soln4b->cmp);

#Show the students which answers were correct
$showPartialCorrectAnswers = 1;

######################################
# Done

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




In reply to Murphy Waggoner

Re: Differences in display between our WeBWork and the MAA's

by Davide Cervone -
Your images didn't come through. Can you try again with the images?

I suspect that you are running an earlier version of WeBWorK and PG. The PREP course is using the latest version (originally pre-release, but 2.9 was officially released last week). The math4 theme in version 2.8 and I think 2.7 had some CSS that interfered with the layout of the problems, so it may be that. For example, paragraphs didn't always get space between them.

If that is the case for you, you might try using one of the other themes (math3 for example; I think it didn't have those problems). You can set the theme in the Course Configuration menu item in the sidebar.
In reply to Davide Cervone

Re: Differences in display between our WeBWork and the MAA's

by Murphy Waggoner -
I thought I could just copy and paste the pictures. The Moodle 'add image' button requires a url. I'm pasting that as jpg this time instead of bmp. I am also attaching them.

Since Moodle only allows one attachment - in this post is what the problem looks like on the PREP2014 WebWork course. What it looks like on ours will be in the next post.

Attachment New_Picture_1_.jpg
In reply to Davide Cervone

Re: Differences in display between our WeBWork and the MAA's

by Murphy Waggoner -
The same problem on our version of WebWork, hosted on our campus.

Attachment New_Picture_2_.jpg
In reply to Davide Cervone

Re: Differences in display between our WeBWork and the MAA's

by Davide Cervone -
OK, my guess about the cause was wrong. The reason there is a difference is that the PREP2014 course has MathJax as the default renderer for mathematics, and your server at home uses Image mode by default. The problem is that the TeX code is invalid, and MathJax flags invalid TeX code, while Image mode does not. The boxed TeX code you see in the PREP2014 course is the indication that there is a problem with the TeX code. In this case, the error is that you have an extra open brace at the end of the TeX code.
  \(\displaystyle\lim_{z \to \infty}$f1 \ = \ \lim_{z \to 0}{\ \)
The final "{" is the problem. Try removing that.