From: jj v. a. <we...@ma...> - 2005-08-23 22:52:13
|
Log Message: ----------- Allow snippets of html (or Tex) to be specified in global.conf to be inserted right before/after the body of a problem. A commented out example which produces boxed problem in HTML is given. In this approach, the added parts are not used for problems rendered in the Library Browser or Problem Set Detail. This addresses bug 817. This solution may not be suitable for inclusion of needed bits for modes such as asciimath or tth because the those bits of html are probably needed for display in the Library Browser. It is hard to distinguish bits which are always wanted, and those which are only wanted for use by Problem. To make use of this, you need to update your global.conf, and make the corresponding pg update. Modified Files: -------------- webwork-modperl/conf: global.conf.dist webwork-modperl/lib/WeBWorK/Utils: Tasks.pm Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/conf/global.conf.dist,v retrieving revision 1.128 retrieving revision 1.129 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.128 -r1.129 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -678,6 +678,21 @@ # Size in pixels of dynamically-generated images, i.e. graphs. $pg{specialPGEnvironmentVars}{onTheFlyImageSize} = 400, +# Strings to insert at the start and end of the body of a problem +# (at beginproblem() and ENDDOCUMENT) in various modes. More display modes +# can be added if different behaviours are desired (e.g., HTML_dpng, +# HTML_asciimath, etc.). These parts are not used in the Library browser. + +$pg{specialPGEnvironmentVars}{problemPreamble} = { TeX => '', HTML=> '' }; +$pg{specialPGEnvironmentVars}{problemPostamble} = { TeX => '', HTML=>'' }; + +# To have the problem body indented and boxed, uncomment: + +# $pg{specialPGEnvironmentVars}{problemPreamble}{HTML} = '<BLOCKQUOTE> +# <TABLE BORDER=1 CELLSPACING=1 CELLPADDING=15 BGCOLOR=#E8E8E8><TR><TD>'; +# $pg{specialPGEnvironmentVars}{problemPostamble}{HTML} = '</TD></TR></TABLE> +# </BLOCKQUOTE>'; + ##### PG modules to load # The first item of each list is the module to load. The remaining items are Index: Tasks.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Utils/Tasks.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -Llib/WeBWorK/Utils/Tasks.pm -Llib/WeBWorK/Utils/Tasks.pm -u -r1.11 -r1.12 --- lib/WeBWorK/Utils/Tasks.pm +++ lib/WeBWorK/Utils/Tasks.pm @@ -132,6 +132,12 @@ my $displayMode = $args{displayMode} || $r->param("displayMode") || $ce->{pg}->{options}->{displayMode}; my $problemNumber= $args{'problem_number'} || 1; + $ce->{pg}->{specialPGEnvironmentVars}->{problemPreamble} = { + TeX=>'', + HTML=>''}; + $ce->{pg}->{specialPGEnvironmentVars}->{problemPostamble} = { + TeX=>'', + HTML=>''}; my @output = (); my $onefile; |