are there to order 2 white balls, 3 red balls and one greenball.
I have several questions:
1) How can I expand the set of functions recognized to include, in addition to
factorial (which is already included) the binomial function Binom(m,n) and the
multinomial function multi(m,n1,n2,n3,...,n_k) ? so that the students can use these functions in their answers and not get bogged down in numerical computations.
2) When the student chooses to see the correct answer, I would like the answer
to be the original formula (containing factorials, binomials etc) with a nice typeset, rather than the numeric answer? I do however, what to compare the correct answer to the student's answer numerically as there are many ways to compute the correct answer.
3) Is there a tutorial somewhere that explains some pedagogical approaches to WW? How to write questions that are more instructive, in other words, detect the correct parts of the student's answer, use hints and use a multi-step questions?
I'm sure others will chime in here, but to offer an approach to question (1). Permutations and combinations are defined in pg/lib/contextIntegerFunctions.pl.
So: Download this file and place a copy in your course macros directory (accessible from within the file manager). Macros in the course macros directory trump macros in pg/macros and those in the problem library. Then you can add custom functions which will be available when you load contextIntegerFunctions.pl in a loadMacros() statement.
Also, you might be interested in Nandor Sieben's collection of combinatorics problems:
Instructions for installing his graph theory library are here:
If you're on the MAA servers I believe this is available, and if not we can easily install it.
Hope this helps with (1).
Your pointers are very helpful.
What I find frustrating is finding all these different pieces of information...
Is there something like a reference manual or at least a master index for
I know about the webwork documentation wiki, but I find that very hard to navigate. Are there any usable PDF documents ?
These past few weeks I've been working hard on the documentation for MathObjects, at least from an authoring standpoint. So if you haven't looked there recently, you might try it and see if it is any better. I've reworked the introduction page, and added a number of new pages, including individual pages for each of the main MathObject classes. These give examples of creating and working with each type of object, what its answer-checker options are, and lists of its methods and properties.
I still have to work on the Context information, but hope to improve that as well.
There is not very much in the way of documentation about extending MathObjects, and that is definitely one of the things that needs work. A number of the sample problem techniques on the Wiki do this, but as far as I know, there isn't a comprehensive list for these.
There are some examples in the
pg/doc/MathObjectsdirectory, and I've also updated that documentation, which you can check out on my fork of
extensionsdirectory in particular give some examples of extending MathObjects in different ways.
Hope that helps a little.
Your Perl installation should include programs pod2html and pod2latex that can be used to convert .pod files to HTML and LaTeX (from whence you can generate PDF files).
You can use either the man command or the perldoc command to get instructions for using pod2html and pod2latex.
I managed to download the NAU/setCount problem files from Git.
I also managed to upload them using the File Manager.
However, I am failing to add the problems to a problem set on my account so that I can try them. Maybe this has to do with the .def file that visible
sets seem to have? How do I create this .def file ?
As an alternative, are all of the problems in the Git repository also available through the Library browser in WebWorks instructor tools?
In order to do your
multi() function, however, you will need to do a little more work, since these examples are only for one or two arguments. To do more than that, you will need to make a new subclass of the
Parser::Function class and implement a few additional methods that handle checking the parameters, evaluating the function, and so on.
There are no official examples for that, but the code at
pg/lib/Parser/Function/ are the ones that implement the existing functions. In particular,
numeric2.pm are the ones to look at.
_check() routine is the one that checks parameters during the parsing, and these call service routines that are in
lib/Parser/Function.pm. You would need to make your own version of these for handling arbitrary numbers of parameters (or at least even numbers). You would also need to make
_call() methods that handle arbitrary parameters.
I will see if I can work up an example for you, but you can start there yourself if you want.
As for question (2), the
formatStudentAnswer option for the answer checkers controls how the "entered" value is displayed. By default it is
"evaluated", meaning the final result, but you can change it to
"reduced" if you want to show the original formula instead. E.g.,
ANS($ans->cmp(formatStudentAnswer=>"parsed"));I don't know the answer to question (3). Multi-step questions are still not easy to produce, but people are working on that. There are some macros in
pg/macros/compoundProblem.plthat implement one approach, but it has its problems.
Hope that helps.
Is PGML compatible with CompoundProblems?
Going through the examples is helpful, but in order to work on new problems,
rather than edit old problems, it would be extremely useful to have a reference manual for PGML / MathObjects as well as for other more specialized items such as compound problems.
Without those I am just writing and praying...
A manual for the PGML markdown language would be particularly useful.
I saw some useful documentation in compoundProblem.pl but none in PGML.pl
Is PGML compatible with CompoundProblems?
It should be. I haven't tried it out specifically, but I don't see why not.
I have just completed an expansion of the MathObject documentation on the WeBWork Wiki, so that should be a much better reference than before. But you are right, there is nothing on PGML. I never quite finished PGML and still considered it in experimental shape when it was included in WeBWorK, and so had not done the documentation, and haven't gotten back to it. I had hoped to work on that this summer, but the other MathObject documentation took all my available time.
The compounProblem macros desperately need rewriting, but that will have to wait as well. But, as you say, at least there is some documentation there. The best I can offer for PGML is the PGML lab linked from the PGlabs wiki page. In the first link, Problem 1 is a lab for PGML and it has a number of examples that describe some of how it works. The "for reference" menus list all the commands, so perhaps that is some help.
The second problem was supposed to be a lab for the Typeset context (which is part of PGML), but it doesn't seem to be working at the moment.
The new documentation of MathObjects is great.
The annotated PGML problem is also great: http://webwork.maa.org/wiki/SampleProblem4
I wish there was some way for me to print out the list of PGML example problems (https://courses.webwork.maa.org/webwork2/cervone_course/PGML-examples/?login_practice_user=true) together with the source code, that could serve as searchable/browsable documentation. Without it switching back and forth between browser windows is tiresome.
The source for the problems is available in a link in the info box at
so perhaps you can print them as a group (or concatenate them into a single file) and print that. Would that do?