[system] / trunk / webwork-modperl / conf / global.conf.dist Repository:
ViewVC logotype

View of /trunk/webwork-modperl/conf/global.conf.dist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3564 - (download) (annotate)
Wed Aug 24 20:22:32 2005 UTC (7 years, 9 months ago) by jj
File size: 31715 byte(s)
Make it so that by default, practice users don't see saved answers.  That can be controlled in global.conf.dist.  Also, default to not showing saved answers after the due date.  In all cases, the Apply options button can adjust what you want.

Also fixed a bug with showOldAnswers related to '', 0, and undef being similar in perl.

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9