Most people write problems starting from templates. Problems from the OPL can be modified to suit individual needs, or existing problem templates can be used to create new problems.
- Problem Techniques This page lists templates for WeBWorK problems in alphabetical order. This collection of templates can also be accessed through the associated category page: Category:Problem Techniques
- Subject Area Templates Some may find it useful to use this page where templates are ordered by subject area.
- Sample_Problems A third page with a collection of templates is this page of sample problems. These are very basic examples that illustrate the structure of a WeBWorK problem.
WeBWorK problems should be written with the use of MathObjects, PG and PGML. MathObjects package things like numbers, vectors, matrices, etc., into a convenient form that controls formatting and includes an answer checker. PG provides many macros that generate random numbers, graphics, compute statistical distributions, etc. PGML gives authors finer control over a problem's display, and helps organize code in a way that is easy to maintain. Many older problems were written without PGML. Some were written without MathObjects, but that practice is now strongly discouraged except in very specific circumstances.
Most of the templates mentioned above use MathObjects, and many use PGML macros -- look for "MathObjects.pl" and "PGML.pl" in the LoadMacros section of the code. For learning the basics of coding problems the following pages are recommended:
- Problem Authoring Background Information -- includes a PG language overview, some comments about editing problems and ensuring server access.
- MathObjects -- information on authoring problems using MathObjects.
- PGML -- information on authoring problem using the PGML markup language.
- PG-Labs -- try out code fragments on line including code fragments containing MathObjects and PGML. This is a quick way to learn the fine points of the MathObject and PGML syntax.
- Learning How to Author Problems
- Writing Your Own Homework Problems Using PGML
- WeBWorK Problem Authoring Tutorial aimed at people who already know TeX, but need to learn about Perl, PG, and MathObjects (pdf file).
- University of Lethbridge programming examples and libraries
- Problem Authoring Videos, recordings from the PREP 2015 Problem Authoring Workshop.
Reference documents and manuals
- POD -- POD = "plain old documentation" -- original documentation embedded in the code files -- this is the place to find the most complete and most technical description of macro behaviors.
- Notes on training authors, and suggestions for further documentation-- Sam Hathaway
- The Good Questions project at Cornell University
- Converting CAPA problems for use with WeBWorK (This article has been retained as a historical document.)