--- trunk/webwork2/conf/global.conf.dist 2003/06/18 23:04:51 1210 +++ trunk/webwork2/conf/global.conf.dist 2005/07/12 00:52:00 3365 @@ -1,183 +1,512 @@ #!perl ################################################################################ -# WeBWorK mod_perl (c) 1995-2002 WeBWorK Team, Univeristy of Rochester -# $Id: global.conf.dist,v 1.33 2003-06-18 23:04:51 malsyned Exp $ +# WeBWorK Online Homework Delivery System +# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ +# $CVSHeader: webwork2/conf/global.conf.dist,v 1.120 2005/07/02 16:52:30 dpvc Exp $ +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of either: (a) the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version, or (b) the "Artistic License" which comes with this package. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the +# Artistic License for more details. ################################################################################ # This file is used to set up the default WeBWorK course environment for all # requests. Values may be overwritten by the course.conf for a specific course. # All package variables set in this file are added to the course environment. # If you wish to set a variable here but omit it from the course environment, -# use the "my" keyword. The following variables are available to this file: -# -# $webworkRoot directory that contains the WeBWorK distribution -# $webworkURL base URL handled by Apache::WeBWorK -# $pgRoot directory that contains the PG distribution -# $courseName name of the course being used - -################################################################################ -# WeBWorK settings -################################################################################ - -%webworkDirs = ( - root => "$webworkRoot", - bin => "$webworkRoot/bin", - conf => "$webworkRoot/conf", - courses => "$webworkRoot/courses", - lib => "$webworkRoot/lib", - logs => "$webworkRoot/logs", - macros => "$pgRoot/macros", - tmp => "$webworkRoot/tmp", -); +# use the "my" keyword. The $webwork_dir variable is set in the WeBWorK Apache +# configuration file (webwork.apache-config) and is available for use here. In +# addition, the $courseName variable holds the name of the current course. -%webworkFiles = ( - environment => "$webworkDirs{conf}/global.conf", - hardcopySnippets => { - preamble => "$webworkDirs{conf}/snippets/hardcopyPreamble.tex", - setHeader => "$webworkDirs{conf}/snippets/hardcopySetHeader.pg", - problemDivider => "$webworkDirs{conf}/snippets/hardcopyProblemDivider.tex", - setFooter => "$webworkDirs{conf}/snippets/hardcopySetFooter.pg", - setDivider => "$webworkDirs{conf}/snippets/hardcopySetDivider.tex", - userDivider => "$webworkDirs{conf}/snippets/hardcopyUserDivider.tex", - postamble => "$webworkDirs{conf}/snippets/hardcopyPostamble.tex", - }, - screenSnippets => { - setHeader => "$webworkDirs{conf}/snippets/screenSetHeader.pg", - }, - logs => { - timing => "$webworkDirs{logs}/timing.log", - }, -); +################################################################################ +# Seed variables +################################################################################ -%webworkURLs = ( - root => "$webworkURLRoot", - home => "/webwork2_files/index.html", - htdocs => "/webwork2_files", - docs => "http://webhost.math.rochester.edu/webworkdocs/docs", - oldProf => "/webwork-old/profLogin.pl", -); +# Set these variables to correspond to your configuration and preferences. You +# will need to restart the webserver to reset the variables in this section. + +# URL of WeBWorK handler. +$webwork_url = "/webwork2"; + +# Root directory of PG. +$pg_dir = "/opt/pg"; + +# URL and path to htdocs directory. +$webwork_htdocs_url = "/webwork2_files"; +$webwork_htdocs_dir = "$webwork_dir/htdocs"; + +# URL and path to courses directory. +$webwork_courses_url = "/webwork2_course_files"; +$webwork_courses_dir = "$webwork_dir/courses"; ################################################################################ -# Default course-specific settings +# Paths to external programs ################################################################################ -my $courseRoot = "$webworkDirs{courses}/$courseName"; -%courseDirs = ( - root => "$courseRoot", - DATA => "$courseRoot/DATA", - auth_DATA => "$courseRoot/DATA/.auth", - html => "$courseRoot/html", - html_images => "$courseRoot/html/images", - html_temp => "$courseRoot/html/tmp", - logs => "$courseRoot/logs", - scoring => "$courseRoot/scoring", - templates => "$courseRoot/templates", - macros => "$courseRoot/templates/macros", -); +$externalPrograms{mkdir} = "/bin/mkdir"; +$externalPrograms{mv} = "/bin/mv"; +$externalPrograms{mysql} = "/usr/local/bin/mysql"; -%courseFiles = ( - environment => "$courseDirs{root}/course.conf", - motd => "$courseDirs{root}/motd.txt", -); +$externalPrograms{latex} = "/usr/local/bin/latex"; +$externalPrograms{pdflatex} = "/usr/local/bin/pdflatex --shell-escape"; # allows pdflatex to handle .eps files +$externalPrograms{dvipng} = "/usr/local/bin/dvipng"; +$externalPrograms{tth} = "/usr/local/bin/tth"; -# quick hack to fix transaction logging. blah. -$webworkFiles{logs}->{transaction} = "$courseDirs{logs}/transaction.log"; -$webworkFiles{logs}->{pastAnswerList} = "$courseDirs{logs}/past_answers.log"; - -my $courseURLRoot = "$webworkURLs{htdocs}/courses/$courseName"; -%courseURLs = ( - root => "$courseURLRoot", - html => "$courseURLRoot", - html_temp => "$courseURLRoot/tmp", -); +$externalPrograms{tar} = "/usr/bin/tar"; ################################################################################ -# Other site-specific options +# Mail settings ################################################################################ -%mail = ( - smtpServer => "mail.math.rochester.edu", - smtpSender => "webwork\@math.rochester.edu", - # allowedRecipients defines addresses that the PG system is allowed to - # send mail to. this prevents subtle PG exploits. This should be set - # in course.conf to the addresses of professors of each course. Sending - # mail from the PG system (i.e. questionaires, essay questions) will - # fail if this is not set somewhere (either here or in course.conf). - #allowedRecipients => [ - # "yourname\@host.yourdomain.edu", - #], - # if defined, feedbackRecipients overrides the list of recipients for - # feedback email. It's appropriate to set this in the course.conf for - # specific courses, but probably not in global.conf. if not defined, - # mail is sent to all professors and TAs for a given course - #feedbackRecipients => [ - # "prof1\@host.yourdomain.edu", - # "prof2\@host.yourdomain.edu", - #], - # feedbackVerbosity: - # 0: send only the feedback comment and context link - # 1: as in 0, plus user, set, problem, and PG data - # 2: as in 1, plus the problem environment (debugging data) - feedbackVerbosity => 1, -); +# Mail sent by the PG system and the mail merge and feedback modules will be +# sent via this SMTP server. +$mail{smtpServer} = 'mail.yourschool.edu'; -%externalPrograms = ( - mkdir => "/bin/mkdir", - tth => "/usr/local/bin/tth", - pdflatex => "/usr/local/bin/pdflatex", - latex => "/usr/local/bin/latex", - #dvipng => "/usr/local/bin/dvipng -mode ljfivemp -D600 -Q6 -x1000.5 -bgTransparent", - dvipng => "/usr/local/bin/dvipng", - gif2eps => "$webworkDirs{bin}/gif2eps", - png2eps => "$webworkDirs{bin}/png2eps", - gif2png => "$webworkDirs{bin}/gif2png", -); +# When connecting to the above server, WeBWorK will send this address in the +# MAIL FROM command. This has nothing to do with the "From" address on the mail +# message. It can really be anything, but some mail servers require it contain +# a valid mail domain, or at least be well-formed. +$mail{smtpSender} = 'webwork@yourserver.yourschool.edu'; + +# AllowedRecipients defines addresses that the PG system is allowed to send mail +# to. this prevents subtle PG exploits. This should be set in course.conf to the +# addresses of professors of each course. Sending mail from the PG system (i.e. +# questionaires, essay questions) will fail if this is not set somewhere (either +# here or in course.conf). +$mail{allowedRecipients} = [ + #'prof1@yourserver.yourdomain.edu', + #'prof2@yourserver.yourdomain.edu', +]; + +# If defined, feedbackRecipients overrides the list of recipients for feedback +# email. It's appropriate to set this in the course.conf for specific courses, +# but probably not in global.conf. if not defined, mail is sent to all +# professors and TAs for a given course +#$mail{feedbackRecipients} = [ +# 'prof1@yourserver.yourdomain.edu', +# 'prof2@yourserver.yourdomain.edu', +#]; + +# feedbackVerbosity: +# 0: send only the feedback comment and context link +# 1: as in 0, plus user, set, problem, and PG data +# 2: as in 1, plus the problem environment (debugging data) +$mail{feedbackVerbosity} = 1; + +# Defines the size of the Mail Merge editor window +# FIXME: should this be here? it's UI, not mail +# FIXME: replace this with the auto-size method that TWiki uses +$mail{editor_window_rows} = 15; +$mail{editor_window_columns} = 100; ################################################################################ -# Frontend options +# System-wide locations (directories and URLs) ################################################################################ -%templates = ( - system => "$webworkDirs{conf}/templates/ur.template", -); +# The root directory, set by webwork_root variable in Apache configuration. +$webworkDirs{root} = "$webwork_dir"; + +# Location of system-wide data files. +$webworkDirs{DATA} = "$webworkDirs{root}/DATA"; + +# Used for temporary storage of uploaded files. +$webworkDirs{uploadCache} = "$webworkDirs{DATA}/uploads"; + +# Location of utility programs. +$webworkDirs{bin} = "$webworkDirs{root}/bin"; + +# Location of configuration files, templates, snippets, etc. +$webworkDirs{conf} = "$webworkDirs{root}/conf"; + +# Location of course directories. +$webworkDirs{courses} = "$webwork_courses_dir" || "$webworkDirs{root}/courses"; + +# Contains log files. +$webworkDirs{logs} = "$webworkDirs{root}/logs"; + +# Contains non-web-accessible temporary files, such as TeX working directories. +$webworkDirs{tmp} = "$webworkDirs{root}/tmp"; + +# The (absolute) destinations of symbolic links that are OK for the FileManager to follow. +# (any subdirectory of these is a valid target for a symbolic link.) +# For example: +# $webworkDirs{valid_symlinks} = ["$webworkDirs{courses}/modelCourse/templates","/ww2/common/sets"]; +$webworkDirs{valid_symlinks} = []; + +##### The following locations are web-accessible. + +# The root URL (usually /webwork2), set by in Apache configuration. +$webworkURLs{root} = "$webwork_url"; + +# Location of system-wide web-accessible files, such as equation images, and +# help files. +$webworkDirs{htdocs} = "$webwork_htdocs_dir" || "$webworkDirs{root}/htdocs"; +$webworkURLs{htdocs} = "$webwork_htdocs_url"; + +# Location of web-accessible temporary files, such as equation images. +$webworkDirs{htdocs_temp} = "$webworkDirs{htdocs}/tmp"; +$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp"; + +# Location of cached equation images. +$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations"; +$webworkURLs{equationCache} = "$webworkURLs{htdocs_temp}/equations"; + +# Contains context-sensitive help files. +$webworkDirs{local_help} = "$webworkDirs{htdocs}/helpFiles"; +$webworkURLs{local_help} = "$webworkURLs{htdocs}/helpFiles"; + +# URL of general WeBWorK documentation. +$webworkURLs{docs} = "http://webhost.math.rochester.edu/webworkdocs/docs"; + +# URL of WeBWorK 1.x profLogin.pl script, for access to old professor pages. +# Note that both systems must share a single "courses" directory for this to be +# useful. Leave this blank to disable +$webworkURLs{oldProf} = "/webwork1/profLogin.pl"; + +# URL of WeBWorK Bugzilla database. +$webworkURLs{bugReporter} = "http://bugs.webwork.rochester.edu/"; + +# Location of CSS +$webworkURLs{stylesheet} = "$webworkURLs{htdocs}/css/ur.css"; + +# Location of jsMath script, used for the jsMath display mode. +$webworkURLs{jsMath} = "$webworkURLs{htdocs}/jsMath/jsMath.js"; + +# Location of ASCIIMathML script, used for the asciimath display mode. +$webworkURLs{asciimath} = "$webworkURLs{htdocs}/ASCIIMathML/ASCIIMathML.js"; + +################################################################################ +# Defaults for course-specific locations (directories and URLs) +################################################################################ + +# The root directory of the current course. (The ID of the current course is +# available in $courseName.) +$courseDirs{root} = "$webworkDirs{courses}/$courseName"; + +# Location of course-specific data files, such as WW1 (GDBM) database files. +$courseDirs{DATA} = "$courseDirs{root}/DATA"; + +# Location of authentication data files when using a WW1 (GDBM) database. +$courseDirs{auth_DATA} = "$courseDirs{DATA}/.auth"; + +# Location of course HTML files, passed to PG. +$courseDirs{html} = "$courseDirs{root}/html"; +$courseURLs{html} = "$webwork_courses_url/$courseName"; + +# Location of course image files, passed to PG. +$courseDirs{html_images} = "$courseDirs{html}/images"; + +# Location of web-accessible, course-specific temporary files, like static and +# dynamically-generated PG graphics. +$courseDirs{html_temp} = "$courseDirs{html}/tmp"; +$courseURLs{html_temp} = "$courseURLs{html}/tmp"; + +# Location of course-specific logs, like the transaction log. +$courseDirs{logs} = "$courseDirs{root}/logs"; + +# Location of scoring files. +$courseDirs{scoring} = "$courseDirs{root}/scoring"; + +# Location of PG templates and set definition files. +$courseDirs{templates} = "$courseDirs{root}/templates"; + +# Location of course-specific macro files. +$courseDirs{macros} = "$courseDirs{templates}/macros"; + +# Location of mail-merge templates. +$courseDirs{email} = "$courseDirs{templates}/email"; + +################################################################################ +# System-wide files +################################################################################ + +# Location of this file. +$webworkFiles{environment} = "$webworkDirs{conf}/global.conf"; + +# Flat-file database used to protect against MD5 hash collisions. TeX equations +# are hashed to determine the name of the image file. There is a tiny chance of +# a collision between two TeX strings. This file allows for that. However, this +# is slow, so most people chose not to worry about it. Set this to "" if you +# don't want to use the equation cache file. +$webworkFiles{equationCacheDB} = ""; # "$webworkDirs{DATA}/equationcache"; + +##### Hardcopy snippets are used in constructing a TeX file for hardcopy output. +##### They should contain TeX code unless otherwise noted. + +# The preamble is the first thing in the TeX file. +$webworkFiles{hardcopySnippets}{preamble} = "$webworkDirs{conf}/snippets/hardcopyPreamble.tex"; + +# The setHeader preceeds each set. It is a PG file. +$webworkFiles{hardcopySnippets}{setHeader} = "$webworkDirs{conf}/snippets/setHeader.pg"; # hardcopySetHeader.pg", + +# The problem divider goes between problems. +$webworkFiles{hardcopySnippets}{problemDivider} = "$webworkDirs{conf}/snippets/hardcopyProblemDivider.tex"; + +# The set footer goes after each set. Is is a PG file. +$webworkFiles{hardcopySnippets}{setFooter} = "$webworkDirs{conf}/snippets/hardcopySetFooter.pg"; + +# The set divider goes between sets (in multiset output). +$webworkFiles{hardcopySnippets}{setDivider} = "$webworkDirs{conf}/snippets/hardcopySetDivider.tex"; + +# The user divider does between users (in multiuser output). +$webworkFiles{hardcopySnippets}{userDivider} = "$webworkDirs{conf}/snippets/hardcopyUserDivider.tex"; + +# The postabmle is the last thing in the TeX file. +$webworkFiles{hardcopySnippets}{postamble} = "$webworkDirs{conf}/snippets/hardcopyPostamble.tex"; + +##### Screen snippets are used when displaying problem sets on the screen. + +# The set header is displayed on the problem set page. It is a PG file. +$webworkFiles{screenSnippets}{setHeader} = "$webworkDirs{conf}/snippets/setHeader.pg"; # screenSetHeader.pg" + +# A PG template for creation of new problems. +$webworkFiles{screenSnippets}{blankProblem} = "$webworkDirs{conf}/snippets/blankProblem.pg"; # screenSetHeader.pg" + +# A site info "message of the day" file +$webworkFiles{site_info} = "$webworkDirs{htdocs}/site_info.txt"; +################################################################################ +# Course-specific files +################################################################################ + +# The course configuration file. +$courseFiles{environment} = "$courseDirs{root}/course.conf"; + +# File contents are displayed after login, on the problem sets page. Path given +# here is relative to the templates directory. +$courseFiles{course_info} = "course_info.txt"; + +# File contents are displayed on the login page. Path given here is relative to +# the templates directory. +$courseFiles{login_info} = "login_info.txt"; + +# Additional library buttons can be added to the Library Browser (SetMaker.pm) +# by adding the libraries you want to the following line. For each key=>value +# in the list, if a directory (or link to a directory) with name 'key' appears +# in the templates directory, then a button with name 'value' will be placed at +# the top of the problem browser. (No button will appear if there is no +# directory or link with the given name in the templates directory.) For +# example, +# +# $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"}; +# +# would add two buttons, one for the Rochester library and one for the ASU +# library, provided templates/rochester and templates/asu exists either as +# subdirectories or links to other directories. +# +$courseFiles{problibs} = { +# rochesterLibrary => "Rochester", +# asuLibrary => "Arizona State", +# dcdsLibrary => "Detroit CDS", +# dartmouthLibrary => "Dartmouth", +# indianaLibrary => "Indiana", +# osuLibrary => "Ohio State", +# capaLibrary => "CAPA", +}; ################################################################################ -# Database options +# Database options (WWDBv3) ################################################################################ -# Several database layouts are defined in separate environment files. Select the -# one which should be used by all courses by default, and include it. This can -# be overridden by including a difference environment file in the course.conf of -# a particular course. +# The four arguments passed to the DBI::connect() method. See the DBI manual for +# more information. +$wwdbv3_settings{dsn} = "dbi:mysql:wwdbv3"; +$wwdbv3_settings{user} = "wwdbv3"; +$wwdbv3_settings{pass} = "xyzzy"; +$wwdbv3_settings{attr} = {}; -# Include sql.conf to specify a database layout for use with an SQL server. -#include "conf/sql.conf"; +# WWDBv3 needs a lock file to prevent concurrent database upgrades. The file +# will be locked with flock(). +$wwdbv3_settings{upgrade_lock} = "$webworkDirs{tmp}/wwdbv3_upgrade.lock"; -# Include gdbm.conf to specify a database layout for WeBWorK 1.x compatible GDBM -# databases. Use this layout if you wish to share courses between WeBWorK 1.x -# and WeBWorK 2. -include "conf/gdbm.conf"; +################################################################################ +# Database options (WWDBv2) +################################################################################ + +# Several database are defined in the file conf/database.conf and stored in the +# hash %dbLayouts. +include "conf/database.conf"; + +# Select the default database layout. This can be overridden in the course.conf +# file of a particular course. If you choose "gdbm", WeBWorK will be able to +# use courses from WeBWorK 1 without first adding course.conf files to them. +# However, the recommended database layout for new courses is "sql_single". This +# can be set when creating a course. +$dbLayoutName = "sql_single"; # or "gdbm" or "sql" + +# This sets the symbol "dbLayout" as an alias for the selected database layout. +*dbLayout = $dbLayouts{$dbLayoutName}; + +################################################################################ +# Problem library options +################################################################################ -# Please read the documentation in the file that you chose to include, as there -# are layout-specific options that must be configured. +# The directory containing the problem library files. Set to "" if no problem +# library is installed. +$problemLibrary{root} = ""; + +# The name of the SQL database containing problem metadata +$problemLibrary{sourceSQL} = "ProblemLibrary"; + +# The user name to use when connecting to the problem library database +$problemLibrary{userSQL} = "webworkRead"; + +# The password to use when connecting to the problem library database +$problemLibrary{passwordSQL} = ""; + +################################################################################ +# Logs +################################################################################ + +# FIXME: take logs out of %webworkFiles/%courseFiles and give them their own +# top-level hash. + +# Logs data about how long it takes to process problems. (Do not confuse this +# with the /other/ timing log which can be set by WeBWorK::Timing and is used +# for benchmarking system performance in general. At some point, this timing +# mechanism will be deprecated in favor of the WeBWorK::Timing mechanism.) +$webworkFiles{logs}{timing} = "$webworkDirs{logs}/timing.log"; + +# Logs courses created via the web-based Course Administration module. +$webworkFiles{logs}{hosted_courses} = "$webworkDirs{logs}/hosted_courses.log"; + +# The transaction log contains data from each recorded answer submission. This +# is useful if the database becomes corrupted. +$webworkFiles{logs}{transaction} = "$courseDirs{logs}/transaction.log"; + +# The answer log stores a history of all users' submitted answers. +$courseFiles{logs}{answer_log} = "$courseDirs{logs}/answer_log"; + +# Log logins. +$courseFiles{logs}{login_log} = "$courseDirs{logs}/login.log"; + +################################################################################ +# More paths to external programs +################################################################################ + +# These image conversion utilities are included in the WeBWorK distribution. +$externalPrograms{gif2eps} = "$webworkDirs{bin}/gif2eps"; +$externalPrograms{png2eps} = "$webworkDirs{bin}/png2eps"; +$externalPrograms{gif2png} = "$webworkDirs{bin}/gif2png"; + +################################################################################ +# Site defaults (FIXME: what other things could be "site defaults"?) +################################################################################ + +# Status strings -- lists valid status values and their names. If your site uses +# additional values, add them here. +$siteDefaults{status} = { + A => "Audit", + a => "Audit", + audit => "Audit", + D => "Drop", + d => "Drop", + drop => "Drop", + withdraw => "Drop", + C => "Enrolled", + c => "Enrolled", + current => "Enrolled", + enrolled => "Enrolled", +}; + +# Set the default timezone of courses on this server. To get a list of valid +# timezones, run: +# +# perl -MDateTime::TimeZone -e 'print join "\n", DateTime::TimeZone::all_names' +# +# To get a list of valid timezone "links" (deprecated names), run: +# +# perl -MDateTime::TimeZone -e 'print join "\n", DateTime::TimeZone::links' +# +# If left blank, the system timezone will be used. This is usually what you +# want. You might want to set this if your server is NOT in the same timezone as +# your school. If just a few courses are in a different timezone, set this in +# course.conf for the affected courses instead. +# +$siteDefaults{timezone} = ""; + +################################################################################ +# Frontend options +################################################################################ + +%templates = ( + system => "$webworkDirs{conf}/templates/ur.template", +); ################################################################################ # Authorization system ################################################################################ # This lets you specify a minimum permission level needed to perform certain -# actions. In the current system, >=10 will allow a professor to perform the -# action, >=5 will allow a TA to, and >=0 will allow a student to perform an -# action (almost never what you want). -my $ta = 5; +# actions. For each pair in the hash below, in order to perform the action +# described by the key, the user must have a permission level greater than or +# equal to the value. + +my $guest = -1; +my $student = 0; +my $ta = 5; my $professor = 10; +my $nobody = undef; + %permissionLevels = ( + login => $guest, + report_bugs => $student, + submit_feedback => $student, + change_password => $student, + change_email_address => $student, + + view_multiple_sets => $ta, + view_unopened_sets => $ta, + view_unpublished_sets => $ta, + view_answers => $ta, + become_student => $professor, access_instructor_tools => $ta, + score_sets => $professor, + send_mail => $professor, + receive_feedback => $ta, + create_and_delete_problem_sets => $professor, - modify_problem_sets => $professor, assign_problem_sets => $professor, + modify_problem_sets => $professor, modify_student_data => $professor, + modify_classlist_files => $professor, + modify_set_def_files => $professor, + modify_scoring_files => $professor, + modify_problem_template_files => $professor, + + create_and_delete_courses => $professor, + fix_course_databases => $professor, + + ##### Behavior of the interactive problem processor ##### + + show_correct_answers_before_answer_date => $ta, + show_solutions_before_answer_date => $ta, + avoid_recording_answers => $ta, + check_answers_before_open_date => $ta, + check_answers_after_open_date_with_attempts => $ta, + check_answers_after_open_date_without_attempts => $guest, + check_answers_after_due_date => $guest, + check_answers_after_answer_date => $guest, + record_answers_when_acting_as_student => $nobody, + # "record_answers_when_acting_as_student" takes precedence + # over the following for professors acting as students: + record_answers_before_open_date => $nobody, + record_answers_after_open_date_with_attempts => $student, + record_answers_after_open_date_without_attempts => $nobody, + record_answers_after_due_date => $nobody, + record_answers_after_answer_date => $nobody, + dont_log_past_answers => $professor, + + ##### Behavior of the Hardcopy Processor ##### + + download_hardcopy_multiuser => $ta, + download_hardcopy_multiset => $ta, + download_hardcopy_format_tex => $ta, ); ################################################################################ @@ -204,77 +533,184 @@ #$debugPracticeUser = "practice666"; ################################################################################ -# PG translation options +# PG subsystem options ################################################################################ -%pg = ( - directories => { - # directories used only by PG - lib => "$pgRoot/lib", - macros => "$pgRoot/macros", - }, # (not used yet) - options => { - # default translation options - displayMode => "images", - showOldAnswers => 1, - showCorrectAnswers => 0, - showHints => 0, - showSolutions => 0, - catchWarnings => 0, # there's a global warning catcher now - # default grader - grader => "avg_problem_grader", +# List of enabled display modes. Comment out any modes you don't wish to make +# available for use. +$pg{displayModes} = [ + "plainText", # display raw TeX for math expressions + "formattedText", # format math expressions using TtH + "images", # display math expressions as images generated by dvipng + "jsMath", # render TeX math expressions on the client side using jsMath + "asciimath", # render TeX math expressions on the client side using ASCIIMathML +]; + +#### Default settings for the PG translator + +# Default display mode. Should be listed above. +$pg{options}{displayMode} = "images"; + +# The default grader to use, if a problem doesn't specify. +$pg{options}{grader} = "avg_problem_grader"; + +# Fill in answer blanks with the student's last answer by default? +$pg{options}{showOldAnswers} = 1; + +# Show correct answers (when allowed) by default? +$pg{options}{showCorrectAnswers} = 0; + +# Show hints (when allowed) by default? +$pg{options}{showHints} = 0; + +# Show solutions (when allowed) by default? +$pg{options}{showSolutions} = 0; + +# Catch translation warnings internally by default? (We no longer need to do +# this, since there is a global warnings handler. So this should be off.) +$pg{options}{catchWarnings} = 0; + +##### Currently-selected renderer + +# Only the local renderer is supported in this version. +$pg{renderer} = "WeBWorK::PG::Local"; + +# The remote renderer connects to an XML-RPC PG rendering server. +#$pg{renderer} = "WeBWorK::PG::Remote"; + +##### Renderer-dependent options + +# The remote renderer has one option: +$pg{renderers}{"WeBWorK::PG::Remote"} = { + # The "proxy" server to connect to for remote rendering. + proxy => "http://localhost:21000/RenderD", +}; + +##### Settings for various display modes + +# "images" mode has several settings: +$pg{displayModeOptions}{images} = { + # Determines the method used to align images in output. Can be + # "baseline", "absmiddle", or "mysql". + dvipng_align => 'baseline', + + # If we choose mysql, we need information on connecting to the + # database. Whatever you use here, you have to create the database + # and grant read/write priveleges to the user listed here. To create + # the database in mysql, as root use: + # + # CREATE DATABASE DvipngDepths; + # USE DvipngDepths; + # CREATE TABLE depths (md5 CHAR(33) NOT NULL, depth SMALLINT, PRIMARY KEY (md5)); + # GRANT ALL ON DvipngDepths.* TO webworkWrite; + # + # In the last statement, "webworkWrite" should match the user below. + # FIXME: this database can become a table in the 'webwork' database + dvipng_depth_db => { + dbsource => 'dbi:mysql:DvipngDepths', + user => $dbLayouts{sql}->{password}->{params}->{usernameRW}, + passwd => $dbLayouts{sql}->{password}->{params}->{passwordRW}, }, - # this will be customized in the course.conf file - specialPGEnvironmentVars => { - PRINT_FILE_NAMES_FOR => ['gage','apizer','voloshin','lr003k','professor'], - CAPA_Tools => "$courseDirs{macros}/CAPA_Tools/", - CAPA_MCTools => "$courseDirs{macros}/CAPA_MCTools/", - CAPA_Graphics_URL => "$courseDirs{html}/CAPA_Graphics/", - CAPA_GraphicsDirectory => "$courseDirs{html}CAPA_Graphics/", - }, - # modules lists module names and the packages each contains - modules => [ - [qw(DynaLoader)], - [qw(Exporter)], - [qw(GD)], - - [qw(AlgParser AlgParserWithImplicitExpand Expr ExprWithImplicitExpand)], - [qw(AnswerHash AnswerEvaluator)], - [qw(WWPlot)], # required by Circle (and others) - [qw(Circle)], - [qw(Complex)], - [qw(Complex1)], - [qw(Distributions)], - [qw(Fraction)], - [qw(Fun)], - [qw(Hermite)], - [qw(Label)], - [qw(List)], - [qw(Match)], - [qw(MatrixReal1)], # required by Matrix - [qw(Matrix)], - [qw(Multiple)], - [qw(PGrandom)], - [qw(Regression)], - [qw(Select)], - [qw(Units)], - [qw(VectorField)], - ], - # defaults used by answer evaluators - ansEvalDefaults => { - functAbsTolDefault => .001, - functLLimitDefault => .0000001, - functMaxConstantOfIntegration => 1E8, - functNumOfPoints => 3, - functRelPercentTolDefault => .1, - functULimitDefault => .9999999, - functVarDefault => "x", - functZeroLevelDefault => 1E-14, - functZeroLevelTolDefault => 1E-12, - numAbsTolDefault => .001, - numFormatDefault => "", - numRelPercentTolDefault => .1, - numZeroLevelDefault => 1E-14, - numZeroLevelTolDefault => 1E-12, - }, -); +}; + +$pg{displayModeOptions}{jsMath} = { + reportMissingFonts => 1, # set to 0 to prevent the missing font message + missingFontMessage => undef, # set to an HTML string to use for the missing font message +}; + +##### Directories used by PG + +# The root of the PG directory tree (from pg_root in Apache config). +$pg{directories}{root} = "$pg_dir"; +$pg{directories}{lib} = "$pg{directories}{root}/lib"; +$pg{directories}{macros} = "$pg{directories}{root}/macros"; + +# +# The macro file search path. Each directory in this list is seached +# (in this order) by loadMacros() when it looks for a .pl file. +# +$pg{directories}{macrosPath} = [ + ".", # search the problem file's directory + $courseDirs{macros}, + $pg{directories}{macros}, +]; + +##### "Special" PG environment variables. (Stuff that doesn't fit in anywhere else.) + +# Users for whom to print the file name of the PG file being processed. +$pg{specialPGEnvironmentVars}{PRINT_FILE_NAMES_FOR} = [ "professor", ]; + +# 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/", + +# Size in pixels of dynamically-generated images, i.e. graphs. +$pg{specialPGEnvironmentVars}{onTheFlyImageSize} = 400, + +##### PG modules to load + +# The first item of each list is the module to load. The remaining items are +# additional packages to import. + +${pg}{modules} = [ + [qw(DynaLoader)], + [qw(Exporter)], + [qw(GD)], + + [qw(AlgParser AlgParserWithImplicitExpand Expr ExprWithImplicitExpand utf8)], + [qw(AnswerHash AnswerEvaluator)], + [qw(WWPlot)], # required by Circle (and others) + [qw(Circle)], + [qw(Complex)], + [qw(Complex1)], + [qw(Distributions)], + [qw(Fraction)], + [qw(Fun)], + [qw(Hermite)], + [qw(Label)], + [qw(List)], + [qw(Match)], + [qw(MatrixReal1)], # required by Matrix + [qw(Matrix)], + [qw(Multiple)], + [qw(PGrandom)], + [qw(Regression)], + [qw(Select)], + [qw(Units)], + [qw(VectorField)], + [qw(Parser Value)], + [qw(Apache::Log)], +]; + +##### Answer evaluatior defaults + +$pg{ansEvalDefaults} = { + functAbsTolDefault => .001, + functLLimitDefault => .0000001, + functMaxConstantOfIntegration => 1E8, + functNumOfPoints => 3, + functRelPercentTolDefault => .1, + functULimitDefault => .9999999, + functVarDefault => "x", + functZeroLevelDefault => 1E-14, + functZeroLevelTolDefault => 1E-12, + numAbsTolDefault => .001, + numFormatDefault => "", + numRelPercentTolDefault => .1, + numZeroLevelDefault => 1E-14, + numZeroLevelTolDefault => 1E-12, + useBaseTenLog => 0, + defaultDisplayMatrixStyle => "[s]", +}; + +################################################################################ +# Compatibility +################################################################################ + +# Define the old names for the various "root" variables. +$webworkRoot = $webworkDirs{root}; +$webworkURLRoot = $webworkURLs{root}; +$pgRoot = $pg{directories}{root};