Difference between revisions of "DifferenceQuotient1"

From WeBWorK_wiki
Jump to navigation Jump to search
(Created page with '<h2>Answer is a Difference Quotient</h2> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> This PG code shows how to require students to simplify a differ…')
 
(Add link to PGML version in OPL)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<h2>Answer is a Difference Quotient</h2>
 
<h2>Answer is a Difference Quotient</h2>
   
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;">
 
  +
[[File:DifferenceQuotient1.png|300px|thumb|right|Click to enlarge]]
  +
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
 
This PG code shows how to require students to simplify a difference quotient.
 
This PG code shows how to require students to simplify a difference quotient.
<ul>
 
<li>Download file: [[File:DifferenceQuotient1.txt]] (change the file extension from txt to pg when you save it)</li>
 
<li>File location in NPL: <code>NationalProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1.pg</code></li>
 
</ul>
 
 
</p>
 
</p>
  +
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1.pg NationalProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1.pg]
  +
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1_PGML.pg FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1_PGML.pg]
   
  +
<br clear="all" />
 
<p style="text-align:center;">
 
<p style="text-align:center;">
 
[[SubjectAreaTemplates|Templates by Subject Area]]
 
[[SubjectAreaTemplates|Templates by Subject Area]]
Line 135: Line 135:
 
Context()->texStrings;
 
Context()->texStrings;
 
BEGIN_SOLUTION
 
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
 
 
Solution explanation goes here.
 
Solution explanation goes here.
 
END_SOLUTION
 
END_SOLUTION
Line 157: Line 156:
   
 
[[Category:Top]]
 
[[Category:Top]]
[[Category:Authors]]
+
[[Category:Sample Problems]]
  +
[[Category:Subject Area Templates]]

Revision as of 17:04, 7 June 2015

Answer is a Difference Quotient

Click to enlarge

This PG code shows how to require students to simplify a difference quotient.


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"parserDifferenceQuotient.pl",
);

TEXT(beginproblem());

Initialization: We need to include the macros file parserDifferenceQuotient.pl.

Context("Numeric");

$limit = DifferenceQuotient("2*x+h","h");

$fp = Compute("2 x");

Setup: The routine DifferenceQuotient("function","variable") takes the simplified function and a variable name. If the variable is omitted, dx is used by default.

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;

Main Text:

$showPartialCorrectAnswers = 1;

ANS( $limit->cmp() );
ANS( $fp->cmp() );

Answer Evaluation:

Context()->texStrings;
BEGIN_SOLUTION
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();

Solution:

Templates by Subject Area