Skip to content

Commit 31d5099

Browse files
committed
display fixes
1 parent ede02e4 commit 31d5099

File tree

5 files changed

+50
-30
lines changed

5 files changed

+50
-30
lines changed

Contrib/CCCS/CollegeAlgebra/3.2/RRCC_CCCS_Openstax_AlgTrig_AT-1-001-AS_3_2_43.pg

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ loadMacros(
2323
"PGauxiliaryFunctions.pl",
2424
"PGgraphmacros.pl",
2525
"PGnumericalmacros.pl",
26+
"PGstandard.pl",
27+
"MathObjects.pl",
28+
"PGunion.pl",
29+
"answerHints.pl",
30+
"PGML.pl",
31+
"PGcourse.pl",
32+
"niceTables.pl"
2633
);
2734

2835
do {$x1 = random(-5,-3,1) ;
@@ -36,7 +43,6 @@ $y3 = random(-5,5,1);
3643
$slope1 = ($y2- $y1)/($x2 - $x1);
3744
$slope2 = ($y3- $y2)/($x3 - $x2);
3845

39-
#TEXT($BEGIN_ONE_COLUMN);
4046
TEXT(beginproblem());
4147
$showPartialCorrectAnswers = 1;
4248

@@ -49,33 +55,33 @@ add_functions($graph, "$slope2*(x-$x2)+$y2 for x in <$x2,$x3>".
4955
$graph->stamps(open_circle($x1,$y1,'blue'), open_circle($x2,$y2,'blue'), open_circle($x3, $y3,'blue') );
5056
$in=time();
5157
$graph->gifName($graph->gifName()."$in");
58+
59+
$piecewise =
60+
BeginTable().
61+
Row(["\(\displaystyle f(x) = \Bigg\{ \; \)",ans_rule(1).$BR.$BR.ans_rule(1),'\(\displaystyle for \)'.$BR.$BR.'\(\displaystyle for \)',ans_rule(1).$BR.$BR.ans_rule(1), '\( < x < \)'.$BR.$BR. '\( < x < \)', ans_rule(1).$BR.$BR.ans_rule(1)],separation=>1).
62+
EndTable();
63+
5264
BEGIN_TEXT
5365
$BCENTER
5466
\{ image(insertGraph($graph),tex_size => 400, width=>400, height=>400) \}
5567
$ECENTER
5668
$BR
5769
$BR
58-
Fill in the blanks to describe the given piecewise graph. Hint: In each row, the first blank should be the function, the second blank should be the lower bound for x, and the third blank should be the upper bound for x.
70+
Fill in the blanks to describe the given piecewise graph. (Note: Enter your answers with the function in the left blank and the `x` intervals for the second two blanks. Be sure the first line is the function with the smallest `x` values and the second line is the function with the largest `x` values.)
5971
$BR
6072
$BR
6173
END_TEXT
6274

63-
TEXT(
64-
begintable(3),
65-
row( '', ans_rule(20), EV2(" \{ans_rule(3)\} < x < \{ans_rule(3) \} ")),
66-
row(EV2("\(f(x) = \)"), '',''),
67-
row( '', ans_rule(20), EV2(" \{ans_rule(3)\} < x < \{ans_rule(3) \} ") ),
68-
endtable()
69-
);
75+
BEGIN_PGML
76+
[$piecewise]*
77+
END_PGML
78+
7079
$slope1 = ($y2- $y1)/($x2 - $x1);
7180
$slope2 = ($y3- $y2)/($x3 - $x2);
7281
$ans1 = FEQ( EV2(" $slope1*(x - $x1) + $y1 ") );
7382
$ans2 = FEQ( EV2(" $slope2*(x - $x2) + $y2 ") );
7483

84+
ANS(fun_cmp($ans1),fun_cmp($ans2),num_cmp([$x1,$x2,$x2,$x3]), );
7585

76-
ANS(fun_cmp($ans1), num_cmp([$x1,$x2]),fun_cmp($ans2),num_cmp([$x2,$x3]), );
77-
78-
ANS(@answers);
79-
#TEXT($END_ONE_COLUMN);
8086
ENDDOCUMENT(); # This should be the last executable line in the problem.
8187

Contrib/CCCS/PreCalculus/08.3/CCD_CCCS_Openstax_AlgTrig_AT-1-001-AS_8_3_25.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Context()->functions->enable("sqrt");
4242
$n=random(0,7,1);
4343

4444
# Array of 8 angles
45-
@latexfraction=("11pi/6", "pi/3" ,"pi/4" ,"pi/6", "(2pi)/3" , "(3pi)/4", "(5pi)/6", "pi");
45+
@latexfraction=("(11pi)/6", "pi/3" ,"pi/4" ,"pi/6", "(2pi)/3" , "(3pi)/4", "(5pi)/6", "pi");
4646

4747
# Selecting angle for PGML
4848
$a = $latexfraction[$n] ;

Contrib/CCCS/PreCalculus/08.3/CCD_CCCS_Openstax_AlgTrig_AT-1-001-AS_8_3_30.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Context()->functions->enable("sqrt");
4242
$n=random(0,7,1);
4343

4444
# Array of 8 angles
45-
@latexfraction=("11pi/6", "pi/3" ,"pi/4" ,"pi/6", "(2pi)/3" , "(3pi)/4", "(5pi)/6", "pi");
45+
@latexfraction=("(11pi)/6", "pi/3" ,"pi/4" ,"pi/6", "(2pi)/3" , "(3pi)/4", "(5pi)/6", "pi");
4646

4747
# Selecting angle for PGML
4848
$a = $latexfraction[$n] ;

Contrib/CCCS/PreCalculus/3.2/RRCC_CCCS_Openstax_AlgTrig_AT-1-001-AS_3_2_43.pg

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## DBsection(Piecewise functions)
1010
## Date(06/06/2017)
1111
## Institution(Red Rocks Community College, Colorado Community College System)
12-
## Author(Craig Faulhaber)
12+
## Author(Craig Faulhaber, Updated Brittni Lorton February 2022)
1313
## MO(1)
1414
## KEYWORDS('college algebra')
1515

@@ -23,6 +23,12 @@ loadMacros(
2323
"PGauxiliaryFunctions.pl",
2424
"PGgraphmacros.pl",
2525
"PGnumericalmacros.pl",
26+
"PGstandard.pl",
27+
"PGunion.pl",
28+
"MathObjects.pl",
29+
"PGML.pl",
30+
"PGcourse.pl",
31+
"niceTables.pl"
2632
);
2733

2834
do {$x1 = random(-5,-3,1) ;
@@ -33,41 +39,49 @@ $x3 = random(3,5,1);
3339
$y3 = random(-5,5,1);
3440
} until (abs($y1-$y2)<4 && $y1!=$y2 && ($y3- $y2)/($x3 - $x2)<2 && ($y3- $y2)/($x3 - $x2)!=($y2- $y1)/($x2 - $x1));
3541

42+
$slope1 = ($y2- $y1)/($x2 - $x1);
43+
$slope2 = ($y3- $y2)/($x3 - $x2);
44+
3645
#TEXT($BEGIN_ONE_COLUMN);
3746
TEXT(beginproblem());
3847
$showPartialCorrectAnswers = 1;
3948

4049
$graph = init_graph(-6,-6,6,6,grid =>[12,12], axes => [0,0]);
41-
$f1 = new Fun( plot_list([$x1, $x2, $x3],[ $y1,$y2,$y3]), $graph);
50+
#$f1 = new Fun( plot_list([$x1, $x2, $x3],[ $y1,$y2,$y3]), $graph);
51+
add_functions($graph, "$slope1*(x-$x1)+$y1 for x in <$x1,$x2>".
52+
" using color:blue and weight:3");
53+
add_functions($graph, "$slope2*(x-$x2)+$y2 for x in <$x2,$x3>".
54+
" using color:blue and weight:3");
4255
$graph->stamps(open_circle($x1,$y1,'blue'), open_circle($x2,$y2,'blue'), open_circle($x3, $y3,'blue') );
56+
$in=time();
57+
$graph->gifName($graph->gifName()."$in");
58+
59+
$piecewise =
60+
BeginTable().
61+
Row(["\(\displaystyle f(x) = \Bigg\{ \; \)",ans_rule(1).$BR.$BR.ans_rule(1),'\(\displaystyle for \)'.$BR.$BR.'\(\displaystyle for \)',ans_rule(1).$BR.$BR.ans_rule(1), '\( < x < \)'.$BR.$BR. '\( < x < \)', ans_rule(1).$BR.$BR.ans_rule(1)],separation=>1).
62+
EndTable();
4363

4464
BEGIN_TEXT
4565
$BCENTER
4666
\{ image(insertGraph($graph),tex_size => 400, width=>400, height=>400) \}
4767
$ECENTER
4868
$BR
4969
$BR
50-
Fill in the blanks to describe the given piecewise graph. Hint: In each row, the first blank should be the function, the second blank should be the lower bound for x, and the third blank should be the upper bound for x.
51-
$BR
70+
Fill in the blanks to describe the given piecewise graph. (Note: Enter your answers with the function in the left blank and the `x` intervals for the second two blanks. Be sure the first line is the function with the smallest `x` values and the second line is the function with the largest `x` values.)
5271
$BR
5372
END_TEXT
5473

55-
TEXT(
56-
begintable(3),
57-
row( '', ans_rule(20), EV2(" \{ans_rule(3)\} < x < \{ans_rule(3) \} ")),
58-
row(EV2("\(f(x) = \)"), '',''),
59-
row( '', ans_rule(20), EV2(" \{ans_rule(3)\} < x < \{ans_rule(3) \} ") ),
60-
endtable()
61-
);
74+
BEGIN_PGML
75+
[$piecewise]*
76+
END_PGML
77+
6278
$slope1 = ($y2- $y1)/($x2 - $x1);
6379
$slope2 = ($y3- $y2)/($x3 - $x2);
6480
$ans1 = FEQ( EV2(" $slope1*(x - $x1) + $y1 ") );
6581
$ans2 = FEQ( EV2(" $slope2*(x - $x2) + $y2 ") );
6682

83+
ANS(fun_cmp($ans1),fun_cmp($ans2),num_cmp([$x1,$x2,$x2,$x3]), );
6784

68-
ANS(fun_cmp($ans1), num_cmp([$x1,$x2]),fun_cmp($ans2),num_cmp([$x2,$x3]), );
6985

70-
ANS(@answers);
71-
#TEXT($END_ONE_COLUMN);
7286
ENDDOCUMENT(); # This should be the last executable line in the problem.
7387

Contrib/CCCS/Trigonometry/08.3/CCD_CCCS_Openstax_AlgTrig_AT-1-001-AS_8_3_25.pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Context()->functions->enable("sqrt");
4242
$n=random(0,7,1);
4343

4444
# Array of 8 angles
45-
@latexfraction=("11pi/6", "pi/3" ,"pi/4" ,"pi/6", "(2pi)/3" , "(3pi)/4", "(5pi)/6", "pi");
45+
@latexfraction=("(11pi)/6", "pi/3" ,"pi/4" ,"pi/6", "(2pi)/3" , "(3pi)/4", "(5pi)/6", "pi");
4646

4747
# Selecting angle for PGML
4848
$a = $latexfraction[$n] ;

0 commit comments

Comments
 (0)