From: Michael E. G. <ga...@ma...> - 2005-07-05 04:19:38
|
Hello all, I've made a chart of most of the macros currently available for use in WeBWorK problem (this includes macros from union_problib/macros, but not yet the macros from nau_problib/macros) It was made essentially by searching for /^sub / in the macro files, followed by a bit of text cleaning. You can find them displayed on the twiki at http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/PGmacrosByFile and at http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/ PGmacrosSortedAlphabetically The first link is easier to keep up to date. The chart is already slightly obsolete since I've made some changes in the macro files. I am also writing notes indicating which subroutines should be deprecated, which ones are really obsolete and should never be used, which ones are actually internal and should not be available to a problem writer and so forth. It's on the twiki, so you are all invited to help with the editing and notating. There are over 900 macros -- way too many -- so some consolidation is in order and the place to start would be to try to get a handle on what has already been produced and how they overlap. One of my desires is to replace the calls such as strict_num_cmp( $ans, .001,'%0.5f') by num_cmp($ans, relTol=>.001, format=>'%0.5f', mode=>'strict') and strict_num_cmp_list(.001, '%0.5f',$ans1, $ans2, $ans3); by num_cmp([$ans1, $ans2, $ans3], relTol=>.001, mode=>'strict', format=>'%o.5f'); perhaps a dozen different subroutines can be replaced by using num_cmp with either a single answer, or a reference to an array of answers and then followed by a list of parameters. This is fairly similar to the style that Mathematica uses and I think that it will be easier to remember, document and maintain. I'm thinking of placing these calls in a "PGcompatibility.pl" file where they can be called for those who want to use them, but taking them out of PGanswermacros.pl and modifying the problems in rochester_problib that use them. Similar savings can be made with the fun_cmp family. This will also cut down substantially on the size of PGanswermacros.pl I invite your comments. Reply to this list. Take care, Mike |