Difference between revisions of "Specialized contexts"
m (SpecializedContexts moved to Specialized contexts: "CamelCase" not needed in mediawiki) |
|||
Line 36: | Line 36: | ||
** Allow complex numbers but not complex operations. |
** Allow complex numbers but not complex operations. |
||
* [http://webwork.maa.org/doc/cvs/pg_CURRENT/macros/contextLimitedNumeric.pl contextLimitedNumeric.pl] |
* [http://webwork.maa.org/doc/cvs/pg_CURRENT/macros/contextLimitedNumeric.pl contextLimitedNumeric.pl] |
||
− | ** ( [DEPRECATED] -- loadMacros("contextLimitedNumeric.pl") is not needed, these contexts are now standard. |
+ | ** ( [DEPRECATED] -- loadMacros("contextLimitedNumeric.pl") is not needed, these contexts are now standard and defined in <code>pg/lib/Parser/Legacy/LimitedNumeric.pm</code> |
− | ** <code>Context("LimitedNumeric |
+ | ** <code>Context("LimitedNumeric");</code> |
− | ** <code>Context(" |
+ | ** <code>Context("LimitedNumeric-List");</code> -- allows lists -- (need contextLimiteNumeric.pl for this) |
+ | ** <code>Context("LimitedNumeric-Fraction")</code> |
||
+ | ** <code>Context("LimitedNumeric-StrictFraction");</code> -- no decimals |
||
** Allows numeric entry but no operations. |
** Allows numeric entry but no operations. |
||
* [http://webwork.maa.org/doc/cvs/pg_CURRENT/macros/contextLimitedPoint.pl contextLimitedPoint.pl] |
* [http://webwork.maa.org/doc/cvs/pg_CURRENT/macros/contextLimitedPoint.pl contextLimitedPoint.pl] |
Revision as of 14:32, 14 November 2008
Specialized Contexts
Using advanced methods one can customize Contexts to control the possible student responses that are allowed
and the feedback given to students if their response has incorrect syntax.
These customizations can be placed in a macro file for reuse which by convention is given a
name starting with "context" -- e.g. contextYourContextHere.pl
.
The page ModifyingContexts(Advanced) contains information on the techniques and commands for doing this.
Examples are provided in the files listed below.
The other advanced method for customizing MathObjects is to modify the parser which translates "TI calculator" formulae into MathObjects. See SpecializedParsers
Specialized Context Macro files
Here is a partial list of contexts.
Check the POD documentation for more examples.
Use loadMacros("contextABCD.pl");
to make the context available for a WeBWorK question.
- contextABCD.pl
Context("ABCD");
Context("ABCD-List");
- Contexts for matching problems. Adds strings A, B, C, D as allowable entries.
- contextCurrency.pl
Context("Currency");
- Context for entering numbers with currency symbols and commas.
- contextInequalities.pl
Context(`Inequalities');
Context(`Inequalities-Only');
- Provides contexts that allow intervals to be specified as inequalities.
- contextIntegerFunctions.pl
Context("IntegerFunctions");
- adds integer related functions C(n,r) and P(n,r).
- contextLimitedComplex.pl
Context("LimitedComplex");
- Allow complex numbers but not complex operations.
- contextLimitedNumeric.pl
- ( [DEPRECATED] -- loadMacros("contextLimitedNumeric.pl") is not needed, these contexts are now standard and defined in
pg/lib/Parser/Legacy/LimitedNumeric.pm
Context("LimitedNumeric");
Context("LimitedNumeric-List");
-- allows lists -- (need contextLimiteNumeric.pl for this)Context("LimitedNumeric-Fraction")
Context("LimitedNumeric-StrictFraction");
-- no decimals- Allows numeric entry but no operations.
- ( [DEPRECATED] -- loadMacros("contextLimitedNumeric.pl") is not needed, these contexts are now standard and defined in
- contextLimitedPoint.pl
Context("LimitedPoint")
- Allow point entry but no point operations.
- contextLimitedPolynomial.pl
Context("LimitedPolynomial");
- Allow only entry of expanded polynomials.
- contextLimitedPowers.pl
LimitedPowers::NoBaseE();
LimitedPowers::OnlyIntegers();
LimitedPowers::OnlyPositiveIntegers();
LimitedPowers::OnlyNonNegativeIntegers();
- Restrict the base or power allowed in exponentials.
- contextLimitedVector.pl
Context("LimitedVector-coordinate");
Context("LimitedVector-ijk");
Context("LimitedVector");
# either one- Allow vector entry but no vector operations.
- contextPeriodic.pl
- [DEPRECATED] Features added to Real and Complex MathObjects classes.
- contextPiecewiseFunction.pl
Context("PiecewiseFuntion");
- Allow usage of piecewise functions.
- contextScientificNotation.pl
Context("ScientificNotation");
- Allows entry of scientific notation. Tries hard to report useful error messages when student's answer is not in the proper format.
- Experimental: may be renamed to LimitedScientifcNotation
- contextString.pl
- Use this context to allow restricted short answer (no mathematical symbols) questions.
- Feedback is provided if the response contains strings that are not allowed.
- contextTF.pl
Context("TF");