We've just started to write some problems for the first time, and
we have some questions where to find the best and most up-to-date
problem templates. There seem to be an abundance of different styles
used when looking at a cross section of problems from the CVS. Below
are some questions we have. Thanks for any answers.
-- There are many styles, some of the disparity occurs because many of
the simplest problems were written first and we have since developed
more sophisticated, easier to maintain (but perhaps less intuitive)
ways to write problems. Unfortunately, the tutorial problems are NOT
the best model. I hope that we'll be able to update them this summer.
Jeff Holt is working on cleaning up many of the existing problems. I
hope that he will be able to post some of the guidelines he is using,
along with some example problems that the rest of us can follow.
- What macro packages should generally be loaded for simple numerial and/or function answer problems?
PGbasicmacros.pl, PGanswermacros.pl and PGauxiliaryFunctions.pl
(PGchoicemacros.pl and PGgraphmacros.pl are needed for multiple choice
type questions and questions using graphs, respectively. Other packages
may be needed for specialized answer evaluators.)
- What answer evaluators should be used for standard numerical and
function problems? num_cmp or std_num_cmp? fun_cmp or function_cmp?
--- Use num_cmp and fun_cmp. They are easier to maintain since they use
key/value pairs for options, rather than position. See the manpages for
options (http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/). The manpages are useful, but not yet complete.
- Some problems have complicated beginproblem statements with lots of arguments, including $BR, rtc. Is this necessary?
- Are there some "clean," recently coded problems in CVS I can use
as prototypes? -Or do the exaples on
represent "best coding practices?"
- Unfortunately the tutorials are often NOT current best practices,
although they work and represent the original style in which problems
were written. The tutorial manual by Tom Shemanske (new: http://webwork.dartmouth.edu/webwork_local/newbie-1.7/WeBWorK_newbie.pdf
) is much better, but also somewhat out of date.
- Is this the correct layout for a basic numerical problem?
(I've made some corrections.)
$showPartialCorrectAnswers = 1;
$var1 = random(50,90,1);
more variables defined here
$ans = ... ;
Problem text here<
Notice that ampersands are generally not needed (they were originally
required in Perl 4 to denote subroutines/functions, but function() is
more consistent with other languages than &function and probably
more intuitive for most mathematicians as well. One still uses
&function to pass a reference to a function, but that would occur
seldom if at all when writing problems.
<| Post or View Comments |>