Forum archive 2000-2006

Michael Gage -

Michael Gage -

by Arnold Pizer -
Number of replies: 0 topic started 9/14/2004; 2:09:41 PM
last post 9/14/2004; 2:09:41 PM
userMichael Gage -  blueArrow
9/14/2004; 2:09:41 PM (reads: 1959, responses: 0)

NAME -- located in the pg/macros directory


    Macros contributed by John Jones


    Usage: ANS(auto_right());
ANS(auto_right("this answer can be left blank"));

This answer checker marks any answer correct. It is useful when you want to leave multiple answer blanks, only some of which will be used. If you turn off showing partial correct answers and partial credit, the effect is not visible to the students. The comment in the second case is what will be displayed as the correct answer. This helps avoid confusion.


Can be wrapped around an numerical evaluation. It marks the answer wrong if it contains a decimal point. Usage:


This will accept "sqrt(3)" or "3^(1/2)" as answers, but not 1.7320508


Wrapper for other answer evaluators. It insists that a string is part of the answer to be marked right.


Wrapper for other answer evaluators. It marks the answer wrong if it contains one of the six basic trig functions.

This is useful if you want students to report the value of sin(pi/4), but you don't want to allow "sin(pi/4)" as the answer.




Filter for checking that an answer has (or doesn't have) a certain string in it. This can be used to screen answers where you want them in a particular form (e.g., if you allow most functions, but not trig functions in the answer, or if the answer must include some string).

First argument is the string to have, or not have
Second argument is optional, and tells us whether yes or no
Third argument is the error message to produce (if any).






    # Wrapper for an answer evaluator which can also supply comments


        # Wrapper for multiple answer evaluators, it takes a list of the following 
as inputs
# [answer_evaluator, partial credit factor, comment]
# it applies evaluators from the list until it hits one with positive credit,
# weights it by the partial credit factor, and throws in its comment


This is a grader which weights the different parts of the problem differently. The weights passed to it through the environment. In the problem:

 $ENV{'partial_weights'} = [.2,.2,.2,.3];

This will soon be superceded by a better grader.

File path = /ww/webwork/pg/macros/

<| Post or View Comments |>