--- trunk/webwork-modperl/conf/global.conf.dist 2005/09/07 01:18:00 3604 +++ trunk/webwork-modperl/conf/global.conf.dist 2006/08/05 03:36:58 4355 @@ -1,8 +1,8 @@ #!perl ################################################################################ # WeBWorK Online Homework Delivery System -# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ -# $CVSHeader: webwork-modperl/conf/global.conf.dist,v 1.134 2005/08/28 20:54:50 jj Exp $ +# Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ +# $CVSHeader: webwork2/conf/global.conf.dist,v 1.170 2006/07/05 18:24:43 sh002i 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 @@ -44,26 +44,28 @@ $webwork_courses_url = "/webwork2_course_files"; $webwork_courses_dir = "$webwork_dir/courses"; +# machine domain name (#FIXME can we get this automatically???) (needed to find applets) +$domainName = "devel.webwork.rochester.edu:8002"; + + ################################################################################ # Paths to external programs ################################################################################ +# system utilties $externalPrograms{mkdir} = "/bin/mkdir"; $externalPrograms{mv} = "/bin/mv"; $externalPrograms{mysql} = "/usr/bin/mysql"; +$externalPrograms{tar} = "/usr/bin/tar"; +# equation rendering/hardcopy utiltiies $externalPrograms{latex} = "/usr/bin/latex"; -$externalPrograms{pdflatex} = "/usr/bin/pdflatex --shell-escape"; # allows pdflatex to handle .eps files +$externalPrograms{pdflatex} = "/usr/bin/pdflatex --shell-escape"; # --shell-escape allows pdflatex to handle .eps files $externalPrograms{dvipng} = "/usr/bin/dvipng"; $externalPrograms{tth} = "/usr/bin/tth"; -$externalPrograms{tar} = "/usr/bin/tar"; - -# Basic image manipulation utilities - -#################################################### -# Most sites only need to configure the first line -#################################################### +# NetPBM - basic image manipulation utilities +# most sites only need to configure $netpbm_prefix. my $netpbm_prefix = "/usr/bin"; $externalPrograms{giftopnm} = "$netpbm_prefix/giftopnm"; $externalPrograms{ppmtopgm} = "$netpbm_prefix/ppmtopgm"; @@ -71,36 +73,35 @@ $externalPrograms{pnmtopng} = "$netpbm_prefix/pnmtopng"; $externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm"; -# The following lines are the external scripts gif2eps, etc. -# The source file is input with cat, and the output is redirected to -# the desired file. +# url checker +$externalPrograms{checkurl} = "/usr/local/bin/lwp-request -mHEAD "; # or "/usr/local/bin/w3c -head " + -$externalPrograms{gif2eps} = "$externalPrograms{giftopnm} | $externalPrograms{ppmtopgm}| $externalPrograms{pnmtops} -noturn 2>/dev/null"; +# image conversions utiltiies +# the source file is given on stdin, and the output expected on stdout. +# +# Note on conversions pipelines: +# we used to use `pnmdepth 1' instead of ppmtopgm as it creates a +# monochrome image (1 bit) rather than a greyscale image (8 bits). +# However, this was causing improper display of some sort in PDFs. +$externalPrograms{gif2eps} = "$externalPrograms{giftopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null"; $externalPrograms{png2eps} = "$externalPrograms{pngtopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null"; $externalPrograms{gif2png} = "$externalPrograms{giftopnm} | $externalPrograms{pnmtopng}"; -# Note on these conversions: -# we used to use `pnmdepth 1' instead of ppmtopgm as it creates a -# monochrome image (1 bit) rather than a greyscale image (8 bits). -# However, this was causing improper display of some sort in PDFs. - - - - ################################################################################ # Mail settings ################################################################################ # Mail sent by the PG system and the mail merge and feedback modules will be # sent via this SMTP server. -$mail{smtpServer} = 'mail.rochester.edu'; +$mail{smtpServer} = 'mail.yourschool.edu'; # 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. @@ -110,22 +111,49 @@ #'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', -#]; - + +# By default, feeback is sent to all users who have permission to +# receive_feedback. If this list is non-empty, feedback is also sent to the +# addresses specified here. +# +# * If you want to disable feedback altogether, leave this empty and set +# submit_feeback => $nobody in %permissionLevels below. This will cause the +# feedback button to go away as well. +# +# * If you want to send email ONLY to addresses in this list, set +# receive_feedback => $nobody in %permissionLevels below. +# +# It's often useful to set this in the course.conf to change the behavior of +# feedback for a specific course. +# +# Items in this list may be bare addresses, or RFC822 mailboxes, like: +# 'Joe User ' +# The advantage of this form is that the resulting email will include the name +# of the recipient in the "To" field of the email. +# +$mail{feedbackRecipients} = [ + #'prof1@yourserver.yourdomain.edu', + #'prof2@yourserver.yourdomain.edu', +]; + +# Feedback subject line -- the following escape sequences are recognized: +# +# %c = course ID +# %u = user ID +# %s = set ID +# %p = problem ID +# %x = section +# %r = recitation +# %% = literal percent sign +# +$mail{feedbackSubjectFormat} = "[WWfeedback] course:%c user:%u set:%s prob:%p sec:%x rec:%r"; + # 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 @@ -151,6 +179,9 @@ # Location of configuration files, templates, snippets, etc. $webworkDirs{conf} = "$webworkDirs{root}/conf"; +# Location of theme templates. +$webworkDirs{templates} = "$webworkDirs{conf}/templates"; + # Location of course directories. $webworkDirs{courses} = "$webwork_courses_dir" || "$webworkDirs{root}/courses"; @@ -216,12 +247,9 @@ # available in $courseName.) $courseDirs{root} = "$webworkDirs{courses}/$courseName"; -# Location of course-specific data files, such as WW1 (GDBM) database files. +# Location of course-specific data 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"; @@ -249,6 +277,9 @@ # Location of mail-merge templates. $courseDirs{email} = "$courseDirs{templates}/email"; +# Location of temporary editing files. +$courseDirs{tmpEditFileDir} = "$courseDirs{templates}/tmpEdit"; + ################################################################################ # System-wide files ################################################################################ @@ -297,6 +328,7 @@ # A site info "message of the day" file $webworkFiles{site_info} = "$webworkDirs{htdocs}/site_info.txt"; + ################################################################################ # Course-specific files ################################################################################ @@ -304,6 +336,9 @@ # The course configuration file. $courseFiles{environment} = "$courseDirs{root}/course.conf"; +# The course simple configuration file (holds web-based configuratoin). +$courseFiles{simpleConfig} = "$courseDirs{root}/simple.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"; @@ -337,34 +372,31 @@ }; ################################################################################ -# Database options (WWDBv3) +# Database options ################################################################################ -# 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} = {}; - -# 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"; - -################################################################################ -# Database options (WWDBv2) -################################################################################ +# these variables are used by database.conf. we define them here so that editing +# database.conf isn't necessary. +$database_dsn = "dbi:mysql:webwork"; +$database_username = "webworkWrite"; +$database_password = ""; +$database_debug = 0; + +# Variables for sql_moodle database layout. +$moodle_dsn = "dbi:mysql:moodle"; +$moodle_dsn = "dbi:mysql:moodle_sam"; +$moodle_table_prefix = "mdl_"; +$moodle_username = $database_username; +$moodle_password = $database_password; # 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" +# file of a particular course. The only database layout supported in WW 2.1.4 +# and up is "sql_single". +$dbLayoutName = "sql_single"; # This sets the symbol "dbLayout" as an alias for the selected database layout. *dbLayout = $dbLayouts{$dbLayoutName}; @@ -426,22 +458,6 @@ # 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: # @@ -464,92 +480,171 @@ $siteDefaults{default_templates_course} ="modelCourse"; ################################################################################ -# Frontend options +# Theme ################################################################################ -%templates = ( - system => "$webworkDirs{conf}/templates/ur.template", - gateway => "$webworkDirs{conf}/templates/gw.template", -); +$defaultTheme = "math"; +$defaultThemeTemplate = "system"; + +################################################################################ +# Authentication system +################################################################################ + +# FIXME This mechanism is a little awkward and probably should be merged with +# the dblayout selection system somehow. + +# Select the authentication module to use for normal logins. +# +# If this value is a string, the given authentication module will be used +# regardless of the database layout. If it is a hash, the database layout name +# will be looked up in the hash and the resulting value will be used as the +# authentication module. The special hash key "*" is used if no entry for the +# current database layout is found. +# +$authen{user_module} = { + sql_moodle => "WeBWorK::Authen::Moodle", + "*" => "WeBWorK::Authen", +}; + +# Select the authentication module to use for proctor logins. +# +# A string or a hash is accepted, as above. +# +$authen{proctor_module} = "WeBWorK::Authen::Proctor"; ################################################################################ # Authorization system ################################################################################ -# This lets you specify a minimum permission level needed to perform certain -# 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 $proctor = 2; -my $ta = 5; -my $professor = 10; -my $nobody = undef; +# this section lets you define which groups of users can perform which actions. -%permissionLevels = ( - login => $guest, - report_bugs => $student, - submit_feedback => $student, - change_password => $student, - change_email_address => $student, +# this hash maps a numeric permission level to the name of a role. the number +# assigned to a role is significant -- roles with higher numbers are considered +# "more privileged", and are included when that role is listed for a privilege +# below. +# +%userRoles = ( + guest => -5, + student => 0, + proctor => 2, + ta => 5, + professor => 10, +); - proctor_quiz => $proctor, - - 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, - 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, +# this hash maps operations to the roles that are allowed to perform those +# operations. the role listed and any role with a higher permission level (in +# the %userRoles hash) will be allowed to perform the operation. If the role +# is undefined, no users will be allowed to perform the operation. +# +%permissionLevels = ( + login => "guest", + report_bugs => "student", + submit_feedback => "student", + change_password => "student", + change_email_address => "student", + + proctor_quiz => "proctor", + view_proctored_tests => "ta", + + 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", + 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", + manage_course_files => "professor", - create_and_delete_courses => $professor, - fix_course_databases => $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, + show_correct_answers_before_answer_date => "ta", + show_solutions_before_answer_date => "ta", + avoid_recording_answers => "ta", # Below this level, old answers are never initially shown - can_show_old_answers_by_default => $student, + can_show_old_answers_by_default => "student", # at this level, we look at showOldAnswers for default value # even after the due date - can_always_use_show_old_answers_default => $professor, - 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, + can_always_use_show_old_answers_default => "professor", + 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 => undef, # "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, + record_answers_before_open_date => undef, + record_answers_after_open_date_with_attempts => "student", + record_answers_after_open_date_without_attempts => undef, + record_answers_after_due_date => undef, + record_answers_after_answer_date => undef, + dont_log_past_answers => "professor", + # does the user get to see a dump of the problem? + view_problem_debugging_info => "ta", ##### Behavior of the Hardcopy Processor ##### - download_hardcopy_multiuser => $ta, - download_hardcopy_multiset => $ta, - download_hardcopy_format_tex => $ta, + download_hardcopy_multiuser => "ta", + download_hardcopy_multiset => "ta", + download_hardcopy_format_pdf => "guest", + download_hardcopy_format_tex => "ta", +); + +# This is the default permission level given to new students and students with +# invalid or missing permission levels. +$default_permission_level = $userRoles{student}; + +################################################################################ +# Status system +################################################################################ + +# This is the default status given to new students and students with invalid +# or missing statuses. +$default_status = "Enrolled"; + +# The first abbreviation in the abbreviations list is the canonical +# abbreviation, and will be used when setting the status value in a user record +# or an exported classlist file. +# +# Results are undefined if more than one status has the same abbreviation. +# +# The four behaviors that are controlled by status are: +# allow_course_access => is this user allowed to log in? +# include_in_assignment => is this user included when assigning as set to "all" users? +# include_in_stats => is this user included in statistical reports? +# include_in_email => is this user included in emails sent to the class? +# include_in_scoring => is this user included in score reports? + +%statuses = ( + Enrolled => { + abbrevs => [qw/ C c current enrolled /], + behaviors => [qw/ allow_course_access include_in_assignment include_in_stats + include_in_email include_in_scoring /], + }, + Audit => { + abbrevs => [qw/ A a audit /], + behaviors => [qw/ allow_course_access include_in_assignment include_in_stats + include_in_email /], + }, + Drop => { + abbrevs => [qw/ D d drop withdraw /], + behaviors => [qw/ /], + }, ); ################################################################################ @@ -560,10 +655,10 @@ $sessionKeyTimeout = 60*30; # $sessionKeyLength defines the length (in characters) of the session key -$sessionKeyLength = 40; +$sessionKeyLength = 32; # @sessionKeyChars lists the legal session key characters -@sessionKeyChars = ('A'..'Z', 'a'..'z', '0'..'9', '.', '^', '/', '!', '*'); +@sessionKeyChars = ('A'..'Z', 'a'..'z', '0'..'9'); # Practice users are users who's names start with $practiceUser # (you can comment this out to remove practice user support) @@ -575,6 +670,10 @@ # password. Come to think of it, why do we even have this?! #$debugPracticeUser = "practice666"; +# Option for gateway tests; $gatewayGracePeriod is the time in seconds +# after the official due date during which we'll still grade the test +$gatewayGracePeriod = 120; + ################################################################################ # PG subsystem options ################################################################################ @@ -651,8 +750,8 @@ # 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}, + user => $dbLayouts{sql_single}->{password}->{params}->{usernameRW}, + passwd => $dbLayouts{sql_single}->{password}->{params}->{passwordRW}, }, }; @@ -660,6 +759,7 @@ reportMissingFonts => 0, # set to 1 to allow the missing font message missingFontMessage => undef, # set to an HTML string to replace the missing font message noImageFonts => 0, # set to 1 if you didn't install the jsMath image fonts + processDoubleClicks => 1, # set to 0 to disable double-click on math to get TeX source }; ##### Directories used by PG @@ -668,6 +768,7 @@ $pg{directories}{root} = "$pg_dir"; $pg{directories}{lib} = "$pg{directories}{root}/lib"; $pg{directories}{macros} = "$pg{directories}{root}/macros"; +$pg{directories}{applets} = "http://$domainName$webwork_htdocs_url/applets"; # # The macro file search path. Each directory in this list is seached @@ -679,6 +780,11 @@ $pg{directories}{macros}, ]; +$pg{directories}{appletPath} = [ # paths to search for applets (requires full url) + $pg{directories}{applets}, + "http://$domainName$courseURLs{html}/applets", +]; + ##### "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. @@ -694,9 +800,9 @@ # Size in pixels of dynamically-generated images, i.e. graphs. $pg{specialPGEnvironmentVars}{onTheFlyImageSize} = 400, -# To activate Parser-based versions of num_cmp and fun_cmp, change this -# value to 0. -$pg{specialPGEnvironmentVars}{useOldAnswerMacros} = 1; +# To disable the Parser-based versions of num_cmp and fun_cmp, and use the +# original versions instead, set this value to 1. +$pg{specialPGEnvironmentVars}{useOldAnswerMacros} = 0; # Strings to insert at the start and end of the body of a problem # (at beginproblem() and ENDDOCUMENT) in various modes. More display modes @@ -746,7 +852,6 @@ [qw(VectorField)], [qw(Parser Value)], [qw(Parser::Legacy)], - [qw(Apache::Log)], ]; ##### Answer evaluatior defaults