Converting CAPA problems for use with WeBWorK

From WeBWorK_wiki
Jump to navigation Jump to search
This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

First you will need to translate the original CAPA problems into the PG language. We have a perl script which will do 95% of the translation automatically. Write gage@math.rochester.edu for a copy. (N.B.: Some assembly required.) You must already own the CAPA problems, since we cannot distribute them. Once translated the CAPA problems are placed set subdirectories in the templates directory as usual.

The translated copies require some special runtime macros and in order to access the macros. Verify that the following lines are set in global.conf:

# Locations of CAPA resources. (Only necessary if you need to use converted CAPA
# problems.)
$pg{specialPGEnvironmentVars}{CAPA_Tools}             = "$courseDirs{macros}/CAPA_Tools/", 
$pg{specialPGEnvironmentVars}{CAPA_MCTools}           = "$courseDirs{macros}/CAPA_MCTools/",  
$pg{specialPGEnvironmentVars}{CAPA_GraphicsDirectory} = "$courseDirs{html}/CAPA_Graphics/", 
$pg{specialPGEnvironmentVars}{CAPA_Graphics_URL}      = "$courseURLs{html}/CAPA_Graphics/",   

The html directory for the course needs to contain an entry called CAPA_Graphics which either is a directory of graphics or links to a directory of graphics for CAPA.

The templates/macros directory for the course must contain the subdirectories CAPA_Tools and CAPA_MCTools and their contents or else it must contain links to those directories. (Forgetting this link is the most common of the difficulties encountered when starting a CAPA course.)

Finally, the templates/macros directory for the course must contain the file PG_CAPAmacros.pl.

You also need to make some changes to the texSetPreamble.tex file in order to provide tex macros used routinely by CAPA problems. Here are the additions that are needed:

% capa graphics
\usepackage{epsf}

%capa tex macros
\newcommand{\capa}{{\sl C\kern-.10em\raise-.00ex\hbox{\rm A}\kern-.22em%
	{\sl P}\kern-.14em\kern-.01em{\rm A}}}

\newenvironment{choicelist}
{\begin{list}{}
        {\setlength{\rightmargin}{0in}
         \setlength{\leftmargin}{0.13in}
         \setlength{\topsep}{0.05in}
         \setlength{\itemsep}{0.022in}
         \setlength{\parsep}{0in}
         \setlength{\belowdisplayskip}{0.04in}
         \setlength{\abovedisplayskip}{0.05in}
         \setlength{\abovedisplayshortskip}{-0.04in}
         \setlength{\belowdisplayshortskip}{0.04in}}
        }
{\end{list}} 

You may also wish to adjust some other parameters to adjust the output of the printed problem sets.