Difference between revisions of "InequalityAnswer1"
Jump to navigation
Jump to search
Paultpearson (talk | contribs) (Add link to PGML version in OPL) |
(add historical tag and give links to newer problems.) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{historical}} |
||
+ | |||
+ | <p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/Algebra/InequalityAnswer.html a newer version of this problem]</p> |
||
+ | |||
+ | |||
<h2>Answer is an Inequality</h2> |
<h2>Answer is an Inequality</h2> |
||
Line 79: | Line 84: | ||
<p> |
<p> |
||
<b>Setup:</b> |
<b>Setup:</b> |
||
− | We require students to use inequalities by using <code>Context("Inequalities-Only")</code>. If we had used <code>Context("Inequalities")</code> instead, then students could also enter their answer using interval notation. For more details, please see [http://webwork.maa.org/pod/ |
+ | We require students to use inequalities by using <code>Context("Inequalities-Only")</code>. If we had used <code>Context("Inequalities")</code> instead, then students could also enter their answer using interval notation. For more details, please see [http://webwork.maa.org/pod/pg/macros/contextInequalities.html contextInequalities.pl] |
</p> |
</p> |
||
<p> |
<p> |
Latest revision as of 04:46, 18 July 2023
This problem has been replaced with a newer version of this problem
Answer is an Inequality
This PG code shows a question whose answer is an inequality.
- File location in OPL: FortLewis/Authoring/Templates/Algebra/InequalityAnswer1.pg
- PGML location in OPL: FortLewis/Authoring/Templates/Algebra/InequalityAnswer1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "contextInequalities.pl", "AnswerFormatHelp.pl", ); TEXT(beginproblem()); |
Initialization:
We must load |
Context("Inequalities-Only"); Context()->flags->set(formatStudentAnswer=>'parsed'); $a = random(3,9,1); $ineq = "-$a x \leq 10"; # TeX $answer = Compute("x >= -10 / $a"); |
Setup:
We require students to use inequalities by using
We use |
Context()->texStrings; BEGIN_TEXT Solve the inequality \( \displaystyle $ineq \). Enter your answer using inequality notation. $BR $BR \{ ans_rule(40) \} \{ AnswerFormatHelp("inequalities") \} END_TEXT Context()->normalStrings; |
Main Text: |
$showPartialCorrectAnswers = 1; ANS( $answer->cmp() ); |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT("MathObject version."); ENDDOCUMENT(); |
Solution: |