Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section9.1Configuring a WeBWorK Course for MBX

We assume a mild familiarity with administrating a WeBWorK server. The version of WeBWorK needs to be 2.12 or later for use with MBX, although with version 2.11 all features should function except for latex output with server-based problems (see Subsection 9.3.2. Using the admin course, create a course named anonymous. In the course's Course Configuration menu, set all permissions to admin (or perhaps set some to the even more restrictive nobody). Except set “Allowed to login to the course” to login_proctor.

In the Classlist Editor, add a user named anonymous, and set that user's permission level to login_proctor, the permission level one higher than student. Set that user's password to anonymous. Note that because this is public information, anyone will be able to log into this course as user anonymous. This is why setting the permissions earlier is very important. (Especially preventing this user from changing its own password.)

Add the following lines to the course.conf file (which lives in the parent folder of the templates/ folder.)

# Hide message about previewing hints and solutions for instructors
$pg{specialPGEnvironmentVars}{ALWAYS_SHOW_HINT_PERMISSION_LEVEL} = 100;
$pg{specialPGEnvironmentVars}{ALWAYS_SHOW_SOLUTION_PERMISSION_LEVEL} = 100;

In the templates/macros/ folder, edit PGcourse.pl (or create it if need be) and add the lines:

#### Replace essay boxes with a message
sub essay_box {
    my $out = MODES(
        TeX => '',
        Latex2HTML => '',
        HTML => qq!<P>If you were logged into a WeBWorK course 
        and this problem were assigned to you, 
        you would be able to submit an essay answer 
        that would be graded later by a human being.</P>!
    );
    $out;
};

#### Suppress essay help link
sub essay_help {};

#### How many attempts until hint is available
$showHint = -1;
# May be a bug that WeBWorK requires -1 instead of 0
# for immediate access to hints

1;

Now both xsltproc with mathbook-html.xsl and the mbx script will be able to communicate with this course to retrieve what is needed.