[system] / branches / ghe3_dev / webwork2 / lib / WeBWorK / Constants.pm Repository:
ViewVC logotype

View of /branches/ghe3_dev/webwork2/lib/WeBWorK/Constants.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7133 - (download) (as text) (annotate)
Wed Feb 1 22:58:44 2012 UTC (15 months, 2 weeks ago) by ghe3
File size: 18960 byte(s)

    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.62 2010/02/01 01:57:56 apizer 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 use WeBWorK::Request;
   28 
   29 ################################################################################
   30 # WeBWorK::Debug
   31 ################################################################################
   32 
   33 # If true, WeBWorK::Debug will print debugging output.
   34 #
   35 $WeBWorK::Debug::Enabled = 0;
   36 
   37 # If non-empty, debugging output will be sent to the file named rather than STDERR.
   38 #
   39 $WeBWorK::Debug::Logfile = "";
   40 
   41 # If defined, prevent subroutines matching the following regular expression from
   42 # logging.
   43 #
   44 # For example, this pattern prevents the dispatch() function from logging:
   45 #     $WeBWorK::Debug::DenySubroutineOutput = qr/^WeBWorK::dispatch$/;
   46 #
   47 $WeBWorK::Debug::DenySubroutineOutput = undef;
   48 
   49 # If defined, allow only subroutines matching the following regular expression
   50 # to log.
   51 #
   52 # For example, this pattern allow only some function being worked on to log:
   53 #     $WeBWorK::Debug::AllowSubroutineOutput = qr/^WeBWorK::SomePkg::myFunc$/;
   54 #
   55 $WeBWorK::Debug::AllowSubroutineOutput = undef;
   56 
   57 ################################################################################
   58 # WeBWorK::ContentGenerator::Hardcopy
   59 ################################################################################
   60 
   61 # If true, don't delete temporary files
   62 #
   63 $WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles = 0;
   64 
   65 ################################################################################
   66 # WeBWorK::PG::Local
   67 ################################################################################
   68 # The maximum amount of time (in seconds) to work on a single problem.
   69 # At the end of this time a timeout message is sent to the browser.
   70 
   71 $WeBWorK::PG::Local::TIMEOUT = 60;
   72 
   73 ################################################################################
   74 # WeBWorK::PG::ImageGenerator
   75 ################################################################################
   76 
   77 # Arguments to pass to dvipng. This is dependant on the version of dvipng.
   78 #
   79 # For dvipng versions 0.x
   80 #     $WeBWorK::PG::ImageGenerator::DvipngArgs = "-x4000.5 -bgTransparent -Q6 -mode toshiba -D180";
   81 # For dvipng versions 1.0 to 1.5
   82 #     $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgTransparent -D120 -q -depth";
   83 #
   84 # For dvipng versions 1.6 (and probably above)
   85 #     $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgtransparent -D120 -q -depth";
   86 # Note: In 1.6 and later, bgTransparent gives alpha-channel transparency while
   87 # bgtransparent gives single-bit transparency. If you use alpha-channel transparency,
   88 # the images will not be viewable with MSIE.  bgtransparent works for version 1.5,
   89 # but does not give transparent backgrounds. It does not work for version 1.2. It has not
   90 # been tested with other versions.
   91 #
   92 $WeBWorK::PG::ImageGenerator::DvipngArgs = "-bgTransparent -D120 -q -depth";
   93 
   94 # If true, don't delete temporary files
   95 #
   96 $WeBWorK::PG::ImageGenerator::PreserveTempFiles = 0;
   97 
   98 # TeX to prepend to equations to be processed.
   99 #
  100 $WeBWorK::PG::ImageGenerator::TexPreamble = <<'EOF';
  101 \documentclass[12pt]{article}
  102 \nonstopmode
  103 \usepackage{amsmath,amsfonts,amssymb}
  104 \def\gt{>}
  105 \def\lt{<}
  106 \usepackage[active,textmath,displaymath]{preview}
  107 \begin{document}
  108 EOF
  109 
  110 # TeX to append to equations to be processed.
  111 #
  112 $WeBWorK::PG::ImageGenerator::TexPostamble = <<'EOF';
  113 \end{document}
  114 EOF
  115 
  116 ################################################################################
  117 # WeBWorK::ContentGenerator::Instructor::Config
  118 ################################################################################
  119 
  120 # Configuation data
  121 # It is organized by section.  The allowable types are
  122 #  'text' for a text string (no quote marks allowed),
  123 #  'number' for a number,
  124 #  'list' for a list of text strings,
  125 #  'permission' for a permission value,
  126 #  'boolean' for variables which really hold 0/1 values as flags.
  127 #  'checkboxlist' for variables which really hold a list of values which
  128 #      can be independently picked yes/no as checkboxes
  129 
  130 $WeBWorK::ContentGenerator::Instructor::Config::ConfigValues = [
  131     ['General',
  132     { var => 'courseFiles{course_info}',
  133       doc => 'Name of course information file',
  134       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.',
  135       type => 'text'},
  136     { var => 'defaultTheme',
  137       doc => 'Theme (refresh page after saving changes to reveal new theme.)',
  138       doc2 => 'There are currently five themes (or skins) to choose from: ur, math, math2, and dgage.  The theme
  139 specifies a unified look and feel for the WeBWorK course web pages.',
  140       values => [qw(math math2 math3 ur dgage  union)],
  141       type => 'popuplist'},
  142       { var => 'language',
  143       doc => 'Language (refresh page after saving changes to reveal new language.)',
  144       doc2 => 'WeBWorK currently has translations for four languages: "English en", "Turkish tr", "Spanish es", and "French fr" ',
  145       values => [qw(en tr es fr)],
  146       type => 'popuplist'},
  147     { var => 'sessionKeyTimeout',
  148       doc => 'Inactivity time before a user is required to login again',
  149       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',
  150       type => 'number'},
  151     { var => 'siteDefaults{timezone}',
  152       doc => 'Timezone for the course',
  153       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://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones">TimeZoneFiles</a>',
  154       type => 'text'},],
  155   ['Permissions',
  156     { var => 'permissionLevels{login}',
  157       doc => 'Allowed to login to the course',
  158       type => 'permission'},
  159     { var => 'permissionLevels{change_password}',
  160       doc => 'Allowed to change their password',
  161       doc2 => 'Users at this level and higher are allowed to change their password. Normally guest users are not allowed to change their password.',
  162       type => 'permission'},
  163     { var => 'permissionLevels{become_student}',
  164       doc => 'Allowed to <em>act as</em> another user',
  165       type => 'permission'},
  166     { var => 'permissionLevels{submit_feedback}',
  167       doc => 'Can e-mail instructor',
  168       doc2 => 'Only this permission level and higher get buttons for sending e-mail to the instructor.',
  169       type => 'permission'},
  170     { var => 'permissionLevels{record_answers_when_acting_as_student}',
  171       doc => 'Can submit answers for a student',
  172       doc2 => 'When acting as a student, this permission level and higher can submit answers for that student.',
  173       type => 'permission'},
  174     { var => 'permissionLevels{report_bugs}',
  175       doc => 'Can report bugs',
  176       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',
  177       type => 'permission'},
  178     { var => 'permissionLevels{change_email_address}',
  179       doc => 'Allowed to change their e-mail address',
  180       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.',
  181       type => 'permission'},
  182     { var => 'permissionLevels{view_answers}',
  183       doc => 'Allowed to view past answers',
  184       doc2 => 'These users and higher get the "Show Past Answers" button on the problem page.',
  185       type => 'permission'},
  186     { var => 'permissionLevels{view_unopened_sets}',
  187       doc => 'Allowed to view problems in sets which are not open yet',
  188       type => 'permission'},
  189     { var => 'permissionLevels{show_correct_answers_before_answer_date}',
  190       doc => 'Allowed to see the correct answers before the answer date',
  191       type => 'permission'},
  192     { var => 'permissionLevels{show_solutions_before_answer_date}',
  193       doc => 'Allowed to see solutions before the answer date',
  194       type => 'permission'},
  195     { var => 'permissionLevels{can_show_old_answers_by_default}',
  196       doc => 'Can show old answers by default',
  197       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.',
  198       type => 'permission'},
  199     { var => 'permissionLevels{can_always_use_show_old_answers_default}',
  200       doc => 'Can always show old answers by default',
  201       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).',
  202       type => 'permission'},
  203   ],
  204   ['PG - Problem Display/Answer Checking',
  205     { var => 'pg{displayModes}',
  206       doc => 'List of display modes made available to students',
  207       doc2 => 'When viewing a problem, users may choose different methods of rendering
  208  formulas via an options box in the left panel.  Here, you can adjust what display modes are
  209  listed.<p>
  210  Some display modes require other software to be installed on the server.  Be sure to check
  211  that all display modes selected here work from your server.<p>
  212  The display modes are <ul>
  213 <li> plainText: shows the raw LaTeX strings for formulas.
  214 <li> formattedText: formulas are passed through the external program <code>tth</code>,
  215  which produces an HTML version of them.  Some browsers do not display all of the fonts
  216  properly.
  217 <li> images: produces images using the external programs LaTeX and dvipng.
  218 <li> jsMath: uses javascript to place symbols, which may come from fonts or images
  219  (the choice is configurable by the end user).
  220 <li> MathJax: a successor to jsMath, uses javascript to place render mathematics.
  221 <li> asciimath: renders formulas client side using ASCIIMathML
  222 <li> LaTeXMathML: renders formulas client side using LaTeXMathML
  223 </ul>
  224 <p>
  225 You must use at least one display mode.  If you select only one, then the options box will
  226  not give a choice of modes (since there will only be one active).',
  227       min  => 1,
  228       values => ["MathJax", "images", "plainText", "formattedText",  "jsMath",  "asciimath", "LaTeXMathML"],
  229       type => 'checkboxlist'},
  230 
  231     { var => 'pg{options}{displayMode} ',
  232       doc => 'The default display mode',
  233       doc2 => 'Enter one of the allowed display mode types above.  See \'display modes entry\' for descriptions.',
  234       min  => 1,
  235       type => 'text'},
  236 
  237     { var => 'pg{options}{showEvaluatedAnswers}',
  238       doc => 'Display the evaluated student answer',
  239       doc2 => 'Set to true to display the "Entered" column which automatically shows the evaluated student answer, e.g. 1
  240       if student input is sin(pi/2). If this is set to false, e.g. to save space in the response area, the student can
  241       still see their evaluated answer by hovering the mouse pointer over the typeset version of their answer.',
  242       type => 'boolean'},
  243 
  244     { var => 'pg{options}{showEvaluatedAnswers}',
  245       doc => 'Display the evaluated student answer',
  246       doc2 => 'Set to true to display the "Entered" column which automatically shows the evaluated student answer, e.g. 1
  247       if student input is sin(pi/2). If this is set to false, e.g. to save space in the response area, the student can
  248       still see their evaluated answer by hovering the mouse pointer over the typeset version of their answer.',
  249       type => 'boolean'},
  250 
  251     { var => 'pg{ansEvalDefaults}{useBaseTenLog}',
  252       doc => 'Use log base 10 instead of base <i>e</i>',
  253       doc2 => 'Set to true for log to mean base 10 log and false for log to mean natural logarithm',
  254       type => 'boolean'},
  255 
  256     { var => 'pg{ansEvalDefaults}{useOldAnswerMacros}',
  257       doc => 'Use older answer checkers',
  258       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.',
  259       type => 'boolean'},
  260 
  261     { var => 'pg{ansEvalDefaults}{defaultDisplayMatrixStyle}',
  262       doc => 'Control string for displaying matricies',
  263       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.',
  264       type => 'text'},
  265 
  266     { var => 'pg{ansEvalDefaults}{numRelPercentTolDefault}',
  267       doc => 'Allowed error, as a percentage, for numerical comparisons',
  268       doc2 => "When numerical answers are checked, most test if the student's answer
  269  is close enough to the programmed answer be computing the error as a percentage of
  270  the correct answer.  This value controls the default for how close the student answer
  271  has to be in order to be marked correct.
  272 <p>
  273 A value such as 0.1 means 0.1 percent error is allowed.",
  274       type => 'number'},
  275     { var => 'pg{ansEvalDefaults}{reducedScoringPeriod}',
  276       doc => 'Length of Reduced Credit Period in minutes',
  277       doc2 => 'The Reduced Credit Period (formally called the Reduced Scoring Period) is a period before the due date during which
  278  all additional work done by the student counts at a reduced rate. Here is where
  279  you set the length of this period in minutes. If this value is greater than 0, a
  280  message like "This assignment has a Reduced Credit Period that begins 11/08/2009
  281  at 06:17pm EST and ends on the due date, 11/10/2009 at 06:17pm EST. During this
  282  period all additional work done counts 50% of the original." will be displayed.<p>
  283  To use this, you also have to enable Reduced Credit for individual assignments by
  284  editing the set data using the Hmwk Sets Editor.<p>
  285  This works with the avg_problem_grader (which is the the default grader) and the
  286  std_problem_grader (the all or nothing grader).  It will work with custom graders
  287  if they are written appropriately.' ,
  288       type => 'number'},
  289     { var => 'pg{ansEvalDefaults}{reducedScoringValue}',
  290       doc => 'Value of work done in Reduced Credit Period' ,
  291       doc2 => 'The Reduced Credit Period (formally called the Reduced Scoring Period) is a period before the due date during which
  292  all additional work done by the student counts at a reduced rate. Here is where
  293  you set the reduced rate which must be a number in the interval [0,1]. 1 means no
  294  reduction. For example if this value is .5 and a student views a problem during the
  295  Reduced Credit Period, they will see the message "You are in the Reduced Credit
  296  Period: All additional work done counts 50% of the original." <p>
  297  To use this, you also have to enable Reduced Credit for individual assignments by
  298  editing the set data using the Hmwk Sets Editor.<p>
  299  This works with the avg_problem_grader (which is the the default grader) and the
  300  std_problem_grader (the all or nothing grader).  It will work with custom graders
  301  if they are written appropriately.' ,
  302       type => 'number'},
  303   ],
  304   ['E-Mail',
  305     { var => 'mail{feedbackSubjectFormat}',
  306       doc => 'Format for the subject line in feedback e-mails',
  307       doc2 => 'When students click the <em>Email Instructor</em> button
  308  to send feedback, WeBWorK fills in the subject line.  Here you can set the
  309  subject line.  In it, you can have various bits of information filled in
  310  with the following escape sequences.
  311 <p>
  312 <ul>
  313 <li> %c = course ID
  314 <li> %u = user ID
  315 <li> %s = set ID
  316 <li> %p = problem ID
  317 <li> %x = section
  318 <li> %r = recitation
  319 <li> %% = literal percent sign
  320 </ul>',
  321       width => 45,
  322       type => 'text'},
  323     { var => 'mail{feedbackVerbosity}',
  324       doc => 'E-mail verbosity level',
  325       doc2 => 'The e-mail verbosity level controls how much information is
  326  automatically added to feedback e-mails.  Levels are
  327 <ol>
  328 <li value="0"> send only the feedback comment and context link
  329 <li value="1"> as in 0, plus user, set, problem, and PG data
  330 <li value="2"> as in 1, plus the problem environment (debugging data)
  331 </ol>',
  332       type => 'number'
  333     },
  334     { var => 'mail{allowedRecipients}',
  335       doc => 'E-mail addresses which can receive e-mail from a pg problem',
  336       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.',
  337       type => 'list'},
  338     { var => 'permissionLevels{receive_feedback}',
  339       doc => 'E-mail feedback from students automatically sent to this permission level and higher:',
  340       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".',
  341       type => 'permission'},
  342 
  343     { var => 'mail{feedbackRecipients}',
  344       doc => 'Additional addresses for receiving feedback e-mail.',
  345       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.',
  346       type => 'list'},
  347   ]
  348 ];
  349 
  350 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9