I am in the process of writing a compound problem. When I finish each part I move
an ENDDOCUMENT() from the end of the previous part to test what I have done
so far. When the ENDDOCUMENT() was at the end of section 7 the
problem up to that point worked fine. So I added a section 8. When I tried to
run it I was told that I had a syntax error which was located at a line number in
the text section of
section 8. So I essentially moved the the entire text section of section 8 past
an ENDDOCUMENT() at the end of the problem (sections past 8 are ghosts
from a template). Now it claimed that I had a syntax error at the first answer
in section 7. So I moved the ENDDOCUMENT() back to the end of section 7.
Everything then worked fine so clearly the insult to section 7 was a lie. I have
removed the ENDDOCUMENT() from section 7 and we are back with the lie.
Here is the code.
##DESCRIPTION
## powers extended
##ENDDESCRIPTION
##KEYWORDS('Powers')
## DBsubject('')
## DBchapter('')
## DBsection('')
## Date('')
## Author('')
## Institution('')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')
########################################################################
DOCUMENT();
loadMacros(
"PGstandard.pl", # Standard macros for PG languag
"PGgraphmacros.pl",
"MathObjects.pl",
"compoundProblem.pl",
"unionLists.pl",
#"source.pl", # allows code to be displayed on certain sites.
#"PGcourse.pl", # Customization file for the course
);
# Print problem number and point value (weight) for the problem
TEXT(beginproblem());
# Show which answers are correct and which ones are incorrect
$showPartialCorrectAnswers = 1;
##############################################
$isProfessor = ($studentLogin eq 'kia' || $studentLogin eq 'professor');
#
# Start a compound problem. See the compoundProblem.pl
# file for more details about the parameters you
# can supply.
#
$cp = new compoundProblem(
parts => 10, # the total number of parts in this problem
totalAnswers => 40, # total answers in all parts combined
parserValues => 1, # make parser objects from student answers
allowReset => $isProfessor, # professors get Reset button for testing
);
$part = $cp->part; # look up the current part
##############################################
#
# Part 1
#
if ($part == 1) {
##############################################
##############################################################
#
# Setup
#
#
Context("Numeric");
Context()->flags->set(reduceConstants=>0);
##############################################################
#
# Text
#
#
#Context()->texStrings;
$graph = init_graph(-.1,-.1,7.1,2.1,pixels=>[700,200] );
# the size is 700 by 200 pixels (200 by 200 is default)
my $im = $graph->im;
$im->setPixel(0,7,0);
$graph->moveTo(0,1);
$graph->lineTo(7,1,'black');
$graph->moveTo(1.5,1.10);
$graph->lineTo(1.5,1.01,'red');
$graph->moveTo(.75,1.10);
$graph->lineTo(.75,1.01,'green');
$graph->moveTo(1,1.10);
$graph->lineTo(1,1.01,'blue');
$graph->moveTo(4.5,1.10);
$graph->lineTo(4.5,1.01,'black');
$new_label1= new Label (-.025, .86,'0','black',('bottom','left'));
$graph -> lb($new_label1);
$label2= new Label (2.975, .86,'1','black',('bottom','left'));
$graph -> lb($label2);
$label3= new Label (5.975, .86,'2','black',('bottom','left'));
$graph -> lb($label3);
TEXT(image(insertGraph($graph),width=>700,height=>400));
BEGIN_TEXT
THIS PROBLEM USES A SYSTEM TO PERMIT PROBLEMS IN WHICH A STUDENT CANNOT SEE
LATER PARTS OF THE PROBLEM UNTIL EARLIER PARTS ARE SATISFACTORILY COMPLETED.
THE SYSTEM IS NOT YET FULLY DEVELOPED AND SEVERAL PEOPLE AT DIFFERENT UNIVERSITIES ARE WORKING ON ELIMINATING THE DIFFICULTIES. THEY EXPECT THAT THE DIFFICULTIES
WILL BE ELIMINATED THIS SUMMER. UNTIL THEN THE PRINCIPAL ANNOYANCE WILL BE THAT
IN LATER PARTS YOU DO NOT HAVE THE OPPORTUNITY TO SUBMIT ANSWERS UNTIL AFTER
BEING TOLD THAT YOU ARE WRONG FOR NOT HAVING SUBMITTING THEN. IF YOU IGNORE THIS
TEMPORARY DIFFICULTY, PROBLEMS OF THIS TYPE WILL BE OTHERWISE CORRECT.
$PAR
$PAR
The picture above shows a part of the number line with the numbers 0, 1, and
2 marked (below the number line)by the longer vertical lines.$BR There are four short colored lines. Each
of these corresponds to a fraction and is put at the point on the number
line that represents that fraction. $BR The four short colored lines correspond to the factions \( \frac{1}{3}, \frac
{3}{2}, \frac{1}{2}, \frac{1}{4}\)
$PAR
The red line corresponds to the fraction \{ans_rule(3)\}
$PAR
The blue line corresponds to the fraction \{ans_rule(3)\}
$PAR
The green line corresponds to the fraction \{ans_rule(3)\}
$PAR
The black line corresponds to the fraction \{ans_rule(3)\}
$PAR
END_TEXT
##############################################################
#
# Answers
#
ANS(Real(1/2)->cmp);
ANS(Real(1/3)->cmp);
ANS(Real(1/4)->cmp);
ANS(Real(3/2)->cmp);
} # End of Part 1
##############################################
#
# Part 2
#
if ($part == 2) {
$graph = init_graph(-.1,-.1,6.1,2.1,pixels=>[600,200] );
# the size is 600 by 200 pixels (200 by 200 is default)
my $im = $graph->im;
$im->setPixel(0,7,0);
$graph->moveTo(0,1);
$graph->lineTo(6,1,'black');
$graph->moveTo(1.5,1);
$graph->lineTo(1.5,1.1,'red');
$graph->lineTo(1.5,1.2,'green');
$graph->moveTo(3,1);
$graph->lineTo(3,1.1,'red');
$graph->lineTo(3,1.2,'green');
$graph->lineTo(3,1.3,'blue');
$graph->moveTo(6,1);
$graph->lineTo(6,1.1,'red');
$graph->lineTo(6,1.2,'green');
$graph->lineTo(6,1.3,'blue');
$graph->moveTo(4.5,1);
$graph->lineTo(4.5,1.1,'red');
$graph->lineTo(4.5,1.2,'green');
$graph->moveTo(3.75,1);
$graph->lineTo(3.75,1.10,'green');
$graph->moveTo(5.25,1);
$graph->lineTo(5.25,1.10,'green');
$graph->moveTo(.75,1);
$graph->lineTo(.75,1.10,'green');
$graph->moveTo(2.25,1);
$graph->lineTo(2.25,1.10,'green');
$graph->moveTo(1,1);
$graph->lineTo(1,1.1,'blue');
$graph->moveTo(2,1);
$graph->lineTo(2,1.1,'blue');
$graph->moveTo(4,1);
$graph->lineTo(4,1.1,'blue');
$graph->moveTo(5,1);
$graph->lineTo(5,1.1,'blue');
$new_label1= new Label (-.025, .86,'0','black',('bottom','left'));
$graph -> lb($new_label1);
$label2= new Label (2.975, .86,'1','black',('bottom','left'));
$graph -> lb($label2);
$label3= new Label (5.975, .86,'2','black',('bottom','left'));
$graph -> lb($label3);
TEXT(image(insertGraph($graph),width=>600,height=>400));
BEGIN_TEXT
Part 2:
$PAR
The picture above shows a part of the number line with the numbers 0, 1, and
2 marked (below the number line) by the longer vertical lines.$BR Here some
points on the number line are marked with shorter colored lines (one or more
of them).
$PAR
All of the point with a line of the same color above them correspond to fractions that can be written with the same denominator.
$PAR
The smallest number which can be the denominator of all fractions with red lines above them is \{ans_rule(1)\}
$PAR
The smallest number which can be the denominator of all fractions with blue lines above them is \{ans_rule(1)\}
$PAR
The smallest number which can be the denominator of all fractions with green lines above them is \{ans_rule(1)\}
END_TEXT
##############################################################
#
# Answers
#
#
ANS(Real(2)->cmp);
ANS(Real(3)->cmp);
ANS(Real(4)->cmp);
} # End of Part 2
##############################################
#
# Part 3
#
if ($part == 3) {
$graph = init_graph(-.1,-.1,6.1,2.1,pixels=>[600,200] );
# the size is 600 by 200 pixels (200 by 200 is default)
my $im = $graph->im;
$im->setPixel(0,7,0);
$graph->moveTo(0,1);
$graph->lineTo(6,1,'black');
$graph->moveTo(1.5,1);
$graph->lineTo(1.5,1.1,'red');
$graph->lineTo(1.5,1.2,'green');
$graph->moveTo(3,1);
$graph->lineTo(3,1.1,'red');
$graph->lineTo(3,1.2,'green');
$graph->lineTo(3,1.3,'blue');
$graph->moveTo(6,1);
$graph->lineTo(6,1.1,'red');
$graph->lineTo(6,1.2,'green');
$graph->lineTo(6,1.3,'blue');
$graph->moveTo(4.5,1);
$graph->lineTo(4.5,1.1,'red');
$graph->lineTo(4.5,1.2,'green');
$graph->moveTo(3.75,1);
$graph->lineTo(3.75,1.10,'green');
$graph->moveTo(5.25,1);
$graph->lineTo(5.25,1.10,'green');
$graph->moveTo(.75,1);
$graph->lineTo(.75,1.10,'green');
$graph->moveTo(2.25,1);
$graph->lineTo(2.25,1.10,'green');
$graph->moveTo(1,1);
$graph->lineTo(1,1.1,'blue');
$graph->moveTo(2,1);
$graph->lineTo(2,1.1,'blue');
$graph->moveTo(4,1);
$graph->lineTo(4,1.1,'blue');
$graph->moveTo(5,1);
$graph->lineTo(5,1.1,'blue');
$new_label1= new Label (-.025, .86,'0','black',('bottom','left'));
$graph -> lb($new_label1);
$label2= new Label (2.975, .86,'1','black',('bottom','left'));
$graph -> lb($label2);
$label3= new Label (5.975, .86,'2','black',('bottom','left'));
$graph -> lb($label3);
$label4= new Label (1.49, .86,"1",'red',('bottom','left'));
$graph -> lb($label4);
$label5= new Label (1.49, .76,"2",'green',('bottom','left'));
$graph -> lb($label5);
$label6= new Label (.74,.86 ,"1",'green',('bottom','left'));
$graph -> lb($label6);
$label7= new Label (2.24,.86 ,"3",'green',('bottom','left'));
$graph -> lb($label7);
$label8= new Label (2.975,.76 ,"2",'red',('bottom','left'));
$graph -> lb($label8);
$label9= new Label (2.975,.66 ,"4",'green',('bottom','left'));
$graph -> lb($label9);
$label9a= new Label (2.975,.56 ,"3",'blue',('bottom','left'));
$graph -> lb($label9a);
$label10= new Label (.975,.86 ,"1",'blue',('bottom','left'));
$graph -> lb($label10);
$label11= new Label (1.975,.86 ,"2",'blue',('bottom','left'));
$graph -> lb($label11);
$label12= new Label (3.975,.86 ,"4",'blue',('bottom','left'));
$graph -> lb($label12);
$label13= new Label (4.975,.86 ,"5",'blue',('bottom','left'));
$graph -> lb($label13);
$label14= new Label (4.49,.86 ,"3",'red',('bottom','left'));
$graph -> lb($label14);
$label15= new Label (5.975,.76 ,"4",'red',('bottom','left'));
$graph -> lb($label15);
$label16= new Label (3.749,.86 ,"5",'green',('bottom','left'));
$graph -> lb($label16);
$label17= new Label (4.475,.76 ,"6",'green',('bottom','left'));
$graph -> lb($label17);
$label18= new Label (5.249,.86 ,"7",'green',('bottom','left'));
$graph -> lb($label18);
$label19= new Label (5.975,.66 ,"8",'green',('bottom','left'));
$graph -> lb($label19);
$label20= new Label (5.975,.56 ,"6",'blue',('bottom','left'));
$graph -> lb($label20);
TEXT(image(insertGraph($graph),width=>600,height=>400));
BEGIN_TEXT
Part 3:
$PAR
Now, to make the situation more clear, we have taken the previous picture
and added all the fraction values. However we have done it in an unusual way.$BR
We have used colors to indicate the denominators. The color green means that
the denominator 4 (that is a green 1 means \(\frac {1}{4}\)). The color red $BR
means that the denominator is 2 and the color blue means that the denominator
is 3. Notice that since \(\frac {2}{4} = \frac{1}{2} \) the third marked point $BR has both a red 1 and a green 2 beneath it.
$PAR
Now there is another (very useful) way of thinking about this. If we think of
the part of the number line as a sort of ruler, then its length is 2. That $BR
means that it is two units long, where a unit is measured by the distance from the
0 at the left we have to go to reach 1. Thus its end is 2 units from 0 and is marked by a black 2. $BR
$PAR
But suppose we thought of our unit as being the distance we had to go from the
left to reach \(frac {1}{3}\). Since thirds are represented by the blue color$BR
we will call these blue units. Then the end is 6 blue units from 0 and is marked by a blue 6.
$PAR
Our ruler is \{ans_rule(1)\} green units long.
$PAR
It takes \{ans_rule(1)\} green units to equal 3 blue units.
END_TEXT
##############################################################
#
# Answers
ANS(Real(8)->cmp);
ANS(Real(4)->cmp);
} #end of part 3
##############################################
#
# Part 4
#
if ($part == 4) {
$graph = init_graph(-.1,-.1,6.1,2.1,pixels=>[600,200] );
# the size is 600 by 200 pixels (200 by 200 is default)
my $im = $graph->im;
$im->setPixel(0,7,0);
$graph->moveTo(0,1);
$graph->lineTo(6,1,'black');
$graph->moveTo(1.5,1);
$graph->lineTo(1.5,1.1,'red');
$graph->lineTo(1.5,1.2,'green');
$graph->moveTo(3,1);
$graph->lineTo(3,1.1,'red');
$graph->lineTo(3,1.2,'green');
$graph->lineTo(3,1.3,'blue');
$graph->moveTo(6,1);
$graph->lineTo(6,1.1,'red');
$graph->lineTo(6,1.2,'green');
$graph->lineTo(6,1.3,'blue');
$graph->moveTo(4.5,1);
$graph->lineTo(4.5,1.1,'red');
$graph->lineTo(4.5,1.2,'green');
$graph->moveTo(3.75,1);
$graph->lineTo(3.75,1.10,'green');
$graph->moveTo(5.25,1);
$graph->lineTo(5.25,1.10,'green');
$graph->moveTo(.75,1);
$graph->lineTo(.75,1.10,'green');
$graph->moveTo(2.25,1);
$graph->lineTo(2.25,1.10,'green');
$graph->moveTo(1,1);
$graph->lineTo(1,1.1,'blue');
$graph->moveTo(2,1);
$graph->lineTo(2,1.1,'blue');
$graph->moveTo(4,1);
$graph->lineTo(4,1.1,'blue');
$graph->moveTo(5,1);
$graph->lineTo(5,1.1,'blue');
$new_label1= new Label (-.025, .86,'0','black',('bottom','left'));
$graph -> lb($new_label1);
$label2= new Label (2.975, .86,'1','black',('bottom','left'));
$graph -> lb($label2);
$label3= new Label (5.975, .86,'2','black',('bottom','left'));
$graph -> lb($label3);
$label4= new Label (1.49, .86,"1",'red',('bottom','left'));
$graph -> lb($label4);
$label5= new Label (1.49, .76,"2",'green',('bottom','left'));
$graph -> lb($label5);
$label6= new Label (.74,.86 ,"1",'green',('bottom','left'));
$graph -> lb($label6);
$label7= new Label (2.24,.86 ,"3",'green',('bottom','left'));
$graph -> lb($label7);
$label8= new Label (2.975,.76 ,"2",'red',('bottom','left'));
$graph -> lb($label8);
$label9= new Label (2.975,.66 ,"4",'green',('bottom','left'));
$graph -> lb($label9);
$label9a= new Label (2.975,.56 ,"3",'blue',('bottom','left'));
$graph -> lb($label9a);
$label10= new Label (.975,.86 ,"1",'blue',('bottom','left'));
$graph -> lb($label10);
$label11= new Label (1.975,.86 ,"2",'blue',('bottom','left'));
$graph -> lb($label11);
$label12= new Label (3.975,.86 ,"4",'blue',('bottom','left'));
$graph -> lb($label12);
$label13= new Label (4.975,.86 ,"5",'blue',('bottom','left'));
$graph -> lb($label13);
$label14= new Label (4.49,.86 ,"3",'red',('bottom','left'));
$graph -> lb($label14);
$label15= new Label (5.975,.76 ,"4",'red',('bottom','left'));
$graph -> lb($label15);
$label16= new Label (3.749,.86 ,"5",'green',('bottom','left'));
$graph -> lb($label16);
$label17= new Label (4.475,.76 ,"6",'green',('bottom','left'));
$graph -> lb($label17);
$label18= new Label (5.249,.86 ,"7",'green',('bottom','left'));
$graph -> lb($label18);
$label19= new Label (5.975,.66 ,"8",'green',('bottom','left'));
$graph -> lb($label19);
$label20= new Label (5.975,.56 ,"6",'blue',('bottom','left'));
$graph -> lb($label20);
TEXT(image(insertGraph($graph),width=>600,height=>400));
BEGIN_TEXT
Part 4:
$PAR
Now we will do something that seems very strange but will help explain something
that many people find difficult. We will give the lengths names in an unusual way
$PAR
We will just say that the black units are "units" since they measure
our ruler by the number of 1's.
$BR
We will call our red units are "half-units" since they measure our ruler by the
number of \(\frac {1}{2}\)'s.
$BR
We will call our blue units are "one-third-units" since they measure our ruler by the
number of \(\frac {1}{3}\)'s.
$BR
We will call our red units are "quarter-units" since they measure our ruler by the
number of \(\frac {1}{4}\)'s.
$PAR
Nothing unusual yet. But now suppose we know the number of units of one color
for a certain length and want to know the number of units of another color for
the same length. $BR Well, let's experiment with an example.
We will compare various lengths in green units and black units. Some we
will take from our ruler and some from a longer ruler that we can imagine.$BR
We will make a table with the first row for green units and the second
row for black units. I will fill in some numbers and you will fill in others.$BR
Remember that a number in the first row is some length in green units and the
number below it is the same length in black units.
(Ignore the little dots which were needed for spacing.)
$PAR
\(Green \ \ \ \ \ \ \ 4\ \ \ \ \ \ \.\) \{ans_rule(1)\}\(\ .\ \ \ \ 12\)
$BR
\(Black\ \ \ \ \ \ \ 1 \ \ \ \ \ \ \ 2 \ \ \ \ \ \ \ \ \ \ \. \) \{ans_rule(1)\}
$BR
END_TEXT
##############################################################
#
# Answers
ANS(Real(8)->cmp);
ANS(Real(3)->cmp);
} #end of part 4
##############################################
#
# Part 5
#
if ($part == 5) {
BEGIN_TEXT
Part 5:
Well, if you have gotten here you have filled out the table correctly. Now let's look at it a bit more closely.
$PAR
\(Green \ \ \ \ \ \ \ 4 \ \ \ \ \ \ \ 8 \ \ \ \ \ \ \ 12\)
$BR
\(Black \ \ \ \ \ \ \ 1 \ \ \ \ \ \ \ 2 \ \ \ \ \ \ \ \ 3\)
$PAR
First lets notice that every number in the second row is equal to the
number in the number above it divided by four, or, said in another way,$BR
every number in the first row is four times the number below it. Should
this be surprising?$PAR
If you think it over, it should not be surprising. Since it takes four green
units to make a black unit, the number of green units it takes to add
up to a certain length$BR should be four times the number of black units. or, in
other words, the number of black units it takes to add up to that length should be one quarter of the number of green units.
$PAR
Now lets talk about this example in one more way, replacing our "color"
language by "unit" language$BR
It takes four times as many quarter-units to make a number as it takes units.
It takes one quarter the number of units to make a number as it takes quarter-units.
$PAR
Let's see if you are comfortable with these ideas.
$PAR
It takes \{ans_rule(1)\} quarter-units to make 4 units.
$PAR
It takes 24 quarter-units to make \{ans_rule(1)\} units.
$PAR
END_TEXT
##############################################################
#
# Answers
ANS(Real (16)-> cmp);
ANS(Real (6)-> cmp);
} #end of part 5
##############################################
#
# Part 6
#
if ($part == 6) {
BEGIN_TEXT
Part 6:
You have been very patient to do all this thinking without knowing why we were
doing all this. Now you will see the reason.
$PAR
In the work in the last two parts we have only compared numbers of units and
quarter units that were integers (whole numbers). If we change our language
a bit $BR we can say what we have said in Part 5 in another way.
$PAR
What your answers to the last two questions said can be explained as$BR
\(16\times \frac{1}{4} =4\) and \(24\times \frac{1}{4}=6\), or more simply
\(\frac{16}{4} =4\) and \(\frac{24}{6}=4\).
$PAR
This probably does not surprise you too much but what comes next might be
a surprise. We will use the same reasoning to extend our table and see
what happens.
$PAR
\(Green \ \ \ \ \ \ \ 4 \ \ \ \ \ \ \ 8 \ \ \ \ \ \ \ 12\ \ \ \ \ \ 1\ \ \ \ \ \ \ . \)\{ans_rule(1)\}
$BR
\(Black \ \ \ \ \ \ \ 1 \ \ \ \ \ \ \ 2 \ \ \ \ \ \ \ \ 3\ \ \ \ \ . \)\{ans_rule(2)\}\(.\ \ \frac{3}{4}\)
$PAR
END_TEXT
##############################################################
#
# Answers
ANS( Real(3)->cmp,Real(1/4)->cmp);
} #end of part 6
##############################################
#
# Part 7
#
if ($part == 7) {
BEGIN_TEXT
Part 7:
Now remember that from the fact that 24 was above 6 in our table and that
there are 4 green units in each black unit, we deduced
that $BR
\(\frac{24}{6}=4\)
$PAR Now if we use the fact that 1 is above \(\frac{1}{4}\) in our table and
there are 4 green units in each black unit, we see that
$PAR
\(\frac{1}{(\frac{1}{4})}=4\).
$PAR
Looking again at our table, we see that \(\frac{3}{(\frac{3}{4})}=4\).
$PAR
This illustrates the fact that we can divide by a fraction by inverting
(turning over) the fraction in the denominator and multipying it by the
numerator.$BR For example, since \(\frac{3}{(\frac{3}{4})}=4\) we can
dividing both sides by 3 to see that \(\frac{1}{(\frac{3}{4})}=\frac{4}{3}\)
$PAR
So, for example, if we wanted to divide \(\frac{9}{4}\) by \(\frac {3}{8}\)
and wanted to end up with a reduced fraction $BR
(no integer greater than 1 dividing
both numerator and denominator) we would proceed as follows:
$PAR
\( \frac{(\frac {9}{4})}{(\frac{3}{8})}= \frac {9}{4}\times \frac{8}{3}=\frac{72}{12}=6\)
$PAR
Now you can try a few:
$PAR
\(\frac{(\frac {9}{4})}{(\frac {27}{8})}}=\) \{ans_rule(1)\}
$PAR
\(\frac{(\frac {11}{9})}{(\frac {77}{45})}=\) \{ans_rule(1)\}
$PAR
\(\frac{100}{(\frac {75}{4})}=\) \{ans_rule(1)\}
END_TEXT
##############################################################
#
# Answers
ANS(Real (2/3)-> cmp);
ANS(Real (5/7)-> cmp);
ANS(Real (16/3)-> cmp);
} #end of part 7
##############################################
#
# Part 8
if ($part == 8) {
BEGIN_TEXT
END_TEXT
##############################################################
#
# Answers
ANS( Real(1)->cmp);
ANS(Real (Real (102)->cmp);
} #end of part 8
ENDDOCUMENT()
##############################################
#
# Part 9
#
if ($part == 9) {
Context()->texStrings;
BEGIN_TEXT
Part 9: Here we get the next digit of the quotient
$PAR
=\{ans_rule(1)\}
END_TEXT
##############################################################
#
# Answers
Context("LimitedNumeric");
ANS( Real(46)->cmp,Real(109)->cmp,Real(102 )->cmp ,Real(7 )->cmp) ;
} #end of part 9
##############################################
#
# Part 10
#
if ($part == 10) {
##############################################
#
# Part 9
#
if ($part == 9) {
Context()->texStrings;
BEGIN_TEXT
Part 9: Here we get the next digit of the quotient
$PAR
=\{ans_rule(1)\}
END_TEXT
##############################################################
#
# Answers
Context("LimitedNumeric");
ANS( Real(46)->cmp,Real(109)->cmp,Real(102 )->cmp ,Real(7 )->cmp) ;
} #end of part 9
##############################################
#
# Part 10
#
if ($part == 10) {
Context()->texStrings;
BEGIN_TEXT
Part 10: Here we finish the problem.
$PAR
\{ans_rule(1)\}
END_TEXT
##############################################################
#
# Answers
Context("LimitedNumeric");
ANS( Real(464)->cmp,Real(72)->cmp,Real(68) ->cmp ,Real(4 ) ->cmp ) ;
} #end of part 10
##############################################
#
ENDDOCUMENT()
Part 8:
Now that you have gotten this far, we can mention one more
interesting thing that you can do with what you have learned. $BR
Sometimes it is important to know which of two fractions is larger.
When the fractions are ugly, this can look difficult. $BR. For
example, you might be asked which of \(\frac{203}{307}\) and
\(\frac{29}{44}\) is larger.
$PAR
Here is an easy way to think about this kind of problem. Suppose a number a
is less than a number b. Which of the three statements below is true:
$PAR
1) \(\frac{a}{b} <1\)
$PAR
2) \(\frac{a}{b} =1\)
$PAR
3) \(\frac{a}{b} >1\)
$PAR The true statement is the one with label \{ans_rule(1)\})
Ken Appel
In reply to Kenneth Appel
Re: A compound problem that tests my shaky hold on sanity
by Davide Cervone -
The problem is really at line 662, not 641. It is the extra "Real(" on that line.
The reason that the line number is reported incorrectly is that the PG translator is stripping out blank lines before BEGIN_TEXT and after END_TEXT before processing the code, but it uses the original PG file in the error output. That means the line numbers don't match up between the error message and the listed code.
I have modified the PG Translator to not remove the blank lines, and that should make it report the proper error lines in the future. You will need to get the latest version of /pg/lib/WeBWorK/PG/Translator.pm for that.
Davide
The reason that the line number is reported incorrectly is that the PG translator is stripping out blank lines before BEGIN_TEXT and after END_TEXT before processing the code, but it uses the original PG file in the error output. That means the line numbers don't match up between the error message and the listed code.
I have modified the PG Translator to not remove the blank lines, and that should make it report the proper error lines in the future. You will need to get the latest version of /pg/lib/WeBWorK/PG/Translator.pm for that.
Davide