diff --git a/OpenProblemLibrary/ASU-topics/setCalculus/stef/stef2_5p1.pg b/OpenProblemLibrary/ASU-topics/setCalculus/stef/stef2_5p1.pg index d98a2db647..181b761663 100644 --- a/OpenProblemLibrary/ASU-topics/setCalculus/stef/stef2_5p1.pg +++ b/OpenProblemLibrary/ASU-topics/setCalculus/stef/stef2_5p1.pg @@ -22,9 +22,6 @@ ## Problem2('') ## KEYWORDS('calculus', 'limits', 'continuous','Limit') -DOCUMENT(); # This should be the first executable line in the problem. - - DOCUMENT(); # This should be the first executable line in the problem. loadMacros( @@ -65,7 +62,7 @@ $questStr0 = "\( BEGIN_TEXT Calculate the following limits by direct substitution. -$BR +$PAR $quests[0] \{ans_rule(7)\}$BR$BR $quests[1] \{ans_rule(7)\}$BR$BR $quests[2] \{ans_rule(7)\}$BR$BR diff --git a/OpenProblemLibrary/ASU-topics/setStat/kolossa19.pg b/OpenProblemLibrary/ASU-topics/setStat/kolossa19.pg index d280f18f31..f569e64a5a 100644 --- a/OpenProblemLibrary/ASU-topics/setStat/kolossa19.pg +++ b/OpenProblemLibrary/ASU-topics/setStat/kolossa19.pg @@ -24,7 +24,7 @@ TEXT(beginproblem()); $showPartialCorrectAnswers = 1; -@event = (' \(s \)', ' \( \sigma \)', ' \( \overline{x} \)', ' \( \mu \)'); +@event = (' \( s \)', ' \( \sigma \)', ' \( \overline{x} \)', ' \( \mu \)'); @ans = ("statistic","parameter","statistic", "parameter"); @slice = NchooseK(4,4); @@ -33,21 +33,20 @@ $showPartialCorrectAnswers = 1; BEGIN_TEXT -Identify each quantity as a parameter or statistic -Write "parameter" or "statistic". (without quotations) $PAR +Identify each quantity as a parameter or statistic. +Write ${LQ}parameter${RQ} or ${LQ}statistic${RQ} (without quotations). $PAR -(a) \( \) $sevent[0] $BR +(a) $SPACE $sevent[0] $BR answer: \{ans_rule(20)\} $PAR -(b) \( \) $sevent[1] $BR +(b) $SPACE $sevent[1] $BR answer: \{ans_rule(20)\} $PAR -(c) \( \) $sevent[2] $BR +(c) $SPACE $sevent[2] $BR answer: \{ans_rule(20)\} $PAR -(d) \( \) $sevent[3] $BR +(d) $SPACE $sevent[3] $BR answer: \{ans_rule(20)\} $PAR - - END_TEXT + ANS(str_cmp($sans[0])); ANS(str_cmp($sans[1])); ANS(str_cmp($sans[2])); @@ -55,28 +54,3 @@ ANS(str_cmp($sans[3])); ENDDOCUMENT(); # This should be the last executable line in the problem. - - - - - - - - - - - - - - - -# -# Tell WeBWork how to test if answers are right. These should come in the -# same order as the answer blanks above. You tell WeBWork both the type of -# "answer evaluator" to use, and the correct answer. -# - -ANS(num_cmp($ans1)); - -ENDDOCUMENT(); # This should be the last executable line in the problem. - diff --git a/OpenProblemLibrary/ASU-topics/setUnitCircle/p7.pg b/OpenProblemLibrary/ASU-topics/setUnitCircle/p7.pg index fa6bc6c651..8bb872f784 100644 --- a/OpenProblemLibrary/ASU-topics/setUnitCircle/p7.pg +++ b/OpenProblemLibrary/ASU-topics/setUnitCircle/p7.pg @@ -39,7 +39,7 @@ $tan = $tan_answer[$tag1]; $sec = $sec_answer[$tag1]; -TEXT(EV2(<"arith")); -TEXT(EV2(<"arith")); -TEXT(EV2(<"arith")); -TEXT(EV2(<"arith")); +ANS(exact_no_trig($ans)); ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/OpenProblemLibrary/Dartmouth/setMTWCh4S3/problem_1.pg b/OpenProblemLibrary/Dartmouth/setMTWCh4S3/problem_1.pg index aa18a27b7d..1ee17a5b91 100644 --- a/OpenProblemLibrary/Dartmouth/setMTWCh4S3/problem_1.pg +++ b/OpenProblemLibrary/Dartmouth/setMTWCh4S3/problem_1.pg @@ -19,9 +19,16 @@ DOCUMENT(); +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGgraphmacros.pl", + "Dartmouthmacros.pl", + "PGcourse.pl" +); ## Do NOT show partial correct answers -$showPartialCorrectAnswers = 1; +$showPartialCorrectAnswers = 0; ## Lots of set up goes here $ml = new_match_list(); @@ -96,26 +103,3 @@ ANS(str_cmp($ml -> ra_correct_ans)); ENDDOCUMENT(); - - - - -################################################################## -##########Date:: 8-9-100, 11:54:47################ - - -## -*- perl -*- ## -## Line above puts emacs in perl mode -## -## Description -## Vector field matching problem -## EndDescription - -DOCUMENT(); -loadMacros( - "PGstandard.pl", - "PGchoicemacros.pl", - "PGgraphmacros.pl", - "Dartmouthmacros.pl", - "PGcourse.pl" -); diff --git a/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/AnswerWithUnits1.pg b/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/AnswerWithUnits1.pg index 2c46b4f523..e64f2b7e10 100644 --- a/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/AnswerWithUnits1.pg +++ b/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/AnswerWithUnits1.pg @@ -19,6 +19,15 @@ DOCUMENT(); +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "parserNumberWithUnits.pl", + "parserFormulaWithUnits.pl", + "parserDifferenceQuotient.pl", + "PGcourse.pl" +); + TEXT(beginproblem()); @@ -94,81 +103,3 @@ Context()->normalStrings; ; ENDDOCUMENT(); - - - - - -########################### -# Initialization - - -DOCUMENT(); - -loadMacros( - "PGstandard.pl", - "MathObjects.pl", - "parserNumberWithUnits.pl", - "parserFormulaWithUnits.pl", - "parserDifferenceQuotient.pl", - "PGcourse.pl" -); - -TEXT(beginproblem()); - - -########################### -# Setup - -Context("Numeric"); - -$limit = DifferenceQuotient("2*x+h","h"); - -$fp = Compute("2 x"); - - -########################### -# Main text - -Context()->texStrings; -BEGIN_TEXT -Simplify and then evaluate the limit. -$BR -$BR -\( \displaystyle -\frac{d}{dx} \big( x^2 \big) -= -\lim_{h \to 0} \frac{(x+h)^2-x^2}{h} -= -\lim_{h \to 0} -\big( -\) -\{ ans_rule(15) \} -\( \big) = \) -\{ ans_rule(15) \} -END_TEXT -Context()->normalStrings; - - -############################ -# Answer evaluation - -$showPartialCorrectAnswers = 1; - -ANS( $limit->cmp() ); -ANS( $fp->cmp() ); - - -############################ -# Solution - -Context()->texStrings; -BEGIN_SOLUTION - -Solution explanation goes here. -END_SOLUTION -Context()->normalStrings; - -; - -ENDDOCUMENT(); diff --git a/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferentiateFunction1.pg b/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferentiateFunction1.pg index 1b8d7f0436..219a8e7f53 100644 --- a/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferentiateFunction1.pg +++ b/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferentiateFunction1.pg @@ -105,6 +105,3 @@ Context()->normalStrings; ; ENDDOCUMENT(); - - -ENDDOCUMENT(); diff --git a/OpenProblemLibrary/FortLewis/Calc2/10-5-Fourier-series/Fourier-series-03.pg b/OpenProblemLibrary/FortLewis/Calc2/10-5-Fourier-series/Fourier-series-03.pg index 904a0a95f3..2ae30a49e7 100644 --- a/OpenProblemLibrary/FortLewis/Calc2/10-5-Fourier-series/Fourier-series-03.pg +++ b/OpenProblemLibrary/FortLewis/Calc2/10-5-Fourier-series/Fourier-series-03.pg @@ -4,6 +4,24 @@ ## Tagged by glr 02/03/09 +## DBsubject(Calculus - single variable) +## DBchapter(Infinite sequences and series) +## DBsection(Fourier series) +## Institution(Fort Lewis College) +## Author(Paul Pearson) +## Level(4) +## MO(1) +## TitleText1('Calculus') +## AuthorText1('Hughes-Hallett') +## EditionText1('4') +## Section1('10.5') +## Problem1('5') +## TitleText2('Calculus') +## AuthorText2('Hughes-Hallett') +## EditionText2('5') +## Section2('10.5') +## Problem2('5') +## KEYWORDS('calculus','integral', 'fourier', 'series', 'approximation') ## Textbook tags ## HHChapter1('Approximating Functions Using Series') @@ -229,157 +247,3 @@ ANS( $popupc->cmp() ); COMMENT('Uses the convention that the constant term is a0, not a0/2'); ENDDOCUMENT(); - - -# DESCRIPTION -# Fourier Series -# ENDDESCRIPTION - -## Tagged by glr 02/03/09 - -## DBsubject(Calculus - single variable) -## DBchapter(Infinite sequences and series) -## DBsection(Fourier series) -## Institution(Fort Lewis College) -## Author(Paul Pearson) -## Level(4) -## MO(1) -## TitleText1('Calculus') -## AuthorText1('Hughes-Hallett') -## EditionText1('4') -## Section1('10.5') -## Problem1('5') -## TitleText2('Calculus') -## AuthorText2('Hughes-Hallett') -## EditionText2('5') -## Section2('10.5') -## Problem2('5') -## KEYWORDS('calculus','integral', 'fourier', 'series', 'approximation') - -## Textbook tags -## HHChapter1('Approximating Functions Using Series') -## HHChapter2('Approximating Functions Using Series') - - -################################# -# Initialization - -DOCUMENT(); - - -$refreshCachedImages=1; - - -################################ -# Setup - -Context("Numeric"); -Context()->flags->set( reduceConstants=>0 ); - -$f = list_random(2,4,5); -$f2 = 2 * $f; - -$F1 = Compute("$f/2 + $f2/pi cos(x)"); -$F3 = Compute("$f/2 + $f2/pi cos(x) - $f2/(3 pi) cos(3x)"); -$F5 = Compute("$f/2 + $f2/pi cos(x) - $f2/(3 pi) cos(3x) + $f2/(5 pi) cos(5x)"); - -$g1 = $F3; -$g2 = Compute("$f/2 + $f2/pi sin(x) - $f2/(3 pi) sin(3x)"); -$g3 = -($F5); - -$g[0] = "$F5 for x in <-6,6> using color:red and weight:2"; -$gr[0] = init_graph(-6,-6,6,6,'axes'=>[0,0]); -$gr[0]->lb('reset'); -$gr[0]->lb(new Label(5.25,0.25,'x','black','center','middle')); -$gr[0]->lb(new Label(0.25,5.25,'y','black','center','middle')); - -$g[1] = "$g1 for x in <-6,6> using color:red and weight:2"; -$gr[1] = init_graph(-6,-6,6,6,'axes'=>[0,0]); -$gr[1]->lb('reset'); -$gr[1]->lb(new Label(5.25,0.25,'x','black','center','middle')); -$gr[1]->lb(new Label(0.25,5.25,'y','black','center','middle')); - -$g[2] = "$g2 for x in <-6,6> using color:red and weight:2"; -$gr[2] = init_graph(-6,-6,6,6,'axes'=>[0,0]); -$gr[2]->lb('reset'); -$gr[2]->lb(new Label(5.25,0.25,'x','black','center','middle')); -$gr[2]->lb(new Label(0.25,5.25,'y','black','center','middle')); - -$g[3] = "$g3 for x in <-6,6> using color:red and weight:2"; -$gr[3] = init_graph(-6,-6,6,6,'axes'=>[0,0]); -$gr[3]->lb('reset'); -$gr[3]->lb(new Label(5.25,0.25,'x','black','center','middle')); -$gr[3]->lb(new Label(0.25,5.25,'y','black','center','middle')); - - -for $i (0..3) { - plot_functions( $gr[$i], $g[$i]); - $fig[$i]=image(insertGraph($gr[$i]), - width=>200,height=>200,tex_size=>450); -} - -$k = 0; - -@perm = shuffle(4); -@fig = @fig[@perm]; -@inv = invert(@perm); - -@letter = ("A", "B", "C", "D"); - -$popup = PopUp(["?","A","B","C","D"], $letter[$inv[$k]]); - - - -TEXT(beginproblem()); -Context()->texStrings; -BEGIN_TEXT -\{ ColumnTable( -"(a) Suppose you're given the following Fourier coefficients: -\( \displaystyle a_0 = \frac{$f}{2} \), -\( \displaystyle a_1 = \frac{$f2}{\pi} \), -\( \displaystyle a_3 = -\frac{$f2}{3 \pi} \), -\( \displaystyle a_5 = \frac{$f2}{5 \pi} \), -and \( a_2, a_4, b_1, b_2, b_3, b_4, b_5 \) are all zero. -Find the following Fourier approximations. -$BR -\( F_1(x) = \) " . ans_rule(50) . " -$BR -\( F_3(x) = \) " . ans_rule(50) . " -$BR -\( F_5(x) = \) " . ans_rule(50) . " -$BR -$BR -(b) Using a calculator, graph the Fourier approximation -\( F_5(x) \). Then, select the letter of the graph which -most closely resembles your graph. " . $popup->menu() -, -$BCENTER. -BeginTable(). - AlignedRow([$fig[0],$fig[1]]). - TableSpace(5,0). - AlignedRow(["A","B"]). - TableSpace(25,6). - AlignedRow([$fig[2],$fig[3]]). - TableSpace(5,0). - AlignedRow(["C","D"]). -EndTable(). -$BR. -"(Click on a graph to enlarge it.)" . -$ECENTER -, -indent => 0, separation => 10, valign => "TOP" -) -\} -END_TEXT -Context()->normalStrings; - -$showPartialCorrectAnswers = 1; - -ANS($F1->cmp() ); -ANS($F3->cmp() ); -ANS($F5->cmp() ); - -ANS( $popup->cmp() ); - -; -ENDDOCUMENT(); diff --git a/OpenProblemLibrary/FortLewis/Calc3/12-3-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams.pg b/OpenProblemLibrary/FortLewis/Calc3/12-3-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams.pg index 8c3e28b637..b089919067 100644 --- a/OpenProblemLibrary/FortLewis/Calc3/12-3-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams.pg +++ b/OpenProblemLibrary/FortLewis/Calc3/12-3-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams/HGM4-12-3-18f-Contour-diagrams.pg @@ -26,6 +26,14 @@ DOCUMENT(); +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "unionTables.pl", + "LiveGraphics3D.pl", + "PGgraders.pl", + "PGcourse.pl" +); TEXT(beginproblem()); @@ -135,82 +143,3 @@ ANS(str_cmp([@ALPHABET[@inv]])); COMMENT("Uses interactive graphs"); ENDDOCUMENT(); - -DOCUMENT(); - -loadMacros( - "PGstandard.pl", - "PGchoicemacros.pl", - "unionTables.pl", - "LiveGraphics3D.pl", - "PGgraders.pl", - "PGcourse.pl" -); - -$refreshCachedImages=1; - -@surfaces = ( -image("Surface01.png",width=>150,height=>150,tex_size=>220), -image("Surface17.png",width=>150,height=>150,tex_size=>220), -image("Surface18.png",width=>150,height=>150,tex_size=>220), -image("Surface19.png",width=>150,height=>150,tex_size=>220), -); - -@contours = ( -image("contour01.png",width=>150,height=>150,tex_size=>220), -image("contour17.png",width=>150,height=>150,tex_size=>220), -image("contour18.png",width=>150,height=>150,tex_size=>220), -image("contour19.png",width=>150,height=>150,tex_size=>220), -); - -$n = scalar(@surfaces); -$k = $n; # $k can be less than $n -@subset = NchooseK($n,$k); - -@subset_of_surfaces = @surfaces[@subset]; -@subset_of_contours = @contours[@subset]; -@permutation = NchooseK($k,$k); -@shuffled_subset_of_contours = @subset_of_contours[@permutation]; -@numbercaptions = (1..$k); -@alphacaptions = @ALPHABET[0..$k-1]; - -TEXT(beginproblem()); - -BEGIN_TEXT -Match each graph with its contour plot. If you click on a graph, -a larger graph will appear in a new window. In the contour plots, darker areas represent -lower elevations and lighter areas represent higher elevations. -$BR$BR -END_TEXT - -#for $j (1..$k) { -#BEGIN_TEXT -#$j. \{ pop_up_list(['?', @alphacaptions]) \} $SPACE$SPACE$SPACE$SPACE$SPACE -#END_TEXT -#} - -BEGIN_TEXT -$BCENTER -\{ -BeginTable(). - AlignedRow([$subset_of_surfaces[0],$subset_of_surfaces[1],$subset_of_surfaces[2],$subset_of_surfaces[3]]). - TableSpace(5,0). - AlignedRow([pop_up_list(['Choose', @alphacaptions]),pop_up_list(['Choose', @alphacaptions]),pop_up_list(['Choose', @alphacaptions]),pop_up_list(['Choose', @alphacaptions])]). - TableSpace(25,6). - AlignedRow([$shuffled_subset_of_contours[0],$shuffled_subset_of_contours[1],$shuffled_subset_of_contours[2],$shuffled_subset_of_contours[3]]). - TableSpace(5,0). - AlignedRow(["A","B","C","D"]). -EndTable(); -\} -$BR -(Click on a graph to enlarge it.) -$ECENTER -END_TEXT - -install_problem_grader(~~&std_problem_grader); - -$showPartialCorrectAnswers = 0; - -ANS(str_cmp([@ALPHABET[invert(@permutation)]])); - -ENDDOCUMENT(); diff --git a/OpenProblemLibrary/FortLewis/DiffEq/4-Laplace-transforms/01-Laplace-transforms/KJ-5-2-37.pg b/OpenProblemLibrary/FortLewis/DiffEq/4-Laplace-transforms/01-Laplace-transforms/KJ-5-2-37.pg index 07151714c0..c8a7a7164e 100644 --- a/OpenProblemLibrary/FortLewis/DiffEq/4-Laplace-transforms/01-Laplace-transforms/KJ-5-2-37.pg +++ b/OpenProblemLibrary/FortLewis/DiffEq/4-Laplace-transforms/01-Laplace-transforms/KJ-5-2-37.pg @@ -136,41 +136,3 @@ $showPartialCorrectAnswers = 1; ANS( $answer->cmp() ); ENDDOCUMENT(); - - - -############################# -# Main text1 - -Context()->texStrings; -BEGIN_TEXT - -The graph of \( f(t) \) is given below: - -$BCENTER -\{ image( insertGraph($gr), -width=>200,height=>200,tex_size=>500 ) \} -$BR -(Click on graph to enlarge) -$ECENTER -$BR - -Represent \( f(t) \) using a combination of Heaviside step functions. Use \( h(t-a) \) for the Heaviside function shifted \( a \) units horizontally. -$BR -$BR -\( f(t) = \) -\{ ans_rule(60) \} -\{ AnswerFormatHelp("formulas") \} - -END_TEXT -Context()->normalStrings; - - -############################## -# Answer evaluation1 - -$showPartialCorrectAnswers = 0; - -ANS( $answer->cmp() ); - -ENDDOCUMENT();