[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Mon, 17 Feb 2003 16:43:54 -0000
This is a MIME encoded message
--sakharuk1045500234
Content-Type: text/plain
sakharuk Mon Feb 17 11:43:54 2003 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
1. Addede Greek alphabet as I promised et the end of last week;
2. Done really important changes to print the name of the student in the header for the item - print assignment for the group of students. It appears that the very important thing here is the order of commands in the header of document (I could not find any notion about this in manuals, books or newsgroups. Anyway, it works now.
3. Done cosmetic changes to the item All problems from "main.sequence" for selected students to avoide further questions from users (Lars, for example).
--sakharuk1045500234
Content-Type: text/plain
Content-Disposition: attachment; filename="sakharuk-20030217114354.txt"
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.116 loncom/interface/lonprintout.pm:1.117
--- loncom/interface/lonprintout.pm:1.116 Fri Feb 14 16:43:35 2003
+++ loncom/interface/lonprintout.pm Mon Feb 17 11:43:54 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.116 2003/02/14 21:43:35 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.117 2003/02/17 16:43:54 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -381,11 +381,12 @@
}
}
$r->print(<<ENDMENUOUT2);
-<br />Number of blank pages to add: <select name="addedpages"><option selected>0</option>
- <option>1</option>
- <option>2</option>
- <option>3</option>
- </select>
+<br /><br /><br />
+<table><tr><td width=300>Number of blank pages added to each student assignments to print these assignments on physically different sheets (<b>requires manual addjustment</b>): <select name="addedpages"><option selected>0</option>
+ <option>1</option>
+ <option>2</option>
+ <option>3</option>
+ </select></td></tr></table>
<br />
<input type="hidden" name="papersize" value="$ENV{'form.papersize'}">
<input type="hidden" name="numberofstudents" value="$i">
@@ -630,13 +631,13 @@
$flag_latex_header_remove = 'YES';
}
}
+ my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
if ($current_output=~/\\documentclass/) {
- my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
- $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{$courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}} \\begin{document}\\noindent\\textit{\\textbf{$fullname}}\\vskip 3 mm /;
+ $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\vskip 3 mm /;
} else {
my $blanspages = '';
for (my $j=0;$j<$ENV{'form.addedpages'};$j++) {$blanspages.='\clearpage\strut\clearpage';}
- $current_output = '\strut\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License } \\vskip 3mm'.$blanspages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\textit{\textbf{'.$fullname.'}}\hskip 1.4in } \vskip 5 mm '.$current_output;
+ $current_output = '\strut\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License } \\vskip 3mm'.$blanspages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}} - '.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}\hskip 1.4in } \vskip 5 mm '.$current_output;
}
$result .= $current_output;
&Apache::lonnet::delenv('form.counter');
@@ -834,7 +835,6 @@
$result =~ s/&\#0?61;/\$=\$/g;
$result =~ s/&(\#0?62|gt|\#155);/\$>\$/g;
$result =~ s/&\#0?63;/\?/g;
-# $result =~ s/�?64;//g;
$result =~ s/&\#0?65;/A/g;
$result =~ s/&\#0?66;/B/g;
$result =~ s/&\#0?67;/C/g;
@@ -924,8 +924,6 @@
$result =~ s/&(\#168|uml);/\\texthighdieresis /g;
$result =~ s/&(\#169|copy);/\\copyright /g;
$result =~ s/&(\#170|ordf);/\\textordfeminine /g;
-# $result =~ s/«//g;
-# $result =~ s/«//g;
$result =~ s/&(\#172|not);/\$\\neg\$/g;
$result =~ s/&(\#173|shy);/ - /g;
$result =~ s/&(\#174|reg);/\\textregistered /g;
@@ -941,8 +939,6 @@
$result =~ s/&(\#184|cedil);/\\c{\\strut}/g;
$result =~ s/&(\#185|sup1);/\$^1\$/g;
$result =~ s/&(\#186|ordm);/\\textordmasculine /g;
-# $result =~ s/»//g;
-# $result =~ s/»//g;
$result =~ s/&(\#188|frac14);/\\textonequarter /g;
$result =~ s/&(\#189|frac12);/\\textonehalf /g;
$result =~ s/&(\#190|frac34);/\\textthreequarters /g;
@@ -963,8 +959,6 @@
$result =~ s/&(\#205|Iacute);/\\\'{I}/g;
$result =~ s/&(\#206|Icirc);/\\^{I}/g;
$result =~ s/&(\#207|Iuml);/\\\"{I}/g;
-# $result =~ s/Ð//g;
-# $result =~ s/Ð//g;
$result =~ s/&(\#209|Ntilde);/\\~{N}/g;
$result =~ s/&(\#210|Ograve);/\\\`{O}/g;
$result =~ s/&(\#211|Oacute);/\\\'{O}/g;
@@ -978,8 +972,6 @@
$result =~ s/&(\#219|Ucirc);/\\^{U}/g;
$result =~ s/&(\#220|Uuml);/\\\"{U}/g;
$result =~ s/&(\#221|Yacute);/\\\'{Y}/g;
-# $result =~ s/Þ//g;
-# $result =~ s/Þ//g;
$result =~ s/&(\#223|szlig);/\\ss/g;
$result =~ s/&(\#224|agrave);/\\\`{a}/g;
$result =~ s/&(\#225|aacute);/\\\'{a}/g;
@@ -1011,10 +1003,44 @@
$result =~ s/&(\#251|ucirc);/\\^{u}/g;
$result =~ s/&(\#252|uuml);/\\\"{u}/g;
$result =~ s/&(\#253|yacute);/\\\'{y}/g;
-# $result =~ s/þ//g;
-# $result =~ s/þ//g;
$result =~ s/&(\#255|yuml);/\\\"{y}/g;
$result =~ s/&\#952;/\$\\theta\$/g;
+#Greek Alphabet
+ $result =~ s/&(alpha|\#945);/\$\\alpha \$/g;
+ $result =~ s/&(beta|\#946);/\$\\beta \$/g;
+ $result =~ s/&(gamma|\#947);/\$\\gamma \$/g;
+ $result =~ s/&(delta|\#948);/\$\\delta \$/g;
+ $result =~ s/&(epsilon|\#949);/\$\\epsilon \$/g;
+ $result =~ s/&(zeta|\#950);/\$\\zeta \$/g;
+ $result =~ s/&(eta|\#951);/\$\\eta \$/g;
+ $result =~ s/&(theta|\#952);/\$\\theta \$/g;
+ $result =~ s/&(iota|\#953);/\$\\iota \$/g;
+ $result =~ s/&(kappa|\#954);/\$\\kappa \$/g;
+ $result =~ s/&(lambda|\#955);/\$\\lambda \$/g;
+ $result =~ s/&(mu|\#956);/\$\\mu \$/g;
+ $result =~ s/&(nu|\#957);/\$\\nu \$/g;
+ $result =~ s/&(xi|\#958);/\$\\xi \$/g;
+ $result =~ s/&(pi|\#960);/\$\\pi \$/g;
+ $result =~ s/&(rho|\#961);/\$\\rho \$/g;
+ $result =~ s/&(sigma|\#963);/\$\\sigma \$/g;
+ $result =~ s/&(tau|\#964);/\$\\tau \$/g;
+ $result =~ s/&(upsilon|\#965);/\$\\upsilon \$/g;
+ $result =~ s/&(phi|\#966);/\$\\phi \$/g;
+ $result =~ s/&(chi|\#967);/\$\\chi \$/g;
+ $result =~ s/&(psi|\#968);/\$\\psi \$/g;
+ $result =~ s/&(omega|\#969);/\$\\omega \$/g;
+ $result =~ s/&(Gamma|\#915);/\$\\Gamma \$/g;
+ $result =~ s/&(Delta|\#916);/\$\\Delta \$/g;
+ $result =~ s/&(Theta|\#920);/\$\\Theta \$/g;
+ $result =~ s/&(Lambda|\#923);/\$\\Lambda \$/g;
+ $result =~ s/&(Xi|\#926);/\$\\Xi \$/g;
+ $result =~ s/&(Pi|\#928);/\$\\Pi \$/g;
+ $result =~ s/&(Sigma|\#931);/\$\\Sigma \$/g;
+ $result =~ s/&(Upsilon|\#933);/\$\\Upsilon \$/g;
+ $result =~ s/&(Phi|\#934);/\$\\Phi \$/g;
+ $result =~ s/&(Psi|\#936);/\$\\Psi \$/g;
+ $result =~ s/&(Omega|\#937);/\$\\Omega \$/g;
+
return $result;
}
@@ -1104,7 +1130,8 @@
if ($choice ne 'All class print') {
$text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$firstname $lastname} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/;
} else {
- $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-0\.8cm\\setcounter{page}{1} \\vskip 5 mm /;
+ $text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\begin{document}\\voffset=-0\.8cm\\setcounter{page}{1} \\vskip 5 mm /;
+
}
}
return $text;
--sakharuk1045500234--