Difference between revisions of "InequalityAnswer1"
Jump to navigation
Jump to search
Paultpearson (talk | contribs) m |
Paultpearson (talk | contribs) |
||
Line 5: | Line 5: | ||
This PG code shows a question whose answer is an inequality. |
This PG code shows a question whose answer is an inequality. |
||
</p> |
</p> |
||
− | * Download file: [[File:InequalityAnswer1.txt]] (change the file extension from txt to pg when you save it) |
||
+ | * File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Algebra/InequalityAnswer1.pg FortLewis/Authoring/Templates/Algebra/InequalityAnswer1.pg] |
||
− | * File location in NPL: <code>FortLewis/Authoring/Templates/Algebra/InequalityAnswer1.pg</code> |
||
<br clear="all" /> |
<br clear="all" /> |
Revision as of 22:19, 15 June 2013
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
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: |