Skip to content

Commit 0690ab5

Browse files
committed
display error, exponent error, bug fixes
1 parent 81da10e commit 0690ab5

5 files changed

Lines changed: 18 additions & 17 deletions

File tree

Contrib/CCCS/AlgebraicLiteracy/IA_6.5/OpenStax_IA_6.5_296.pg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Context("Numeric");
3636

3737
# Problem can be factored as (x + a)(x + b) = 0
3838
#Solutions are x = -a, -b
39-
$a = non_zero_random(-10, 10, 2);
39+
do{$a = non_zero_random(-10, 10, 2);
4040
$b = non_zero_random (-10, 10);
4141

4242
#expanded form
@@ -47,7 +47,7 @@ $last = $a*$b;
4747
#problem is x(x + c) = n(x + d)
4848
#x^2 + (c - n)x -nd = 0
4949
$n = 2;
50-
$c = $middle + $n;
50+
$c = $middle + $n;}until($c != 0);
5151
$d = $last/-$n;
5252

5353
$right = Compute("x(x + $c)")->reduce;

Contrib/CCCS/CalculusOne/04.10/CCD_CCCS_Openstax_Calc1_C1-2016-002_4_10_493.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ BEGIN_PGML_HINT
5858

5959
If you break up the fraction and simplify, it will make it easier to identify the antiderivative.
6060

61-
For example: [`\frac{2x^9+5x^2}{x^5} = \frac{2x^9}{x^5}+\frac{5x^2}{x^5} = 2x^5+5x^{-3}`]
61+
For example: [`\frac{2x^9+5x^2}{x^5} = \frac{2x^9}{x^5}+\frac{5x^2}{x^5} = 2x^4+5x^{-3}`]
6262

6363
END_PGML_HINT
6464
############################

Contrib/CCCS/CalculusOne/04.3/CCD_CCCS_Openstax_Calc1_C1-2016-002_4_3_140.pg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ $showPartialCorrectAnswers = 1;
4141
# Setup
4242

4343
$a=random(1,3,1);
44-
$b=random(1000, 2000, 100);
45-
$c=random(36000, 40000, 50);
46-
$ans1=Compute(1000*$b/(2*$a));
47-
$fun=Formula("$a*x^2-$b*x+$c")->reduce;
48-
44+
$h = random(100,400,1);
45+
$k = random(36000,40000,50);
46+
$c = $h**2+$k;
47+
$ans = Compute(1000*$h);
4948

49+
$fun = Formula("$a*x**2-2*$a*$h*x+$c")->reduce;
5050
#################################
5151
# Main text
5252

@@ -55,7 +55,7 @@ BEGIN_PGML
5555
A company that produces cell phones has a cost function of [`C(x) = [$fun]`] where [`C`] is cost in dollars and [`x`] is number of cell phones produced (in
5656
thousands). How many units of cell phones minimizes this cost function?
5757

58-
Cost function is minimized at [________________]{$ans1} cell phones. [@ AnswerFormatHelp("numbers") @]*
58+
Cost function is minimized at [________________]{$ans} cell phones. [@ AnswerFormatHelp("numbers") @]*
5959

6060

6161
END_PGML

Contrib/CCCS/CalculusOne/05.6/CCD_CCCS_Openstax_Calc1_C1-2016-002_5_6_320.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $a = random(2,25,1);
3131
$b = random(2,30,1);
3232
$c = random(-20,20,1);
3333
$func = FormulaUpToConstant("($a/$b)*e**{$b*x} + $c*x + C");
34-
34+
$func->{limits} = [0.1,0.2];
3535
BEGIN_PGML
3636

3737
Evaluate the following indefinite integral.

Contrib/CCCS/PreCalculus/6.2/CCD_CCCS_Openstax_AlgTrig_AT-1-001-AS_6_2_sup1.pg

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,23 @@ $showPartialCorrectAnswers = 1;
4343
# Setup
4444

4545
Context("Numeric");
46-
46+
Context()->noreduce('(-x)-y','(-x)+y');
4747
$a = random(2,5,1);
4848
$vertshift = non_zero_random(-8,8,1);
4949
do{$horizshift = non_zero_random(-4,4,1);} until ($horizshift != $vertshift);
5050
$stretch = random(0.15, 2, 0.1 );
5151

5252

5353
if ($vertshift>0, $horizshift>0)
54-
{$func = ("-$stretch($a^(x+$horizshift)) + $vertshift");}
54+
{$func = Formula("-$stretch($a^(x+$horizshift)) + $vertshift")->reduce;}
5555
if ($vertshift>0, $horizshift<0)
56-
{$func = ("-$stretch($a^(x $horizshift)) + $vertshift");}
56+
{$func = Formula("-$stretch($a^(x $horizshift)) + $vertshift")->reduce;}
5757
if ($vertshift<0, $horizshift<0)
58-
{$func = ("-$stretch($a^(x $horizshift)) + $vertshift");}
59-
else{ $func = ("-$stretch($a^(x+$horizshift)) + $vertshift");};
58+
{$func = Formula("-$stretch($a^(x $horizshift)) + $vertshift")->reduce;}
59+
else{ $func = Formula("-$stretch($a^(x+$horizshift)) + $vertshift")->reduce;};
6060

6161
$absvertshift = abs($vertshift);
62+
$abshorizshift = abs($horizshift);
6263

6364
$ans1 = Formula("$a^x");
6465

@@ -91,8 +92,8 @@ if ($horizshift>0)
9192

9293
else {
9394
$popup2 = PopUp(
94-
["?","Upward shift of $horizshift units", "Downward shift of $horizshift units", "Left shift of $horizshift units", "Right shift of $horizshift units"],
95-
"Right shift of $horizshift units",
95+
["?","Upward shift of $abshorizshift units", "Downward shift of $abshorizshift units", "Left shift of $abshorizshift units", "Right shift of $abshorizshift units"],
96+
"Right shift of $abshorizshift units",
9697
);
9798

9899
};

0 commit comments

Comments
 (0)