[system] / trunk / webwork2 / conf / global.conf.dist Repository:
ViewVC logotype

View of /trunk/webwork2/conf/global.conf.dist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3643 - (download) (annotate)
Wed Sep 21 20:26:29 2005 UTC (7 years, 8 months ago) by apizer
File size: 32646 byte(s)
fixed small typo

    1 #!perl
    2 ################################################################################
    3 # WeBWorK Online Homework Delivery System
    4 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/
    5 # $CVSHeader: webwork-modperl/conf/global.conf.dist,v 1.138 2005/09/16 19:08:13 sh002i Exp $
    6 #
    7 # This program is free software; you can redistribute it and/or modify it under
    8 # the terms of either: (a) the GNU General Public License as published by the
    9 # Free Software Foundation; either version 2, or (at your option) any later
   10 # version, or (b) the "Artistic License" which comes with this package.
   11 #
   12 # This program is distributed in the hope that it will be useful, but WITHOUT
   13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   14 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   15 # Artistic License for more details.
   16 ################################################################################
   17 
   18 # This file is used to set up the default WeBWorK course environment for all
   19 # requests. Values may be overwritten by the course.conf for a specific course.
   20 # All package variables set in this file are added to the course environment.
   21 # If you wish to set a variable here but omit it from the course environment,
   22 # use the "my" keyword. The $webwork_dir variable is set in the WeBWorK Apache
   23 # configuration file (webwork.apache-config) and is available for use here. In
   24 # addition, the $courseName variable holds the name of the current course.
   25 
   26 ################################################################################
   27 # Seed variables
   28 ################################################################################
   29 
   30 # Set these variables to correspond to your configuration and preferences. You
   31 # will need to restart the webserver to reset the variables in this section.
   32 
   33 # URL of WeBWorK handler.
   34 $webwork_url         = "/webwork2";
   35 
   36 # Root directory of PG.
   37 $pg_dir              = "/opt/pg";
   38 
   39 # URL and path to htdocs directory.
   40 $webwork_htdocs_url  = "/webwork2_files";
   41 $webwork_htdocs_dir  = "$webwork_dir/htdocs";
   42 
   43 # URL and path to courses directory.
   44 $webwork_courses_url = "/webwork2_course_files";
   45 $webwork_courses_dir = "$webwork_dir/courses";
   46 
   47 ################################################################################
   48 # Paths to external programs
   49 ################################################################################
   50 
   51 # system utilties
   52 $externalPrograms{mkdir}    = "/bin/mkdir";
   53 $externalPrograms{mv}       = "/bin/mv";
   54 $externalPrograms{mysql}    = "/usr/bin/mysql";
   55 $externalPrograms{tar}      = "/usr/bin/tar";
   56 
   57 # equation rendering/hardcopy utiltiies
   58 $externalPrograms{latex}    = "/usr/bin/latex";
   59 $externalPrograms{pdflatex} = "/usr/bin/pdflatex --shell-escape"; # --shell-escape allows pdflatex to handle .eps files
   60 $externalPrograms{dvipng}   = "/usr/bin/dvipng";
   61 $externalPrograms{tth}      = "/usr/bin/tth";
   62 
   63 # NetPBM - basic image manipulation utilities
   64 # most sites only need to configure $netpbm_prefix.
   65 my $netpbm_prefix = "/usr/bin";
   66 $externalPrograms{giftopnm} = "$netpbm_prefix/giftopnm";
   67 $externalPrograms{ppmtopgm} = "$netpbm_prefix/ppmtopgm";
   68 $externalPrograms{pnmtops}  = "$netpbm_prefix/pnmtops";
   69 $externalPrograms{pnmtopng} = "$netpbm_prefix/pnmtopng";
   70 $externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm";
   71 
   72 # image conversions utiltiies
   73 # the source file is given on stdin, and the output expected on stdout.
   74 #
   75 # Note on conversions pipelines:
   76 #     we used to use `pnmdepth 1' instead of ppmtopgm as it creates a
   77 #     monochrome image (1 bit) rather than a greyscale image (8 bits).
   78 #     However, this was causing improper display of some sort in PDFs.
   79 $externalPrograms{gif2eps}  = "$externalPrograms{giftopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null";
   80 $externalPrograms{png2eps}  = "$externalPrograms{pngtopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null";
   81 $externalPrograms{gif2png}  = "$externalPrograms{giftopnm} | $externalPrograms{pnmtopng}";
   82 
   83 ################################################################################
   84 # Mail settings
   85 ################################################################################
   86 
   87 # Mail sent by the PG system and the mail merge and feedback modules will be
   88 # sent via this SMTP server.
   89 $mail{smtpServer}            = 'mail.yourschool.edu';
   90 
   91 # When connecting to the above server, WeBWorK will send this address in the
   92 # MAIL FROM command. This has nothing to do with the "From" address on the mail
   93 # message. It can really be anything, but some mail servers require it contain
   94 # a valid mail domain, or at least be well-formed.
   95 $mail{smtpSender}            = 'webwork@yourserver.yourschool.edu';
   96 
   97 # AllowedRecipients defines addresses that the PG system is allowed to send mail
   98 # to. this prevents subtle PG exploits. This should be set in course.conf to the
   99 # addresses of professors of each course. Sending mail from the PG system (i.e.
  100 # questionaires, essay questions) will fail if this is not set somewhere (either
  101 # here or in course.conf).
  102 $mail{allowedRecipients}     = [
  103   #'prof1@yourserver.yourdomain.edu',
  104   #'prof2@yourserver.yourdomain.edu',
  105 ];
  106 
  107 # By default, feeback is sent to all users who have permission to
  108 # receive_feedback. If this list is non-empty, feedback is also sent to the
  109 # addresses specified here.
  110 #
  111 # * If you want to disable feedback altogether, leave this empty and set
  112 #   submit_feeback => $nobody in %permissionLevels below. This will cause the
  113 #   feedback button to go away as well.
  114 #
  115 # * If you want to send email ONLY to addresses in this list, set
  116 #   receive_feedback => $nobody in %permissionLevels below.
  117 #
  118 # It's often useful to set this in the course.conf to change the behavior of
  119 # feedback for a specific course.
  120 #
  121 $mail{feedbackRecipients}    = [
  122   #'prof1@yourserver.yourdomain.edu',
  123   #'prof2@yourserver.yourdomain.edu',
  124 ];
  125 
  126 # feedbackVerbosity:
  127 #  0: send only the feedback comment and context link
  128 #  1: as in 0, plus user, set, problem, and PG data
  129 #  2: as in 1, plus the problem environment (debugging data)
  130 $mail{feedbackVerbosity}     = 1;
  131 
  132 # Defines the size of the Mail Merge editor window
  133 # FIXME: should this be here? it's UI, not mail
  134 # FIXME: replace this with the auto-size method that TWiki uses
  135 $mail{editor_window_rows}    = 15;
  136 $mail{editor_window_columns} = 100;
  137 
  138 ################################################################################
  139 # System-wide locations (directories and URLs)
  140 ################################################################################
  141 
  142 # The root directory, set by webwork_root variable in Apache configuration.
  143 $webworkDirs{root}          = "$webwork_dir";
  144 
  145 # Location of system-wide data files.
  146 $webworkDirs{DATA}          = "$webworkDirs{root}/DATA";
  147 
  148 # Used for temporary storage of uploaded files.
  149 $webworkDirs{uploadCache}   = "$webworkDirs{DATA}/uploads";
  150 
  151 # Location of utility programs.
  152 $webworkDirs{bin}           = "$webworkDirs{root}/bin";
  153 
  154 # Location of configuration files, templates, snippets, etc.
  155 $webworkDirs{conf}          = "$webworkDirs{root}/conf";
  156 
  157 # Location of course directories.
  158 $webworkDirs{courses}       = "$webwork_courses_dir" || "$webworkDirs{root}/courses";
  159 
  160 # Contains log files.
  161 $webworkDirs{logs}          = "$webworkDirs{root}/logs";
  162 
  163 # Contains non-web-accessible temporary files, such as TeX working directories.
  164 $webworkDirs{tmp}           = "$webworkDirs{root}/tmp";
  165 
  166 # The (absolute) destinations of symbolic links that are OK for the FileManager to follow.
  167 #   (any subdirectory of these is a valid target for a symbolic link.)
  168 # For example:
  169 #    $webworkDirs{valid_symlinks} = ["$webworkDirs{courses}/modelCourse/templates","/ww2/common/sets"];
  170 $webworkDirs{valid_symlinks}   = [];
  171 
  172 ##### The following locations are web-accessible.
  173 
  174 # The root URL (usually /webwork2), set by <Location> in Apache configuration.
  175 $webworkURLs{root}          = "$webwork_url";
  176 
  177 # Location of system-wide web-accessible files, such as equation images, and
  178 # help files.
  179 $webworkDirs{htdocs}        = "$webwork_htdocs_dir" || "$webworkDirs{root}/htdocs";
  180 $webworkURLs{htdocs}        = "$webwork_htdocs_url";
  181 
  182 # Location of web-accessible temporary files, such as equation images.
  183 $webworkDirs{htdocs_temp}   = "$webworkDirs{htdocs}/tmp";
  184 $webworkURLs{htdocs_temp}   = "$webworkURLs{htdocs}/tmp";
  185 
  186 # Location of cached equation images.
  187 $webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations";
  188 $webworkURLs{equationCache} = "$webworkURLs{htdocs_temp}/equations";
  189 
  190 # Contains context-sensitive help files.
  191 $webworkDirs{local_help}    = "$webworkDirs{htdocs}/helpFiles";
  192 $webworkURLs{local_help}    = "$webworkURLs{htdocs}/helpFiles";
  193 
  194 # URL of general WeBWorK documentation.
  195 $webworkURLs{docs}          = "http://webhost.math.rochester.edu/webworkdocs/docs";
  196 
  197 # URL of WeBWorK 1.x profLogin.pl script, for access to old professor pages.
  198 # Note that both systems must share a single "courses" directory for this to be
  199 # useful. Leave this blank to disable
  200 $webworkURLs{oldProf}       = "/webwork1/profLogin.pl";
  201 
  202 # URL of WeBWorK Bugzilla database.
  203 $webworkURLs{bugReporter}   = "http://bugs.webwork.rochester.edu/";
  204 
  205 # Location of CSS
  206 $webworkURLs{stylesheet}    = "$webworkURLs{htdocs}/css/ur.css";
  207 
  208 # Location of jsMath script, used for the jsMath display mode.
  209 $webworkURLs{jsMath}        = "$webworkURLs{htdocs}/jsMath/jsMath-ww.js";
  210 
  211 # Location of ASCIIMathML script, used for the asciimath display mode.
  212 $webworkURLs{asciimath}     = "$webworkURLs{htdocs}/ASCIIMathML/ASCIIMathML.js";
  213 
  214 ################################################################################
  215 # Defaults for course-specific locations (directories and URLs)
  216 ################################################################################
  217 
  218 # The root directory of the current course. (The ID of the current course is
  219 # available in $courseName.)
  220 $courseDirs{root}        = "$webworkDirs{courses}/$courseName";
  221 
  222 # Location of course-specific data files, such as WW1 (GDBM) database files.
  223 $courseDirs{DATA}        = "$courseDirs{root}/DATA";
  224 
  225 # Location of authentication data files when using a WW1 (GDBM) database.
  226 $courseDirs{auth_DATA}   = "$courseDirs{DATA}/.auth";
  227 
  228 # Location of course HTML files, passed to PG.
  229 $courseDirs{html}        = "$courseDirs{root}/html";
  230 $courseURLs{html}        = "$webwork_courses_url/$courseName";
  231 
  232 # Location of course image files, passed to PG.
  233 $courseDirs{html_images} = "$courseDirs{html}/images";
  234 
  235 # Location of web-accessible, course-specific temporary files, like static and
  236 # dynamically-generated PG graphics.
  237 $courseDirs{html_temp}   = "$courseDirs{html}/tmp";
  238 $courseURLs{html_temp}   = "$courseURLs{html}/tmp";
  239 
  240 # Location of course-specific logs, like the transaction log.
  241 $courseDirs{logs}        = "$courseDirs{root}/logs";
  242 
  243 # Location of scoring files.
  244 $courseDirs{scoring}     = "$courseDirs{root}/scoring";
  245 
  246 # Location of PG templates and set definition files.
  247 $courseDirs{templates}   = "$courseDirs{root}/templates";
  248 
  249 # Location of course-specific macro files.
  250 $courseDirs{macros}      = "$courseDirs{templates}/macros";
  251 
  252 # Location of mail-merge templates.
  253 $courseDirs{email}       = "$courseDirs{templates}/email";
  254 
  255 ################################################################################
  256 # System-wide files
  257 ################################################################################
  258 
  259 # Location of this file.
  260 $webworkFiles{environment}                      = "$webworkDirs{conf}/global.conf";
  261 
  262 # Flat-file database used to protect against MD5 hash collisions. TeX equations
  263 # are hashed to determine the name of the image file. There is a tiny chance of
  264 # a collision between two TeX strings. This file allows for that. However, this
  265 # is slow, so most people chose not to worry about it. Set this to "" if you
  266 # don't want to use the equation cache file.
  267 $webworkFiles{equationCacheDB}                  = ""; # "$webworkDirs{DATA}/equationcache";
  268 
  269 ##### Hardcopy snippets are used in constructing a TeX file for hardcopy output.
  270 ##### They should contain TeX code unless otherwise noted.
  271 
  272 # The preamble is the first thing in the TeX file.
  273 $webworkFiles{hardcopySnippets}{preamble}       = "$webworkDirs{conf}/snippets/hardcopyPreamble.tex";
  274 
  275 # The setHeader preceeds each set. It is a PG file.
  276 $webworkFiles{hardcopySnippets}{setHeader}      = "$webworkDirs{conf}/snippets/setHeader.pg";  # hardcopySetHeader.pg",
  277 
  278 # The problem divider goes between problems.
  279 $webworkFiles{hardcopySnippets}{problemDivider} = "$webworkDirs{conf}/snippets/hardcopyProblemDivider.tex";
  280 
  281 # The set footer goes after each set. Is is a PG file.
  282 $webworkFiles{hardcopySnippets}{setFooter}      = "$webworkDirs{conf}/snippets/hardcopySetFooter.pg";
  283 
  284 # The set divider goes between sets (in multiset output).
  285 $webworkFiles{hardcopySnippets}{setDivider}     = "$webworkDirs{conf}/snippets/hardcopySetDivider.tex";
  286 
  287 # The user divider does between users (in multiuser output).
  288 $webworkFiles{hardcopySnippets}{userDivider}    = "$webworkDirs{conf}/snippets/hardcopyUserDivider.tex";
  289 
  290 # The postabmle is the last thing in the TeX file.
  291 $webworkFiles{hardcopySnippets}{postamble}      = "$webworkDirs{conf}/snippets/hardcopyPostamble.tex";
  292 
  293 ##### Screen snippets are used when displaying problem sets on the screen.
  294 
  295 # The set header is displayed on the problem set page. It is a PG file.
  296 $webworkFiles{screenSnippets}{setHeader}        = "$webworkDirs{conf}/snippets/setHeader.pg"; # screenSetHeader.pg"
  297 
  298 # A PG template for creation of new problems.
  299 $webworkFiles{screenSnippets}{blankProblem}    = "$webworkDirs{conf}/snippets/blankProblem.pg"; # screenSetHeader.pg"
  300 
  301 # A site info  "message of the day" file
  302 $webworkFiles{site_info}                       = "$webworkDirs{htdocs}/site_info.txt";
  303 ################################################################################
  304 # Course-specific files
  305 ################################################################################
  306 
  307 # The course configuration file.
  308 $courseFiles{environment} = "$courseDirs{root}/course.conf";
  309 
  310 # File contents are displayed after login, on the problem sets page. Path given
  311 # here is relative to the templates directory.
  312 $courseFiles{course_info} = "course_info.txt";
  313 
  314 # File contents are displayed on the login page. Path given here is relative to
  315 # the templates directory.
  316 $courseFiles{login_info}  = "login_info.txt";
  317 
  318 # Additional library buttons can be added to the Library Browser (SetMaker.pm)
  319 # by adding the libraries you want to the following line.  For each key=>value
  320 # in the list, if a directory (or link to a directory) with name 'key' appears
  321 # in the templates directory, then a button with name 'value' will be placed at
  322 # the top of the problem browser.  (No button will appear if there is no
  323 # directory or link with the given name in the templates directory.)  For
  324 # example,
  325 #
  326 #     $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"};
  327 #
  328 # would add two buttons, one for the Rochester library and one for the ASU
  329 # library, provided templates/rochester and templates/asu exists either as
  330 # subdirectories or links to other directories.
  331 #
  332 $courseFiles{problibs}    = {
  333 #   rochesterLibrary => "Rochester",
  334 #   asuLibrary       => "Arizona State",
  335 #   dcdsLibrary      => "Detroit CDS",
  336 #   dartmouthLibrary => "Dartmouth",
  337 #   indianaLibrary   => "Indiana",
  338 #   osuLibrary       => "Ohio State",
  339 #   capaLibrary      => "CAPA",
  340 };
  341 
  342 ################################################################################
  343 # Database options (WWDBv3)
  344 ################################################################################
  345 
  346 # The four arguments passed to the DBI::connect() method. See the DBI manual for
  347 # more information.
  348 $wwdbv3_settings{dsn}          = "dbi:mysql:wwdbv3";
  349 $wwdbv3_settings{user}         = "wwdbv3";
  350 $wwdbv3_settings{pass}         = "xyzzy";
  351 $wwdbv3_settings{attr}         = {};
  352 
  353 # WWDBv3 needs a lock file to prevent concurrent database upgrades. The file
  354 # will be locked with flock().
  355 $wwdbv3_settings{upgrade_lock} = "$webworkDirs{tmp}/wwdbv3_upgrade.lock";
  356 
  357 ################################################################################
  358 # Database options (WWDBv2)
  359 ################################################################################
  360 
  361 # Several database are defined in the file conf/database.conf and stored in the
  362 # hash %dbLayouts.
  363 include "conf/database.conf";
  364 
  365 # Select the default database layout. This can be overridden in the course.conf
  366 # file of a particular course. If you choose "gdbm", WeBWorK will be able to
  367 # use courses from WeBWorK 1 without first adding course.conf files to them.
  368 # However, the recommended database layout for new courses is "sql_single". This
  369 # can be set when creating a course.
  370 $dbLayoutName = "sql_single"; # or "gdbm" or "sql"
  371 
  372 # This sets the symbol "dbLayout" as an alias for the selected database layout.
  373 *dbLayout     = $dbLayouts{$dbLayoutName};
  374 
  375 ################################################################################
  376 # Problem library options
  377 ################################################################################
  378 
  379 # The directory containing the problem library files. Set to "" if no problem
  380 # library is installed.
  381 $problemLibrary{root}        = "";
  382 
  383 # Problem Library version
  384 # Version 1 is in use.  Version 2 will be released soon.
  385 $problemLibrary{version} = "1";
  386 
  387 # The name of the SQL database containing problem metadata
  388 $problemLibrary{sourceSQL}   = "ProblemLibrary";
  389 
  390 # The user name to use when connecting to the problem library database
  391 $problemLibrary{userSQL}     = "webworkRead";
  392 
  393 # The password to use when connecting to the problem library database
  394 $problemLibrary{passwordSQL} = "";
  395 
  396 ################################################################################
  397 # Logs
  398 ################################################################################
  399 
  400 # FIXME: take logs out of %webworkFiles/%courseFiles and give them their own
  401 # top-level hash.
  402 
  403 # Logs data about how long it takes to process problems. (Do not confuse this
  404 # with the /other/ timing log which can be set by WeBWorK::Timing and is used
  405 # for benchmarking system performance in general. At some point, this timing
  406 # mechanism will be deprecated in favor of the WeBWorK::Timing mechanism.)
  407 $webworkFiles{logs}{timing}         = "$webworkDirs{logs}/timing.log";
  408 
  409 # Logs courses created via the web-based Course Administration module.
  410 $webworkFiles{logs}{hosted_courses} = "$webworkDirs{logs}/hosted_courses.log";
  411 
  412 # The transaction log contains data from each recorded answer submission. This
  413 # is useful if the database becomes corrupted.
  414 $webworkFiles{logs}{transaction}    = "$courseDirs{logs}/transaction.log";
  415 
  416 # The answer log stores a history of all users' submitted answers.
  417 $courseFiles{logs}{answer_log}      = "$courseDirs{logs}/answer_log";
  418 
  419 # Log logins.
  420 $courseFiles{logs}{login_log}       = "$courseDirs{logs}/login.log";
  421 
  422 # Log for almost every click.  By default it is the empty string, which
  423 # turns this log off.  If you want it turned on, we suggest
  424 #                "$courseDirs{logs}/activity.log"
  425 # When turned on, this log can get quite large.
  426 $courseFiles{logs}{activity_log} = '';
  427 
  428 ################################################################################
  429 # Site defaults (FIXME: what other things could be "site defaults"?)
  430 ################################################################################
  431 
  432 # Status strings -- lists valid status values and their names. If your site uses
  433 # additional values, add them here.
  434 $siteDefaults{status} = {
  435   A        => "Audit",
  436   a        => "Audit",
  437   audit    => "Audit",
  438   D        => "Drop",
  439   d        => "Drop",
  440   drop     => "Drop",
  441   withdraw => "Drop",
  442   C        => "Enrolled",
  443   c        => "Enrolled",
  444   current  => "Enrolled",
  445   enrolled => "Enrolled",
  446 };
  447 
  448 # Set the default timezone of courses on this server. To get a list of valid
  449 # timezones, run:
  450 #
  451 #     perl -MDateTime::TimeZone -e 'print join "\n", DateTime::TimeZone::all_names'
  452 #
  453 # To get a list of valid timezone "links" (deprecated names), run:
  454 #
  455 #     perl -MDateTime::TimeZone -e 'print join "\n", DateTime::TimeZone::links'
  456 #
  457 # If left blank, the system timezone will be used. This is usually what you
  458 # want. You might want to set this if your server is NOT in the same timezone as
  459 # your school. If just a few courses are in a different timezone, set this in
  460 # course.conf for the affected courses instead.
  461 #
  462 $siteDefaults{timezone} = "";
  463 
  464 # The default_templates_course is used by default to create a new course.
  465 # The contents of the templates directory are copied from this course
  466 # to the new course being created.
  467 $siteDefaults{default_templates_course} ="modelCourse";
  468 
  469 ################################################################################
  470 # Frontend options
  471 ################################################################################
  472 
  473 %templates = (
  474   system => "$webworkDirs{conf}/templates/ur.template",
  475   gateway => "$webworkDirs{conf}/templates/gw.template",
  476 );
  477 
  478 ################################################################################
  479 # Authorization system
  480 ################################################################################
  481 
  482 # This lets you specify a minimum permission level needed to perform certain
  483 # actions. For each pair in the hash below, in order to perform the action
  484 # described by the key, the user must have a permission level greater than or
  485 # equal to the value.
  486 
  487 my $guest     = -1;
  488 my $student   = 0;
  489 my $proctor   = 2;
  490 my $ta        = 5;
  491 my $professor = 10;
  492 my $nobody    = undef;
  493 
  494 %permissionLevels = (
  495   login                          => $guest,
  496   report_bugs                    => $student,
  497   submit_feedback                => $student,
  498   change_password                => $student,
  499   change_email_address           => $student,
  500 
  501   proctor_quiz                   => $proctor,
  502 
  503   view_multiple_sets             => $ta,
  504   view_unopened_sets             => $ta,
  505   view_unpublished_sets          => $ta,
  506   view_answers                   => $ta,
  507 
  508   become_student                 => $professor,
  509   access_instructor_tools        => $ta,
  510   score_sets                     => $professor,
  511   send_mail                      => $professor,
  512   receive_feedback               => $ta,
  513 
  514   create_and_delete_problem_sets => $professor,
  515   assign_problem_sets            => $professor,
  516   modify_problem_sets            => $professor,
  517   modify_student_data            => $professor,
  518   modify_classlist_files         => $professor,
  519   modify_set_def_files           => $professor,
  520   modify_scoring_files           => $professor,
  521   modify_problem_template_files  => $professor,
  522 
  523   create_and_delete_courses      => $professor,
  524   fix_course_databases           => $professor,
  525 
  526   ##### Behavior of the interactive problem processor #####
  527 
  528   show_correct_answers_before_answer_date         => $ta,
  529   show_solutions_before_answer_date               => $ta,
  530   avoid_recording_answers                         => $ta,
  531   # Below this level, old answers are never initially shown
  532   can_show_old_answers_by_default                 => $student,
  533   # at this level, we look at showOldAnswers for default value
  534   # even after the due date
  535   can_always_use_show_old_answers_default         => $professor,
  536   check_answers_before_open_date                  => $ta,
  537   check_answers_after_open_date_with_attempts     => $ta,
  538   check_answers_after_open_date_without_attempts  => $guest,
  539   check_answers_after_due_date                    => $guest,
  540   check_answers_after_answer_date                 => $guest,
  541   record_answers_when_acting_as_student           => $nobody,
  542   # "record_answers_when_acting_as_student" takes precedence
  543   # over the following for professors acting as students:
  544   record_answers_before_open_date                 => $nobody,
  545   record_answers_after_open_date_with_attempts    => $student,
  546   record_answers_after_open_date_without_attempts => $nobody,
  547   record_answers_after_due_date                   => $nobody,
  548   record_answers_after_answer_date                => $nobody,
  549   dont_log_past_answers                           => $professor,
  550 
  551   ##### Behavior of the Hardcopy Processor #####
  552 
  553   download_hardcopy_multiuser  => $ta,
  554   download_hardcopy_multiset   => $ta,
  555   download_hardcopy_format_tex => $ta,
  556 );
  557 
  558 ################################################################################
  559 # Session options
  560 ################################################################################
  561 
  562 # $sessionKeyTimeout defines seconds of inactivity before a key expires
  563 $sessionKeyTimeout = 60*30;
  564 
  565 # $sessionKeyLength defines the length (in characters) of the session key
  566 $sessionKeyLength = 40;
  567 
  568 # @sessionKeyChars lists the legal session key characters
  569 @sessionKeyChars = ('A'..'Z', 'a'..'z', '0'..'9', '.', '^', '/', '!', '*');
  570 
  571 # Practice users are users who's names start with $practiceUser
  572 # (you can comment this out to remove practice user support)
  573 $practiceUserPrefix = "practice";
  574 
  575 # There is a practice user who can be logged in multiple times.  He's
  576 # commented out by default, though, so you don't hurt yourself.  It is
  577 # kindof a backdoor to the practice user system, since he doesn't have a
  578 # password.  Come to think of it, why do we even have this?!
  579 #$debugPracticeUser = "practice666";
  580 
  581 ################################################################################
  582 # PG subsystem options
  583 ################################################################################
  584 
  585 # List of enabled display modes. Comment out any modes you don't wish to make
  586 # available for use.
  587 $pg{displayModes} = [
  588   "plainText",     # display raw TeX for math expressions
  589   "formattedText", # format math expressions using TtH
  590   "images",        # display math expressions as images generated by dvipng
  591   "jsMath",        # render TeX math expressions on the client side using jsMath
  592   "asciimath",     # render TeX math expressions on the client side using ASCIIMathML
  593 ];
  594 
  595 #### Default settings for the PG translator
  596 
  597 # Default display mode. Should be listed above.
  598 $pg{options}{displayMode}        = "images";
  599 
  600 # The default grader to use, if a problem doesn't specify.
  601 $pg{options}{grader}             = "avg_problem_grader";
  602 
  603 # Fill in answer blanks with the student's last answer by default?
  604 $pg{options}{showOldAnswers}     = 1;
  605 
  606 # Show correct answers (when allowed) by default?
  607 $pg{options}{showCorrectAnswers} = 0;
  608 
  609 # Show hints (when allowed) by default?
  610 $pg{options}{showHints}          = 0;
  611 
  612 # Show solutions (when allowed) by default?
  613 $pg{options}{showSolutions}      = 0;
  614 
  615 # Catch translation warnings internally by default? (We no longer need to do
  616 # this, since there is a global warnings handler. So this should be off.)
  617 $pg{options}{catchWarnings}      = 0;
  618 
  619 ##### Currently-selected renderer
  620 
  621 # Only the local renderer is supported in this version.
  622 $pg{renderer} = "WeBWorK::PG::Local";
  623 
  624 # The remote renderer connects to an XML-RPC PG rendering server.
  625 #$pg{renderer} = "WeBWorK::PG::Remote";
  626 
  627 ##### Renderer-dependent options
  628 
  629 # The remote renderer has one option:
  630 $pg{renderers}{"WeBWorK::PG::Remote"} = {
  631   # The "proxy" server to connect to for remote rendering.
  632   proxy => "http://localhost:21000/RenderD",
  633 };
  634 
  635 ##### Settings for various display modes
  636 
  637 # "images" mode has several settings:
  638 $pg{displayModeOptions}{images} = {
  639   # Determines the method used to align images in output. Can be
  640   # "baseline", "absmiddle", or "mysql".
  641   dvipng_align => 'baseline',
  642 
  643   # If we choose mysql, we need information on connecting to the
  644   # database. Whatever you use here, you have to create the database
  645   # and grant read/write priveleges to the user listed here. To create
  646   # the database in mysql, as root use:
  647   #
  648   #     CREATE DATABASE DvipngDepths;
  649   #     USE DvipngDepths;
  650   #     CREATE TABLE depths (md5 CHAR(33) NOT NULL, depth SMALLINT, PRIMARY KEY (md5));
  651   #     GRANT ALL ON DvipngDepths.* TO webworkWrite;
  652   #
  653   # In the last statement, "webworkWrite" should match the user below.
  654   # FIXME: this database can become a table in the 'webwork' database
  655   dvipng_depth_db => {
  656     dbsource => 'dbi:mysql:DvipngDepths',
  657     user     => $dbLayouts{sql}->{password}->{params}->{usernameRW},
  658     passwd   => $dbLayouts{sql}->{password}->{params}->{passwordRW},
  659   },
  660 };
  661 
  662 $pg{displayModeOptions}{jsMath} = {
  663   reportMissingFonts => 0,       # set to 1 to allow the missing font message
  664   missingFontMessage => undef,   # set to an HTML string to replace the missing font message
  665   noImageFonts => 0,             # set to 1 if you didn't install the jsMath image fonts
  666 };
  667 
  668 ##### Directories used by PG
  669 
  670 # The root of the PG directory tree (from pg_root in Apache config).
  671 $pg{directories}{root}   = "$pg_dir";
  672 $pg{directories}{lib}    = "$pg{directories}{root}/lib";
  673 $pg{directories}{macros} = "$pg{directories}{root}/macros";
  674 
  675 #
  676 #  The macro file search path.  Each directory in this list is seached
  677 #  (in this order) by loadMacros() when it looks for a .pl file.
  678 #
  679 $pg{directories}{macrosPath} = [
  680    ".",                     # search the problem file's directory
  681    $courseDirs{macros},
  682    $pg{directories}{macros},
  683 ];
  684 
  685 ##### "Special" PG environment variables. (Stuff that doesn't fit in anywhere else.)
  686 
  687 # Users for whom to print the file name of the PG file being processed.
  688 $pg{specialPGEnvironmentVars}{PRINT_FILE_NAMES_FOR} = [ "professor", ];
  689 
  690 # Locations of CAPA resources. (Only necessary if you need to use converted CAPA
  691 # problems.)
  692 $pg{specialPGEnvironmentVars}{CAPA_Tools}             = "$courseDirs{macros}/CAPA_Tools/",
  693 $pg{specialPGEnvironmentVars}{CAPA_MCTools}           = "$courseDirs{macros}/CAPA_MCTools/",
  694 $pg{specialPGEnvironmentVars}{CAPA_GraphicsDirectory} = "$courseDirs{html}/CAPA_Graphics/",
  695 $pg{specialPGEnvironmentVars}{CAPA_Graphics_URL}      = "$courseURLs{html}/CAPA_Graphics/",
  696 
  697 # Size in pixels of dynamically-generated images, i.e. graphs.
  698 $pg{specialPGEnvironmentVars}{onTheFlyImageSize}      = 400,
  699 
  700 # To activate Parser-based versions of num_cmp and fun_cmp, change this
  701 # value to 0.
  702 $pg{specialPGEnvironmentVars}{useOldAnswerMacros} = 1;
  703 
  704 # Strings to insert at the start and end of the body of a problem
  705 #  (at beginproblem() and ENDDOCUMENT) in various modes.  More display modes
  706 #  can be added if different behaviours are desired (e.g., HTML_dpng,
  707 #  HTML_asciimath, etc.).  These parts are not used in the Library browser.
  708 
  709 $pg{specialPGEnvironmentVars}{problemPreamble} = { TeX => '', HTML=> '' };
  710 $pg{specialPGEnvironmentVars}{problemPostamble} = { TeX => '', HTML=>'' };
  711 
  712 # To have the problem body indented and boxed, uncomment:
  713 
  714 # $pg{specialPGEnvironmentVars}{problemPreamble}{HTML} = '<BLOCKQUOTE>
  715 #     <TABLE BORDER=1 CELLSPACING=1 CELLPADDING=15 BGCOLOR=#E8E8E8><TR><TD>';
  716 # $pg{specialPGEnvironmentVars}{problemPostamble}{HTML} = '</TD></TR></TABLE>
  717 #     </BLOCKQUOTE>';
  718 
  719 ##### PG modules to load
  720 
  721 # The first item of each list is the module to load. The remaining items are
  722 # additional packages to import.
  723 
  724 ${pg}{modules} = [
  725   [qw(DynaLoader)],
  726   [qw(Exporter)],
  727   [qw(GD)],
  728 
  729   [qw(AlgParser AlgParserWithImplicitExpand Expr ExprWithImplicitExpand utf8)],
  730   [qw(AnswerHash AnswerEvaluator)],
  731   [qw(WWPlot)], # required by Circle (and others)
  732   [qw(Circle)],
  733   [qw(Complex)],
  734   [qw(Complex1)],
  735   [qw(Distributions)],
  736   [qw(Fraction)],
  737   [qw(Fun)],
  738   [qw(Hermite)],
  739   [qw(Label)],
  740   [qw(List)],
  741   [qw(Match)],
  742   [qw(MatrixReal1)], # required by Matrix
  743   [qw(Matrix)],
  744   [qw(Multiple)],
  745   [qw(PGrandom)],
  746   [qw(Regression)],
  747   [qw(Select)],
  748   [qw(Units)],
  749   [qw(VectorField)],
  750   [qw(Parser Value)],
  751   [qw(Parser::Legacy)],
  752   [qw(Apache::Log)],
  753 ];
  754 
  755 ##### Answer evaluatior defaults
  756 
  757 $pg{ansEvalDefaults} = {
  758   functAbsTolDefault            => .001,
  759   functLLimitDefault            => .0000001,
  760   functMaxConstantOfIntegration => 1E8,
  761   functNumOfPoints              => 3,
  762   functRelPercentTolDefault     => .1,
  763   functULimitDefault            => .9999999,
  764   functVarDefault               => "x",
  765   functZeroLevelDefault         => 1E-14,
  766   functZeroLevelTolDefault      => 1E-12,
  767   numAbsTolDefault              => .001,
  768   numFormatDefault              => "",
  769   numRelPercentTolDefault       => .1,
  770   numZeroLevelDefault           => 1E-14,
  771   numZeroLevelTolDefault        => 1E-12,
  772   useBaseTenLog                 => 0,
  773   defaultDisplayMatrixStyle     => "[s]",
  774 };
  775 
  776 ################################################################################
  777 # Compatibility
  778 ################################################################################
  779 
  780 # Define the old names for the various "root" variables.
  781 $webworkRoot    = $webworkDirs{root};
  782 $webworkURLRoot = $webworkURLs{root};
  783 $pgRoot         = $pg{directories}{root};

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9