[system] / branches / rel-2-4-patches / webwork2 / lib / WeBWorK / Constants.pm Repository:
ViewVC logotype

View of /branches/rel-2-4-patches/webwork2/lib/WeBWorK/Constants.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5864 - (download) (as text) (annotate)
Thu Aug 7 00:32:48 2008 UTC (4 years, 9 months ago) by apizer
File size: 15599 byte(s)
Back ported change of dvipng parameter -bgTransparent to -bgtransparent

    1 ################################################################################
    2 # WeBWorK Online Homework Delivery System
    3 # Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
    4 # $CVSHeader: webwork2/lib/WeBWorK/Constants.pm,v 1.52.4.3.2.2 2008/07/14 21:41:59 gage Exp $
    5 #
    6 # This program is free software; you can redistribute it and/or modify it under
    7 # the terms of either: (a) the GNU General Public License as published by the
    8 # Free Software Foundation; either version 2, or (at your option) any later
    9 # version, or (b) the "Artistic License" which comes with this package.
   10 #
   11 # This program is distributed in the hope that it will be useful, but WITHOUT
   12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   13 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   14 # Artistic License for more details.
   15 ################################################################################
   16 
   17 package WeBWorK::Constants;
   18 
   19 =head1 NAME
   20 
   21 WeBWorK::Constants - provide constant values for other WeBWorK modules.
   22 
   23 =cut
   24 
   25 use strict;
   26 use warnings;
   27 
   28 ################################################################################
   29 # WeBWorK::Debug
   30 ################################################################################
   31 
   32 # If true, WeBWorK::Debug will print debugging output.
   33 #
   34 $WeBWorK::Debug::Enabled = 0;
   35 
   36 # If non-empty, debugging output will be sent to the file named rather than STDERR.
   37 #
   38 $WeBWorK::Debug::Logfile = "";
   39 
   40 # If defined, prevent subroutines matching the following regular expression from
   41 # logging.
   42 #
   43 # For example, this pattern prevents the dispatch() function from logging:
   44 #     $WeBWorK::Debug::DenySubroutineOutput = qr/^WeBWorK::dispatch$/;
   45 #
   46 $WeBWorK::Debug::DenySubroutineOutput = undef;
   47 
   48 # If defined, allow only subroutines matching the following regular expression
   49 # to log.
   50 #
   51 # For example, this pattern allow only some function being worked on to log:
   52 #     $WeBWorK::Debug::AllowSubroutineOutput = qr/^WeBWorK::SomePkg::myFunc$/;
   53 #
   54 $WeBWorK::Debug::AllowSubroutineOutput = undef;
   55 
   56 ################################################################################
   57 # WeBWorK::ContentGenerator::Hardcopy
   58 ################################################################################
   59 
   60 # If true, don't delete temporary files
   61 #
   62 $WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles = 0;
   63 
   64 ################################################################################
   65 # WeBWorK::PG::Local
   66 ################################################################################
   67 # The maximum amount of time (in seconds) to work on a single problem.
   68 # At the end of this time a timeout message is sent to the browser.
   69 
   70 $WeBWorK::PG::Local::TIMEOUT = 60;
   71 
   72 ################################################################################
   73 # WeBWorK::PG::ImageGenerator
   74 ################################################################################
   75 
   76 # Arguments to pass to dvipng. This is dependant on the version of dvipng.
   77 #
   78 # For dvipng versions 0.x
   79 #     $WeBWorK::PG::ImageGenerator::DvipngArgs = "-x4000.5 -bgTransparent -Q6 -mode toshiba -D180";
   80 # For dvipng versions 1.0 to 1.5
   81 #     $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgTransparent -D120 -q -depth";
   82 #
   83 # For dvipng versions 1.6 (and probably above)
   84 #     $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgtransparent -D120 -q -depth";
   85 # Note: In 1.6 and later, bgTransparent gives alpha-channel transparency while
   86 # bgtransparent gives single-bit transparency. If you use alpha-channel transparency,
   87 # the images will not be viewable with MSIE.  bgtransparent works for version 1.5,
   88 # but does not give transparent backgrounds. It does not work for version 1.2. It has not
   89 # been tested with other versions.
   90 #
   91 $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgtransparent -D120 -q -depth";
   92 
   93 # If true, don't delete temporary files
   94 #
   95 $WeBWorK::PG::ImageGenerator::PreserveTempFiles = 0;
   96 
   97 # TeX to prepend to equations to be processed.
   98 #
   99 $WeBWorK::PG::ImageGenerator::TexPreamble = <<'EOF';
  100 \documentclass[12pt]{article}
  101 \nonstopmode
  102 \usepackage{amsmath,amsfonts,amssymb}
  103 \def\gt{>}
  104 \def\lt{<}
  105 \usepackage[active,textmath,displaymath]{preview}
  106 \begin{document}
  107 EOF
  108 
  109 # TeX to append to equations to be processed.
  110 #
  111 $WeBWorK::PG::ImageGenerator::TexPostamble = <<'EOF';
  112 \end{document}
  113 EOF
  114 
  115 ################################################################################
  116 # WeBWorK::ContentGenerator::Instructor::Config
  117 ################################################################################
  118 
  119 # Configuation data
  120 # It is organized by section.  The allowable types are
  121 #  'text' for a text string (no quote marks allowed),
  122 #  'number' for a number,
  123 #  'list' for a list of text strings,
  124 #  'permission' for a permission value,
  125 #  'boolean' for variables which really hold 0/1 values as flags.
  126 #  'checkboxlist' for variables which really hold a list of values which
  127 #      can be independently picked yes/no as checkboxes
  128 
  129 $WeBWorK::ContentGenerator::Instructor::Config::ConfigValues = [
  130     ['General',
  131     { var => 'courseFiles{course_info}',
  132       doc => 'Name of course information file',
  133       doc2 => 'The name of course information file (located in the templates directory). Its contents are displayed in the right panel next to the list of homework sets.',
  134       type => 'text'},
  135     { var => 'defaultTheme',
  136       doc => 'Theme (refresh page after saving changes to reveal new theme)',
  137       doc2 => 'There are currently four themes (or skins) to choose from: ur, math, math2 and moodle.  The theme
  138 specifies a unified look and feel for the WeBWorK course web pages.',
  139       values => [qw(math math2 ur moodle union)],
  140       type => 'popuplist'},
  141     { var => 'sessionKeyTimeout',
  142       doc => 'Inactivity time before a user is required to login again',
  143       doc2 => 'Length of time, in seconds, a user has to be inactive before he is required to login again.<p> This value should be entered as a number, so as 3600 instead of 60*60 for one hour',
  144       type => 'number'},
  145     { var => 'siteDefaults{timezone}',
  146       doc => 'Timezone for the course',
  147       doc2 => 'Some servers handle courses taking place in different timezones.  If this course is not showing the correct timezone, enter the correct value here.  The format consists of unix times, such as "America/New_York","America/Chicago", "America/Denver", "America/Phoenix" or "America/Los_Angeles". Complete list: <a href="http://cpan.uwinnipeg.ca/dist/DateTime-TimeZone">TimeZoneFiles</a>',
  148       type => 'text'},],
  149   ['Permissions',
  150     { var => 'permissionLevels{login}',
  151       doc => 'Allowed to login to the course',
  152       type => 'permission'},
  153     { var => 'permissionLevels{change_password}',
  154       doc => 'Allowed to change their password',
  155       doc2 => 'Users at this level and higher are allowed to change their password. Normally guest users are not allowed to change their password.',
  156       type => 'permission'},
  157     { var => 'permissionLevels{become_student}',
  158       doc => 'Allowed to <em>act as</em> another user',
  159       type => 'permission'},
  160     { var => 'permissionLevels{submit_feedback}',
  161       doc => 'Can e-mail instructor',
  162       doc2 => 'Only this permission level and higher get buttons for sending e-mail to the instructor.',
  163       type => 'permission'},
  164     { var => 'permissionLevels{record_answers_when_acting_as_student}',
  165       doc => 'Can submit answers for a student',
  166       doc2 => 'When acting as a student, this permission level and higher can submit answers for that student.',
  167       type => 'permission'},
  168     { var => 'permissionLevels{report_bugs}',
  169       doc => 'Can report bugs',
  170       doc2 => 'Users with at least this permission level get a link in the left panel for reporting bugs to the bug tracking system in Rochester',
  171       type => 'permission'},
  172     { var => 'permissionLevels{change_email_address}',
  173       doc => 'Allowed to change their e-mail address',
  174       doc2 => 'Users at this level and higher are allowed to change their e-mail address. Normally guest users are not allowed to change the e-mail address since it does not make sense to send e-mail to anonymous accounts.',
  175       type => 'permission'},
  176     { var => 'permissionLevels{view_answers}',
  177       doc => 'Allowed to view past answers',
  178       doc2 => 'These users and higher get the "Show Past Answers" button on the problem page.',
  179       type => 'permission'},
  180     { var => 'permissionLevels{view_unopened_sets}',
  181       doc => 'Allowed to view problems in sets which are not open yet',
  182       type => 'permission'},
  183     { var => 'permissionLevels{show_correct_answers_before_answer_date}',
  184       doc => 'Allowed to see the correct answers before the answer date',
  185       type => 'permission'},
  186     { var => 'permissionLevels{show_solutions_before_answer_date}',
  187       doc => 'Allowed to see solutions before the answer date',
  188       type => 'permission'},
  189     { var => 'permissionLevels{can_show_old_answers_by_default}',
  190       doc => 'Can show old answers by default',
  191       doc2 => 'When viewing a problem, WeBWorK usually puts the previously submitted answer in the answer blank if it is before the due date.  Below this level, old answers are never initially shown.  Typically, that is the desired behaviour for guest accounts.',
  192       type => 'permission'},
  193     { var => 'permissionLevels{can_always_use_show_old_answers_default}',
  194       doc => 'Can always show old answers by default',
  195       doc2 => 'When viewing a problem, WeBWorK usually puts the previously submitted answer in the answer blank if it is before the due date.  At this level and higher, old answers are always shown (independent of the answer date).',
  196       type => 'permission'},
  197   ],
  198   ['PG - Problem Display/Answer Checking',
  199     { var => 'pg{displayModes}',
  200       doc => 'List of display modes made available to students',
  201       doc2 => 'When viewing a problem, users may choose different methods of rendering
  202  formulas via an options box in the left panel.  Here, you can adjust what display modes are
  203  listed.<p>
  204  Some display modes require other software to be installed on the server.  Be sure to check
  205  that all display modes selected here work from your server.<p>
  206  The display modes are <ul>
  207 <li> plainText: shows the raw LaTeX strings for formulas.
  208 <li> formattedText: formulas are passed through the external program <code>tth</code>,
  209  which produces an HTML version of them.  Some browsers do not display all of the fonts
  210  properly.
  211 <li> images: produces images using the external programs LaTeX and dvipng.
  212 <li> jsMath: uses javascript to place symbols, which may come from fonts or images
  213  (the choice is configurable by the end user).
  214 <li> asciimath: renders formulas client side using ASCIIMathML
  215 <li> LaTeXMathML: renders formulas client side using LaTeXMathML
  216 </ul>
  217 <p>
  218 You must use at least one display mode.  If you select only one, then the options box will
  219  not give a choice of modes (since there will only be one active).',
  220       min  => 1,
  221       values => ["plainText", "formattedText", "images", "jsMath", "asciimath", "LaTeXMathML"],
  222       type => 'checkboxlist'},
  223 
  224     { var => 'pg{options}{displayMode} ',
  225       doc => 'The default display mode',
  226       doc2 => 'Enter one of the allowed display mode types above.  See \'display modes entry\' for descriptions.',
  227       min  => 1,
  228       type => 'text'},
  229 
  230     { var => 'pg{ansEvalDefaults}{useBaseTenLog}',
  231       doc => 'Use log base 10 instead of base <i>e</i>',
  232       doc2 => 'Set to true for log to mean base 10 log and false for log to mean natural logarithm',
  233       type => 'boolean'},
  234 
  235     { var => 'pg{ansEvalDefaults}{useOldAnswerMacros}',
  236       doc => 'Use older answer checkers',
  237       doc2 => 'During summer 2005, a newer version of the answer checkers was implemented for answers which are functions and numbers.  The newer checkers allow more functions in student answers, and behave better in certain cases.  Some problems are specifically coded to use new (or old) answer checkers.  However, for the bulk of the problems, you can choose what the default will be here.  <p>Choosing <i>false</i> here means that the newer answer checkers will be used by default, and choosing <i>true</i> means that the old answer checkers will be used by default.',
  238       type => 'boolean'},
  239 
  240     { var => 'pg{ansEvalDefaults}{defaultDisplayMatrixStyle}',
  241       doc => 'Control string for displaying matricies',
  242       doc2 => 'String of three characters for defining the defaults for displaying matricies.  The first and last characters give the left and right delimiters of the matrix, so usually one of ([| for a left delimiter, and one of )]| for the right delimiter.  It is also legal to specify "." for no delimiter. <p> The middle character indicates how to display vertical lines in a matrix (e.g., for an augmented matrix).  This can be s for solid lines and d for dashed lines.  While you can specify the defaults, individual problems may override these values.',
  243       type => 'text'},
  244 
  245     { var => 'pg{ansEvalDefaults}{numRelPercentTolDefault}',
  246       doc => 'Allowed error, as a percentage, for numerical comparisons',
  247       doc2 => "When numerical answers are checked, most test if the student's answer
  248  is close enough to the programmed answer be computing the error as a percentage of
  249  the correct answer.  This value controls the default for how close the student answer
  250  has to be in order to be marked correct.
  251 <p>
  252 A value such as 0.1 means 0.1 percent error is allowed.",
  253       type => 'number'},
  254   ],
  255   ['E-Mail',
  256     { var => 'mail{feedbackSubjectFormat}',
  257       doc => 'Format for the subject line in feedback e-mails',
  258       doc2 => 'When students click the <em>Email Instructor</em> button
  259  to send feedback, WeBWorK fills in the subject line.  Here you can set the
  260  subject line.  In it, you can have various bits of information filled in
  261  with the following escape sequences.
  262 <p>
  263 <ul>
  264 <li> %c = course ID
  265 <li> %u = user ID
  266 <li> %s = set ID
  267 <li> %p = problem ID
  268 <li> %x = section
  269 <li> %r = recitation
  270 <li> %% = literal percent sign
  271 </ul>',
  272       width => 45,
  273       type => 'text'},
  274     { var => 'mail{feedbackVerbosity}',
  275       doc => 'E-mail verbosity level',
  276       doc2 => 'The e-mail verbosity level controls how much information is
  277  automatically added to feedback e-mails.  Levels are
  278 <ol>
  279 <li value="0"> send only the feedback comment and context link
  280 <li value="1"> as in 0, plus user, set, problem, and PG data
  281 <li value="2"> as in 1, plus the problem environment (debugging data)
  282 </ol>',
  283       type => 'number'
  284     },
  285     { var => 'mail{allowedRecipients}',
  286       doc => 'E-mail addresses which can receive e-mail from a pg problem',
  287       doc2 => 'List of e-mail addresses to which e-mail can be sent by a problem. Professors need to be added to this list if questionaires are used, or other WeBWorK problems which send e-mail as part of their answer mechanism.',
  288       type => 'list'},
  289     { var => 'permissionLevels{receive_feedback}',
  290       doc => 'E-mail feedback from students automatically sent to this permission level and higher:',
  291       doc2 => 'Users with this permssion level or greater will automatically be sent feedback from students (generated when they use the "Contact instructor" button on any problem page).  In addition the feedback message will be sent to addresses listed below.  To send ONLY to addresses listed below set permission level to "nobody".',
  292       type => 'permission'},
  293 
  294     { var => 'mail{feedbackRecipients}',
  295       doc => 'Additional addresses for receiving feedback e-mail.',
  296       doc2 => 'By default, feeback is sent to all users above who have permission to receive feedback. Feedback is also sent to any addresses specified in this blank. Separate email address entries by commas.',
  297       type => 'list'},
  298   ]
  299 ];
  300 
  301 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9