Skip to content

Commit

Permalink
Merge pull request openwebwork#599 from jirilebl/fixes
Browse files Browse the repository at this point in the history
Various fixes, several problems were non-functioning, and in others some dead code
  • Loading branch information
jwj61 authored Sep 24, 2019
2 parents 7d4edf1 + 9a7c274 commit 529b119
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 464 deletions.
5 changes: 1 addition & 4 deletions OpenProblemLibrary/ASU-topics/setCalculus/stef/stef2_5p1.pg
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
42 changes: 8 additions & 34 deletions OpenProblemLibrary/ASU-topics/setStat/kolossa19.pg
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -33,50 +33,24 @@ $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]));
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.

65 changes: 15 additions & 50 deletions OpenProblemLibrary/ASU-topics/setUnitCircle/p7.pg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $tan = $tan_answer[$tag1];
$sec = $sec_answer[$tag1];


TEXT(EV2(<<EOT));
BEGIN_TEXT
Evaluate the following expressions.
$BR
$BBOLD Note: $EBOLD Your answer must be in EXACT form: it cannot
Expand All @@ -51,68 +51,33 @@ If \( \theta = $display[$tag1] \), then $BR
$BR
\( \sin ( \theta ) =\) \{ans_rule(15) \}
$BR
EOT
END_TEXT

$ans = $sin;
ANS(exact_no_trig($ans));
TEXT(EV2(<<EOT));

BEGIN_TEXT
\( \cos ( \theta ) =\) \{ans_rule(15) \}
$BR
EOT
END_TEXT

$ans = $cos;
ANS(exact_no_trig($ans));
TEXT(EV2(<<EOT));

BEGIN_TEXT
\( \tan ( \theta ) =\) \{ans_rule(15) \}
$BR
EOT
END_TEXT

$ans = $tan;
ANS(exact_no_trig($ans));
TEXT(EV2(<<EOT));

BEGIN_TEXT
\( \sec ( \theta ) =\) \{ans_rule(15) \}
$BR
EOT
$ans = $sec;
ANS(exact_no_trig($ans));

ENDDOCUMENT(); # This should be the last executable line in the problem.
END_TEXT



TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

$n1 = random(-7,9,4);
$pi = 3.14159265;
$a1 = $n1*$pi/4;
$sin = sin($a1);
$cos = cos($a1);
$tan = $sin/$cos;
$sec = 1/$cos;

TEXT(EV2(<<EOT));
If \( \theta = \frac { $n1 \pi } { 4} \), then $BR
$BR
\( \sin ( \theta ) \) equals \{ans_rule(10) \}
$BR
EOT
$ans = $sin;
ANS(num_cmp($ans, mode=>"arith"));
TEXT(EV2(<<EOT));
\( \cos ( \theta ) \) equals \{ans_rule(10) \}
$BR
EOT
$ans = $cos;
ANS(num_cmp($ans, mode=>"arith"));
TEXT(EV2(<<EOT));
\( \tan ( \theta ) \) equals \{ans_rule(10) \}
$BR
EOT
$ans = $tan;
ANS(num_cmp($ans, mode=>"arith"));
TEXT(EV2(<<EOT));
\( \sec ( \theta ) \) equals \{ans_rule(10) \}
$BR
EOT
$ans = $sec;
ANS(num_cmp($ans, mode=>"arith"));
ANS(exact_no_trig($ans));

ENDDOCUMENT(); # This should be the last executable line in the problem.
32 changes: 8 additions & 24 deletions OpenProblemLibrary/Dartmouth/setMTWCh4S3/problem_1.pg
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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"
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"parserNumberWithUnits.pl",
"parserFormulaWithUnits.pl",
"parserDifferenceQuotient.pl",
"PGcourse.pl"
);


TEXT(beginproblem());

Expand Down Expand Up @@ -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();
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,3 @@ Context()->normalStrings;
;

ENDDOCUMENT();


ENDDOCUMENT();
Loading

0 comments on commit 529b119

Please sign in to comment.