DisableFunctions1
Jump to navigation
Jump to search
Disabling Functions so Students Must Simplify Answers
This PG code shows how to disable all functions and restrict student answers to fractions.
- Download file: File:DisableFunctions1.txt (change the file extension from txt to pg when you save it)
- File location in NPL:
NationalProblemLibrary/FortLewis/Authoring/Templates/Trig/DisableFunctions1.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "contextFractions.pl", ); TEXT(beginproblem()); |
Initialization: |
Context("Fraction-NoDecimals"); $x = Formula("cos(pi)"); $y = Formula("sin(pi/3)"); |
Setup: |
Context()->texStrings; BEGIN_TEXT Enter your answers as simplified fractions. $BR $BR \( $x = \) \{ ans_rule(20) \} \{ AnswerFormatHelp("fractions") \} $BR $BR \( $y = \) \{ ans_rule(20) \} \{ AnswerFormatHelp("fractions") \} END_TEXT Context()->normalStrings; |
Main Text: |
$showPartialCorrectAnswers = 1; ANS( Real($x->eval)->cmp() ); ANS( Real($y->eval)->cmp() ); |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |