Skip to content

Commit f6a75ab

Browse files
authored
Merge pull request #918 from brittnilorton/master
display fixes
2 parents 4974b99 + 0fbdc2c commit f6a75ab

File tree

5 files changed

+48
-32
lines changed

5 files changed

+48
-32
lines changed

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

Lines changed: 19 additions & 15 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

@@ -47,35 +53,33 @@ add_functions($graph, "$slope1*(x-$x1)+$y1 for x in <$x1,$x2>".
4753
add_functions($graph, "$slope2*(x-$x2)+$y2 for x in <$x2,$x3>".
4854
" using color:blue and weight:3");
4955
$graph->stamps(open_circle($x1,$y1,'blue'), open_circle($x2,$y2,'blue'), open_circle($x3, $y3,'blue') );
50-
$in=time();
51-
$graph->gifName($graph->gifName()."$in");
56+
57+
$piecewise =
58+
BeginTable().
59+
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).
60+
EndTable();
61+
5262
BEGIN_TEXT
5363
$BCENTER
5464
\{ image(insertGraph($graph),tex_size => 400, width=>400, height=>400) \}
5565
$ECENTER
5666
$BR
5767
$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.
68+
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.)
5969
$BR
6070
$BR
6171
END_TEXT
6272

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-
);
73+
BEGIN_PGML
74+
[$piecewise]*
75+
END_PGML
76+
7077
$slope1 = ($y2- $y1)/($x2 - $x1);
7178
$slope2 = ($y3- $y2)/($x3 - $x2);
7279
$ans1 = FEQ( EV2(" $slope1*(x - $x1) + $y1 ") );
7380
$ans2 = FEQ( EV2(" $slope2*(x - $x2) + $y2 ") );
7481

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

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);
8084
ENDDOCUMENT(); # This should be the last executable line in the problem.
8185

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: 26 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,47 @@ $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') );
4356

57+
$piecewise =
58+
BeginTable().
59+
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).
60+
EndTable();
61+
4462
BEGIN_TEXT
4563
$BCENTER
4664
\{ image(insertGraph($graph),tex_size => 400, width=>400, height=>400) \}
4765
$ECENTER
4866
$BR
4967
$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
68+
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.)
5269
$BR
5370
END_TEXT
5471

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-
);
72+
BEGIN_PGML
73+
[$piecewise]*
74+
END_PGML
75+
6276
$slope1 = ($y2- $y1)/($x2 - $x1);
6377
$slope2 = ($y3- $y2)/($x3 - $x2);
6478
$ans1 = FEQ( EV2(" $slope1*(x - $x1) + $y1 ") );
6579
$ans2 = FEQ( EV2(" $slope2*(x - $x2) + $y2 ") );
6680

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

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

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

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)