You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(53) |
Feb
(56) |
Mar
|
Apr
|
May
(30) |
Jun
(78) |
Jul
(121) |
Aug
(155) |
Sep
(77) |
Oct
(61) |
Nov
(45) |
Dec
(94) |
2006 |
Jan
(116) |
Feb
(33) |
Mar
(11) |
Apr
(23) |
May
(60) |
Jun
(89) |
Jul
(130) |
Aug
(109) |
Sep
(124) |
Oct
(63) |
Nov
(82) |
Dec
(45) |
2007 |
Jan
(31) |
Feb
(35) |
Mar
(123) |
Apr
(36) |
May
(18) |
Jun
(134) |
Jul
(133) |
Aug
(241) |
Sep
(126) |
Oct
(31) |
Nov
(15) |
Dec
(5) |
2008 |
Jan
(11) |
Feb
(6) |
Mar
(16) |
Apr
(29) |
May
(43) |
Jun
(149) |
Jul
(27) |
Aug
(29) |
Sep
(37) |
Oct
(20) |
Nov
(4) |
Dec
(6) |
2009 |
Jan
(34) |
Feb
(30) |
Mar
(16) |
Apr
(6) |
May
(1) |
Jun
(32) |
Jul
(22) |
Aug
(7) |
Sep
(18) |
Oct
(50) |
Nov
(22) |
Dec
(8) |
2010 |
Jan
(17) |
Feb
(15) |
Mar
(10) |
Apr
(9) |
May
(67) |
Jun
(30) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
From: dpvc v. a. <we...@ma...> - 2010-04-27 02:32:03
|
Log Message: ----------- Make penalties cumulative (they were supposed to be, but weren't Modified Files: -------------- pg/macros: problemPanic.pl Revision Data ------------- Index: problemPanic.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/problemPanic.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -Lmacros/problemPanic.pl -Lmacros/problemPanic.pl -u -r1.6 -r1.7 --- macros/problemPanic.pl +++ macros/problemPanic.pl @@ -156,7 +156,7 @@ ); my $label = $options{label}; my $level = $options{level}; - $penalty[$buttonCount] = $penalty[$buttonCount] + $options{penalty}; + $penalty[$buttonCount] = $penalty[$buttonCount-1] + $options{penalty}; $penalty[$buttonCount] = 1 if $penalty[$buttonCount] > 1; return if $isTeX || $main::panicked >= $level; my $time = time(); |
From: dpvc v. a. <we...@ma...> - 2010-04-27 02:23:37
|
Log Message: ----------- Correct problem with documentation of GradeWithPenalty Modified Files: -------------- pg/macros: problemPanic.pl Revision Data ------------- Index: problemPanic.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/problemPanic.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -Lmacros/problemPanic.pl -Lmacros/problemPanic.pl -u -r1.5 -r1.6 --- macros/problemPanic.pl +++ macros/problemPanic.pl @@ -102,7 +102,7 @@ To allow the grading penalties to work, you must include the command - Panic::GradeWithPenalty; + Panic::GradeWithPenalty(); in order to install the panic-button grader. You should do this afer setting the grader that you want to use for the problem itself, as the @@ -113,7 +113,6 @@ sub _problemPanic_init {Panic::Init()} - # # The packge to contain the routines and data for the Panic buttons # @@ -194,7 +193,7 @@ # # The grader for the panic levels. -# +# sub grader { # # Save the old score and call the original grader. |
From: Mike G. v. a. <we...@ma...> - 2010-04-22 01:22:15
|
Log Message: ----------- Adding help files authored by Paul Pearson Added Files: ----------- webwork2/htdocs/helpFiles: Entering-Angles.html Entering-Decimals.html Entering-Equations.html Entering-Exponents.html Entering-Formulas.html Entering-Fractions.html Entering-Inequalities.html Entering-Intervals.html Entering-Limits.html Entering-Logarithms.html Entering-Numbers.html Entering-Points.html Entering-Syntax.html Entering-Units.html Entering-Vectors.html Revision Data ------------- --- /dev/null +++ htdocs/helpFiles/Entering-Units.html @@ -0,0 +1,96 @@ +<!DOCTYPE HTML PUBtr><tdC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head><Title>WeBWorK Help: Units</title> + + <style type="text/css"><p> + + </style> + + </head> + <body bgcolor="#FFFFFF" alink="#FF0000" vlink="#800080" link="#0000FF" text="#000000"> + <p align="center"> + +<p > + + +<H4 align="center">Units Available in WeBWorK</H4><p><p> +<p> +Some WeBWorK problems ask for answers with units. Below is a list of basic units +and how they need to be abbreviated in WeBWorK answers. In some problems, you +may need to combine units (e.g, velocity might be in <code>ft/s</code> for feet per +second). +<center> +<table border="1" cellpadding="4"> +<tr> <th> Unit <th> Abbreviation +<tr><td colspan="2" align="center"><b>Time</b> +<tr><td> Seconds <td align="center"> s + +<tr><td> Minutes <td align="center"> min +<tr><td> Hours <td align="center"> hr +<tr><td> Days <td align="center"> day +<tr><td> Years <td align="center"> year +<tr><td> Milliseconds <td align="center"> ms + + +<tr><td colspan="2" align="center"><b>Distance</b> +<tr><td> Feet <td align="center"> ft +<tr><td> Inches <td align="center"> in +<tr><td> Miles <td align="center"> mi +<tr><td> Meters <td align="center"> m + +<tr><td> Centimeters <td align="center"> cm +<tr><td> Millimeters <td align="center"> mm +<tr><td> Kilometers <td align="center"> km +<tr><td> Angstroms <td align="center"> A +<tr><td> Light years <td align="center"> light-year + + +<tr><td colspan="2" align="center"><b>Mass</b> +<tr><td> Grams <td align="center"> g +<tr><td> Kilograms <td align="center"> kg +<tr><td> Slugs <td align="center"> slug + +<tr><td colspan="2" align="center"><b>Volume</b> +<tr><td> Liters <td align="center"> L + +<tr><td> Cubic Centimeters <td align="center"> cc +<tr><td> Milliliters <td align="center"> ml + +<tr><td colspan="2" align="center"><b>Force</b> +<tr><td> Newtons <td align="center"> N +<tr><td> Dynes <td align="center"> dyne + +<tr><td> Pounds <td align="center"> lb +<tr><td> Tons <td align="center"> ton + +<tr><td colspan="2" align="center"><b>Work/Energy</b> +<tr><td> Joules <td align="center"> J +<tr><td> kilo Joule <td align="center"> kJ + +<tr><td> ergs <td align="center"> erg +<tr><td> foot pounds <td align="center"> lbf +<tr><td> calories <td align="center"> cal +<tr><td> kilo calories <td align="center"> kcal +<tr><td> electron volts <td align="center"> eV + +<tr><td> kilo Watt hours <td align="center"> kWh + +<tr><td colspan="2" align="center"><b>Misc</b> +<tr><td> Amperes <td align="center"> amp +<tr><td> Moles <td align="center"> mol +<tr><td> Degrees Centrigrade <td align="center"> degC + +<tr><td> Degrees Fahrenheit <td align="center"> degF +<tr><td> Degrees Kelvin <td align="center"> degK +<tr><td> Angle degrees <td align="center"> deg +<tr><td> Angle radians <td align="center"> rad + +</table> + + +</center> +<script language="JavaScript"> +document.write(" <center> <p><input type=\"button\" value=\"Close this window\" name=\"close\" onClick=\"window.close()\"></p> </center> "); +</script> + </body> + </html> --- /dev/null +++ htdocs/helpFiles/Entering-Formulas.html @@ -0,0 +1,67 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Formulas</font></b> +</center> + +<ul type="square"> + +<li><a href="http://webwork.maa.org/wiki/Available_Functions" target="_new">Link to a list of all available functions</a><br /><br /></li> + +<li><u>Formulas must use the correct variable(s):</u> +<blockquote> +For example, a function of time <tt>t</tt> could be <tt>-16t^2 + 12</tt>, while <tt>-16x^2 + 12</tt> would be incorrect. +</blockquote> +</li> + +<li><u>Examples of valid formulas:</u> +<blockquote> +<tt>5*sin((pi*x)/2)</tt> or <tt>5 sin(pi x/2)</tt><br /> +<tt>e^(-x)</tt> or <tt>e**(-x)</tt> or <tt>1/(e^x)</tt><br /> +<tt>abs(5y)</tt> or <tt>|5y|</tt><br /> +<tt>sqrt(9 - z^2)</tt> or <tt>(9 - z^2)^(1/2)</tt><br /> +<tt>24</tt> or <tt>4!</tt> or <tt>4 * 3 * 2 * 1</tt><br /> +<tt>pi</tt> or <tt>4 arctan(1)</tt> or <tt>4 atan(1)</tt> or <tt>4 tan^(-1)(1)</tt><br /> +</blockquote> +</li> + +<li><u>Examples of constants used in formulas:</u> +<blockquote><tt>pi</tt>, <tt>e = e^1</tt></blockquote> +</li> + +<li><u>Examples of operations used in formulas:</u> +<blockquote>Addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>, exponentiation <tt>^</tt> (or <tt>**</tt>), factorial <tt>!</tt> +</blockquote> +</li> + +<li><u>Examples of functions used in formulas:</u> +<blockquote> +<tt>sqrt(x) = x^(1/2)</tt>, <tt>abs(x) = | x |</tt><br /> +<tt>2^x, e^x, ln(x), log10(x)</tt> <br /> +<tt>sin(x), cos(x), tan(x), csc(x), sec(x), cot(x)</tt><br /> +<tt>arcsin(x) = asin(x) = sin^(-1)(x)</tt><br /> +<tt>arccos(x) = acos(x) = cos^(-1)(x)</tt><br /> +<tt>arctan(x) = atan(x) = tan^(-1)(x)</tt><br /> +</blockquote> + +<li><u>Sometimes formulas must be simplified:</u> +<blockquote> +For example, <tt>6x + 5 - 2x</tt> should be simplified to <tt>4x + 5</tt> +</blockquote> +</li> + +<li><u>Sometimes, certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>, and exponentiation <tt>^</tt> (or <tt>**</tt>). When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Exponents.html @@ -0,0 +1,33 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering exponents</font></b> +</center> + +<ul type="square"> + +<li><u>Both ^ and ** are used for exponentiation.</u> +<blockquote>For example, <tt>x^2</tt> and <tt>x**2</tt> are the same, as are <tt>e^(-x/2)</tt> and <tt>1/(e**(x/2))</tt></blockquote> +</li> + +<li><u>Square roots have a named function, but other roots do not and should be entered using fractional exponents.</u> +<blockquote> +For example, the square root of 2 can be entered as <tt>sqrt(2)</tt>, <tt>2^(1/2)</tt>, or <tt>2**(1/2)</tt>, but the cube root of 2 must be entered as <tt>2^(1/3)</tt> or <tt>2**(1/3)</tt>. The parentheses in <tt>2^(1/3)</tt> are required, since <tt>2^1/3</tt> will be interpreted as <tt>(2^1)/3 = 2/3</tt>. +</blockquote> +</li> + +<li><u>Sometimes, fractional exponents and certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>. When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Equations.html @@ -0,0 +1,48 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Equations</font></b> +</center> + +<ul type="square"> + +<li><u>Equations must have an equals sign and use the correct variable names:</u> +<blockquote> +<tt>y = 5x+2</tt> will be incorrect if the answer is <tt>w = 5y+2</tt> +</blockquote> +</li> + +<li><u>Examples of valid equations that are equivalent:</u> +<blockquote> +<tt>32 = 5*x + 2</tt> is the same as <tt>30 = 5x</tt> or <tt>x = 6</tt></tt><br /> +<tt>y = (x-1)^2 + 3</tt> is the same as <tt>y - 3 = (x-1)^2</tt><br /> +<tt>x^2 + xy + y^2 = 13x</tt> is the same as <tt>y*(y+x) = 13x - x^2</tt><br /> +</blockquote> +</li> + +<li><u>If there is no equation that solves the question:</u> +<blockquote> +Enter <tt>NONE</tt> or <tt>DNE</tt> (this may vary from problem to problem) +</blockquote> +</li> + +<li><u>Examples of constants used in equations:</u> +<blockquote><tt>pi</tt>, <tt>e = e^1</tt></blockquote> +</li> + +<li><u>Functions may be used in equations, but may not be applied across the equals sign:</u> +<blockquote> +<tt>sqrt(x) = sqrt(5)</tt> is valid, but <tt>sqrt(x=5)</tt> is not +<br /> +<br /> +<a href="http://webwork.maa.org/wiki/Available_Functions" target="_new">Link to a list of all available functions</a> +</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Inequalities.html @@ -0,0 +1,73 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering inequalities</font></b> +</center> + +<ul type="square"> + +<li><u>Types of operators:</u> +<blockquote> +<table border="0" cellspacing="2"> +<tr><td><tt><</tt></td><td> less than</td></tr> +<tr><td><tt><=</tt></td><td> less than or equal to ( <tt>=<</tt> might also work)</td></tr> +<tr><td><tt>=</tt></td><td> equals</td></tr> +<tr><td><tt>!=</tt></td><td> not equal to (uses exclamation point)</td></tr> +<tr><td><tt>></tt></td><td> greater than</td></tr> +<tr><td><tt>>=</tt></td><td> greater than or equal to ( <tt>=></tt> might also work)</td></tr> +</table> +</blockquote> +</li> + +<li><u>Special symbols:</u> +<blockquote> +<tt>infinity</tt> or <tt>inf</tt> means positive infinity<br /> +<tt>-infinity</tt> or <tt>-inf</tt> means negative infinity<br /> +<tt>R</tt> means all real numbers<br /> +<tt>R</tt> is the same as <tt>-inf < x < inf</tt> or <tt>(-inf,inf)</tt><br /> +<tt>{2,4,5}</tt> using curly braces denotes a finite set<br /> +<tt>NONE</tt> or a pair of curly braces <tt>{}</tt> means the empty set<br /> +<tt>U</tt> denotes the union of intervals +</blockquote> +</li> + +<li><u>Entering answers using inequality or interval notation:</u> +<blockquote> +<table border="1" cellspacing="0" cellpadding="5"> +<tr><td>Inequality<br />Notation</td><td><font color="#FF0000">* </font>Interval<br />Notation</td><td>Remarks</td></tr> +<tr><td><tt>x<2</tt></td><td><tt>(-infinity,2)</tt></td> + <td>Use rounded parentheses <nobr><tt>(</tt> or <tt>)</tt></nobr> at infinite endpoints</td></tr> +<tr><td><tt>x>2</tt></td><td><tt>(2,infinity)</tt></td><td> </td></tr> +<tr><td><tt>x<=2</tt></td><td><tt>(-infinity,2]</tt></td><td> </td></tr> +<tr><td><tt>x>=2</tt></td><td><tt>[2,infinity)</tt></td><td> </td></tr> +<tr><td><tt>0<x<=2</tt></td><td><tt>(0,2]</tt></td><td> </td></tr> +<tr><td><nobr><tt>0<x and x<2</tt></nobr></td><td><tt>(0,2)</tt></td> + <td><tt>and</tt> is special</td></tr> +<tr><td><nobr><tt>x<0 or x>2</tt></nobr></td><td><tt>(-inf,0)U(2,inf)</tt></td> + <td><tt>or</tt> is special<br /><tt>U</tt> denotes union</td></tr> +<tr><td><nobr><tt>x=0 or x=2</tt></nobr></td><td><tt>{0,2}</tt></td> + <td>finite sets are allowed using curly braces <tt>{a,b,c}</tt></td></tr> +<tr><td><nobr><tt>x<3 or x>3</tt></nobr></td><td><tt>(-inf,3)U(3,inf)</tt><br /><tt>x != 3</tt><br /><tt>R-{3}</tt></td><td>set differences are allowed</td></tr> +</table> +<br /> +<font color="#FF0000">* Some questions may not allow interval notation to be used</font> +</blockquote> +</li> + +<li><u>Tips for entering inequalities and intervals:</u> +<blockquote> +If an interval includes an endpoint, use square brackets: <nobr><tt>[</tt> or <tt>]</tt></nobr><br /><br /> +If an interval excludes an endpoint or an endpoint is infinite, use rounded parentheses: <nobr><tt>(</tt> or <tt>)</tt></nobr><br /><br /> +Use curly braces to enclose finite sets and commas to separate elements the set: <nobr><tt>{ -3, pi, 2/5, 0.75 }</tt></nobr><br /><br /> +All sets should be expressed in their simplest form in interval notation with no overlapping intervals. For example, <tt>[2,4]U[3,5]</tt> is not equivalent to <tt>[2,5]</tt></br /><br /> +If you are asked to find the range of a function <tt>y = f(x)</tt>, your inequality should be in terms of the variable <tt>y</tt> +</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Angles.html @@ -0,0 +1,47 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Angles</font></b> +</center> + +<ul type="square"> + +<li><u>Angles in radians without units are the default:</u> +<blockquote> +For an angle of 60 degrees, enter it in radians as <tt>pi/3</tt> or <tt>1.04719...</tt>, but <b>not 60</b><br /> +By default, trig functions are evaluated in radians, so <tt>cos(pi/3) = 1/2</tt>, but <tt>cos(60) = -0.9524</tt> since it is radians. You must convert degrees to radians before applying a trig function to an angle. +</blockquote> +</li> + +<li><u>Occasionally, units are required on angles:</u> +<blockquote> +If asked for units on an angle, enter, for example, <br /> +<tt>pi/6 rad</tt> (including rad)<br /> +<tt>30 deg</tt> (including deg) +</blockquote> +</li> + +<li><u>Examples of constants available:</u> +<blockquote><tt>pi</tt>, <tt>e = e^1</tt></blockquote> +</li> + +<li><u>Sometimes decimals are not allowed:</u> +<blockquote>Sometimes <tt>pi/6</tt> is allowed, but <tt>0.524</tt> is not</blockquote> +</li> + +<li><u>Sometimes trig functions are not allowed:</u> +<blockquote> +Sometimes <tt>0.866025403784</tt> is allowed, but <tt>cos(pi/6)</tt> is not +</blockquote> +</li> + +<li><a href="http://webwork.maa.org/wiki/Available_Functions" target="_new">Link to a list of all available functions</a></li> + + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Decimals.html @@ -0,0 +1,33 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering decimals</font></b> +</center> + +<ul type="square"> + +<li><u>In general, give at least 5 decimal places.</u> +<blockquote>Typically, if your answer is correct to 5 decimal places it will be marked correct, although the number of decimal places required may vary from problem to problem. When in doubt, give more decimal places.</blockquote> +</li> + +<li><u>If there is more than one correct answer, enter your answers as a comma separated list.</u> +<blockquote> +For example, if your answers are <nobr><tt>-3/2, 4/3, 2pi, e^3, 5</tt></nobr> enter them as +<nobr><tt>-1.5, 1.3333333, 6.2831853, 20.0855369, 5</tt></nobr> +</blockquote> + +<li><u>Sometimes, fractions and certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>, and exponentiation <tt>^</tt> (or <tt>**</tt>). When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Syntax.html @@ -0,0 +1,147 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title>Syntax for entering answers to WeBWorK</title> + <meta name="generator" content="BBEdit 8.7"> +</head> +<body> +<h1 id="firstHeading">Syntax for entering answers to WeBWorK</h1> + + +<h4> <span class="mw-headline">Mathematical Symbols Available In WeBWorK</span></h4> + +<ul><li> + Addition +</li><li> - Subtraction +</li><li> * Multiplication can also be indicated by a space or juxtaposition, e.g. 2x, 2 x or 2*x, also 2(3+4). +</li><li> / Division +</li><li> ^ or ** You can use either ^ or ** for exponentiation, e.g. 3^2 or 3**2 +</li><li> Parentheses: () - You can also use square brackets, [ ], and braces, { }, for grouping, e.g. [1+2]/[3(4+5)] +</li></ul> +<a name="Syntax_for_entering_expressions"></a><h4> <span class="mw-headline">Syntax for entering expressions</span></h4> +<ul><li> Be careful entering expressions just as you would be careful entering expressions in a calculator. + +</li><li> <b>Use the "Preview Button" to see exactly how your entry +looks. E.g. to tell the difference between 1+2/3*4 and [1+2]/[3*4] +click the "Preview Button".</b> +</li><li> Sometimes using the * symbol to indicate mutiplication makes +things easier to read. For example (1+2)*(3+4) and (1+2)(3+4) are both +valid. So are 3*4 and 3 4 (3 space 4, not 34) but using a * makes +things clearer. +</li><li> Use ('s and )'s to make your meaning clear. You can also use ['s and ]'s and {'s and }'s. +</li><li> Don't enter 2/4+5 (which is 5.5) when you really want 2/(4+5) (which is 2/9). +</li><li> Don't enter 2/3*4 (which is 8/3) when you really want 2/(3*4) (which is 2/12). +</li><li> Entering big quotients with square brackets, e.g. [1+2+3+4]/[5+6+7+8], is a good practice. +</li><li> Be careful when entering functions. It's always good practice +to use parentheses when entering functions. Write sin(t) instead of +sint or sin t even though WeBWorK is smart enough to <b>usually</b> accept sin t or even sint. For example, sin 2t is interpreted as sin(2)t, i.e. (sin(2))*t so be careful. + +</li><li> You can enter sin^2(t) as a short cut although mathematically +speaking sin^2(t) is shorthand for (sin(t))^2(the square of sin of t). +(You can enter it as sin(t)^2 or even sint^2, but don't try such things +unless you <b>really</b> understand the precedence of operations. The +"sin" operation has highest precedence, so it is performed first, using +the next token (i.e. t) as an argument. Then the result is squared.) +You can always use the Preview button to see a typeset version of what +you entered and check whether what you wrote was what you +meant. :-) +</li><li> For example 2+3sin^2(4x) will work and is equivalent to +2+3(sin(4x))^2 or 2+3sin(4x)^2. Why does the last expression work? +Because things in parentheses are always done first [ i.e. (4x)], next +all functions, such as sin, are evaluated [giving sin(4x)], next all +exponents are taken [giving sin(4x)^2], next all multiplications and +divisions are performed in order from left to right [giving +3sin(4x)^2], and finally all additions and subtractions are performed +[giving 2+3sin(4x)^2]. +</li><li> Is -5^2 positive or negative? It's negative. This is because +the square operation is done before the negative sign is applied. Use +(-5)^2 if you want to square negative 5. +</li><li> When in doubt use parentheses!!! :-) +</li><li> The complete rules for the precedence of operations, in addition to the above, are +<ul><li> Multiplications and divisions are performed left to right: 2/3*4 = (2/3)*4 = 8/3. + +</li><li> Additions and subtractions are performed left to right: 1-2+3 = (1-2)+3 = 2. +</li><li> Exponents are taken right to left: 2^3^4 = 2^(3^4) = 2^81 = a big number. +</li></ul> +</li><li> <b>Use the "Preview Button" to see exactly how your entry +looks. E.g. to tell the difference between 1+2/3*4 and [1+2]/[3*4] +click the "Preview Button".</b> +</li></ul> +<a name="Mathematical_Constants_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Constants Available In WeBWorK</span></h4> +<ul><li> pi This gives 3.14159265358979, e.g. cos(pi) is -1 +</li><li> e This gives 2.71828182845905, e.g. ln(e*2) is 1 + ln(2) +</li></ul> + +<a name="Scientific_Notation_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Scientific Notation Available In WeBWorK</span></h4> +<ul><li> 2.1E2 is the same as 210 +</li><li> 2.1E-2 is the same as .021 +</li></ul> +<a name="Mathematical_Functions_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Functions Available In WeBWorK</span></h4> +<p>Note that sometimes one or more of these functions is disabled for a WeBWorK problem because the +instructor wants you to calculate the answer by some means other than just using the function. +</p> +<ul><li> abs( ) The absolute value +</li><li> cos( ) Note: cos( ) uses radian measure + +</li><li> sin( ) Note: sin( ) uses radian measure +</li><li> tan( ) Note: tan( ) uses radian measure +</li><li> sec( ) Note: sec( ) uses radian measure +</li><li> cot( ) Note: cot( ) uses radian measure +</li><li> csc( ) Note: csc( ) uses radian measure +</li><li> exp( ) The same function as e^x +</li><li> log( ) This is usually the natural log but your professor may have redined this as log to the base 10 +</li><li> ln( ) The natural log +</li><li> logten( ) The log to the base 10 + +</li><li> arcsin( ) +</li><li> asin( ) or sin^-1() Another name for arcsin +</li><li> arccos( ) +</li><li> acos( ) or cos^-1() Another name for arccos +</li><li> arctan( ) +</li><li> atan( ) or tan^-1() Another name for arctan +</li><li> arccot( ) +</li><li> acot( ) or cot^-1() Another name for arccot +</li><li> arcsec( ) + +</li><li> asec( ) or sec^-1() Another name for arcsec +</li><li> arccsc( ) +</li><li> acsc( ) or csc^-1() Another name for arccsc +</li><li> sinh( ) +</li><li> cosh( ) +</li><li> tanh( ) +</li><li> sech( ) +</li><li> csch( ) +</li><li> coth( ) + +</li><li> arcsinh( ) +</li><li> asinh( ) or sinh^-1() Another name for arcsinh +</li><li> arccosh( ) +</li><li> acosh( ) or cosh^-1()Another name for arccosh +</li><li> arctanh( ) +</li><li> atanh( ) or tanh^-1()Another name for arctanh +</li><li> arcsech( ) +</li><li> asech( ) or sech^-1()Another name for arcsech +</li><li> arccsch( ) + +</li><li> acsch( ) or csch^-1() Another name for arccsch +</li><li> arccoth( ) +</li><li> acoth( ) or coth^-1() Another name for arccoth +</li><li> sqrt( ) +</li><li> n! (n factorial -- defined for <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">n</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ãâ¢</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span> +</li><li> These functions may not always be available for every problem. +<ul><li> sgn( ) The sign function, either -1, 0, or 1 + +</li><li> step( ) The step function (0 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmmi10"><</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.833em; vertical-align: 0.744em;"></span></span></nobr></span>, 1 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ãâ¢</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span>) +</li><li> fact(n) The factorial function n! (defined only for nonnegative integers) +</li><li> P(n,k) = n*(n-1)*(n-2)...(n-k+1) the number of ordered sequences of k elements chosen from n elements +</li><li> C(n,k) = "n choose k" the number of unordered sequences of k elements chosen from n elements +</li></ul> +</li></ul> + +For more information: + +<a href="http://webwork.maa.org/wiki/Available_Functions">http://webwork.maa.org/wiki/Available_Functions</a> + + +</body> +</html> --- /dev/null +++ htdocs/helpFiles/Entering-Points.html @@ -0,0 +1,48 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Points</font></b> +</center> + +<ul type="square"> + +<li><u>A point must use parentheses and commas:</u> +<blockquote> +<tt>(4.5, 3/7)</tt> is a valid point in 2 dimensions<br /> +<tt>(pi,e,2)</tt> is a valid point in 3 dimensions +</blockquote> +</li> + +<li><u>If the answer is more than one point:</u> +<blockquote> +Enter your answer as a comma-separated list of points, for example: +<tt>(4,3), (5,10)</tt> +</blockquote> +</li> + +<li><u>If there are no solutions:</u> +<blockquote> +Enter <tt>NONE</tt> or <tt>DNE</tt> (this may vary from problem to problem) +</blockquote> +</li> + +<li><u>Examples of constants used in points:</u> +<blockquote><tt>pi</tt>, <tt>e = e^1</tt></blockquote> +</li> + +<li><u>Functions may be used in each coordinate of a point, but may not be applied across the parentheses or commas:</u> +<blockquote> +<tt>(sqrt(2),sqrt(5))</tt> is valid, but <tt>(sqrt(2,5))</tt> is not +<br /> +<br /> +<a href="http://webwork.maa.org/wiki/Available_Functions" target="_new">Link to a list of all available functions</a> +</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Numbers.html @@ -0,0 +1,43 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering numbers</font></b> +</center> + +<ul type="square"> + +<li><u>Examples of (real) numbers include:</u> +<blockquote><tt>4, 5/2, -1/3, pi/3, e^3, 3.1415926535, sqrt(2) = 2^(1/2), ln(2), sin(2pi/3)</tt></blockquote> +</li> + +<li><u>If there is more than one correct answer, enter your answers as a comma separated list.</u> +<blockquote> +For example, enter <nobr><tt>-1.5, 4/3, 2pi, e^3, 5</tt></nobr><br /> +Do not use commas in large numbers: enter <tt>4321</tt> (not <tt>4,321</tt>) +</blockquote> + +<li><u>If there are no solutions:</u> +<blockquote> +Enter <tt>NONE</tt> or <tt>DNE</tt> (this may vary from problem to problem) +</blockquote> +</li> + +<li><u>If your answer is a decimal, give at least 5 decimal places.</u> +<blockquote>Typically, if your answer is correct to 5 decimal places it will be marked correct, although the number of decimal places required may vary from problem to problem. When in doubt, give more decimal places.</blockquote> +</li> + +<li><u>Sometimes, fractions and certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>, and exponentiation <tt>^</tt> (or <tt>**</tt>). When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Logarithms.html @@ -0,0 +1,55 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Logarithms</font></b> +</center> + +<ul type="square"> + +<li><u>Entering natural logarithms:</u> <tt>ln(x)</tt> or <tt>log(x)</tt> +<blockquote> +The default is that <tt>ln(x)</tt> and <tt>log(x)</tt> are <b>both</b> the natural log function. (Although unlikely, your professor may have changed the default setting for your course.) +</blockquote> +</li> + +<li><u>Entering base 10 logarithms:</u> <tt>log10(x)</tt> or <tt>logten(x)</tt> +<blockquote> +The default is that <tt>log10(x)</tt> and <tt>logten(x)</tt> are <b>both</b> the base 10 logarithm function. (Although unlikely, your professor may have changed the default setting for your course.) +</blockquote> +</li> + +<li><u>Entering logarithms base b:</u> <tt>ln(x)/ln(b)</tt> or <tt>log10(x)/log10(b)</tt> +<blockquote> +WeBWorK does not recognize logarithms to other bases, so you must use the change of base formula for logarithms to enter your answer. For example, enter log base 2 of x as +<br /><br /> +<tt>ln(x)/ln(2)</tt> or <tt>log10(x)/log10(2)</tt> +</blockquote> +</li> + +<li><u>Put parentheses around the arguments to logs:</u> +<blockquote> +<tt>ln(2x+8)</tt> and <tt>ln2x+8 = ln(2)*x+8</tt> are very different. +</blockquote> +</li> + +<li><u>Sometimes logarithms must be simplified or expanded:</u> +<blockquote> +For example, the required answer may be <tt>ln(6) + ln(x)</tt> or <tt>ln(6x)</tt> +</blockquote> +</li> + +<li><u>Sometimes, certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>, and exponentiation <tt>^</tt> (or <tt>**</tt>). When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Intervals.html @@ -0,0 +1,73 @@ +<html> +<head> +<title>WeBWorK Help: Interval Notation</title> +</head> +<body bgcolor=#ffffff text=#000000 link=#0000cc +vlink=#551a8b alink=#ff0000 onLoad=sf()> + +<h4 align="center"> +Using Interval Notation +</h4> + +<ul> + +<li> If an endpoint is included, then use <tt>[</tt> or <tt>]</tt>. +If not, then use <tt>(</tt> or <tt>)</tt>. For example, the interval +from -3 to 7 that includes 7 but not -3 is expressed <tt>(-3,7]</tt>. + + +<br> +<br> + +<li> For infinite intervals, use <tt>Inf</tt> +for <font size="+2">∞</font> (infinity) and/or +<tt>-Inf</tt> for <font size="+2">-∞</font> (-Infinity). For +example, the infinite interval containing all points greater than or +equal to 6 is expressed <tt>[6,Inf)</tt>. + + +<br> +<br> + +<li> If the set includes more than one interval, they are joined using the union +symbol U. For example, the set consisting of all points in (-3,7] together with all points in [-8,-5) is expressed <code>[-8,-5)U(-3,7]</code>. + +<br> +<br> + +<li> If the answer is the empty set, you can specify that by using + braces with nothing inside: <code> { } </code> + +<br> + +<br> + +<li> You can use <code>R</code> as a shorthand for all real numbers. + So, it is equivalent to entering <code>(-Inf, Inf)</code>. + +<br> +<br> + +<li> You can use set difference notation. So, for all real numbers + except 3, you can use <code>R-{3}</code> or + <code>(-Inf, 3)U(3,Inf)</code> (they are the same). Similarly, + <code>[1,10)-{3,4}</code> is the same as <code>[1,3)U(3,4)U(4,10)</code>. + + +<br> +<br> + + +<li> WeBWorK will <b>not</b> interpret <tt>[2,4]U[3,5]</tt> as equivalent + to <tt>[2,5]</tt>, unless a problem tells you otherwise. +All sets should be expressed in their simplest interval notation form, with no +overlapping intervals. + +</ul> + +<script language="JavaScript"> +document.write(" <center> <p><input type=\"button\" value=\"Close this window\" name=\"close\" onClick=\"window.close()\"></p> </center> "); + +</script> + +</body></html> --- /dev/null +++ htdocs/helpFiles/Entering-Vectors.html @@ -0,0 +1,56 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Vectors</font></b> +</center> + +<ul type="square"> + +<li><u>Predefined vectors i, j, and k</u> +<blockquote> +<tt>i</tt> is the same as <tt><1,0,0></tt><br /> +<tt>j</tt> is the same as <tt><0,1,0></tt><br /> +<tt>k</tt> is the same as <tt><0,0,1></tt><br /> +</blockquote> +</li> + +<li><u>A vector may be entered using angle brackes and commas, or adding multiples of i, j, and k:</u> +<blockquote> +<tt><4.5, 3/7></tt> and <tt>4.5i + 3/7j</tt> are valid vectors in 2 dimensions<br /> +<tt><pi,e,2></tt> and <tt>pi i + e j + 2 k</tt> are valid vectors in 3 dimensions +</blockquote> +</li> + +<li><u>If the answer is more than one vector:</u> +<blockquote> +Enter your answer as a comma-separated list of vectors, for example: +<tt><4,3>, <5,10></tt> +</blockquote> +</li> + +<li><u>If there are no solutions:</u> +<blockquote> +Enter <tt>NONE</tt> or <tt>DNE</tt> (this may vary from problem to problem) +</blockquote> +</li> + +<li><u>Examples of constants used in vectors:</u> +<blockquote><tt>pi</tt>, <tt>e = e^1</tt></blockquote> +</li> + +<li><u>Functions may be used in each coordinate of a vector, but may not be applied across the parentheses or commas:</u> +<blockquote> +<tt><sqrt(2),sqrt(5)></tt> is valid, but <tt><sqrt(2,5)></tt> is not +<br /> +<br /> +<a href="http://webwork.maa.org/wiki/Available_Functions" target="_new">Link to a list of all available functions</a> +</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Fractions.html @@ -0,0 +1,62 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering fractions</font></b> +</center> + +<ul type="square"> + +<li><u>Examples of fractions, which are of the form a / b for non-decimal numbers a and b that have no common factors, include:</u> +<blockquote> +<tt>5/2, -1/3, pi/3, 4, sqrt(2)/2</tt> +</blockquote> +</li> + +<li><u>Examples of fractions that can be simplified include:</u> +<blockquote> +<tt>15/6, (3-4)/3, 2*pi/6, (16/2)/2</tt> +</blockquote> +</li> + +<li><u>Sometimes decimals are not allowed:</u> +<blockquote> +Allowed: <tt>5/2, -1/3, pi/3, 4, sqrt(2)/2, 2^(1/2)</tt><br /> +Not allowed: <tt>2.5, -0.33333, 3.14159/3, 0.707106/2, 2^(0.5)</tt> +</blockquote> +</li> + +<li><u>Sometimes a mixed fraction is required:</u> +<blockquote>Enter <tt>1 2/3</tt> (for 1 and 2/3) with a space between the 1 and the 2 instead of <tt>5/3</tt></blockquote> +</li> + +<li><u>Sometimes, you must make an integer into a fraction:</u> +<blockquote>Enter <tt>4/1</tt> instead of <tt>4</tt></blockquote> +</li> + +<li><u>If there is more than one correct answer, enter your answers as a comma separated list.</u> +<blockquote> +For example, if your answers are <nobr><tt>-3/2, 4/3, 2pi, e^3, 5</tt></nobr> enter +<nobr><tt>3/2, 4/3, 2*pi, e^3, 5</tt></nobr> +</blockquote> + +<li><u>If there are no solutions:</u> +<blockquote> +Enter <tt>NONE</tt> or <tt>DNE</tt> (this may vary from problem to problem) +</blockquote> +</li> + +<li><u>Sometimes, certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, and exponentiation <tt>^</tt> (or <tt>**</tt>). When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file --- /dev/null +++ htdocs/helpFiles/Entering-Limits.html @@ -0,0 +1,59 @@ +<html> + +<body> + +<center> +<b><font size="+2">Entering Limits</font></b> +</center> + +<ul type="square"> + +<li><u>Limits whose values are numbers:</u> +<blockquote> +For example, lim<sub>x → ∞</sub> arctan(x) = π/2, so you would enter <tt>pi/2</tt> +</blockquote> +</li> + +<li><u>Limits whose values are infinite:</u> +<blockquote> +Enter <tt>infinity</tt>, <tt>inf</tt>, <tt>-infinity</tt>, <tt>-inf</tt> +</blockquote> +</li> + +<li><u>Limits that don't exist:</u> +<blockquote> +Enter <tt>DNE</tt> or <tt>NONE</tt> (this may vary from question to question) +</blockquote> +</li> + +<li><u>Limits whose value is a function:</u> +<blockquote> +Enter the function using appropriate syntax, for example:<br /> +<tt>sqrt(x) = x^(1/2)</tt>, <tt>abs(x) = | x |</tt><br /> +<tt>2^x, e^x, ln(x), log10(x)</tt> <br /> +<tt>sin(x), cos(x), tan(x), csc(x), sec(x), cot(x)</tt><br /> +<tt>arcsin(x) = asin(x) = sin^(-1)(x)</tt><br /> +<tt>arccos(x) = acos(x) = cos^(-1)(x)</tt><br /> +<tt>arctan(x) = atan(x) = tan^(-1)(x)</tt><br /> +</blockquote> +</li> + +<li><u>Sometimes answers must be simplified:</u> +<blockquote> +For example, <tt>6x+5-2x+7</tt> should be simplified to <tt>4x+12</tt> +</blockquote> +</li> + +<li><u>Sometimes, certain operations are not allowed.</u> +<blockquote>Usually, the operations that are not allowed include addition <tt>+</tt>, subtraction <tt>-</tt>, multiplication <tt>*</tt>, division <tt>/</tt>, and exponentiation <tt>^</tt> (or <tt>**</tt>). When these operations are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +<li><u>Sometimes, certain functions are not allowed.</u> +<blockquote>Usually, the functions that are not allowed include square root <tt>sqrt( )</tt>, absolute value <tt>| |</tt> (or <tt>abs( )</tt>), as well as other named functions such as <tt>sin( )</tt>, <tt>ln( )</tt>, etc. When these functions are not allowed, it is usually because you are expected to be able to simplify your answer, often without using a calculator.</blockquote> +</li> + +</ul> + +</body> + +</html> \ No newline at end of file |
From: dpvc v. a. <we...@ma...> - 2010-04-14 14:48:47
|
Log Message: ----------- Make sure inherited formulas get the right variables Modified Files: -------------- pg/lib/Value: Formula.pm Revision Data ------------- Index: Formula.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Formula.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.67 -r1.68 --- lib/Value/Formula.pm +++ lib/Value/Formula.pm @@ -227,6 +227,7 @@ my $self = shift; my $tree = $self->{tree}; $self = $self->SUPER::inherit(@_); $self->{tree} = $tree->copy($self); + $self->{variables} = $tree->getVariables; return $self; } |
From: dpvc v. a. <we...@ma...> - 2010-04-08 11:11:28
|
Log Message: ----------- Since $self->{tree} is not inherited, cache it beforehand so that we can use it afterward. Modified Files: -------------- pg/lib/Value: Formula.pm Revision Data ------------- Index: Formula.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Formula.pm,v retrieving revision 1.66 retrieving revision 1.67 diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.66 -r1.67 --- lib/Value/Formula.pm +++ lib/Value/Formula.pm @@ -224,9 +224,9 @@ # (so it's nodes point to the correct equation, for one thing) # sub inherit { - my $self = shift; + my $self = shift; my $tree = $self->{tree}; $self = $self->SUPER::inherit(@_); - $self->{tree} = $self->{tree}->copy($self); + $self->{tree} = $tree->copy($self); return $self; } |
From: Mike G. v. a. <we...@ma...> - 2010-04-03 20:50:39
|
Log Message: ----------- Added line so that if the dot_radius on a vector arrow is 0 then the dot is not drawn at all. Modified Files: -------------- pg/lib: VectorField.pm Revision Data ------------- Index: VectorField.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/VectorField.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -Llib/VectorField.pm -Llib/VectorField.pm -u -r1.4 -r1.5 --- lib/VectorField.pm +++ lib/VectorField.pm @@ -271,7 +271,8 @@ my $dx = $dt*&{$self->dx_rule}($x,$y); my $dy = $dt*&{$self->dy_rule}($x,$y); $g->moveTo($x,$y); - $g->stamps(new Circle($x, $y, $dot_radius,$dot_color,$dot_color) ); + $g->stamps(new Circle($x, $y, $dot_radius,$dot_color,$dot_color) ) if $dot_radius > 0; + # setting the radius to zero omits the dot $g->lineTo($x+$dx*&$rf_arrow_length($dx,$dy), $y+$dy*&$rf_arrow_length($dx,$dy),gdBrushed); } |
From: dpvc v. a. <we...@ma...> - 2010-04-01 00:46:35
|
Log Message: ----------- Back out of accidental commit of complex macros Modified Files: -------------- pg/macros: PGcomplexmacros.pl Revision Data ------------- Index: PGcomplexmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGcomplexmacros.pl,v retrieving revision 1.15 retrieving revision 1.16 diff -Lmacros/PGcomplexmacros.pl -Lmacros/PGcomplexmacros.pl -u -r1.15 -r1.16 --- macros/PGcomplexmacros.pl +++ macros/PGcomplexmacros.pl @@ -90,148 +90,7 @@ =cut -my %cplx_context = ( - 'std' => 'Complex', - 'strict' => 'LimitedComplex-strict', - 'strict_polar' => 'LimitedComplex-polar', - 'strict_cartesian' => 'LimitedComplex-cartesian', - 'strict_num_polar' => 'LimitedComplex-polar-strict', - 'strict_num_cartesian' => 'LimitedComplex-cartesian-strict', -); - sub cplx_cmp { - return original_cplx_cmp(@_) if $main::useOldAnswerMacros; - - my $correctAnswer = shift; - my %cplx_params = @_; - - # - # Get default options - # - assign_option_aliases( \%cplx_params, - 'reltol' => 'relTol', - ); - set_default_options(\%cplx_params, - 'tolType' => (defined($cplx_params{tol}) ) ? 'absolute' : 'relative', - # default mode should be relative, to obtain this tol must not be defined - 'tolerance' => $main::numAbsTolDefault, - 'relTol' => $main::numRelPercentTolDefault, - 'zeroLevel' => $main::numZeroLevelDefault, - 'zeroLevelTol' => $main::numZeroLevelTolDefault, - 'format' => $main::numFormatDefault, - 'debug' => 0, - 'mode' => 'std', - 'strings' => undef, - ); - my $format = $cplx_params{'format'}; - my $mode = $cplx_params{'mode'}; - - if( $cplx_params{tolType} eq 'relative' ) { - $cplx_params{'tolerance'} = .01*$cplx_params{'relTol'}; - } - - my $context = $cplx_context{$mode}; - unless ($context) {$context = "Complex"; warn "Unknown mode '$mode'"} - $context = $Parser::Context::Default::context{$context}->copy; - - # - # Set the format for the context - # - $context->{format}{number} = $cplx_params{'format'} if $cplx_params{'format'}; - - # - # Add the strings to the context - # - if ($cplx_params{strings}) { - foreach my $string (@{$cplx_params{strings}}) { - my %tex = ($string =~ m/(-?)inf(inity)?/i)? (TeX => "$1\\infty"): (); - $context->strings->add(uc($string) => {%tex}) - unless $context->strings->get(uc($string)); - } - } - - # - # Set the tolerances - # - if ($cplx_params{tolType} eq 'absolute') { - $context->flags->set( - tolerance => $cplx_params{tolerance}, - tolType => 'absolute', - ); - } else { - $context->flags->set( - tolerance => .01*$cplx_params{tolerance}, - tolType => 'relative', - ); - } - $context->flags->set( - zeroLevel => $cplx_params{zeroLevel}, - zeroLevelTol => $cplx_params{zeroLevelTol}, - ); - - # - # Get the proper Parser object for the professor's answer - # using the initialized context - # - my $oldContext = Parser::Context->current(\%main::context,$context); my $z; - if (ref($correctAnswer) eq 'Complex') { - $z = Value::Complex->new($correctAnswer->Re,$correctAnswer->Im); - } else { - $z = Value::Formula->new($correctAnswer); - die "The professor's answer can't be a formula" unless $z->isConstant; - $z = $z->eval; $z = new Value::Complex($z) unless Value::class($z) eq 'String'; - } - $z->{correct_ans} = $correctAnswer; - - # - # Get the answer checker from the parser object - # - my $cmp = $z->cmp; - $cmp->install_pre_filter(sub { - my $rh_ans = shift; - $rh_ans->{original_student_ans} = $rh_ans->{student_ans}; - $rh_ans->{original_correct_ans} = $rh_ans->{correct_ans}; - return $rh_ans; - }); - $cmp->install_post_filter(sub { - my $rh_ans = shift; my $z = $rh_ans->{student_value}; - # - # Stringify student answer (use polar form if student did) - # - if (ref($z) && $z->isNumber) { - $z = Value::Complex->new($z); # promote real to complex - if ($rh_ans->{original_student_ans} =~ m/(^|[^a-zA-Z])e\s*(\^|\*\*)/) { - my ($a,$b) = ($z->mod,$z->arg); - unless ($context->flag('strict_numeric')) { - my $rt = (new Complex($z->Re->value,$z->Im->value))->stringify_polar; - ($a,$b) = ($rt =~ m/\[(.*),(.*)\]/); - } - $a = Value::Real->new($a)->string; - $b = Value::Real->new($b)->string if Value::matchNumber($b); - if ($b eq '0') { - $rh_ans->{student_ans} = $a; - } else { - if ($a eq '1') {$a = ''} elsif ($a eq '-1') {$a = '-'} else {$a .= '*'} - if ($b eq '1') {$b = 'i'} elsif ($b eq '-1') {$b = '(-i)'} else {$b = "($b i)"} - $rh_ans->{student_ans} = $a.'e^'.$b; - } - } else { - $rh_ans->{student_ans} = $rh_ans->{student_value}->string; - } - } - return $rh_ans; - }); - $cmp->{debug} = $cplx_params{debug}; - Parser::Context->current(\%main::context,$oldContext); - - return $cmp; -} - -# -# The original version, for backward compatibility -# (can be removed when the Parser-based version is more fully tested.) -# -sub original_cplx_cmp { my $correctAnswer = shift; my %cplx_params = @_; |
From: dpvc v. a. <we...@ma...> - 2010-04-01 00:43:55
|
Log Message: ----------- Provide a limited context in which rational functions can be specified Modified Files: -------------- pg/macros: PGcomplexmacros.pl contextLimitedPolynomial.pl Added Files: ----------- pg/macros: contextRationalFunction.pl Revision Data ------------- Index: contextLimitedPolynomial.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextLimitedPolynomial.pl,v retrieving revision 1.23 retrieving revision 1.24 diff -Lmacros/contextLimitedPolynomial.pl -Lmacros/contextLimitedPolynomial.pl -u -r1.23 -r1.24 --- macros/contextLimitedPolynomial.pl +++ macros/contextLimitedPolynomial.pl @@ -50,6 +50,56 @@ sub _contextLimitedPolynomial_init {LimitedPolynomial::Init()}; # don't load it again ################################################## + +package LimitedPolynomial; + +# +# Mark a variable as having power 1 +# Mark a number as being present (when strict coefficients are used) +# Mark a monomial as having its given powers +# +sub markPowers { + my $self = shift; + if ($self->class eq 'Variable') { + my $vIndex = LimitedPolynomial::getVarIndex($self); + $self->{index} = $vIndex->{$self->{name}}; + $self->{exponents} = [(0) x scalar(keys %{$vIndex})]; + $self->{exponents}[$self->{index}] = 1; + } elsif ($self->class eq 'Number') { + my $vIndex = LimitedPolynomial::getVarIndex($self); + $self->{exponents} = [(0) x scalar(keys %{$vIndex})]; + } + if ($self->{exponents}) { + my $power = join(',',@{$self->{exponents}}); + $self->{powers}{$power} = 1; + } +} + +# +# Get a hash of variable names that point to indices +# within the array of powers for a monomial +# +sub getVarIndex { + my $self = shift; + my $equation = $self->{equation}; + if (!$equation->{varIndex}) { + $equation->{varIndex} = {}; my $i = 0; + foreach my $v ($equation->{context}->variables->names) + {$equation->{varIndex}{$v} = $i++} + } + return $equation->{varIndex}; +} + +# +# Check for a constant expression +# +sub isConstant { + my $self = shift; + return 1 if $self->{isConstant} || $self->class eq 'Constant'; + return scalar(keys(%{$self->getVariables})) == 0; +} + +################################################## # # Handle common checking for BOPs # @@ -62,7 +112,7 @@ # sub _check { my $self = shift; - my $super = ref($self); $super =~ s/LimitedPolynomial/Parser/; + my $super = ref($self); $super =~ s/^.*?::/Parser::/; &{$super."::_check"}($self); if (LimitedPolynomial::isConstant($self->{lop}) && LimitedPolynomial::isConstant($self->{rop})) { @@ -133,62 +183,12 @@ $self->Error("Can't use '%s' between constants",$self->{bop}); } -################################################## - -package LimitedPolynomial; - -# -# Mark a variable as having power 1 -# Mark a number as being present (when strict coefficients are used) -# Mark a monomial as having its given powers -# -sub markPowers { - my $self = shift; - if ($self->class eq 'Variable') { - my $vIndex = LimitedPolynomial::getVarIndex($self); - $self->{index} = $vIndex->{$self->{name}}; - $self->{exponents} = [(0) x scalar(keys %{$vIndex})]; - $self->{exponents}[$self->{index}] = 1; - } elsif ($self->class eq 'Number') { - my $vIndex = LimitedPolynomial::getVarIndex($self); - $self->{exponents} = [(0) x scalar(keys %{$vIndex})]; - } - if ($self->{exponents}) { - my $power = join(',',@{$self->{exponents}}); - $self->{powers}{$power} = 1; - } -} - -# -# Get a hash of variable names that point to indices -# within the array of powers for a monomial -# -sub getVarIndex { - my $self = shift; - my $equation = $self->{equation}; - if (!$equation->{varIndex}) { - $equation->{varIndex} = {}; my $i = 0; - foreach my $v ($equation->{context}->variables->names) - {$equation->{varIndex}{$v} = $i++} - } - return $equation->{varIndex}; -} - -# -# Check for a constant expression -# -sub isConstant { - my $self = shift; - return 1 if $self->{isConstant} || $self->class eq 'Constant'; - return scalar(keys(%{$self->getVariables})) == 0; -} - ############################################## # # Now we get the individual replacements for the operators # that we don't want to allow. We inherit everything from # the original Parser::BOP class, and just add the -# polynomial checks here. Note that checkpolynomial +# polynomial checks here. Note that checkPolynomial # only gets called if at least one of the terms is not # a number. # @@ -248,7 +248,7 @@ $self->Error("In a polynomial, you can only divide by numbers") unless LimitedPolynomial::isConstant($r); $self->Error("You can only divide a single term by a number") - if $l->{isPoly} && $l->{isPoly} == 1; + if $l->{isPoly} && $l->{isPoly} != 2; $self->{isPoly} = $l->{isPoly}; $self->{powers} = $l->{powers}; delete $l->{powers}; $self->{exponents} = $l->{exponents}; delete $l->{exponents}; @@ -299,18 +299,18 @@ sub _check { my $self = shift; - my $super = ref($self); $super =~ s/LimitedPolynomial/Parser/; + my $super = ref($self); $super =~ s/^.*?::/Parser::/; &{$super."::_check"}($self); my $op = $self->{op}; return if LimitedPolynomial::isConstant($op); - $self->Error("You can only use '%s' with monomials",$self->{def}{string}) - if $op->{isPoly}; $self->{isPoly} = 2; $self->{powers} = $op->{powers}; delete $op->{powers}; $self->{exponents} = $op->{exponents}; delete $op->{exponents}; + return if $self->checkPolynomial; + $self->Error("You can only use '%s' with monomials",$self->{def}{string}); } -sub checkPolynomial {return 0} +sub checkPolynomial {return !(shift)->{op}{isPoly}} ############################################## Index: PGcomplexmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGcomplexmacros.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -Lmacros/PGcomplexmacros.pl -Lmacros/PGcomplexmacros.pl -u -r1.14 -r1.15 --- macros/PGcomplexmacros.pl +++ macros/PGcomplexmacros.pl @@ -90,7 +90,148 @@ =cut +my %cplx_context = ( + 'std' => 'Complex', + 'strict' => 'LimitedComplex-strict', + 'strict_polar' => 'LimitedComplex-polar', + 'strict_cartesian' => 'LimitedComplex-cartesian', + 'strict_num_polar' => 'LimitedComplex-polar-strict', + 'strict_num_cartesian' => 'LimitedComplex-cartesian-strict', +); + sub cplx_cmp { + return original_cplx_cmp(@_) if $main::useOldAnswerMacros; + + my $correctAnswer = shift; + my %cplx_params = @_; + + # + # Get default options + # + assign_option_aliases( \%cplx_params, + 'reltol' => 'relTol', + ); + set_default_options(\%cplx_params, + 'tolType' => (defined($cplx_params{tol}) ) ? 'absolute' : 'relative', + # default mode should be relative, to obtain this tol must not be defined + 'tolerance' => $main::numAbsTolDefault, + 'relTol' => $main::numRelPercentTolDefault, + 'zeroLevel' => $main::numZeroLevelDefault, + 'zeroLevelTol' => $main::numZeroLevelTolDefault, + 'format' => $main::numFormatDefault, + 'debug' => 0, + 'mode' => 'std', + 'strings' => undef, + ); + my $format = $cplx_params{'format'}; + my $mode = $cplx_params{'mode'}; + + if( $cplx_params{tolType} eq 'relative' ) { + $cplx_params{'tolerance'} = .01*$cplx_params{'relTol'}; + } + + my $context = $cplx_context{$mode}; + unless ($context) {$context = "Complex"; warn "Unknown mode '$mode'"} + $context = $Parser::Context::Default::context{$context}->copy; + + # + # Set the format for the context + # + $context->{format}{number} = $cplx_params{'format'} if $cplx_params{'format'}; + + # + # Add the strings to the context + # + if ($cplx_params{strings}) { + foreach my $string (@{$cplx_params{strings}}) { + my %tex = ($string =~ m/(-?)inf(inity)?/i)? (TeX => "$1\\infty"): (); + $context->strings->add(uc($string) => {%tex}) + unless $context->strings->get(uc($string)); + } + } + + # + # Set the tolerances + # + if ($cplx_params{tolType} eq 'absolute') { + $context->flags->set( + tolerance => $cplx_params{tolerance}, + tolType => 'absolute', + ); + } else { + $context->flags->set( + tolerance => .01*$cplx_params{tolerance}, + tolType => 'relative', + ); + } + $context->flags->set( + zeroLevel => $cplx_params{zeroLevel}, + zeroLevelTol => $cplx_params{zeroLevelTol}, + ); + + # + # Get the proper Parser object for the professor's answer + # using the initialized context + # + my $oldContext = Parser::Context->current(\%main::context,$context); my $z; + if (ref($correctAnswer) eq 'Complex') { + $z = Value::Complex->new($correctAnswer->Re,$correctAnswer->Im); + } else { + $z = Value::Formula->new($correctAnswer); + die "The professor's answer can't be a formula" unless $z->isConstant; + $z = $z->eval; $z = new Value::Complex($z) unless Value::class($z) eq 'String'; + } + $z->{correct_ans} = $correctAnswer; + + # + # Get the answer checker from the parser object + # + my $cmp = $z->cmp; + $cmp->install_pre_filter(sub { + my $rh_ans = shift; + $rh_ans->{original_student_ans} = $rh_ans->{student_ans}; + $rh_ans->{original_correct_ans} = $rh_ans->{correct_ans}; + return $rh_ans; + }); + $cmp->install_post_filter(sub { + my $rh_ans = shift; my $z = $rh_ans->{student_value}; + # + # Stringify student answer (use polar form if student did) + # + if (ref($z) && $z->isNumber) { + $z = Value::Complex->new($z); # promote real to complex + if ($rh_ans->{original_student_ans} =~ m/(^|[^a-zA-Z])e\s*(\^|\*\*)/) { + my ($a,$b) = ($z->mod,$z->arg); + unless ($context->flag('strict_numeric')) { + my $rt = (new Complex($z->Re->value,$z->Im->value))->stringify_polar; + ($a,$b) = ($rt =~ m/\[(.*),(.*)\]/); + } + $a = Value::Real->new($a)->string; + $b = Value::Real->new($b)->string if Value::matchNumber($b); + if ($b eq '0') { + $rh_ans->{student_ans} = $a; + } else { + if ($a eq '1') {$a = ''} elsif ($a eq '-1') {$a = '-'} else {$a .= '*'} + if ($b eq '1') {$b = 'i'} elsif ($b eq '-1') {$b = '(-i)'} else {$b = "($b i)"} + $rh_ans->{student_ans} = $a.'e^'.$b; + } + } else { + $rh_ans->{student_ans} = $rh_ans->{student_value}->string; + } + } + return $rh_ans; + }); + $cmp->{debug} = $cplx_params{debug}; + Parser::Context->current(\%main::context,$oldContext); + + return $cmp; +} + +# +# The original version, for backward compatibility +# (can be removed when the Parser-based version is more fully tested.) +# +sub original_cplx_cmp { my $correctAnswer = shift; my %cplx_params = @_; --- /dev/null +++ macros/contextRationalFunction.pl @@ -0,0 +1,184 @@ +################################################################################ +# WeBWorK Online Homework Delivery System +# Copyright © 2000-2010 The WeBWorK Project, http://openwebwork.sf.net/ +# $CVSHeader: pg/macros/contextRationalFunction.pl,v 1.1 2010/04/01 00:21:45 dpvc Exp $ +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of either: (a) the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version, or (b) the "Artistic License" which comes with this package. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the +# Artistic License for more details. +################################################################################ + +=head1 NAME + +contextRationalFunction.pl - Only allow rational functions + (and their products and powers) + +=head1 DESCRIPTION + +Implements a context in which students can only enter rational +functions, with some control over whether a single division is +allowed, or whether products of rational functions are allowed. + +Select the context using: + + Context("RationalFunction"); + +The RationalFunction context supports all the flags of the +PolynomialFactors context, except for strictDivision, since rational +functions allow division of polynomials. + +In addition, there is a singleQuotients flag that controls whether +products of rational functions are allowed or not. By default, they +are allowed, but you can set this flag to 1 in order to force the +student answer to be as a single fraction. + +Finally, there is also a strict context that does not allow +operations even within the coefficients. Select it using: + + Context("RationalFunction-Strict"); + +In addition to disallowing operations within the coefficients, this +context does not reduce constant operations (since they are not +allowed), and sets the singlePowers, singleFactors, singleQuotients, +and stricPowers flags automatically. In addition, it disables all the +functions, though they can be re-enabled, if needed. + +=cut + +################################################## + +loadMacros( + "MathObjects.pl", + "contextPolynomialFactors.pl" +); + +sub _contextRationalFunction_init {RationalFunction::Init()} + +############################################## + +package RationalFunction::BOP::multiply; +our @ISA = qw(PolynomialFactors::BOP::multiply); + +sub checkFactors { + my $self = shift; my ($l,$r) = @_; + $self->SUPER::checkFactors($l,$r); + if (($l->{isPoly}||0) >= 6 || ($r->{isPoly}||0) >= 6) { + $self->Error("You can not use multiplication with rational functions as operands ". + "(do you need parentheses around the denominator?)") + if $self->context->flag("singleQuotients"); + $self->{isPoly} = 7; # product containing rational functions + } + return 1; +} + +############################################## + +package RationalFunction::BOP::divide; +our @ISA = qw(PolynomialFactors::BOP::divide); + +sub checkPolynomial { + my $self = shift; my ($l,$r) = ($self->{lop},$self->{rop}); + if ((!$l->{isPoly} || $l->{isPoly} == 2) && LimitedPolynomial::isConstant($r)) { + $self->{isPoly} = $l->{isPoly}; + $self->{powers} = $l->{powers}; delete $l->{powers}; + $self->{exponents} = $l->{exponents}; delete $l->{exponents}; + } elsif (($l->{isPoly}||0) >= 6 || ($r->{isPoly}||0) >= 6) { + $self->Error("Only one polynomial division is allowed in a rational function"); + } else { + PolynomialFactors::markFactor($l); + PolynomialFactors::markFactor($r); + $self->checkFactors($l,$r); + } + return 1; +} + +sub checkFactors { + my $self = shift; my ($l,$r) = @_; + my $single = $self->context->flag("singleFactors"); + $self->Error("Only one constant multiple or fraction is allowed (combine or cancel them)") + if $l->{factors}{0} && $r->{factors}{0} && $self->context->flag("singleFactors"); + $self->{factors} = $l->{factors}; delete $l->{factors}; + foreach my $factor (keys %{$r->{factors}}) { + if ($single && $self->{factors}{$factor}) { + $self->Error("Each factor can appear only once (combine or cancel like factors)") unless $factor eq "0"; + $self->Error("Only one constant coefficient or negation is allowed (combine or cancel them)"); + } + $self->{factors}{$factor} = 1; + } + delete $r->{factors}; + $self->{isPoly} = 6; # rational function + return 1; +} + +############################################## + +package RationalFunction::BOP::power; +our @ISA = qw(PolynomialFactors::BOP::power); + +sub checkPolynomial { + my $self = shift; my ($l,$r) = ($self->{lop},$self->{rop}); + $self->SUPER::checkPolynomial; + $self->{isPoly} = 6 if ($l->{isPoly}||0) >= 6; + return 1; +} + +############################################## + +package RationalFunction::UOP::minus; +our @ISA = qw(PolynomialFactors::UOP::minus); + +sub checkPolynomial { + my $self = shift; + $self->SUPER::checkPolynomial; + $self->{isPoly} = 6 if ($self->{op}{isPoly}||0) >= 6; + return 1; +} + +############################################## + +package RationalFunction; +our @ISA = ('PolynomialFactors'); + +sub Init { + # + # Build the new context that calls the + # above classes rather than the usual ones + # + + my $context = $main::context{RationalFunction} = Parser::Context->getCopy("PolynomialFactors"); + $context->{name} = "RationalFunction"; + $context->operators->set( + '*' => {class => 'RationalFunction::BOP::multiply'}, + '* ' => {class => 'RationalFunction::BOP::multiply'}, + ' *' => {class => 'RationalFunction::BOP::multiply'}, + ' ' => {class => 'RationalFunction::BOP::multiply'}, + '/' => {class => 'RationalFunction::BOP::divide'}, + ' /' => {class => 'RationalFunction::BOP::divide'}, + '/ ' => {class => 'RationalFunction::BOP::divide'}, + '^' => {class => 'RationalFunction::BOP::power'}, + '**' => {class => 'RationalFunction::BOP::power'}, + 'u-' => {class => 'RationalFunction::UOP::minus'}, + ); + $context->flags->set(strictPowers => 1); + + # + # A context where coefficients can't include operations + # + $context = $main::context{"RationalFunction-Strict"} = $context->copy; + $context->flags->set( + strictCoefficients => 1, + singlePowers => 1, singleFactors => 1, singleQuotients => 1, + reduceConstants => 0, + ); + $context->functions->disable("All"); # can be re-enabled if needed + + main::Context("RationalFunction"); ### FIXME: probably should require author to set this explicitly +} + +1; |
From: dpvc v. a. <we...@ma...> - 2010-04-01 00:43:10
|
Log Message: ----------- Make it easier to subclass this class for RationalFunction context, and fix a bug with the stict division check Modified Files: -------------- pg/macros: contextPolynomialFactors.pl Revision Data ------------- Index: contextPolynomialFactors.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextPolynomialFactors.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -Lmacros/contextPolynomialFactors.pl -Lmacros/contextPolynomialFactors.pl -u -r1.2 -r1.3 --- macros/contextPolynomialFactors.pl +++ macros/contextPolynomialFactors.pl @@ -55,7 +55,7 @@ (x*(x+1))/3 is allowed, while strictPowers is 1, so (x*(x+1))^3 is not (it must be written x^3*(x+1)^3). -Finally, there is also a strict limited context that does not allow +Finally, there is also a strict context that does not allow operations even within the coefficients. Select it using: Context("PolynomialFactors-Strict"); @@ -109,8 +109,7 @@ our @ISA = qw(LimitedPolynomial::BOP::multiply); sub checkPolynomial { - my $self = shift; - my ($l,$r) = ($self->{lop},$self->{rop}); + my $self = shift; my ($l,$r) = ($self->{lop},$self->{rop}); my $lOK = (LimitedPolynomial::isConstant($l) || $l->{isPower} || $l->class eq 'Variable' || ($l->{isPoly} && $l->{isPoly} == 2)); my $rOK = ($r->{isPower} || $r->class eq 'Variable'); @@ -136,6 +135,7 @@ } $self->{factors}{$factor} = 1; } + delete $r->{factors}; $self->{isPoly} = 4; # product of factors return 1; } @@ -151,17 +151,15 @@ our @ISA = qw(LimitedPolynomial::BOP::divide); sub checkPolynomial { - my $self = shift; - my ($l,$r) = ($self->{lop},$self->{rop}); + my $self = shift; my ($l,$r) = ($self->{lop},$self->{rop}); $self->Error("In a polynomial, you can only divide by numbers") unless LimitedPolynomial::isConstant($r); if ($l->{isPoly} && $l->{isPoly} != 2) { $self->Error("You can only divide a single term or factor by a number") - if $l->{isPoly} == 3 || ($self->context->flag("strictDivision") && $self->{isPoly} != 1); - PolynomialFactors::markFactor($l); + if $l->{isPoly} == 3 || ($self->context->flag("strictDivision") && $l->{isPoly} != 1); + PolynomialFactors::markOpFactor($self,$l); $self->Error("Only one constant multiple or fraction is allowed (combine them)") - if $l->{factors}{0} && $self->context->flag("singleFactors"); - $self->{factors} = $l->{factors}; delete $l->{factors}; + if $self->{factors}{0} && $self->context->flag("singleFactors"); $self->{factors}{0} = 1; # mark as constant multiple; $self->{isPoly} = 3; # factor over a number } else { @@ -178,8 +176,7 @@ our @ISA = qw(LimitedPolynomial::BOP::power); sub checkPolynomial { - my $self = shift; - my ($l,$r) = ($self->{lop},$self->{rop}); + my $self = shift; my ($l,$r) = ($self->{lop},$self->{rop}); $self->Error("Exponents must be constant in a polynomial") unless LimitedPolynomial::isConstant($r); my $n = Parser::Evaluate($r); @@ -190,8 +187,7 @@ if ($l->{isPoly}) { $self->Error("You can only raise a single term or factor to a power") if $l->{isPoly} > 2 && $self->context->flag("strictPowers"); - PolynomialFactors::markFactor($l); - $self->{factors} = $l->{factors}; delete $l->{factors}; + PolynomialFactors::markOpFactor($self,$l); $self->{isPoly} = 5; # factor to a power } else { LimitedPolynomial::markPowers($l); @@ -216,11 +212,9 @@ my $self = shift; my $op = $self->{op}; if ($op->{isPoly} && $self->context->flag("singleFactors")) { $self->Error("Double negatives are not allowed") if $op->{isPoly} == 2; - $self->Error("Only one factor or constant can be negated") - if $op->{isPoly} != 1 && $op->{isPoly} != 5; + $self->Error("Only one factor or constant can be negated") if $op->{isPoly} == 4; } - PolynomialFactors::markFactor($op); - $self->{factors} = $op->{factors}; delete $op->{factors}; + PolynomialFactors::markOpFactor($self,$op); $self->{factors}{0} = 1; # mark as constant multiple return 1; } @@ -245,6 +239,13 @@ } } +sub markOpFactor { + my $self = shift; my $op = shift; + markFactor($op); + $self->{factors} = $op->{factors}; + delete $op->{factors}; +} + sub Init { # # Build the new context that calls the |
From: dpvc v. a. <we...@ma...> - 2010-03-31 22:07:51
|
Log Message: ----------- Remove unneeded parent class Modified Files: -------------- pg/macros: contextPolynomialFactors.pl Revision Data ------------- Index: contextPolynomialFactors.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextPolynomialFactors.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -Lmacros/contextPolynomialFactors.pl -Lmacros/contextPolynomialFactors.pl -u -r1.1 -r1.2 --- macros/contextPolynomialFactors.pl +++ macros/contextPolynomialFactors.pl @@ -106,7 +106,7 @@ ############################################## package PolynomialFactors::BOP::multiply; -our @ISA = qw(PolynomialFactors::BOP LimitedPolynomial::BOP::multiply); +our @ISA = qw(LimitedPolynomial::BOP::multiply); sub checkPolynomial { my $self = shift; |
From: dpvc v. a. <we...@ma...> - 2010-03-31 21:23:24
|
Log Message: ----------- New context for products of powers of polynomials Added Files: ----------- pg/macros: contextPolynomialFactors.pl Revision Data ------------- --- /dev/null +++ macros/contextPolynomialFactors.pl @@ -0,0 +1,286 @@ +################################################################################ +# WeBWorK Online Homework Delivery System +# Copyright © 2000-2010 The WeBWorK Project, http://openwebwork.sf.net/ +# $CVSHeader: pg/macros/contextPolynomialFactors.pl,v 1.1 2010/03/31 21:01:14 dpvc Exp $ +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of either: (a) the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version, or (b) the "Artistic License" which comes with this package. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the +# Artistic License for more details. +################################################################################ + +=head1 NAME + +contextPolynomialFactors.pl - Allow only entry of polynomials, and + their products and powers + +=head1 DESCRIPTION + +Implements a context in which students can only enter products and +powers of polynomials + +Select the context using: + + Context("PolynomialFactors"); + +If you set the "singlePowers" flag, then only one monomial of each +degree can be included in each factor polynomial: + + Context("PolynomialFactors")->flags->set(singlePowers=>1); + +If you set the "singleFactors" flag, then factors can not be repeated. +For example, + + Context("PolynomialFactors")->flags->set(singleFactors=>1); + Formula("(x+1)^2*(x+1)"); + +will generate an error indicating that factors can appear only once. +Note, however, that this only catches factors that appear exactly the +same in both cases, so (x+1)*(1+x) would be allowed, as would +-(x-1)*(1-x). Note also that there is no check for whether the +factors are irreducible, so (x^2-1)*(x+1)*(x-1) would be allowed. +Also, there is no check for whether constants have been factored out, +so 3*(x+1)*(3x+3) would be allowed. This still needs more work to +make it very useful. + +There are two additional flags that control whether division by a +constant or raising to a power are allowed to be performed on a +product or factors or only on a single factor at at time. These are +strictDivision and strictPowers. By default, strictDivisions is 0, so +(x*(x+1))/3 is allowed, while strictPowers is 1, so (x*(x+1))^3 is not +(it must be written x^3*(x+1)^3). + +Finally, there is also a strict limited context that does not allow +operations even within the coefficients. Select it using: + + Context("PolynomialFactors-Strict"); + +In addition to disallowing operations within the coefficients, this +context does not reduce constant operations (since they are not +allowed), and sets the singlePowers, singleFactors, strictDivision, +and stricPowers flags automatically. In addition, it disables all the +functions, though they can be re-enabled, if needed. + +=cut + +################################################## + +loadMacros( + "MathObjects.pl", + "contextLimitedPolynomial.pl" +); + +sub _contextPolynomialFactors_init {PolynomialFactors::Init()} + +############################################## + +package PolynomialFactors::BOP::add; +our @ISA = qw(LimitedPolynomial::BOP::add); + +sub checkPolynomial { + my $self = shift; + my ($l,$r) = ($self->{lop},$self->{rop}); + $self->Error("Addition is allowed only between monomials") + if $r->{isPoly} || ($l->{isPoly} && $l->{isPoly} > 2); + $self->checkPowers; +} + +############################################## + +package PolynomialFactors::BOP::subtract; +our @ISA = qw(LimitedPolynomial::BOP::subtract); + +sub checkPolynomial { + my $self = shift; + my ($l,$r) = ($self->{lop},$self->{rop}); + $self->Error("Subtraction is allowed only between monomials") + if $r->{isPoly} || ($l->{isPoly} && $l->{isPoly} > 2); + $self->checkPowers; +} + +############################################## + +package PolynomialFactors::BOP::multiply; +our @ISA = qw(PolynomialFactors::BOP LimitedPolynomial::BOP::multiply); + +sub checkPolynomial { + my $self = shift; + my ($l,$r) = ($self->{lop},$self->{rop}); + my $lOK = (LimitedPolynomial::isConstant($l) || $l->{isPower} || + $l->class eq 'Variable' || ($l->{isPoly} && $l->{isPoly} == 2)); + my $rOK = ($r->{isPower} || $r->class eq 'Variable'); + return $self->checkExponents if $lOK and $rOK; + $self->Error("Coefficients must come before variables or factors") + if LimitedPolynomial::isConstant($r) && ($l->{isPower} || $l->class eq 'Variable'); + if ($l->{isPoly} || $r->{isPoly}) { + PolynomialFactors::markFactor($l); + PolynomialFactors::markFactor($r); + return $self->checkFactors($l,$r); + } + return 1; +} + +sub checkFactors { + my $self = shift; my ($l,$r) = @_; + my $single = $self->context->flag("singleFactors"); + $self->{factors} = $l->{factors}; delete $l->{factors}; + foreach my $factor (keys %{$r->{factors}}) { + if ($single && $self->{factors}{$factor}) { + $self->Error("Each factor can appear only once (combine like factors)") unless $factor eq "0"; + $self->Error("Only one constant coefficient or negation is allowed (combine them)"); + } + $self->{factors}{$factor} = 1; + } + $self->{isPoly} = 4; # product of factors + return 1; +} + +sub checkStrict { + my $self = shift; + $self->Error("You can only use '%s' between coefficents and variables or between factors",$self->{bop}); +} + +############################################## + +package PolynomialFactors::BOP::divide; +our @ISA = qw(LimitedPolynomial::BOP::divide); + +sub checkPolynomial { + my $self = shift; + my ($l,$r) = ($self->{lop},$self->{rop}); + $self->Error("In a polynomial, you can only divide by numbers") + unless LimitedPolynomial::isConstant($r); + if ($l->{isPoly} && $l->{isPoly} != 2) { + $self->Error("You can only divide a single term or factor by a number") + if $l->{isPoly} == 3 || ($self->context->flag("strictDivision") && $self->{isPoly} != 1); + PolynomialFactors::markFactor($l); + $self->Error("Only one constant multiple or fraction is allowed (combine them)") + if $l->{factors}{0} && $self->context->flag("singleFactors"); + $self->{factors} = $l->{factors}; delete $l->{factors}; + $self->{factors}{0} = 1; # mark as constant multiple; + $self->{isPoly} = 3; # factor over a number + } else { + $self->{isPoly} = $l->{isPoly}; + $self->{powers} = $l->{powers}; delete $l->{powers}; + $self->{exponents} = $l->{exponents}; delete $l->{exponents}; + } + return 1; +} + +############################################## + +package PolynomialFactors::BOP::power; +our @ISA = qw(LimitedPolynomial::BOP::power); + +sub checkPolynomial { + my $self = shift; + my ($l,$r) = ($self->{lop},$self->{rop}); + $self->Error("Exponents must be constant in a polynomial") + unless LimitedPolynomial::isConstant($r); + my $n = Parser::Evaluate($r); + $r->Error($$Value::context->{error}{message}) if $$Value::context->{error}{flag}; + $n = $n->value; + $self->Error("Exponents must be positive integers in a polynomial") + unless $n > 0 && $n == int($n); + if ($l->{isPoly}) { + $self->Error("You can only raise a single term or factor to a power") + if $l->{isPoly} > 2 && $self->context->flag("strictPowers"); + PolynomialFactors::markFactor($l); + $self->{factors} = $l->{factors}; delete $l->{factors}; + $self->{isPoly} = 5; # factor to a power + } else { + LimitedPolynomial::markPowers($l); + $self->{exponents} = $l->{exponents}; delete $l->{exponents}; + foreach my $i (@{$self->{exponents}}) {$i = $n if $i} + $self->{isPower} = 1; + } + return 1; +} + +sub checkStrict { + my $self = shift; + $self->Error("You can only use powers of a variable or factor"); +} + +############################################## + +package PolynomialFactors::UOP::minus; +our @ISA = qw(LimitedPolynomial::UOP::minus); + +sub checkPolynomial { + my $self = shift; my $op = $self->{op}; + if ($op->{isPoly} && $self->context->flag("singleFactors")) { + $self->Error("Double negatives are not allowed") if $op->{isPoly} == 2; + $self->Error("Only one factor or constant can be negated") + if $op->{isPoly} != 1 && $op->{isPoly} != 5; + } + PolynomialFactors::markFactor($op); + $self->{factors} = $op->{factors}; delete $op->{factors}; + $self->{factors}{0} = 1; # mark as constant multiple + return 1; +} + +############################################## + +package PolynomialFactors; +our @ISA = ('LimitedPolynomal'); + +sub markFactor { + my $self = shift; + return if $self->{factors}; + $self->{factors} = {}; + if ($self->class eq 'Variable') { + $self->{factors}{$self->{name}} = 1; + } elsif ($self->class eq 'Number') { + $self->{factors}{0} = 1; + } elsif ($self->{isPoly} && $self->{isPoly} == 1) { + $self->{factors}{$self->string} = 1; + } elsif ($self->{isPower}) { + $self->{factors}{$self->{lop}->string} = 1; + } +} + +sub Init { + # + # Build the new context that calls the + # above classes rather than the usual ones + # + + my $context = $main::context{PolynomialFactors} = Parser::Context->getCopy("LimitedPolynomial"); + $context->{name} = "PolynomialFactors"; + $context->operators->set( + '+' => {class => 'PolynomialFactors::BOP::add'}, + '-' => {class => 'PolynomialFactors::BOP::subtract'}, + '*' => {class => 'PolynomialFactors::BOP::multiply'}, + '* ' => {class => 'PolynomialFactors::BOP::multiply'}, + ' *' => {class => 'PolynomialFactors::BOP::multiply'}, + ' ' => {class => 'PolynomialFactors::BOP::multiply'}, + '/' => {class => 'PolynomialFactors::BOP::divide'}, + ' /' => {class => 'PolynomialFactors::BOP::divide'}, + '/ ' => {class => 'PolynomialFactors::BOP::divide'}, + '^' => {class => 'PolynomialFactors::BOP::power'}, + '**' => {class => 'PolynomialFactors::BOP::power'}, + 'u-' => {class => 'PolynomialFactors::UOP::minus'}, + ); + $context->flags->set(strictPowers => 1); + + # + # A context where coefficients can't include operations + # + $context = $main::context{"PolynomialFactors-Strict"} = $context->copy; + $context->flags->set( + strictCoefficients => 1, strictDivision => 1, + singlePowers => 1, singleFactors => 1, + reduceConstants => 0, + ); + $context->functions->disable("All"); # can be re-enabled if needed + + main::Context("PolynomialFactors"); ### FIXME: probably should require author to set this explicitly +} + +1; |
From: dpvc v. a. <we...@ma...> - 2010-03-29 14:21:39
|
Log Message: ----------- Set main::problemSeed so images will refresh when the problem is re-seeded. Make changes made by professors acting as students only temporary changes Modified Files: -------------- pg/macros: problemRandomize.pl Revision Data ------------- Index: problemRandomize.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/problemRandomize.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -Lmacros/problemRandomize.pl -Lmacros/problemRandomize.pl -u -r1.12 -r1.13 --- macros/problemRandomize.pl +++ macros/problemRandomize.pl @@ -180,6 +180,7 @@ when => "correct", onlyAfterDue => 1, style => "Button", + styleName => ($main::inputs_ref->{effectiveUser} ne $main::inputs_ref->{user} ? "checkAnswers" : "submitAnswers"), label => undef, buttonLabel => "Get a new version of this problem", checkboxLabel => "Get a new version of this problem", @@ -219,6 +220,7 @@ $main::PG_FLAGS{PROBLEM_GRADER_TO_USE} = \&problemRandomize::grader; $main::PG_FLAGS{problemRandomize} = $self; $self->reset if $self->{isReset}; + $main::problemSeed = $self->{status}{seed}; $self->{random}->srand($self->{status}{seed}); } @@ -258,7 +260,7 @@ my $self = shift; my $label = quoteHTML(shift || $self->{buttonLabel}); my $par = shift; $par = ($par ? $main::PAR : ''); - $par . qq!<input type="submit" name="submitAnswers" value="$label" ! + $par . qq!<input type="submit" name="$self->{styleName}" value="$label" ! . q!onclick="document.getElementById('_reseed').value=!.seed().'" />'; } @@ -269,7 +271,7 @@ my $self = shift; my $label = quoteHTML(shift || $self->{inputLabel}); my $par = shift; $par = ($par ? main::PAR : ''); - $par . qq!<input type="submit" name="submitAnswers" value="$label" ! + $par . qq!<input type="submit" name="$self->{styleName}" value="$label" ! . q!onclick="document.getElementById('_reseed').value=document.getElementById('_seed').value" />! . qq!<input name="_seed" id="_seed" value="$self->{status}{seed}" size="10">!; } |
From: dpvc v. a. <we...@ma...> - 2010-03-23 00:48:11
|
Log Message: ----------- Add requirePureFraction flag and include more documentation Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.12 -r1.13 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -156,16 +156,6 @@ This parameter used to be named allowProperFractions, which is deprecated, but you can still use it for backward-compatibility. -=item S<C<< requireProperFractions >>> - -This determines whether fractions MUST be entered as proper fractions. -It is 0 by default, meaning improper fractions are allowed. When set, -you will not be able to enter 5/2 as a fraction, but must use "2 1/2". -This flag is allowed only when strictFractions is in effect. -Set it to 1 only when you also set allowMixedNumbers, or you will -not be able to specify fractions bigger than one. It is off by -default in all three contexts. - =item S<C<< showMixedNumbers >>> This controls whether fractions are displayed as proper fractions or @@ -176,6 +166,28 @@ which is deprecated, but you can still use it for backward-compatibility. +=item S<C<< requireProperFractions >>> + +This determines whether fractions MUST be entered as proper fractions. +It is 0 by default, meaning improper fractions are allowed. When set, +you will not be able to enter 5/2 as a fraction, but must use "2 1/2". +This flag is allowed only when strictFractions is in effect. Set it +to 1 only when you also set allowMixedNumbers, or you will not be able +to specify fractions bigger than one. It is off by default in all +four contexts. You should not set both requireProperFractions and +requirePureFractions to 1. + +=item S<C<< requirePureFractions >>> + +This determines whether fractions MUST be entered as pure fractions +rather than mixed numbers. If allowMixedNumbers is also set, then +mixed numbers will be properly interpretted, but will produce a +warning message and be marked incorrect; that is, 2 3/4 would be +recognized as 2+3/4 rather than 2*3/4, but would generate a message +indicating that mixed numbers are not allowed. This flag is off by +default in all four contexts. You should not set both +requirePureFractions and requireProperFractions to 1. + =back Fraction objects have two methods that can be useful when @@ -236,6 +248,7 @@ strictFractions => 0, strictMinus => 0, strictMultiplication => 0, allowMixedNumbers => 0, # also set reduceConstants => 0 if you change this requireProperFractions => 0, + requirePureFractions => 0, showMixedNumbers => 0, ); $context->reduction->set('a/b' => 1,'a b/c' => 1, '0 a/b' => 1); @@ -426,6 +439,8 @@ $self->{rop}->eval >= 0); } if ($isFraction) { + $self->Error("Mixed numbers are not allowed; you must use a pure fraction") + if ($self->context->flag("requirePureFractions")); $self->{bop} = " "; $self->{def} = $self->context->{operators}{$self->{bop}}; if ($self->{lop}->class eq 'MINUS') { |
From: dpvc v. a. <we...@ma...> - 2010-03-22 11:24:04
|
Log Message: ----------- Add =< and => operators and flag to control whether they are allowed or not. Added more documentation Modified Files: -------------- pg/macros: contextInequalities.pl Revision Data ------------- Index: contextInequalities.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextInequalities.pl,v retrieving revision 1.22 retrieving revision 1.23 diff -Lmacros/contextInequalities.pl -Lmacros/contextInequalities.pl -u -r1.22 -r1.23 --- macros/contextInequalities.pl +++ macros/contextInequalities.pl @@ -30,17 +30,19 @@ =head1 USAGE loadMacros("contextInequalities.pl"); - + Context("Inequalities"); $S1 = Compute("1 < x <= 4"); $S2 = Inequality("(1,4]"); # force interval to be inequality - + Context("Inequalities-Only"); $S1 = Compute("1 < x <= 4"); $S2 = Inequality("(1,4]"); # generates an error - - $S3 = Compute("x < -2 or x > 2"); # forms a Union - $S4 = Compute("x = 1"); # forms a Set + + $S3 = Compute("x < -2 or x > 2"); # forms the Union (-inf,-2) U (2,inf) + $S4 = Compute("x > 2 and x <= 4"); # forms the Interval (2,4] + $S5 = Compute("x = 1"); # forms the Set + $S6 = Compute("x != 1"); # forms the Union (-inf,1) U (1,inf) You can set the "noneWord" flag to specify the string to use when the inequalities specify the empty set. By default, @@ -54,6 +56,26 @@ creates an empty set as a named constant and uses that name. +In addition to the noneWord flag, the inequality contexts accept the +following additional flags: + +=over + +=item S<C<< showNotEquals >>> + +This controls whether intervals of the form (-inf,a) U (a,inf) are +displayed as x != a or not. The default is 1, meaning convert to +x != a. + +=item S<C<< allowSloppyInequalities >>> + +This controls whether <= and >= can also be represented by =< and => +or not. By default, both forms are allowed, to allow maximum +flexibility in student answers, but if set to 0, only the first forms +are allowed. + +=back + Inequalities and interval notation both can coexist side by side, but you may wish to convert from one to the other. Use Inequality() to convert from an Interval, Set or Union @@ -62,8 +84,8 @@ For example: $I0 = Compute("(1,2]"); # the interval (1,2] - $I1 = Inequality($I); # the inequality 1 < x <= 2 - + $I1 = Inequality($I1); # the inequality 1 < x <= 2 + $I0 = Compute("1 < x <= 2"); # the inequality 1 < x <= 2 $I1 = Interval($I0); # the interval (1,2] @@ -71,6 +93,19 @@ regardless of the format, so $I0 == $I1 is true in either example above. +Since Inequality objects are actually Interval objects, the variable +used to create them doesn't matter. That is, + + $I0 = Compute("1 < x <= 2"); + $I1 = Compute("1 < y <= 2"); + +would both produce the same interval, so $I0 == $I1 would be true in +this case. If you need to distinguish between these two, use + + $I0 == $I1 && $I0->{varName} eq $I1->{varName} + +instead. + =cut loadMacros("MathObjects.pl"); @@ -94,9 +129,15 @@ '<=' => {precedence => .5, associativity => 'left', type => 'bin', string => ' <= ', TeX => '\le ', class => 'Inequalities::BOP::inequality', eval => 'evalLessThanOrEqualTo', combine => 1}, + '=<' => {precedence => .5, associativity => 'left', type => 'bin', string => ' <= ', TeX => '\le ', + class => 'Inequalities::BOP::inequality', eval => 'evalLessThanOrEqualTo', combine => 1, + isSloppy => "<="}, '>=' => {precedence => .5, associativity => 'left', type => 'bin', string => ' >= ', TeX => '\ge ', class => 'Inequalities::BOP::inequality', eval => 'evalGreaterThanOrEqualTo', combine => 1}, + '=>' => {precedence => .5, associativity => 'left', type => 'bin', string => ' >= ', TeX => '\ge ', + class => 'Inequalities::BOP::inequality', eval => 'evalGreaterThanOrEqualTo', combine => 1, + isSloppy => ">="}, '=' => {precedence => .5, associativity => 'left', type => 'bin', string => ' = ', class => 'Inequalities::BOP::inequality', eval => 'evalEqualTo'}, @@ -118,7 +159,11 @@ $context->parens->set("[" => {type => "List", formInterval => ')'}); # trap these later $context->strings->remove("NONE"); $context->constants->add(NONE=>Value::Set->new()); - $context->flags->set(noneWord => 'NONE', showNotEquals => 1); + $context->flags->set( + noneWord => 'NONE', + showNotEquals => 1, # display (-inf,a) U (a,inf) as x != a + allowSloppyInequalities => 1, # allow =< and => as equivalent to <= and >= + ); $context->{parser}{Variable} = "Inequalities::Variable"; $context->{value}{'Interval()'} = "Inequalities::MakeInterval"; $context->{value}{Inequality} = "Inequalities::Inequality"; @@ -145,8 +190,6 @@ # Define the Inequality() constructor # main::PG_restricted_eval('sub Inequality {Value->Package("Inequality")->new(@_)}'); - - return; } @@ -169,6 +212,8 @@ # sub _check { my $self = shift; + $self->Error("'%s' should be written '%s'",$self->{bop},$self->{def}{isSloppy}) + if (!$self->context->flag("allowSloppyInequalities") && $self->{def}{isSloppy}); $self->{type} = $Value::Type{interval}; $self->{isInequality} = 1; ($self->{varPos},$self->{numPos}) = |
From: Mike G. v. a. <we...@ma...> - 2010-03-20 01:15:25
|
Log Message: ----------- Add id tag as well as name tag to HIDDEN_ANS_RULE Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.63 retrieving revision 1.64 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.63 -r1.64 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -353,8 +353,8 @@ MODES( TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", Latex2HTML => qq!\\begin{rawhtml}<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\\end{rawhtml}!, - HTML => qq!<INPUT TYPE=HIDDEN SIZE=$col NAME="$name" VALUE="$answer_value">!. - qq!<INPUT TYPE=HIDDEN NAME="previous_$name" VALUE="$answer_value">! + HTML => qq!<INPUT TYPE=HIDDEN SIZE=$col NAME="$name" id ="$name" VALUE="$answer_value">!. + qq!<INPUT TYPE=HIDDEN NAME="previous_$name" id = "previous_$name" VALUE="$answer_value">! ); } sub NAMED_ANS_RULE_OPTION { # deprecated @@ -377,7 +377,7 @@ TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME="$name" id="$name" VALUE = " ">\n\\end{rawhtml}\n!, HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME = "$name" id="$name" VALUE = "$answer_value">!. - qq!<INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value">! + qq!<INPUT TYPE=HIDDEN NAME="previous_$name" id="previous_$name" VALUE = "$answer_value">! ); } |
From: Mike G. v. a. <we...@ma...> - 2010-03-20 01:08:40
|
Log Message: ----------- added id tags as well as name tags to input items Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.24 retrieving revision 1.25 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.24 -r1.25 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -158,7 +158,7 @@ $base_64_encoded_answer_value =~ s/\r|\n//g; # get rid of line returns # debug version of the applet state answerBox and controls my $debug_input_element = qq!\n<textarea rows="4" cols="80" - name = "$appletStateName">$decoded_answer_value</textarea><br/>!; + name = "$appletStateName" id = "$appletStateName">$decoded_answer_value</textarea><br/>!; if ($getState=~/\S/) { # if getStateAlias is not an empty string $debug_input_element .= qq! <input type="button" value="$getState" @@ -193,14 +193,14 @@ } my $state_input_element = ($debugMode) ? $debug_input_element : - qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; + qq!\n<input type="hidden" name = "$appletStateName" id = "$appletStateName" value ="$base_64_encoded_answer_value">!; my $reset_button_str = ($reset_button) ? - qq!<input type='submit' name='previewAnswers' value='return this question to its initial state' onClick="setAppletStateToRestart('$appletName')"><br/>! + qq!<input type='submit' name='previewAnswers' id ='previewAnswers' value='return this question to its initial state' onClick="setAppletStateToRestart('$appletName')"><br/>! : '' ; # <input type="button" value="reinitialize applet" onClick="getQE('$appletStateName').value='$base64_initialState'"/><br/> # always base64 encode the hidden answer value to prevent problems with quotes. # - $state_storage_html_code = qq!<input type="hidden" name="previous_$appletStateName" value = "$base_64_encoded_answer_value">! + $state_storage_html_code = qq!<input type="hidden" name="previous_$appletStateName" id = "previous_$appletStateName" value = "$base_64_encoded_answer_value">! . $state_input_element. $reset_button_str ; my $answerBox_code =''; |
From: dpvc v. a. <we...@ma...> - 2010-03-17 14:30:49
|
Log Message: ----------- Bring jsMath up to version 3.6d. Changes include: * This release includes an important speed improvement. By typesetting several equations before allowing the screen to update, jsMath.Process() now processes pages several times faster than in the past. * Fixed a wrapping problem in Safari, Chrome, and FireFox, where recent versions of these browsers could allow a math expression to extend beyond the right margin on one line while leaving empty space for it on the next line. * Fixed the missing font message used when the noImageFonts plugin is used so that it informs you that the unicode fonts are used rather than image fonts. * Fixed a problem where the jsMath button would not appear in the correct location when a DOCTYPE triggers "standards" mode in MSIE. * Worked around a bug in MSIE8 when a DOCTYPE triggers "standards" mode that would cause some mathematics not to be properly aligned on the baseline. * Fixed a problem were a customized extra font warning message would be overriden by jsMath/easy/load.js when the noImageFonts value was set to 1. Also, the main font message is now adjusted in this case to indicate that unicode fonts will be used rather than image fonts. * Put <script> tag into lower case in easy/load.js for XHTML compliance. * Fixed a bug (introduced in version 3.6) with the smallFonts plugin that prevented it from running. * Remove support for BaKoMa fonts -- they are too unreliable and cause problems now in Chrome as well as FireFox. * Fixed a problem with the tex2math plugin that could cause the \\ terminator, when followed by an open parenthesis or bracket, to not be processed properly. Modified Files: -------------- webwork-modperl/htdocs/jsMath: jsMath-easy-load.js jsMath.js webwork-modperl/htdocs/jsMath/easy: load.js webwork-modperl/htdocs/jsMath/plugins: autoload.js noImageFonts.js smallFonts.js tex2math.js webwork-modperl/htdocs/jsMath/uncompressed: jsMath.js Revision Data ------------- Index: jsMath-easy-load.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath-easy-load.js,v retrieving revision 1.6 retrieving revision 1.7 diff -Lhtdocs/jsMath/jsMath-easy-load.js -Lhtdocs/jsMath/jsMath-easy-load.js -u -r1.6 -r1.7 --- htdocs/jsMath/jsMath-easy-load.js +++ htdocs/jsMath/jsMath-easy-load.js @@ -60,10 +60,18 @@ if (jsMath.Easy.noImageFonts) { jsMath.noImgFonts = 1; if (!jsMath.Font) {jsMath.Font = {}} - jsMath.Font.extra_message = - 'Extra TeX fonts not found: <b><span id="jsMath_ExtraFonts"></span></b><br/>' - + 'Using unicode fonts instead. This may be slow and might not print well.<br/>\n' - + 'Use the jsMath control panel to get additional information.'; + if (!jsMath.Font.message) { + jsMath.Font.message = + '<b>No jsMath TeX fonts found</b> -- using unicode fonts instead.<br/>\n' + + 'This may be slow and might not print well.<br/>\n' + + 'Use the jsMath control panel to get additional information.'; + } + if (!jsMath.Fonts.extra_message) { + jsMath.Font.extra_message = + 'Extra TeX fonts not found: <b><span id="jsMath_ExtraFonts"></span></b><br/>' + + 'Using unicode fonts instead. This may be slow and might not print well.<br/>\n' + + 'Use the jsMath control panel to get additional information.'; + } } if (jsMath.Easy.processSingleDollars || Index: jsMath.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath.js,v retrieving revision 1.45 retrieving revision 1.46 diff -Lhtdocs/jsMath/jsMath.js -Lhtdocs/jsMath/jsMath.js -u -r1.45 -r1.46 --- htdocs/jsMath/jsMath.js +++ htdocs/jsMath/jsMath.js @@ -10,7 +10,7 @@ * * for the latest version, and for documentation on how to use jsMath. * - * Copyright 2004-2008 by Davide P. Cervone + * Copyright 2004-2010 by Davide P. Cervone * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,11 +40,11 @@ //start = new Date().getTime(); jsMath.Script.Uncompress([ - ['if(!','window.','jsMath','||!',1,'jsMath.','loaded','){var ','jsMath_old','=',1,2,';',0,'document.','getElementById','||!',14,'childNodes||!',14,'createElement','){','alert("','The',' mathematics ','on this page requires W3C DOM support in its JavaScript. Unfortunately, your ','browser',' doesn\'t seem to have this.")}','else{',1,2,'={version:"3.6c",document:document,','window',':',32,',','platform',':(','navigator.',36,'.match(/','Mac/)?"mac":',38,36,40,'Win/)?"pc":"unix"),','sizes',':[50,60,70,85,100,120,144,173,207,249],styles:{".math','":{"font-family":"serif","font-style":"normal","font-weight":"normal','"},".typeset',48,'","line-height":"normal','","text-indent":"0px','","white-space":"','normal','"},".typeset .',54,48,'"},"div','.typeset','":{"text-align":"','center",margin:"1em 0px"},"span',59,60,'left',49,' span',60,'left",border',':"0px",margin:"0px','",padding',':"0px"},"a .typeset img, .typeset a img','":{border:"0px','","border-bottom":"','1px solid',' blue! ;"},".typeset .size0','":{"font-size":"','50','%"},".typeset .','size1',76,'60',78,'size2',76,'70',78,'size3',76,'85',78,'size4',76,'100',78,'size5',76,'120',78,'size6',76,'144',78,'size7',76,'173',78,'size8',76,'207',78,'size9',76,'249',78,'cmr10','":{"font-family":"jsMath-',115,', serif',55,'cmbx10',116,120,', ',2,'-cmr10',55,'cmti10',116,127,', ',2,125,55,'cmmi10',116,134,55,'cmsy10',116,138,55,'cmex10',116,142,55,'textit','":{"font-family":"','serif","','font-style":"italic',55,'textbf',147,'serif","font-weight":"bold',55,'link":{"','text-decoration":"none',55,'error',76,'90%","',149,'","background-color','":"#FFFFCC',70,':"1px','",border:"',74,' #CC0000',55,'blank','":{display:"','inline-block','",overflow:"','hidden',166,'0px none",width:"0px",height:"0px',55,'spacer',171,172,'"},"#','jsMath_hiddenSpan":{','visibility:"hidden",position:"absolute",','top:"0px",left:"0px',51,52,181,'jsMath_message','":{position:"fixed",bottom:"','1px",left:"2px',162,'":"#E6E6E6','",bord! er:"solid 1px #959595",margin:"0px",padding:"','1px 8px','","z! -index": "','102','",color:"black","font-size":"','small",width:"auto','"},"#jsMath_panel',189,'1.75em",right:"1.5em',70,':".8em 1.6em',162,'":"#DDDDDD',166,'outset 2px',195,'103",','width:"auto',197,'10pt","font-style":"',54,199,' .disabled":{color:"#888888',199,' .infoLink',76,'85%"},"#jsMath_panel *":{"','font-size":"inherit","font-style":"inherit","font-family":"inherit',51,199,' div":{"','background-color":"inherit",color:"inherit"},"#jsMath_panel ','span":{"',224,'td',72,70,69,'","',224,'tr',72,70,69,'","',224,'table',72,70,69,162,'":"inherit",color:"inherit",height:"auto",',210,181,'jsMath_button',189,'1px",right:"2px',162,'":"white',193,'0px 3px 1px 3px',195,'102",color:"black","',156,'","font-size":"x-',198,'",cursor:"hand"},"#',247,' *":{padding:"0px",border',69,51,'","',220,181,'jsMath_global":{"',149,181,'jsMath_noFont',' .message":{"text-align":"center",padding:".8em 1.6em",border:"3px solid #DD0000","background-color":"#FFF8F8",color:"#AA0000","font-size":"',198,181,'js! Math_noFont .link":{padding:"0px 5px 2px 5px',166,'2px outset',162,'":"#E8E8E8',197,'80%",',210,259,'jsMath_PrintWarning',271,'x-',198,'"},"@media print":{"#',247,171,'none',181,'jsMath_Warning',171,'none"}},"@media screen":{"#',283,171,'none"}}},Element',':function(','a','){return ',5,14,15,'("jsMath_"+a)},','BBoxFor',298,'a','){this.','hidden.innerHTML','=\'<nobr><','span class="','typeset"><',311,'scale">\'+a+"</span></span></nobr>";var b={w:this.',174,'.offsetWidth',',h:this.',174,'.offsetHeight','};this.',309,'="";return b},EmBoxFor',298,'b){var a=',5,'Global.cache.R;if(!a[this.em]){a[this.em]={}}if(!a[this.em][b]){var c=this.BBoxFor(b);','a[this.em][b]={w:c.w/this.em,h:c.h/this.em}}return a[this.em][b]},','EmBoxForItalics',298,324,5,326,'if(b.match(/<i>|class=\\"(icm|italic|igreek|iaccent)/i)){c.w=c.Mw=','this.BBoxFor','(b+',5,'Browser.','italicString',').w-',5,337,'italicCorrection','}',327,'Init',':function(){','if(',5,'Setup.inited','!=1){',0,5,349,'){',5,'Setup.',! 'Body()}if(',5,349,'!=1){if(',5,349,'==-100','){return}',22,'I! t looks like ',2,' failed to set up properly (error code "+',5,349,'+"). I will try to keep going, but it could get ugly.");',5,349,'=1}}this.em=this.CurrentEm();','var a=',5,'Global.cache','.B;',0,'a[this.em]){a[this.em]={};','a[this.em].','bb=',334,'("x");var c=',381,'bb.h;',381,'d=',334,'("x"+',5,'HTML.Rule(1,','c/',5,'em)).h-c;if(',5,337,338,'){',381,'ic=',5,305,'(',5,337,338,').w}}',5,337,342,'=',381,'ic;var g=',381,'bb;var e=g.h;var f=',381,'d;this.h=(e-f)/this.em;this.d=f/this.em;this.hd=this.h+','this.d;this.',356,'TeXfonts','();var b=this.EmBoxFor(\'<',311,115,'">M</span>\').w/2;this.TeX.M_height=b*(26/14);this.TeX.h=this.h;this.TeX.d=',419,'TeX.hd=this.hd;this.Img.Scale();',0,'this.initialized',308,356,'Sizes','();this.','Img.UpdateFonts()}this.p_height=(','this.TeX.cmex10[0].','h+',435,'d)/0.85;',429,'=1},ReInit',346,'if(this.','em!=this.CurrentEm()){this.Init()}},CurrentEm',346,375,334,'(\'<span style="\'+',5,337,'block+\';width:27em;height:1em','"></span>\').','w/27;if! (a>0',300,'a}return ',334,'(\'<img src="\'+',5,170,'+\'" style="width:13em;height:1em" />\').w/13},Loaded',346,'if(',8,7,'b=["Process","ProcessBeforeShowing","ProcessElement","ConvertTeX","ConvertTeX2","ConvertLaTeX","ConvertCustom","CustomSearch","Synchronize","Macro","document"];','for(var a=0;a<','b','.length;a++){','if(',8,'[b[a]]){','delete ',8,'[b[a]]}}}if(',8,'){this.Insert(',2,',',8,')}',8,'=null;',5,6,'=1},Add',298,'c,a){for(var b in a){','c[b]=a[b]}},Insert',298,486,'if(c[b]&&typeof(a[b])=="object"&&(','typeof(c[b])=="','object"||',491,'function")){this.Insert(c[b],a[b])}',28,'c[b]=a[b]}}},Package',298,'b,a',475,'b.prototype,a)}};',5,'Global={isLocal:1,cache:{','T:{},D:{},R:{},B',':{}},ClearCache',346,5,377,'={',503,':{}}},GoGlobal',298,324,'String(',5,1,'location',');var d=(',5,'isCHMmode','?"#":"?");if(b){a=a.replace(/\\?.*/,"")+"?"+b}',5,'Controls.','Reload(',5,'root+"',2,'-global.html"+d+escape(a))},Init',346,'if(',5,'Controls.cookie.','global=="always"&&!',5,! 'noGoGlobal','){if(',38,'accentColorName',364,0,5,32,'){',5,32! ,'=',32, '}',5,522,6,'=1;',5,522,'defaults.hiddenGlobal=null;this.GoGlobal(',5,522,'SetCookie(2))}},Register',346,375,5,1,'parent;',0,5,519,'){',5,519,'=(',5,1,516,'.protocol','=="mk:")}try{',0,5,519,308,'Domain()}if(a.',2,'&&a.',5,'isGlobal){a.',5,'Register(',5,32,')}}catch(b){',5,534,'=1}},Domain',346,'if(',38,'appName=="Microsoft Internet Explorer"&&',5,36,'=="mac"&&',38,'userProfile','!=null',364,'if(',5,14,'all&&!',5,1,'opera',364,'if(',32,'==parent',364,'var b=',5,14,'domain',';try{while(true){try{if(parent.',14,'title',601,'){return}}','catch(a){}',0,14,618,'.match(/\\..*\\./)){break}',5,14,618,'=',5,14,618,'.replace(/^[^.]*\\./,"")}}',624,5,14,618,'=b}};',5,'Script={request:null,Init',346,'if(!(',5,531,'asynch&&',5,531,'progress',')){if(',1,'XMLHttpRequest','){try{','this.request','=new ',654,'}catch(c){}if(',656,'&&',5,'root.match','(/^file:\\/\\//)){try{',656,'.open("GET",',5,525,5,'js",false);',656,'.send(null)}catch(','c){',656,'=null;if(',1,'postMessage&&',1,'addEventLis! tener',308,'mustPost','=1;',5,1,679,'("message",',5,'Post.','Listener,false)}}}}',0,656,'&&',1,'ActiveXObject','&&!this.',681,7,'a=["MSXML2.XMLHTTP.5','.0","MSXML2.XMLHTTP','.4',699,'.3',699,'","Microsoft.XMLHTTP"];','for(var b=0;b<','a.length&&!',656,';b++){try{',656,'=new ',694,'(a[b])}catch(c){}}}}',0,656,'||',5,356,'domainChanged',308,'Load=this.delayedLoad;this.needsBody=1}},Load',298,'b,a){','if(a){',5,'Message.Set("Loading "+','b);',5,'Script.','Delay(1);',5,'Script.Push(','this,"xmlRequest",b',');',5,731,5,'Message',',"Clear")}',28,5,731,732,')}},xmlRequest',298,'url){','this.blocking','=1;try{',656,666,'url,false);',656,672,'err){',746,'=0;if(',5,'Translate.','restart&&',5,'Translate.asynchronous){return""}throw Error("jsMath can\'t load the file \'"+url+"\'\\','nMessage: "+err.message)}if(',656,'.status',601,'&&(',656,763,'>=400||',656,763,'<0)){',746,'=0;if(',5,757,'restart&&',5,760,'nError status: "+',656,763,')}',0,'url','.match(/\\.js$/)){','return(',656,'.res! ponseText',')}var tmpQueue','=this.queue;this.queue','=[];',5,! 1,'eval( ',656,788,');',746,'=0;','this.queue=this.queue.concat(','tmpQueue);this.Process();return""},cancelTimeout:30*1000,blocking:0,cancelTimer:null,needsBody:0,queue:[],Synchronize',298,'a,b','){if(typeof(','a)!="string"){',5,731,'null,a,b)}',28,5,731,5,32,',"eval",a)}},Push',298,'a,c,b',308,'queue[','this.queue.length',']=[a,c,b];if(!(',746,'||(this.needsBody&&!',5,14,'body))){this.Process()}},Process',346,'while(',819,'&&!',746,7,'c=this.queue[0];this.queue=this.queue.slice(1);',375,'this.SaveQueue();var b=c[0];var e=c[1];var d=c[2];if(b){b[e](d)}',28,'if(e){e(d)}}this.','RestoreQueue','(a)}},SaveQueue',346,'var a',790,'=[];return a},',837,298,'a){',800,'a)},delayedLoad',298,'a',308,'Push(','this,"','startLoad','",a)},',853,298,'a',7,'b=',5,14,20,'("iframe");b','.style.visibility="',174,'";b.style.','position="absolute";','b','.style.width="','0px";b','.style.height="','0px";if(',5,14,'body.firstChild','){',5,14,'body.insertBefore(b,',5,14,875,')}',28,5,14,'body','.appendChild(! ','b)}',746,'=1;this.','url=a;if(a','.substr(0,',5,'root.length',')==',5,'root){a=a.substr(',5,895,')}',5,725,'a);this.cancelTimer=setTimeout("',5,728,'cancelLoad','()",this.cancelTimeout);',442,681,'){','b.src=',5,688,853,'(a,b)}',28,'if(a',785,912,5,525,2,'-loader.html"}',28,912,'this.url}}},','endLoad',298,'a){if(this.cancelTimer){clearTimeout(this.cancelTimer);this.cancelTimer=null}',5,688,928,'();',5,737,'.Clear();if(a!="cancel"){',746,'=0;this.Process','()}},Start',346,'this.tmpQueue',790,'=[]},End',346,800,942,');',471,942,'},',907,298,'b,',930,'if(b==null){b','="Can\'t load file"}if(a==null){a=2000}',5,737,'.Set(b);setTimeout(\'',5,728,928,'("cancel")\',a)},Delay',298,'a){',746,'=1;setTimeout("',5,728,'endDelay','()",a)},',971,346,746,939,'()},','imageCount',':0,WaitForImage',298,'b){',746,891,978,'++;',442,'img==null',308,'img=[]}',375,'new Image',433,'img[this.img.length]=a;a.onload=function(){if(--',5,728,978,'==0){',5,728,971,'()}};a.onerror=a.onload;a.onabort=a! .onload;a.src=b},Uncompress',298,'data){for(var k=0;k<data.len! gth;k++) {var d=data[k];var n=d.length;for(var i=0;i<n;i++){if(typeof(d[i])=="number"){d[i]=d[d[i]]}}data[k]=d.join("")}',1,'eval(data.join(""))}};',5,'Post={',32,':null,Listener',298,'d){if(d.source!=',5,688,32,364,'var e=d.origin','.replace(/^file:\\/\\//,"");',375,14,618,1017,'if(e==null||e==""||e=="null"){e','="localhost"}if(','a==null||a==""||a=="null"){a',1023,'e!=a||!','d.data.substr(','0,6).match(/jsM(CP|LD|AL):/)){return}var b=',1027,'6,3).replace(/ /g,"");var c=',1027,'10);if(',5,'Post.Commands[b',']){(',5,1034,'])(c)}},Commands:{SCR',298,'message){',5,1,'eval(message)},ERR',298,'a){',5,728,907,'(a,3000)},BGN',298,'a){',5,728,'Start()},END',298,'a){',723,5,728,'End()}',5,728,928,'()}},',853,298,'a,b',308,32,'=b.contentWindow;',0,'a',785,'return ',5,'root+',454,5,525,2,'-loader-post.html?"+a},',928,346,'this.',32,'=null}};',5,737,'={',170,':null,message:null,text:null,clear:null,Init',346,0,5,14,'body||!',5,531,651,364,'this.message','=',5,'Element("message");',0,1101,'){if(! ',5,356,'stylesReady){',1101,'=',5,'Setup.DIV("','message",{visibility:"',174,'"},',5,'fixedDiv',')}',28,1101,'=',5,1114,'message",{',183,'bottom:"',190,'",','backgroundColor',':"#E6E6E6',193,194,'",zIndex:102,color:"black",fontSize:"',198,'"},',5,1119,')}}','this.text','=',5,14,'createTextNode','("");',1101,888,1141,');',1101,'.onmousedown=',5,757,'Cancel},Set',298,722,'if(this.clear){clearTimeout(this.clear',');this.clear=null}if(',5,531,651,'){',0,1141,308,'Init();',0,1141,623,'if(',5,337,'textNodeBug','){',1101,'.innerHTML','=b}',28,1141,'.nodeValue','=b}',1101,864,'visible";',723,1101,'.style.cursor','="pointer";',0,1101,1188,'){',1101,1188,'="hand"}',1101,'.title=" Cancel Processing of Math "}',28,1101,1188,'="";',1101,'.title=""}}',28,'if(b',893,'8)!="Loading "){',5,1,'status=b}}},Clear',346,1158,')}this.clear=setTimeout("',5,737,'.doClear()",1000)},doClear',346,442,'clear',308,'clear=null;',5,1,'status="";',442,'text){',1141,1181,'=""}if(',1101,'){',1101,864,174,'"}! }},Blank',346,442,170,'||!',5,14,'body',364,'this.blank','=',5! ,1114,17 0,'",{position',':(',5,337,'msiePositionFixedBug','?"absolute":"fixed"),',184,'",bottom:"0px",right:"0px",zIndex:101,',1131,':"white"},',5,1119,');if(',5,337,'msieBlankBug){',1245,1177,'=" ";',1245,869,'110%";',1245,871,'110%"}},UnBlank',346,442,170,'){',5,14,'body.removeChild(',1245,')}',1245,'=null}};',5,'Setup={',6,':[],DIV',298,'e,c,b){',956,'=',5,14,'body}var d=',5,14,20,'("div");d.id="jsMath_"+e;','for(var a in c){','d.style[a]=c[a]}',0,'b.hasChildNodes){b',888,'d)}',28,'b.insertBefore(d,','b.firstChild',')}return d},Script',298,722,442,6,'[b]){return}',28,'this.',6,'[b]=1}',0,'b.match("^([a-zA-Z]+:/?)?/")){b=',5,'root+b}',5,728,'Load(b,a)},Hidden',346,5,174,'=this.DIV("Hidden",{',183,'top:0,left:0,border:0,padding:0,margin:0});',5,'hiddenTop=',5,174,';return},Source',346,'if(',5,'Autoload&&',5,'Autoload.root','){',5,'root=',5,1343,'}',28,5,'root="";',375,5,14,'getElementsByTagName("','script");',723,705,'a.','length;b++){','var d=a[b].src;if(d&&d.match("(^|/|\\\\! \\\\)',5,'js$")){',5,1346,'d.replace','(/',5,'js$/,"");break}}}}if(',5,'root.charAt(','0)=="\\\\"){',5,1346,5,'root.replace','(/\\\\/g,"/")}if(',5,1372,'0)=="/"){if(',5,1372,'1)!="/"){',5,'root="//"+',5,14,516,'.host+',5,'root}',5,1346,5,14,516,573,'+',5,1392,28,0,5,663,'(/^[a-z]+:/i)){var d=','new String(',5,14,516,');var c=new RegExp("/[^/]*/\\\\.\\\\./");',5,1346,1367,'(new RegExp("[^/]*$"),"")+',5,'root;while(',5,663,'(c)){',5,1346,5,1377,'(c,"/")}}}',5,'Img.',1346,5,525,'fonts/";',5,170,'=',5,525,170,'.gif";this.Domain()},Domain',346,'try{',5,14,618,'}catch(d',364,'var c="";',375,5,14,618,';if(',5,663,'("://([^/]*)/")){c=RegExp.$1}c=c.replace(/:\\d+$/,"");if(c==""||c==a',364,'if(',38,'appName=="Microsoft Internet Explorer"&&',5,36,'=="mac"&&',38,'onLine&&',38,600,'&&',5,14,'all',364,'c=c.split(/\\./);a=a.split(/\\./);if(c.length<2||a.length<2||','c[c.length-','1',']!=a[a.length-','1]||',1472,'2',1474,'2]){this.','DomainWarning','();return}var e=',1472,'2]+"."+',1472,'1! ];for(var b=3;b<=c.length&&b<=a.',1361,'if(',1472,'b',1474,'b]! ){break} e=',1472,'b]+"."+e}',5,14,618,'=e;this.',718,'=1},',1480,346,22,'In order for ',2,' to be able to load the additional components that it may need, the ',5,'js file must be ',6,' from a server in the same ',618,' as the page that contains it. Because that is not the case for this page, the',24,'displayed here may not appear correctly.")},','EncodeFont',298,'c',7,'b=',5,'TeX[c];if(b','[0].c',601,364,465,'128;a++){var d=b[a];b[a]=d[3];if(b[a]==null){b[a]={}}b[a].w=d[0];b[a].h=d[1];if(d[2]!=null){b[a].d=d[2]}b[a].c=',5,'TeX.encoding[a]}},Fonts',346,705,5,'TeX.fam','.',1361,375,5,1531,'[b];if(a',308,1514,'(a)}}},TeXfont',298,'c',7,'b=',5,1520,'==null',364,375,5,'EmBoxFor(\'<span class="\'+c+\'">\'+b[65].c','+"</span>");b.hd=a.h;b.d=',5,1551,'+',5,392,'b.hd)+"</span>").h-b.hd;b.h=b.hd-b.d;','if(c=="',134,'"){b.skewchar=','127}',28,1559,138,1561,'48}}},',421,346,465,5,1531,467,'if(',5,1531,'[a]){this.TeXfont(',5,1531,'[a])}}},Sizes',346,5,'TeXparams','=[];var b;var a;for(a=0;a<',5! ,46,467,5,1583,'[a]={}}for(b in ',5,'TeX',804,5,'TeX[b])!="object"){for(a=0;a<',5,46,467,5,1583,'[a][b]=',5,46,'[a]*',5,'TeX[b]/100}}}},Styles',298,'a){',0,'a){a=',5,'styles;a[".typeset .scale"]={"font-size":',5,531,'scale+"%"};this.stylesReady=1}',5,731,852,'AddStyleSheet','",a);if(',5,337,'styleChangeDelay','){',5,731,5,'Script,"Delay",1)}},StyleString',298,'e',7,'a={},f;for(f in e){if(typeof e[f]==="string"){a[f]=e[f]}',28,'if(f',893,'1)==="@"){a[f]=','this.StyleString(','e[f])}',28,'if(e[f]!=null',7,'d=[];for(var c in e[f]){if(e[f][c]!=null){d[d.length]=c+": "+e[f][c]}}a[f]=d.join("; ")}}}}var b="";for(f in a){b+=f+" {"+a[f]+"}\\n"}return b},',1619,298,'d',7,'b=',5,14,1356,'head")[0];if(',324,1637,'d);if(',5,14,'createStyleSheet){b.insertAdjacentHTML("beforeEnd",\'<','span style="display:','none">x</span><style type="text/css">\'+a+"</style>")}',28,'var c=',5,14,20,'("style");c.type="text/css";c',888,5,14,1145,'(a));b',888,'c)}}',28,0,5,'noHEAD){',5,'noHEAD=1;',22,'Docu! ment is missing its <HEAD> section. Style sheet can\'t be cre! ated wit hout it.")}}},Body',346,442,'inited',364,'this.inited=-','1;',5,356,'Hidden();',1685,'2;',5,337,1167,1685,'3;if(',5,531,170,'){',5,737,'.Blank()}',1685,'4;',5,356,'Styles();',1685,'5;',5,522,1167,1685,'6;',5,731,5,'Setup,"User","pre-font");',1685,'7;',5,731,5,'Font,"Check");if(',5,'Font.register.length){',5,731,5,'Font,"LoadRegistered")}this.inited=1},User',298,'a){if(',5,'Setup.UserEvent[a',']){(',5,1735,'])()}},UserEvent:{"pre-font":null,onload:null}};',5,'Update={',421,298,'d){for(var a in d){for(var b in d[a]){for(var c in d[a][b]){',5,'TeX[a][b][c]=d[a][b][c]}}}},TeXfontCodes',298,'c){',1301,705,'c[a].',1361,5,'TeX[a][b].c=c[a][b]}}}};',5,'Browser={allowAbsolute:1,allowAbsoluteDelim:0,','separateSkips',':0,valignBug:0,operaHiddenFix:"",','msieCenterBugFix',':"",','msieInlineBlockFix',':"",msieSpaceFix:"",imgScale:1,renameOK:1,',1623,':0,delay:1,version:0,','TestSpanHeight',346,5,309,'=\'<span><','span style="\'+this.block','+\';height:2em;width:','1px"></span','></span>! \';var b=',5,'hidden.firstChild;',375,1309,';this.','spanHeightVaries','=(b',319,'>=a',319,'&&b',319,'>0);','this.spanHeightTooBig','=(b',319,'>a',319,');',5,309,'=""},','TestInlineBlock',346,'this.block="display',':-','moz-inline-box";','this.hasInlineBlock','=',5,'BBoxFor(\'<span style="\'+this.block','+\';width:10px;height:5px"></span>\').w>0;if','(',1801,'){',5,'styles[".typeset',' .',170,'"].display="-',1800,471,5,1810,' .spacer"].display','}',28,1798,':',172,'";',1801,'=',5,1804,1805,'(!',1801,623,'this.block+=";overflow:',174,'";',375,5,305,'("x").h;this.mozInlineBlockBug=',5,1804,'+";height:"+a+\'px;width:1px','"></span>x','<',1770,'+";height:"+a+"px;width:1px;vertical-align:-"+a+\'px',451,'h>2*a;this.widthAddsBorder=',5,1804,'+\';overflow:',174,';height:1px;width:10px',';border-left:','10px solid',451,'w>10;','this.msieBorderBug','=',5,1804,1842,1843,'\').h!=',5,1804,1842,1854,74,1843,'\').h;','this.blankWidthBug=',1858,'||',5,1804,1771,'0px',451,'h==0},','TestRena! meOK',346,5,309,'="<span></span>";',375,5,1775,'a.setAttribute! ("name", "','jsMath_test','");this.renameOK=(',5,14,'getElementsByName("',1890,'").length>0);',5,309,1795,'TestStyleChange',346,5,309,'=\'<span ID="',1890,'">x</span>\';var b=',5,1775,375,'b',316,';',5,356,1619,'({"#',1890,'":"font-size:200%"});this.',1623,'=(b',316,'==a);',5,309,1795,'VersionAtLeast',298,324,1407,'this.version',').split(".");','b=',1407,'b',1931,'if(b[1]==null){b[1]="0"}return a[0]>b[0]||(a[0]==b[0]&&a[1]>=b[1])},Init',346,5,26,'="unknown";this.',1796,433,1765,433,1881,433,1900,433,'MSIE',433,'Mozilla',433,'Opera',433,'OmniWeb',433,'Safari',433,'Konqueror();if(','this.allowAbsoluteDelim','){',5,'Box.DelimExtend=',5,'Box.DelimExtendAbsolute;',5,'Box.Layout=',5,'Box.LayoutAbsolute}',28,5,'Box.DelimExtend=',5,'Box.DelimExtendRelative;',5,'Box.Layout=',5,'Box.LayoutRelative}',442,1757,'){',5,'HTML.Place=',5,'HTML.','PlaceSeparateSkips',';',5,'Typeset.prototype.','Place=',5,1989,1986,'}},MSIE',346,442,1779,'&&!',1787,'){',5,26,'="MSIE";if(',5,36,'=="pc"){this.','IE7=(',1! ,654,601,');','this.quirks','=(',5,14,'compatMode=="BackCompat");this.msieStandard6=!',2012,695,'IE7;',1960,891,1757,'=1',';this.buttonCheck=1;this.','msieBlankBug=1;this.','msieAccentBug',891,'msieRelativeClipBug','=1;this.msieDivWidthBug=1;this.',1254,891,'msieIntegralBug',891,'waitForImages',891,'msieAlphaBug','=!this.IE7;this.','alphaPrintBug',2037,1759,'="position:relative; ";this.',1761,'=" display:',172,';";this.msieTeXfontBaselineBug=!',2012,';',1858,'=',1872,'1;this.msieSpaceFix=\'<span style="margin-right:-',1772,'><',1658,172,'; width:',1772,'>\';',5,'Macro("','joinrel','","\\\\mathrel{\\\\','kern-5mu}"),',5,'Parser.prototype.mathchardef.','mapstocharOrig','=',5,2065,'mapstochar;',471,5,2065,2070,5,2060,'mapstochar","\\\\','rlap{\\\\',2066,'\\\\,}\\\\kern1mu"),',5,1810,' .arial"]={"font-family":"\'Arial unicode MS\'"};',0,'this.IE7||',2012,'){',5,'styles["#jsMath_message"].',867,471,5,2089,'width;',5,'styles["#jsMath_panel"].',867,471,5,2096,'width;',5,'styles["#! jsMath_button"].','width="1px";',5,2103,867,471,5,2103,'width;! ',5,1119 ,'=',5,1114,1119,1250,':"absolute",zIndex:101});',5,1,'attachEvent("','onscroll",',5,'Controls.MoveButton',');',5,1,2122,'onresize",',5,2125,');',5,2125,'()}',5,'styles["#jsMath_noFont .link"].','display="',172,'";',471,5,1810,1818,';',5,'styles[".tex2math_div','"]={};',5,'Add(',5,2148,'"],',5,'styles["div',59,'"]);',5,2148,'"].width="100%";',5,2148,'"].',2139,172,'";',5,1810,'"]["letter-spacing"]="0";if(','screen.deviceXDPI','&&','screen.logicalXDPI','&&',2171,'!=',2173,308,'imgScale*=',2173,'/',2171,';',5,531,'alpha=0}this.',338,'="<i>x</i>";',5,'EmBoxFor=',5,328,'}',28,'if(',5,36,'=="mac"){this.msieAbsoluteBug',891,'msieButtonBug',2029,2025,'quirks=1;',5,356,'Script("',2,'-msie-mac.js");',5,'Parser.prototype.macros.angle=["Replace","ord",\'<font face="Symbol">‹</font>\',"',54,'"];',5,2096,'width="42em";',5,531,'printwarn=0}}',5,2060,'not',2062,2078,'kern3mu/}}");',5,'Macro("angle","\\\\raise1.','84pt','{\\\\kern2.5mu\\\\rlap{\\\\scriptstyle/}\\\\','kern.5pt\\\\','rul! e{.4em}{-','1.5pt}{1.84pt}\\\\kern2.5mu}")}},',1951,346,'if(',5,174,'.ATTRIBUTE_NODE&&',5,1,'directories){',5,26,'="',1951,'";if(',5,36,2006,2038,'=1}',1960,'=1;',5,2103,'cursor=',5,2138,'cursor="pointer",',5,2060,'not',2062,2078,'kern3mu/}}");',5,2226,'34pt',2228,2230,'1pt}{1.34pt}\\\\kern2.5mu}");if(',38,'vendor=="Firefox"){',1930,'=',38,'vendorSub}',28,'if(',38,'userAgent.match(" Firefox/([0-9.]+)([a-z ]|$)")){',1930,'=RegExp.$1}}',442,1926,'("3.0")){this.mozImageSizeBug=1}}},',1955,346,'if(',38,'accentColorName){',5,26,'="',1955,'";','this.allowAbsolute','=',1801,';',1960,'=',2296,';this.valignBug=!',2296,2024,1174,'=1;',5,'noChangeGlobal=1;',0,1801,'){jsMath.'], - ['Setup','.Script','("','jsMath','-old-browsers.js','")}}},Opera',':function(){','if(this.','spanHeightTooBig){',3,'.browser="','Opera";','var b=','navigator.userAgent.match','("Opera 7");','this.allowAbsolute=0;this.','delay=10;','this.','operaHiddenFix="[Processing]";if(b){',3,'.Setup.Script','("',3,4,'")}','var a=','navigator.appVersion.match','(/^(\\d+\\.\\d+)/);if(a){','this.version=a','[1]}else{',17,'vesion=0}',17,'operaAbsoluteWidthBug=',17,'operaLineHeightBug=(a[1]>=9.5&&a[1]<9.6)}},Safari',6,'if(',26,'(/Safari\\//)){',3,10,'Safari";if(navigator.vendor','.match(/','Google/)){',3,10,'Chrome"}',25,13,'("Safari/([0-9]+)");a=(a)?a[1]:400;',28,';',3,'.TeX.','axis_height','+=0.05;',17,'allowAbsoluteDelim=','a>=125;',17,'safariIFRAMEbug=a>=312&&a<412;',17,'safariButtonBug=a<412;',17,'safariImgBug=1;',17,'textNodeBug=1;',17,'buttonCheck=a<500;',17,'styleChangeDelay=1;',3,'.Macro("not","\\\\mathrel{\\\\rlap{\\\\kern3.25mu/}}")}},','Konqueror',6,'if(','navigator.product','&! &',77,'.match("',74,'")){',3,10,74,'";',15,58,'0;if(',13,'(/',74,'\\/(\\d+)\\.(\\d+)/)){if(RegExp.$1<3||(RegExp.$1==3&&RegExp.$2<3)){',17,'separateSkips=1;',17,'valignBug=1;',3,20,'("',3,4,'")}}',3,'.Add(',3,'.styles,{".typeset .cmr10":"','font-family: ',3,'-','cmr10, ',3,' cmr10',', serif','",".typeset .','cmbx10":"',108,3,'-cmbx10, ',3,' cmbx10, ',3,'-',111,3,113,115,'cmti10":"',108,3,'-cmti10, ',3,' cmti10, ',3,'-',111,3,113,115,'cmmi10":"',108,3,'-cmmi10, ',3,' cmmi10',115,'cmsy10":"',108,3,'-cmsy10, ',3,' cmsy10',115,'cmex10":"',108,3,'-cmex10',', ',3,' cmex10"});',3,'.Font.testFont','="',3,157,', ',3,' cmex10"}}};',3,'.Font={testFont:"',3,157,'",fallback:"symbol",register:[],message:"<b>No ',3,' TeX fonts ','found</b> -- using',' image fonts instead','.<br/>\\nThese may be slow and might not print well.<br/>\\nUse the ',3,' control panel to get additional information','.",','extra_message',':\'Extra',175,'not found: <b><span id="jsMath_ExtraFonts"></span></b><br/>Usin! g',177,'. This may be slow and might not print well.<br/>\\nU! se the ' ,3,180,'.\',','print_message',':"To print higher-resolution math symbols, click the<br/>\\n<b>Hi-Res Fonts for Printing</b> button on the ',3,' control panel.<br/>\\n",','alpha_message',':"If the math symbols print as black boxes, turn off <b>image alpha channels</b><br/>\\nusing the <B>Options</B> pane of the ',3,194,'Test1',':function(','c,','f,d,e){if(f==null){f=124}if(d==null){d=2}if(e==null){e=""}var b=jsMath.BBoxFor(\'<span style="font-family: \'+e+c+\', serif">\'+jsMath.TeX[c][f].c+"</span>");var a=jsMath.BBoxFor(\'<span style="font-family: serif">\'+jsMath.TeX[c][f].c+"</span>");return(','b.w>d*a.w&&b.h!=0)},Test2',200,'c,',202,'a.w>d*b.w&&b.h!=0)},CheckTeX',6,25,3,'.BBoxFor(\'<','span style="','font-family: \'+',3,162,'+\', serif">\'+',3,54,'cmex10[1','].c+"</span>");',3,'.nofonts=((a.w*3>a.h||a.h==0)&&!this.Test1("cmr10','",null,null,"',3,'-"));if(!',3,'.nofonts){','return}','if(',3,'.browser!="Mozilla"||(',3,'.platform','=="mac"&&(!',3,'.Browser.VersionAtLeast(','! 1.5)||',3,236,'3)))||(',3,233,'!="mac"&&!',3,236,'3))){a=',3,'.BBoxFor(\'<',212,108,'CMEX10, serif">\'+',3,54,'cmex10[1',220,3,222,'"));if(!',3,227,3,20,'("',3,'-BaKoMa-fonts.js")}}},Check',6,25,3,'.Controls.','cookie;',17,'CheckTeX();if(',3,227,'if(a.autofont','||a','.font=="tex"){','a.font=',17,'fallback;if(a.warn){',3,'.nofontMessage=1;a.warn=0;',3,269,'SetCookie(0);if','(',3,'.window.NoFontMessage','){',3,288,'()}else{','this.Message(this.','message)}}}}else{',275,'){a.font="tex"}if(a',277,'return}}if(',3,'.noImgFonts){','a.font="unicode"}if(a','.font=="unicode','"){',3,20,'("',3,'-fallback','-"+',3,233,'+".js");',3,'.Box.TeXnonfallback=',3,'.Box.TeX',';',3,316,'=',3,'.Box.TeXfallback;return}','if(!a.print&&a.printwarn){',17,'PrintMessage','((',3,'.Browser.','alphaPrintBug&&',3,269,'cookie.alpha)?',17,191,'+',17,195,':',17,191,')}if(',3,328,'waitForImages){',3,1,'.Push(',3,1,',"WaitForImage",',3,'.blank)}if(a.font=="symbol"){',3,20,'("',3,308,'-symbols.js");',3,'.Box.Te! Xnonfallback=',3,316,';',3,316,'=',3,322,3,'.Img.SetFont','({c! mr10:["a ll"],cmmi10:["all"],cmsy10:["all"],cmex10:["all"],cmbx10:["all"],cmti10:["all"]});',3,'.Img.LoadFont','("cm-fonts")},Message',200,'a){if(',3,'.Element("Warning',82,228,12,3,'.Setup.DIV("','Warning','",{});b.innerHTML=\'<center><table><tr><td><div ','id="jsMath_noFont"><div ','class="message">\'+a','+\'<div style="text-align:left"><',212,'float:left; ','margin: 8px ','0px 0px 20px"><span onclick="',3,269,'Panel()" ','title=" Open ','the ',3,' Control Panel',' " class="link">',3,399,'</span></span','><',212,391,'20px 0px 0px; float:right"><span onclick="',3,'.Font.','HideMessage','()" title=" Remove this font warning message',400,'Hide this Message',403,'></div><div style="height:6px"></div><br clear="all"/></div></','div><div style="width:22em; height:1px"></div></td></tr></table></center><hr/>\'},',410,6,25,3,378,'");if(a','){a.style.display="none"}},',325,200,376,3,'.Element("','PrintWarning',82,228,12,3,383,429,385,387,'+\'</',416,'Register',200,'h,b){if(typeof(h)=="string! "){h={name:h}}if(!',3,'.Setup.inited','&&!b){','this.register','[',446,'.length]=h;',228,'var i=h.name;',25,'i.replace(/10$/,"");var f=',3,54,'fam.length;if(h.prefix==null){h.prefix=""}if(!h.style){h.style="font-family: "+h.prefix+i+", serif"}if(!h.styles){h.styles={}}if(!h.macros){h.macros={}}',3,54,'fam[f]=i;',3,54,'famName[i]=f;h.macros[a]=["HandleFont",f];',3,105,3,'.Parser.prototype.macros,h.macros);h.styles[".typeset ."+i]=h.style;',3,'.Setup.Styles(h.styles);if(',3,'.initialized){',3,1,'.Push(',3,'.Setup,"TeXfont",i)}var c=',3,269,270,'var e=!',3,'.nofonts&&h.test(i,h.testChar,h.testFactor,h.prefix);if(e&&c',277,'if(h.tex){h.tex(i,f,h)}',228,'if(!e&&c.warn&&c.font=="tex"&&!',3,227,'if(!c.fonts.match("/"+i+"/")){c.fonts+=i+"/";',3,269,285,'(!',3,378,82,293,182,')}var g=',3,428,'ExtraFonts");if(g){if(g','.innerHTML','!=""){g',502,'+=","}g',502,'+=" "+h.prefix+i}}}if(c',302,'"||',3,300,'if(h.fallback){h.fallback(i,f,h)}',228,'var d={};if(c.font=="symbol"&&h.symbol!=null! ){d[i]=h.symbol(i,f,h)}else{d[i]=["all"]}',3,370,'(d);',3,373,! '(i);if( ',3,'.initialized){',3,1,'.Push(',3,'.Img,"Scale");',3,1,'.Push(',3,'.Img,"UpdateFonts")}},LoadRegistered',6,25,'0;while(a<',446,'.length){',17,440,'(',446,'[a++],1)}',446,'=[]},Load',200,'a){',3,20,'(',17,'URL(a))},URL',200,'a){','return ',3,'.Img.root+a+"/def.js"}};',3,'.Controls={cookie:{scale:100,font:"tex",autofont:1,scaleImg:0,alpha:1,warn:1,fonts:"/",printwarn:1,stayhires:0,button:1,progress:1,asynch:0,blank:0,print:0,keep:"0D",global:"auto",hiddenGlobal:1},','cookiePath',':"/",','noCookiePattern',':/^(file|mk):$/,Init',6,17,'panel=',3,383,'panel",{display:"none"},',3,'.fixedDiv);','if(!',3,328,'msieButtonBug){',17,'Button',292,'setTimeout("',3,269,576,'()",500)}},Panel',6,3,'.Translate.Cancel();',7,'loaded){',17,'Main',292,3,1,'.delayedLoad(',3,'.root+"',3,'-controls.html")}},',576,6,25,3,383,'button",{},',3,570,'a.',396,3,399,' ";a',502,'=\'<span onclick="',3,269,'Panel()">',3,'</span>\';if(!',3,'.Global.','isLocal&&!',3,'.noShowGlobal){a',502,'+=\'<span id="jsMath_! global" ',396,3,' Global Panel " onclick="',3,619,'Show(1)">Global </span>\'}if(a.offsetWidth<30){a.style.width="auto"}if(!','this.cookie','.button',423,'MoveButton',6,3,'.fixedDiv.style.','left=','document.body.','scrollLeft+"px";',3,637,'top=',639,'scrollTop+',639,'clientHeight+"px";',3,637,'width=',639,'clientWidth+"px"},GetCookie',6,'if(','this.defaults','==null){',655,'={}}',3,105,655,',',631,');',17,'userSet={};var c=',3,'.document.cookie',';if(',3,'.window.location','.protocol.match(',17,561,')){c=',17,'localGetCookie','();',17,'isLocalCookie','=1}if(c',43,3,'=([^;]+)/)){var d=unescape(RegExp.$1).split(/,/);for(',12,'0;b<d.length;b++){',25,'d[b].match(/(.*):(.*)/);if(a[2].match(/^\\d+$/)){a[2]=1*a[2]}',631,'[a[1]]=a[2];',17,'userSet[a[1]]=1}}},',677,6,554,3,671,'.search.substr(1)},SetCookie',200,'f){var b=[];for(var e in ',631,'){if(',655,'[e]==null||',631,'[e]!=',655,'[e]){b[b.length]=e+":"+',631,'[e]}}b=b.join(",");',7,680,'){if(f==2){return"',3,'="+escape(b)}! ',17,'localSetCookie','(b,f)}else{b=escape(b);if(b==""){f=0}',! 7,559,') {b+="; path="+',17,559,'}',7,'cookieDomain','){b+="; domain="+',17,726,'}if(',631,'.keep!="0D"){var a={D',':1000*60*60*24',',W',733,'*7,M',733,'*30,Y',733,'*365};var d=new Date;d.setTime(d.getTime()+',631,'.keep.substr(','0,1)*a[',631,742,'1,1)]);b+="; expires="+d.toGMTString()}if(b!=""){',3,668,'="',3,'="+b;var c=',3,668,';if(f&&!c',43,3,'=/)){alert("Cookies must be enabled in order to save ',3,' options")}}}',554,'null},',717,200,'b,c){if(!c){',228,25,'String(',3,671,').replace(/\\?.*/,"");if(b!=""){a+="?',3,715,'if(a!=',3,671,'.href){',17,'Reload(a)}},Reload',200,'a){if(!',17,587,228,17,'loaded=0;',3,444,'=-100;',3,619,'ClearCache();if(a){',3,671,'.replace(a)}else{',3,671,'.reload()}}};',3,'.Click={CheckClick',200,780,'a){a=',3,'.window.event}if','(a.altKey){',3,269,'Panel()}},CheckDblClick',200,'b){if(!b){b=',3,804,'(!',3,'.Click.DblClick){',3,'.Extension.Require("double-click",1);',25,'b;b={};for(var c in a){b[c]=a[c]}}',3,1,'.Push(',3,'.Click,"DblClick",[b,',17,'alt])}! };',3,'.TeX={thinmuskip:3/18,medmuskip:4/18,thickmuskip:5/18,x_height:0.430554,quad:1,num1:0.676508,num2:0.393732,num3:0.44373,denom1:0.685951,denom2:0.344841,sup1:0.412892,sup2:0.362892,sup3:0.288888,sub1:0.15,sub2:0.247217,sup_drop:0.386108,sub_drop:0.05,delim1:2.39,delim2:1,',55,':0.25,default_rule_thickness:0.06,big_op_spacing1:0.111111,big_op_spacing2:0.166666,big_op_spacing3:0.2,big_op_spacing4:0.6,big_op_spacing5:0.1,integer:6553.6,scriptspace:0.05,nulldelimiterspace:0.12,delimiterfactor:901,delimitershortfall:0.5,scale:1,atom:["ord","op","bin","rel","open","close","punct","ord"],fam:["cmr10","cmmi10","cmsy10","cmex10","cmti10","","cmbx10",""],famName:{cmr10:0,cmmi10:1,cmsy10:2,cmex10:3,cmti10:4,cmbx10:6},encoding:["À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","°","Ñ","Ò","Ó","Ô","Õ","Ö","·","Ø","Ù","Ú","Û","&#x! DC;","µ","¶","ß","ï","!",""","#","$",! "%","&#x 26;","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","ÿ"],cmr10:[[0.625',',0.683],[0.','833',831,'778',831,'694',831,'667',831,'75',831,'722',831,'778',831,'722',831,'778',831,'722',831,'583',',0.694,0,{ic:0.0778,krn:{"39":0.0778,"63":0.0778,"33":0.0778,"41":0.0778,"93":0.0778},lig:{"105":','14,"108":15}}],[0.556',',0.694],[0.','556',855,'833',855,'833',855,'278',',0.431],[0.','306',',0.431,0.194],[0.','5',855,'5',855,'5,0.628],[0.5',855,'5,0.568],[0.75',855,'444,0,0.17],[0.5',855,'722',863,'778',863,'5,0.528,0.0972],[0.903,0.683],[1.01',831,'778,0.732,0.0486],[0.278',',0.431,0,{','krn:{"108":-0.278,"76":-0.319}}],[0.278',',0.694,0,{','lig:{"96":'! ,'60}}],[0.5',855,'833',',0.694,0.194],[','0.5',',0.75,0.0556],[0.','833',892,'778',855,'278',885,'krn:{"63":0.111,"33":0.111},lig:{"39":34}}],[0.389',',0.75,0.25],[0.','389',900,'5,0.75],[','0.778,0.583,0.0833],[','0.278,0.106',',0.194],[0.','333',883,'lig:{"45":','123}}],[',905,'],[0.5',900,'5,0.644','],[0.5,0.644],[0.5,0.','644',915,'644',915,'644',915,'644],[0.5,0.644],[0.278',863,'278',865,'278,0.5',906,'778',',0.367,-0.133],[','0.472,0.5',906,'472',885,886,'62}}],[0.778',855,'75',',0.683,0,{krn:{"','116','":-0.0278,"','67',940,'79',940,'71',940,'85',940,'81',940,'84":-0.0833,"89":-0.0833,"86":-0.111,"87":-0.111}}],[0.','708',831,'722',831,'764',938,'88',940,'87',940,'65',940,'86',940,'89":-','0.0278}}],[0.','681',831,'653',',0.683,0,{','krn:{"111":-0.0833,"101":-0.0833,"117":-0.0833,"114":-0.0833,"97":-0.0833,"65":-0.111,"79":-0.0278,"67":-0.0278,"71":-0.0278,"81":-0.0278}}],[','0.785',831,'75',831,'361',938,'73":',967,'514',831,'778',938,'79',940,'67',940,'71',940,'8! 1":-',967,'625',938,951,'917',831,'75',831,'778',938,'88',940,! '87',940 ,'65',940,'86',940,'89":-',967,'681',938,'65','":-0.0833,"','111',940,'101',940,'97',940,'46',1015,'44":-0.','0833}}],[0.','778,0.683',906,'736',938,'116',940,'67',940,'79',940,'71',940,'85',940,'81',940,951,'556',831,'722',938,'121',940,'101',1015,'111',1015,'114',1015,'97',1015,'65',1015,'117":-0.',1025,'75',831,'75',',0.683,0,{ic:0.','0139,',972,'1.03',1064,'0139,',972,'0.75',938,'79',940,'67',940,'71',940,'81":-',967,'75',1064,'025,krn:{"101',1015,'111',1015,'114',1015,'97',1015,'65',1015,1059,1025,'611',831,'278',900,'5',855,'278',900,'5',855,'278,0.668],[0.','278',885,886,'92}}],[0.5',883,'krn:{"118',940,'106":0.0556,"121',940,'119":-',967,'556,0.','694,0',',{krn:{"101":0.0278,"111":0.0278,"120":-0.0278,"100":0.0278,"99":0.0278,"113":0.0278,"118":-0.0278,"106":0.0556,"121":-0.0278,"119":-0.0278}}],[0.','444',883,'krn:{"104',940,'107":-',967,'556',855,'444',863,'306',853,'12,"102":11,"108":13}}],[0.5',',0.431,0.194,{','ic:0.','0139,krn:{"','106":',967,'556',885,'krn:{"1! 16',940,'117',940,'98',940,'121',940,'118',940,'119":-',967,1105,'306,0.668',906,'528',885,'krn:{"97','":-0.0556,"','101',940,'97',940,'111',940,'99":-',967,'278',855,'833',883,'krn:{"116',940,'117',940,'98',940,'121',940,'118',940,'119":-',967,'556',883,'krn:{"116',940,'117',940,'98',940,'121',940,'118',940,'119":-',967,'5,0.431,0',1119,1117,'431,0.194',1119,'528',865,'392',863,'394',863,'389,0.615,0,{krn:{"121',940,'119":-',967,'556',883,'krn:{"119":-',967,'528',',0.431,0,{ic:0.',1135,'97',1158,'101',940,'97',940,'111',940,'99":-',967,'722',1217,1135,'101',940,'97',940,'111',940,'99":-',967,'528',863,'528',1133,'ic:0.',1135,'111',940,'101',940,'97',940,'46',1015,'44":-0.',1025,'444',863,'5',1217,'0278,',909,'124}}],[1',1217,'0278}],[0.','5',855,'5,0.668],[0.5,0.668]],cmmi10:[[0.615',1064,'139',',krn:{"61":-0.0556,"59":-0.111,"58":-0.111,"127":0.',1025,'833',938,'127":0.167}}],[0.','763',1064,1260,'krn:{"127":0.0833}}],[0.','694',938,1274,'742',1064,'0757,',1278,'831',1064! ,'0812,krn:{"61',1158,'59":-0.0556,"58":-0.0556,"127":0.','055! 6}}],[0. ','78',1064,'0576,',1278,'583',1064,'139',1270,1291,'667',971,1278,'612',1064,'11,krn:{"61',1158,1290,1291,'772',1064,'0502,',1278,'64',1217,'0037,','krn:{"127":',967,'566',',0.694,0.194,{ic:0.','0528,',1278,'518',1133,'ic:0.0556','}],[0.444',885,'ic:0.0378,krn:{"',1290,1291,'406',883,'krn:{"127":0.0556}}],[0.','438',1320,'0738,',1278,'497',1133,'ic:0.0359',',',1333,'469',885,'ic:0.',1260,1278,'354',883,1333,'576',863,'583',855,'603',1133,1317,967,'494',1217,'0637,krn:{"',1290,'0278}}],[0.','438',1320,'046,',1317,'0.111}}],[0.','57',1217,'0359}],[0.','517',1133,1278,'571',1217,'0359,krn:{"59',1158,'58":-0.',1291,'437',1217,'113,krn:{"',1290,1363,'54',1217,'0359,',1317,967,'596,0.694,0.194,{',1278,'626',1133,1333,'651',1320,'0359,',1317,1368,'622',1217,1371,'466',883,1278,'591',885,1278,'828',1217,1264,'517',1133,1278,'363,0.431,0.0972,{ic:0.0799,',1278,'654',1133,1317,'0.0833}}],[1',929,'1',929,'1',929,'1',929,'0.278',',0.464,-0.0363],[','0.278',1430,'0.5,0.465,-0.0347],[',1! 433,'0.5',863,'5',863,'5',863,'5',865,'5',865,'5,0.',1200,915,1200,915,'431',906,'278,0.106],[',905,906,'778',',0.539,0.0391],[','0.5,0.75,0.25,{krn:{"1',1158,'65',1158,'77',1158,'78',1158,'89":0.0556,"90":-0.',1291,'778',1456,1433,'0.531',885,1325,',',1278,'75',938,'127":','0.','139}}],[0.','759',1064,'0502,',1278,'715',1064,'0715,krn:{"61',940,1290,1025,'828',1064,1260,1333,'738',1064,'0576,',1278,'643',1064,'139',1270,1025,'786',971,1278,'831',1064,'0812,krn:{"61',1158,1290,1291,'44',1064,'0785,',1317,1368,'555',1064,'0962',1270,'167}}],[0.','849',1064,'0715,krn:{"61',1158,1290,1291,'681',938,1477,967,'97',1064,'109,krn:{"','61',1158,1290,1025,'803',1064,1534,'61',1015,'61',940,1290,1025,'763',1064,1260,1278,'642',1064,'139',1270,1025,'791,0.683,0.194,{',1278,'759',1064,'00773,',1278,'613',1064,'0576,krn:{"61',1158,1290,1025,'584',1064,'139,krn:{"61',940,1290,1025,'683',1064,1534,'59":-0.111,"',1379,'111,"61',1158,1477,967,'583',1064,'222',',krn:{"59":-0.167,"58":-0.167,! "61":-0.111}}],[0.','944',1064,'139',1587,'828',1064,'0785,krn! :{"61',1 015,'61',940,1290,1025,'581',1064,'222',1587,'683',1064,'0715,krn:{"61',1158,1290,1025,'389,0.75],[0.389',890,'0.389',890,'1,0.358,-0.142],[',1614,'0.417',885,1317,1368,'529',863,'429',855,'433',883,1333,'52',885,'krn:{"89":0.0556,"90',1158,'106":-0.111,"102":-0.167,"',1274,'466',883,1333,'49',1320,'108,krn:{"',1290,1521,'477',1133,1340,',',1317,967,'576',885,'krn:{"127":-',967,'345,0.66],[0.412,0.66,0.194,{ic:0.0572,krn:{"59',1158,1379,1291,'521',885,'ic:0.0315}],[0.298',885,'ic:0.0197,',1278,'878',863,'6',863,'485',883,1333,'503',1133,1278,'446',1133,1340,',',1278,'451',1217,1260,'krn:{"',1290,1291,'469',883,1333,'361,0.615,0,{',1278,'572',883,1317,967,'485',1217,'0359,',1317,967,'716',1217,'0269,',1278,'572',883,1317,967,'49',1133,1340,',',1333,'465',1217,'044,',1333,'322',883,1317,967,'384',1133,1278,'636',1133,1317,1368,'5,0.714,0,{ic:0.154}],[0.278',885,'ic:0.399}]],cmsy10:[[',904,'0.278,0.444,-0.0556],[',904,1433,904,'0.5,0.444,-0.0556],[',904,904,904,904,904,904,904,! '1',890,1732,1732,'0.778',1430,'0.778,0.464,-0.0363','],[0.778,0.636,0.136',1747,1747,1747,1747,1747,'],[0.778',929,'0.778,0.483,-0.0169],[0.778',1456,'0.778',1456,'1',1456,'1',1456,'0.778',1456,'0.778',1456,'1',929,'1',929,'0.5',890,'0.5',890,'1',929,'1',890,'1',890,'0.778',1430,'1',929,'1',929,'0.611',890,'0.611',890,'1',929,'1',890,'1',890,'0.778',863,'275,0.556],[1',863,'667',1456,'0.667',1456,'0.889',890,'0.889',890,'0',890,'0',929,'0.556',855,'556',855,'667',863,'5',892,'722',855,'722',855,'778',855,'778',855,'611',855,'798',938,'48":0.','194}}],[0.657',1064,'0304',',krn:{"48":0.',1479,'527',1064,'0583',1837,1479,'771',1064,'0278',1837,1025,'528',1064,'0894',1837,'111}}],[0.','719',1064,'0993',1837,1853,'595',',0.683,0.0972,{ic:0.','0593',1837,1853,'845',1064,'00965',1837,1853,'545',1064,'0738,krn:{"48":',967,'678',1860,'185',1837,1521,'762',1064,'0144',1837,1291,'69',938,1833,'139}}],[1.2',938,1833,1479,'82',1064,'147',1837,1025,'796',1064,1846,1837,1853,'696',1064,'! 0822',1837,1025,'817,0.683,0.0972,{krn:{"48":',1368,'848',938,! 1833,102 5,'606',1064,'075',1837,1479,'545',1064,'254,krn:{"48":',967,'626',1064,'0993',1837,1025,'613',1064,'0822,krn:{"48":',967,'988',1064,'0822',1837,1025,'713',1064,'146',1837,1479,'668',1860,'0822',1837,1025,'725',1064,'0794',1837,1479,'667,0.556],[0.',1949,1949,1949,1949,'611',855,'611',855,'444',900,'444',900,'444',900,'444',900,'5',900,'5',900,'389',900,'389',900,'278',900,'5',900,'5',900,'611',900,'5',900,'278',890,'0.833,0.04,0.96],[0.75',831,'833',831,'417',1320,'111}],[0.',1949,'667,0.556',1747,1747,'],[0.444',890,'0.444',890,'0.444',890,'0.611',890,'0.778,0.694,0.13','],[',2005,'],[',2005,'],[',2005,']],cmex10:[[0.458',',0.04,1.16,{n:','16}],[0.458',2013,'17}],[0.417',2013,'104}],[0.417',2013,'105','}],[0.472,0.04,1.16,{n:','106',2021,'107',2021,'108',2021,'109}],[0.583',2013,'110}],[0.583',2013,'111',2021,'68',2021,'69}],[0.333',',0,0.6,{delim:{rep:','12}}],[0.556',2037,'13}}],[0.578',2013,'46}],[0.578',2013,'47}],[0.597',',0.04,1.76,{n:','18}],[0.597',2045,'19}],[0.73! 6',',0.04,2.36,{n:','32}],[0.736',2049,'33}],[0.528',2049,'34}],[0.528',2049,'35}],[0.583',2049,'36}],[0.583',2049,'37}],[0.583',2049,'38}],[0.583',2049,'39}],[0.75',2049,'40}],[0.75',2049,'41}],[0.75',2049,'42}],[0.75',2049,'43}],[1.04',2049,'44}],[1.04',2049,'45}],[0.792',',0.04,2.96,{n:','48}],[0.792',2077,'49}],[0.583',2077,'50}],[0.583',2077,'51}],[0.639',2077,'52}],[0.639',2077,'53}],[0.639',2077,'54}],[0.639',2077,'55}],[0.806',2077,'56}],[0.806',2077,'57}],[0.806',',0.04,2.96],[','0.806',2097,'1.28',2097,'1.28',2097,'0.811',2045,'30}],[0.811',2045,'31}],[0.875',',0.04,1.76,{delim:{top:','48,bot:64,rep:66}}],[0.875',2109,'49,bot:65,rep:67}}],[0.667',2109,'50,bot:52,rep:54}}],[0.667',2109,'51,bot:53,rep:55','}}],[0.667,0.04,1.76,{delim:{bot:','52,rep:54',2117,'53,rep:55','}}],[0.667,0,0.6,{delim:{top:','50,rep:54',2121,'51,rep:55','}}],[0.889,0,0.9,{delim:{top:','56,mid:60,bot:58,rep:62',2125,'57,mid:61,bot:59,rep:62',2125,'56,bot:58,rep:62',2125,'57,bot:59,rep:62','}! }],[0.889,0,1.8,{delim:{rep:','63',2133,'119}}],[0.889,0,0.3,{! delim:{r ep:62',2121,'120,bot:121,rep:63}}],[0.875',2109,'56,bot:59,rep:62}}],[0.875',2109,'57,bot:58,rep:62}}],[0.875',2037,'66}}],[0.875',2037,'67}}],[0.611',2045,'28}],[0.611',2045,'29','}],[0.833,0,1,{n:','71}],[1.11,0.1,1.5],[','0.472,0,1.11,{ic:0.194,n:','73}],[0.556,0,2.22,{ic:0.444}],[1.','11,0,1,{n:','75','}],[1.51,0.1,1.5],[1.',2155,'77',2157,2155,'79',2157,'06,0,1,{n:88}],[0.944,0,1,{n:89}],[',2153,'90',2151,'91}],[0.833,0,1'], - [',{n:92','}],[0.','833,0,1,{n:','93',1,2,'94',1,2,'95}],[1.44,0.1,1.5],[','1.28,0.1,1.5],[0.556,0',',2.22',',{ic:0.','444}],[','1.11,0.1,1.5],[',14,14,14,14,'0.944,0,1,{n:97}],[',10,'.722,0,{n:99','}],[1,0.75,0,{n:','100','}],[1.44,0.75],[0.','556,0.722,0,{n:102',22,'103',24,'472',',0.04,1.76,{n:','20',1,'472',30,'21',1,'528',30,'22',1,'528',30,'23',1,'528',30,'24',1,'528',30,'25',1,'667',30,'26',1,'667',30,'27','}],[1,0.04,','1.16,{n:113}],[1',30,'114',60,'2.36,{n:115',60,'2.96,{n:116}],[1.06,0,1.8,{delim:{top:118,bot:116,rep:117}}],[1.06,0,0.6],[1.06,0.04,0.56],[0.778',',0,0.6,{delim:{','top:126,','bot:127,rep:119','}}],[0.667',68,'top:120,rep:63}}],[0.667',68,'bot:121,rep:63}}],[0','.45,0.12],[0',76,76,76,'.778',68,69,'rep:119}}],[0.778',68,70,'}}]],cmti10:[[0.627',',0.683,0,{ic:0.','133',1,'818,0.683],[0.767',87,'094',1,'692,0.683],[0.664',87,'153',1,'743',87,'164',1,'716',87,'12',1,'767',87,'111',1,'716',87,'0599',1,'767',87,'111',1,'716',87,'103',1,'613',',0.694','! ,0.194,{ic:0.','212,krn:{"39":0.104,"63":0.104,"33":0.104,"41":0.104,"93":0.104},lig:{"105":','14,"108":15}}],[0.','562',123,124,'103',1,'588',123,124,'103',1,'882',123,124,'103',1,'894',123,124,'103',1,'307',',0.431,0,{ic:0.','0767',1,'332,0.431',124,'0374',1,'511',',0.694],[0.','511',',0.694,0,{ic:0.','0969',1,'511,0.','628',',0,{ic:0.','083',1,'511',158,'108',1,161,'562',163,'103',1,'831',156,'46,0,0.17],[0.537',123,124,'105',1,'716',148,'0751',1,'716',148,184,1,161,'528,0.0972',12,'0919',1,'883',87,'12',1,'985',87,'12',1,'767,0.732,0.0486',12,'094',1,'256,0.431,0,{krn:{"108":-0.256,"76":-0.321}}],[0.307',158,'124,lig:{"96":','60}}],[0.','514',158,'0696',1,'818',123,124,'0662',1,'769',156,'818,0.75,0.0556',12,'136',1,'767',158,'0969',1,'307',158,'124',',krn:{"','63":0.102,"33":0.102','},lig:{"39":34}}],[0.','409',',0.75,0.25,{ic:0.','162',1,'409',237,'0369',1,161,'75',163,'149',1,'767,0.562,0.0567',12,'0369',1,'307,0.106',',0.194],[0.','358',148,'0283,','lig:{"45":123}}]! ,[0.',253,'],[0.511',237,'162',1,161,'644,0',',{ic:0.136}],[0.! 511,0.64 4,0',266,266,266,'.194',266,266,266,270,266,266,12,'136',1,'307',148,'0582',1,'307,0.','431',124,'0582',1,284,'5',124,'0756',1,'767,0.367,-0.133',12,'0662',1,161,'5',254,'511',158,'122,lig:{"96":62}}],[0.767',158,'096',1,'743,0.683,0,{','krn:{"110":-0.0256,"108":-0.0256,"114":-0.0256,"117":-0.0256,"109":-0.0256,"116":-0.0256,"105":-0.0256,"67":-0.0256,"79":-0.0256,"71":-0.0256,"104":-0.0256,"98":-0.0256,"85":-0.0256,"107":-0.0256,"118":-0.0256,"119":-0.0256,"81":-','0.0256,"84','":-0.0767,"','89',310,'86','":-0.102,"','87',314,'101":-0.0511,"97":-0.0511,"111":-0.0511,"100":-0.0511,"99":-0.0511,"103":-0.0511,"113":-0.0511}}],[0.','704',87,'103',1,'716',87,'145',1,'755',87,'094',233,'88','":-0.0256,"','87',331,'65',331,'86',331,'89','":-0.0256}}],[0.','678',87,'12',1,'653',87,'133',233,'111',310,'101',310,'117','":-0.0767,"114":-0.0767,"97":-0.0767,"','65',314,'79":-0.0256,"67":-0.0256,"71":-0.0256,"81":-0.0256}}],[0.','774',87,'0872',1,'743',87,'164',1,'386',87,'158',1,'525',! 87,'14',1,'769',87,'145',233,356,'627,0.683,0,{krn:{"84',310,'89',310,'86',314,'87',314,317,'897',87,'164',1,'743',87,'164',1,'767',87,'094',233,'88',331,'87',331,'65',331,'86',331,'89',339,'678',87,'103',233,'65":-0.0767}}],[0.','767,0.683',124,'094',1,'729',87,'0387,',308,'0.0256,"84',310,'89',310,'86',314,'87',314,317,'562',87,'12',1,'716',87,'133',233,'121',310,'101',310,'111',353,'117',310,413,'743',87,'164',1,'743',87,'184',233,'111',310,'101',310,'117',353,'65',314,356,'999',87,'184',233,413,'743',87,'158',233,356,'743',87,'194',233,'101',310,'111',353,'117',310,413,'613',87,'145',1,'307',237,'188',1,'514',158,'169',1,'307',237,'105',1,'511',158,'0665',1,284,'668',163,'118',1,'307',158,209,'92}}],[0.','511',148,149,1,'46',158,'0631',233,317,'46',148,'0565',233,317,'511',158,'103',',krn:{"108":0.0511}}],[0.','46',148,184,233,317,'307',123,124,125,'12,"102":11,"108":13}}],[0.','46,0.431',124,'0885',1,'511',158,149,1,284,'655',163,'102',1,284,'655',124,'145',1,'46',158,! '108',1,'256',158,'103',532,'818',148,149,1,'562',148,149,233,! '39":-0. 102}}],[0.511',148,'0631',233,317,161,'431',124,'0631',233,317,'46,0.431',124,'0885',1,'422',148,'108',233,317,'409',148,'0821',1,'332,0.615',163,'0949',1,'537',148,149,1,'46',148,'108',1,'664',148,'108',532,'464',148,'12',1,'486,0.431',124,'0885',1,'409',148,'123',1,'511',148,'0921',',lig:{"45":124}}],[1.','02',148,631,1,'511',158,'122',1,161,'668',163,'116',1,161,'668',163,'105}]],cmbx10:[[0.692',',0.686],[0.','958',650,'894',650,'806',650,'767',650,'9',650,'831',650,'894',650,'831',650,'894',650,'831',650,'671',158,'109,krn:{"39":0.109,"63":0.109,"33":0.109,"41":0.109,"93":0.109},lig:{"105":',126,'639',156,'639',156,'958',156,'958',156,'319',',0.444],[0.','351,0.444',254,'575',156,'575',156,'575,0.','632],[0.575',156,691,'596],[0.869',156,'511,0,0.17],[0.597',156,'831',684,'894',684,691,'542,0.0972],[1.04,0.686],[1.17',650,'894,0.735,0.0486],[0.319',',0.444,0,{krn:{"','108":-0.319,"76":-0.378}}],[0.35',',0.694,0,{lig:{"96":',210,'603',156,'958',123,254,691,'75,0.0556],[0.! ','958,0.',717,'894',156,'319',',0.694,0,{krn:{"','63":0.128,"33":0.128',235,'447',',0.75,0.25],[0.','447',727,691,'75],[0.894,0.633,0.133],[0.','319,0.156',254,'383,0.444,0,{',258,732,'],[0.575',727,691,'644],[','0.575,0.644],[0.575,0.644],[',741,741,741,'0.',691,'644],[0.319',684,'319,0.444',254,'35,0.5',254,'894,0.391,-0.109],[0.543,0.5',254,'543',709,'62}}],[0.894',156,'869',',0.686,0,{krn:{"','116','":-0.0319,"','67',762,'79',762,'71',762,'85',762,'81',762,'84":-0.0958,"89":-0.0958,"86":-0.128,"87":-0.128}}],[','0.818',650,'831',650,'882',760,'88',762,'87',762,'65',762,'86',762,'89','":-0.0319}}],[0.','756',650,'724,0.686,0,{','krn:{"111":-0.0958,"101":-0.0958,"117":-0.0958,"114":-0.0958,"97":-0.0958,"65":-0.128,"79":-0.0319,"67":-0.0319,"71":-0.0319,"81":-0.0319}}],[','0.904',650,'9',650,'436',760,'73','":0.0319}}],[0.','594',650,'901',760,'79',762,'67',762,'71',762,'81',789,'692',760,773,'1.09',650,'9',650,'864',760,'88',762,'87',762,'65',762,'86',762,'89',789,'786',! 760,'65":-0.0958,"111',762,'101',762,'97',762,'46":-0.0958,"44! ":-0.095 8}}],[0.','864,0.686',254,'862',760,'116',762,'67',762,'79',762,'71',762,'85',762,'81',762,773,'0.639',650,'8',760,'121',762,'101":-0.0958,"111":-0.0958,"114":-0.0958,"97":-0.0958,"65":-0.0958,"117":-0.0958}}],[0.','885',650,'869,0.686',163,'016,',793,'1.19,0.686',163,'016,',793,'0.869',760,'79',762,'67',762,'71',762,'81',789,'869,0.686',163,'0287',233,865,'703',650,'319',727,'603',156,'319',727,'575',156,'319',156,'319',709,514,'559',707,'118',762,'106":0.0639,"121',762,'119',789,'639',123,',0',',{krn:{"101":0.0319,"111":0.0319,"120":-0.0319,"100":0.0319,"99":0.0319,"113":0.0319,"118":-0.0319,"106":0.0639,"121":-0.0319,"119":-0.0319}}],[0.','511',707,'104',762,'107',789,'639',156,'527',684,'351',158,673,542,691,'444',124,'016,krn:{"','106',801,'639',723,'116',762,'117',762,'98',762,'121',762,'118',762,'119',789,'319',156,'351',123,254,'607',723,'97":-0.0639,"101',762,'97',762,'111',762,'99',789,'319',156,'958',707,'116',762,'117',762,'98',762,'121',762,'118',762,'119',789,'! 639',707,'116',762,'117',762,'98',762,'121',762,'118',762,'119',789,691,'444,0',917,'639,0.444,0',270,917,'607,0.444',254,'474',684,'454',684,'447,0.635,0,{krn:{"121',762,'119',789,'639',707,'119',789,1003,163,935,'97":-0.0639,"101',762,'97',762,'111',762,'99',789,'831,0.444',163,935,'101',762,'97',762,'111',762,'99',789,'607',684,1003,124,935,'111',762,'101',762,'97',762,841,'511',684,691,'444',163,'0319',632,'15,0.444',163,1056,1,'575',156,'575',156,'575',123,']]};','jsMath.Img','={fonts:[50,60,70,85,100,120,144,173,207,249,298,358,430],w:{"50":6.9,"60":8.3,"70":9.7,"85":11.8,"100":13.9,"120":16.7,"144":20,"173":24,"207":28.8,"249":34.6,"298":41.4,"358":49.8,"430":59.8},best:4,update:{},factor:1,loaded:0,SetFont',':function(','b){for(var a in b){if(!','this.update','[a]){',1073,'[a]=[]}',1073,'[a]=',1073,'[a].concat(b[a])}},AddFont',1071,'a,b){if(!',1069,1074,1069,'[a]={}}jsMath.Add(',1069,'[a],b)},UpdateFonts',':function(){','var e=',1073,';','if(!this.loaded){','return}! for(var a in e){for(var b=0;b<e[a].length;b++){var d=e[a][b];i! f(d=="al l"){for(d in ','jsMath.TeX[','a]){',1095,'a][d].img','={}}}else{',1095,1098,'={}}}}',1073,'={}},BestSize',1089,'var b=jsMath.em*this.factor;var a=','this.w[this.fonts[','0]];for(var c=1;c<this.fonts.length;c++){if(b<(',1107,'c]]+2*a)/3){return c-1}a=',1107,'c]]}return c-1},Scale',1089,1093,'return}this.best=this.BestSize();this.em=',1069,'.w[this.fonts[this.best]];','this.scale','=(jsMath.em/this.em);','if(Math.abs(',1118,'-1)<0.12){',1118,'=1}},URL',1071,'a,b,d){var c=(','jsMath.Controls.cookie.','alpha)?"/alpha/":"/plain/";if(d==null){d="def.js"}else{d="char"+d+".png"}if(b!=""){b+="/"}','return this.','root+a+c+b+d},LoadFont',1071,'a){',1093,'this.Init()}jsMath.Setup.Script(this.URL(a,""))},Init',1089,'if(',1127,'print||',1127,'stayhires','){',1127,'print=',1127,1140,';this.factor*=3;if(!','jsMath.Controls.','isLocalCookie||!jsMath.Global.isLocal){',1147,'SetCookie(0)}if(','jsMath.Browser.','alphaPrintBug){',1127,'alpha=0}}var b="0123456789ABCDEF";this.HexCode=[];for(var c! =0;c<128;c++){var d=Math.floor(c/16);var a=c-16*d;this.HexCode[c]=b.charAt(d)+b.charAt(a)}this.loaded=1}};jsMath.HTML={Em',1071,'a){',1120,'a)<0.000001){a=0}var b=String(a);b=b.replace(/(\\.\\d\\d\\d).+/,"$1");return b+"em"},Spacer',1071,'a){if(a==0){return""}return ',1151,'msieSpaceFix+\'<','span class="spacer" style="margin-','left:\'+this.Em(','a)+\'"></span>\'},Blank',1071,'b,f,i,g){var a','="";var e="";','if(g){e+="border-left',':"+this.Em(','b)+" solid;";if(',1151,'widthAddsBorder){b=0}}if(b==0){if(',1151,'blankWidthBug){if(',1151,'quirks','){e+="width:1px',';";a=\'<',1163,'right:-1px"></span>\'}else{if(!g',1178,';margin-right:-1px;"}}}}else{e+="width',1170,'b)+";"}if(i==null){i=0}if(f){var c=this.Em(f+i);if(g&&f*jsMath.em<=1.5){c="1.5px";f=1.5/jsMath.em}e+="height:"+c+";"}if(',1151,'mozInlineBlockBug){i=-f}if(',1151,'msieBorderBug&&!g){i-=jsMath.d}if(i){e+="','vertical-align:"+','this.Em(-i)}return a+\'<span class="blank" ','style="\'+','e+\'"></span>\'},Rule',1071,'! a,b){if(b==null){b','=jsMath.TeX.default_rule_thickness}',1129! ,'Blank( a,b,0,1)},Class',1071,'a,b){return\'<span class="\'+a','+\'">\'+b+"</span','>"},Place',1071,'b,a,d){',1120,'a)<0.0001){a=0}',1120,'d)<0.0001){d=0}if(a||d){var c=\'<','span style="position',': relative',';\';if(a){c+=" margin-left',1170,'a)+";"}if(d){c+=" top:"+this.Em(-d)+";"}b=c',1201,'>"}return b},PlaceSeparateSkips',1071,'e',',g,f,i,a,h){if(Math.abs(g)<0.0001){g=0}if(Math.abs(f)<0.0001){f=0}','if(f){var d=0;var c=0;','var b="";if(','i!=null){c=','a-h;d=i;b=" width',1170,'a-i)+";"}e=','this.Spacer','(d-c)+\'<',1209,1210,'; top:\'+this.Em(-f)+";left',1170,'c',')+";"+b+\'">\'+',1225,'(-d)+e+',1225,'(c)+"</span>"}if(g){e=',1225,'(g)+e}return e},PlaceAbsolute',1071,'d',1218,'var c',1168,1220,1151,'msieRelativeClipBug&&',1221,1225,'(-i);g+=i;e=',1225,'(a-h)}if(',1151,'operaAbsoluteWidthBug){b=" width: "+this.Em(h+2)}d=\'<',1209,':absolute; ',1164,'g)+"; top',1170,'f',1232,'c+d+e+" </span>";','return d},','Absolute',1071,'b,a,c,e,f){if(f!="none"){',1120,'f)<0.0001){f=0}b=\'! <',1209,1255,'top:\'+','jsMath.HTML.','Em(f)+\'; left:0em;">\'+b+" </span>"}if(e=="none"){e=0}b+=this.Blank(a,c-e,e);if(',1151,'msieAbsoluteBug){b=\'<',1209,':relative',';">\'+b+"</span>"}b=\'<',1209,1276,';\'+',1151,'msieInlineBlockFix',1201,'>";return b}};','jsMath.Box','=function(c,f,a,b,e){','if(e==null','){e=jsMath.d}this.type="typeset";this.w=a;this.h=b;this.d=e;this.bh=b;this.bd=e;this.x=0;this.y=0;this.mw=0;this.Mw=a;this.html=f;this.format=c};jsMath.Add(',1285,',{defaultH:0,Null',1089,'return new ',1285,'("null","",0,0,0)},Text',1071,'l,k,b,m,j,i){var g=','jsMath.Typeset.AddClass(','k,l);g=','jsMath.Typeset.','AddStyle(','b,m,g);var c','=jsMath.EmBoxFor(','g);var e=',1299,'TeX(b,m);var h=((k=="cmsy10"||k=="cmex10")?c.h-e.h:e.d*c.h/e.hd);var f=new ',1285,'("text",l,c.w,c.h-h,h);f.style=b;f.size=m;f.tclass=k;if(i!=null){f.d=i*e.scale}else{f.d=0}if(j==null||j==1){f.h=0.9*e.M_height}else{f.h=1.1*e.x_height+e.scale*j}return f},TeX',1071,'g,a,d,b){var h=',1095,'a][g! ];if(h.d==null){h.d=0}if(h.h==null){h.h=0}if(h.img!=null&&h.c!! =""){thi s.TeXIMG(a,g,',1299,'StyleSize(d,b))}var f=',1299,'TeX(d,b).scale;var e=new ',1285,'("text",h.c,h.w*f,h.h*f,h.d*f);e.style=d;e.size=b;if(h.tclass){e.tclass=h.tclass;if(h.img){e.bh=h.img.bh;e.bd=h.img.bd}else{e.bh=f*jsMath.h;e.bd=f*jsMath.d}}else{e.tclass=a;e.bh=f*',1095,'a].h;e.bd=f*',1095,'a].d;if(',1151,'msieFontBug&&','e','.html.match(/&#/)){','e','.html+=\'<span style="display:none">x</span','>\'}}return e},TeXfallback',1071,'b,f,e,o){var m=',1095,'f][b];if(!m.tclass){m.tclass=f}if(m.img!=null){',1129,'TeXnonfallback(b,f,e,o)}if(m.h!=null&&m.a==null){m.a=m.h-1.1*jsMath.TeX.x_height}var n=m.a;var l=m.d;var k=this.Text(m.c,m.tclass,e,o,n,l);var g=',1299,'TeX(e,o).scale;if(m.bh!=null){k.bh=m.bh*g;k.bd=m.bd*g}else{var j=k.bd+k.bh;var i=',1297,'k.tclass,k.html);i=',1299,1300,'e,o,i);k.bd',1302,'i+',1271,'Blank(1,j)).h-j;k... [truncated message content] |
From: dpvc v. a. <we...@ma...> - 2010-03-13 02:05:54
|
Log Message: ----------- Fixed a problem with the signed number pattern that cause Real("4*3") to produce 4 rather than 12. Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.11 -r1.12 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -218,7 +218,7 @@ sub Init { my $context = $main::context{Fraction} = Parser::Context->getCopy("Numeric"); $context->{name} = "Fraction"; - $context->{pattern}{signedNumber} .= '|-?\d+/\d+'; + $context->{pattern}{signedNumber} = '(?:'.$context->{pattern}{signedNumber}.'|-?\d+/-?\d+)'; $context->operators->set( "/" => {class => "context::Fraction::BOP::divide"}, "//" => {class => "context::Fraction::BOP::divide"}, |
From: dpvc v. a. <we...@ma...> - 2010-02-22 14:15:18
|
Log Message: ----------- Make inherit() properly not inherit the noinherit attributes from self Modified Files: -------------- pg/lib: Value.pm Revision Data ------------- Index: Value.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value.pm,v retrieving revision 1.98 retrieving revision 1.99 diff -Llib/Value.pm -Llib/Value.pm -u -r1.98 -r1.99 --- lib/Value.pm +++ lib/Value.pm @@ -602,9 +602,9 @@ # sub inherit { my $self = shift; - my %copy = (map {%$_} @_); # copy values from given objects + my %copy = (map {%$_} @_,$self); # copy values from given objects foreach my $id ($self->noinherit) {delete $copy{$id}} - $self = bless {%copy,%$self}, ref($self); + $self = bless {%copy}, ref($self); return $self; } |
From: jj v. a. <we...@ma...> - 2010-02-11 02:52:44
|
Log Message: ----------- Backing out previous change. There is still a serious problem with this file, although we hadn't fixed it. Modified Files: -------------- pg/macros: PGdiffeqmacros.pl Revision Data ------------- Index: PGdiffeqmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGdiffeqmacros.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -Lmacros/PGdiffeqmacros.pl -Lmacros/PGdiffeqmacros.pl -u -r1.7 -r1.8 --- macros/PGdiffeqmacros.pl +++ macros/PGdiffeqmacros.pl @@ -784,7 +784,6 @@ my $out1 = $check_eval->ans_hash->{evaluation_points}; my $rf_corrEq = $check_eval->ans_hash->{rf_student_ans}; # if student answer is empty and go on, we get a pink screen - if($rf_corrEq) { my $error_string = "This equation $correctEqn is not constant on solution curves of y'(t) = $diffEqRHS\r\n<br> starting at ( $initial_t , $initial_y )<br> $check_eval->ans_hash->pretty_print()". @@ -803,7 +802,6 @@ } $error_string .= $rh_correct_ans->error_message(); warn $error_string, $check_eval->ans_hash->pretty_print; - } } my ($constant_eval) = fun_cmp('c', vars => [@VARS], |
From: jj v. a. <we...@ma...> - 2010-02-10 17:52:21
|
Log Message: ----------- Fix a bug where problems produce a pink screen on checking answers. We don't bother evaluating the student answer if it is empty. Modified Files: -------------- pg/macros: PGdiffeqmacros.pl Revision Data ------------- Index: PGdiffeqmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGdiffeqmacros.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -Lmacros/PGdiffeqmacros.pl -Lmacros/PGdiffeqmacros.pl -u -r1.6 -r1.7 --- macros/PGdiffeqmacros.pl +++ macros/PGdiffeqmacros.pl @@ -780,10 +780,12 @@ $check_eval->ans_hash(evaluation_points => $rh_correct_ans->{evaluation_points}); $check_eval->evaluate($rh_correct_ans->{correct_ans}); if( $check_eval->ans_hash->{score} == 0 or (defined($options{debug}) and $options{debug})) { - # write error message for professor - my $out1 = $check_eval->ans_hash->{evaluation_points}; - my $rf_corrEq = $check_eval->ans_hash->{rf_student_ans}; - my $error_string = "This equation $correctEqn is not constant on solution curves of y'(t) = $diffEqRHS\r\n<br> + # write error message for professor + my $out1 = $check_eval->ans_hash->{evaluation_points}; + my $rf_corrEq = $check_eval->ans_hash->{rf_student_ans}; + # if student answer is empty and go on, we get a pink screen + if($rf_corrEq) { + my $error_string = "This equation $correctEqn is not constant on solution curves of y'(t) = $diffEqRHS\r\n<br> starting at ( $initial_t , $initial_y )<br> $check_eval->ans_hash->pretty_print()". "options<br>\n".pretty_print({ vars => [@VARS], @@ -794,13 +796,14 @@ debug => $options{debug}, }); - for (my $i=0; $i<$numPoints;$i++) { - my ($z, $err) = &$rf_corrEq( $out1->[$i][0], $out1->[$i][1] ); - $z = $err if defined $err; - $error_string .= "F( ". $out1->[$i][0] . " , ". $out1->[$i][1] . " ) = $z <br>\r\n"; - } - $error_string .= $rh_correct_ans->error_message(); - warn $error_string, $check_eval->ans_hash->pretty_print; + for (my $i=0; $i<$numPoints;$i++) { + my ($z, $err) = &$rf_corrEq( $out1->[$i][0], $out1->[$i][1] ); + $z = $err if defined $err; + $error_string .= "F( ". $out1->[$i][0] . " , ". $out1->[$i][1] . " ) = $z <br>\r\n"; + } + $error_string .= $rh_correct_ans->error_message(); + warn $error_string, $check_eval->ans_hash->pretty_print; + } } my ($constant_eval) = fun_cmp('c', vars => [@VARS], |
From: dpvc v. a. <we...@ma...> - 2010-02-08 14:55:59
|
Log Message: ----------- Make sure variable substitution has occured BEFORE switching the contexts (so we don't get an undefined variable message); contexts must agree in order to compare the two. Modified Files: -------------- pg/macros: parserFormulaUpToConstant.pl Revision Data ------------- Index: parserFormulaUpToConstant.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserFormulaUpToConstant.pl,v retrieving revision 1.23 retrieving revision 1.24 diff -Lmacros/parserFormulaUpToConstant.pl -Lmacros/parserFormulaUpToConstant.pl -u -r1.23 -r1.24 --- macros/parserFormulaUpToConstant.pl +++ macros/parserFormulaUpToConstant.pl @@ -163,7 +163,7 @@ # sub compare { my ($l,$r) = @_; my $self = $l; my $context = $self->context; - $r = Value::makeValue($r,context=>$context); + $r = Value::makeValue($r,context=>$context) unless Value::isValue($r); # # Not equal if the student value is constant or has no + C # @@ -173,6 +173,7 @@ # If constants aren't the same, substitute the professor's in the student answer. # $r = $r->substitute($r->{constant}=>$l->{constant}) unless $r->{constant} eq $l->{constant}; + $r->context($context) unless $r->context == $context; # # Compare with adaptive parameters to see if $l + n00 C = $r for some n0. |
From: dpvc v. a. <we...@ma...> - 2010-02-08 14:52:24
|
Log Message: ----------- Make sure makeValue set's the context, if requested Modified Files: -------------- pg/lib: Value.pm Revision Data ------------- Index: Value.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value.pm,v retrieving revision 1.97 retrieving revision 1.98 diff -Llib/Value.pm -Llib/Value.pm -u -r1.97 -r1.98 --- lib/Value.pm +++ lib/Value.pm @@ -372,9 +372,13 @@ =cut sub makeValue { - my $x = shift; return $x if Value::isValue($x); + my $x = shift; my %params = (showError => 0, makeFormula => 1, context => Value->context, @_); my $context = $params{context}; + if (Value::isValue($x)) { + return $x unless {@_}->{context}; + return $x->copy->inContext($context); + } return $context->Package("Real")->make($context,$x) if matchNumber($x); if (matchInfinite($x)) { my $I = $context->Package("Infinity")->new($context); |
From: dpvc v. a. <we...@ma...> - 2010-02-08 14:16:55
|
Log Message: ----------- Fix up comments Modified Files: -------------- pg/macros: parserFormulaUpToConstant.pl Revision Data ------------- Index: parserFormulaUpToConstant.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserFormulaUpToConstant.pl,v retrieving revision 1.22 retrieving revision 1.23 diff -Lmacros/parserFormulaUpToConstant.pl -Lmacros/parserFormulaUpToConstant.pl -u -r1.22 -r1.23 --- macros/parserFormulaUpToConstant.pl +++ macros/parserFormulaUpToConstant.pl @@ -139,10 +139,10 @@ unless $n->isConstant; # # Make a version with adaptive parameters for use in the - # comparison later on. We could like n0*C, but already have $n - # copies of C, so remove them. That way, n0 will be 0 when there + # comparison later on. We could like n00*C, but already have $n + # copies of C, so remove them. That way, n00 will be 0 when there # are no C's in the student answer during the adaptive comparison. - # (Again, should really check that n0 is not in use already) + # (Again, should really check that n00 is not in use already) # my $n00 = $context->variables->get("n00"); $context->variables->add(n00=>'Parameter') unless $n00 and $n00->{parameter}; @@ -175,7 +175,7 @@ $r = $r->substitute($r->{constant}=>$l->{constant}) unless $r->{constant} eq $l->{constant}; # - # Compare with adaptive parameters to see if $l + n0 C = $r for some n0. + # Compare with adaptive parameters to see if $l + n00 C = $r for some n0. # my $adapt = $l->adapt; my $equal = Parser::Eval(sub {$adapt == $r}); @@ -185,7 +185,7 @@ $_[1]->{test_values} = $r->{test_values}; # save these in student answer for diagnostics return -1 unless $equal; # - # Check that n0 is non-zero (i.e., there is a multiple of C in the student answer) + # Check that n00 is non-zero (i.e., there is a multiple of C in the student answer) # (remember: return value of 0 is equal, and non-zero is unequal) # return abs($context->variables->get("n00")->{value}) < $context->flag("zeroLevelTol"); |
From: dpvc v. a. <we...@ma...> - 2010-02-07 10:45:22
|
Log Message: ----------- Corrected interpretation of 0 a/b (thanks to Adam Weyhaupt) Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.10 retrieving revision 1.11 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.10 -r1.11 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -404,7 +404,7 @@ # sub _eval { my ($self,$a,$b)= @_; - return ($a > 0 ? $a + $b : $a - $b); + return ($a >= 0 ? $a + $b : $a - $b); } # |