Skip to content

Commit d1aaeca

Browse files
committed
Fix bug 4694, improve wording
1 parent 2648acd commit d1aaeca

File tree

1 file changed

+67
-39
lines changed
  • OpenProblemLibrary/AlfredUniv/anton8e/chapter10/review

1 file changed

+67
-39
lines changed

OpenProblemLibrary/AlfredUniv/anton8e/chapter10/review/prob7.pg

+67-39
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ DOCUMENT();
3232
loadMacros(
3333
"PGstandard.pl",
3434
"MathObjects.pl",
35-
"PGgraphmacros.pl",
35+
# "PGgraphmacros.pl",
36+
"parserRadioButtons.pl",
3637
"PGchoicemacros.pl",
3738
"PGcourse.pl"
3839
);
@@ -46,69 +47,96 @@ my @all,@correct,%difference;
4647
##
4748
## The list of series tests
4849
##
49-
Context()->strings->are("Converges"=>{},"Converges Absolutely"=>{},"Converges Conditionally"=>{},"Diverges"=>{},"Divergence Test"=>{},"Geometric Series"=>{},"Integral Test"=>{},"P-Series"=>{},"Comparison Test"=>{},"Limit Comparison Test"=>{},"Ratio Test"=>{},"Alternating Series Test"=>{});
50+
Context("Numeric");
51+
Context()->variables->are(n=>"Real");
5052

51-
$blank = String("");
52-
$converges = String("Converges");
53-
$convergesabs = String("Converges Absolutely");
54-
$convergescond = String("Converges Conditionally");
55-
$diverges = String("Diverges");
56-
57-
$divergence = String("Divergence Test");
58-
$geometric = String("Geometric Series");
59-
$integral = String("Integral Test");
60-
$pseries = String("P-Series");
61-
$comparison = String("Comparison Test");
62-
$limitcomparison = String("Limit Comparison Test");
63-
$ratio = String("Ratio Test");
64-
$alternating = String("Alternating Series Test");
53+
#Context()->strings->are("Converges"=>{},"Converges Absolutely"=>{},"Converges Conditionally"=>{},"Diverges"=>{},"Divergence Test"=>{},"Geometric Series"=>{},"Integral Test"=>{},"P-Series"=>{},"Comparison Test"=>{},"Limit Comparison Test"=>{},"Ratio Test"=>{},"Alternating Series Test"=>{});
6554

55+
#$blank = String("");
56+
#$converges = String("Converges");
57+
#$convergesabs = String("Converges Absolutely");
58+
#$convergescond = String("Converges Conditionally");
59+
#$diverges = String("Diverges");
60+
#
61+
#$divergence = String("Divergence Test");
62+
#$geometric = String("Geometric Series");
63+
#$integral = String("Integral Test");
64+
#$pseries = String("P-Series");
65+
#$comparison = String("Comparison Test");
66+
#$limitcomparison = String("Limit Comparison Test");
67+
#$ratio = String("Ratio Test");
68+
#$alternating = String("Alternating Series Test");
6669

6770
##############################################################################
6871
##############################################################################
6972
##
7073
## Set up the infinite series
7174
##
7275
## To change the problem change $n the start value for the series, $an the
73-
## terms of the series, $correct which is the list of test that can be used
74-
## for the series, $ans which is whether the series converges or not.
75-
76-
Context()->variables->are(n=>"Real",k=>"Real");
76+
## terms of the series, @correct which is the list of tests that could be used
77+
## for the series, @wrong which a list of tests that wouldn't work,
78+
## and $ans which indicates whether the series converges or not.
7779

7880
$n = 1; # starting value for the series
79-
$an = Formula("(-1)^nn/(2n)!")->TeX;
80-
$ans = $convergesabs;
81-
82-
my @all = ($divergence->string,$geometric->string,$integral->string,$pseries->string,$comparison->string,$limitcomparison->string,$ratio->string,$alternating->string);
83-
84-
my @correct = ($limitcomparison->string);
81+
$an = Compute("(-1)^n* n/(2n)!");
8582

86-
my %all=map{$_ =>1} @all;
87-
my %correct=map{$_=>1} @correct;
88-
my @difference=grep(!defined $correct{$_}, @all);
83+
@correct = ("Comparison Test", "Limit comparison test", "Ratio test");
84+
@wrong = ("Divergence test","Geometric series test","Integral test",
85+
"P-Series test", "Alternating series test");
8986

90-
## The multiple choice question.
91-
$mc = new_checkbox_multiple_choice();
87+
## "Which convergence test" question
88+
$convTest = new_checkbox_multiple_choice();
9289
## the correct answers.
93-
$mc->qa("", @correct);
90+
$convTest->qa("", @correct);
9491
## the list of other answers.
95-
$mc->extra(@difference);
92+
$convTest->extra(@wrong);
93+
94+
## "Test result" question
95+
$ans = "Converges absolutely";
96+
$testResult = RadioButtons(
97+
["Converges", "Converges absolutely", "Converges conditionally", "Diverges"],
98+
$ans);
99+
100+
#
101+
#
102+
#
103+
#$converges = String("Converges");
104+
#$convergesabs = String("Converges Absolutely");
105+
#$convergescond = String("Converges Conditionally");
106+
#$diverges = String("Diverges");
107+
#
108+
#
109+
#
110+
##Context()->variables->are(n=>"Real",k=>"Real");
111+
#
112+
#
113+
#$ans = $convergesabs;
114+
#
115+
#my @all = ($divergence->string,$geometric->string,$integral->string,$pseries->string,$comparison->string,$limitcomparison->string,$ratio->string,$alternating->string);
116+
#
117+
#my @correct = ($limitcomparison->string);
118+
#
119+
#my %all=map{$_ =>1} @all;
120+
#my %correct=map{$_=>1} @correct;
121+
#my @difference=grep(!defined $correct{$_}, @all);
96122

97123
Context()->texStrings;
98124
BEGIN_TEXT
99-
Testing for absolute convergence, which of the following series convergence tests could be applied to the infinite series \(\sum\limits_{n=$n}^\infty $an\)? Check all that apply.
100-
\{ $mc->print_q() \}
101-
\{ $mc->print_a() \}
125+
Which of the following series convergence tests could be applied to test the infinite series \(\displaystyle \sum\limits_{n=$n}^\infty $an\) for $BBOLD absolute convergence${EBOLD}? Check all that apply.
126+
\{ $convTest->print_q() \}
127+
\{ $convTest->print_a() \}
102128
$BR
103-
The series \{ pop_up_list([$blank->string,$converges->string,$convergesabs->string,$convergescond->string,$diverges->string]) \}
129+
What is the result? The series $BR
130+
\{ $testResult->buttons() \} $BR
131+
Choose the $BBOLD best $EBOLD answer from the list.
104132
END_TEXT
105133
Context()->normalStrings;
106134

107135
install_problem_grader(~~&std_problem_grader);
108136

109137
$showPartialCorrectAnswers = 0;
110-
ANS( checkbox_cmp( $mc->correct_ans() ) );
111-
ANS($ans->cmp);
138+
ANS( checkbox_cmp( $convTest->correct_ans() ) );
139+
ANS($testResult->cmp);
112140

113141

114142
ENDDOCUMENT();

0 commit comments

Comments
 (0)