version 1.435, 2006/04/06 22:32:07
|
version 1.439, 2006/05/30 12:46:09
|
Line 42 use Apache::lonratedt;
|
Line 42 use Apache::lonratedt;
|
use POSIX qw(strftime); |
use POSIX qw(strftime); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Carp; |
use Carp; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
my %perm; |
my %perm; |
|
|
Line 707 sub get_name {
|
Line 709 sub get_name {
|
sub get_course { |
sub get_course { |
my $courseidinfo; |
my $courseidinfo; |
if (defined($env{'request.course.id'})) { |
if (defined($env{'request.course.id'})) { |
$courseidinfo = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); |
$courseidinfo = &Apache::lonxml::latex_special_symbols(&unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); |
} |
} |
return $courseidinfo; |
return $courseidinfo; |
} |
} |
Line 1322 ENDPART
|
Line 1324 ENDPART
|
$resources_printed .= $urlp.':'; |
$resources_printed .= $urlp.':'; |
|
|
&Apache::lonxml::remember_problem_counter(); |
&Apache::lonxml::remember_problem_counter(); |
|
|
$texversion.=&Apache::lonnet::ssi($urlp,%form); |
$texversion.=&Apache::lonnet::ssi($urlp,%form); |
if ($urlp=~/\.page$/) { |
if ($urlp=~/\.page$/) { |
($texversion,my $number_of_columns_page) = &page_cleanup($texversion); |
($texversion,my $number_of_columns_page) = &page_cleanup($texversion); |
Line 1671 ENDPART
|
Line 1672 ENDPART
|
$selectionmade, |
$selectionmade, |
$helper->{'VARS'}->{'ANSWER_TYPE'}); |
$helper->{'VARS'}->{'ANSWER_TYPE'}); |
} |
} |
#changes page's parameters for the one column output |
&Apache::lonnet::logthis("Resetting page e.g. height -> $helper->{'VARS'}->{'pagesize.height'}"); |
if ($numberofcolumns == 1) { |
&Apache::lonnet::logthis("Before: $result \n--------------------------\n"); |
$result =~ s/\\textwidth\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; |
$result =~ s/\\textwidth\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; |
$result =~ s/\\textheight\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /; |
$result =~ s/\\textheight\s*=?\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /; |
$result =~ s/\\evensidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
$result =~ s/\\evensidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
$result =~ s/\\oddsidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
$result =~ s/\\oddsidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
} |
|
|
&Apache::lonnet::logthis("After: $result \n----------------------------------\n"); |
|
|
#-- writing .tex file in prtspool |
#-- writing .tex file in prtspool |
my $temp_file; |
my $temp_file; |
Line 1733 ENDPART
|
Line 1735 ENDPART
|
my $URLback=''; #link to original document |
my $URLback=''; #link to original document |
if ($helper->{'VARS'}->{'construction'} ne '1') { |
if ($helper->{'VARS'}->{'construction'} ne '1') { |
#prints published resource |
#prints published resource |
$URLback=&Apache::lonnet::escape('/adm/flip?postdata=return:'); |
$URLback=&escape('/adm/flip?postdata=return:'); |
} else { |
} else { |
#prints resource from the construction space |
#prints resource from the construction space |
$URLback='/'.$helper->{'VARS'}->{'filename'}; |
$URLback='/'.$helper->{'VARS'}->{'filename'}; |
Line 2260 RESOURCE_SELECTOR
|
Line 2262 RESOURCE_SELECTOR
|
<choice computer='0'>Sort by section then student</choice> |
<choice computer='0'>Sort by section then student</choice> |
<choice computer='1'>Sort by students across sections.</choice> |
<choice computer='1'>Sort by students across sections.</choice> |
</choices> |
</choices> |
|
<message><br /><hr /><br /> </message> |
<student multichoice='1' variable="STUDENTS" nextstate="SELECT_PROBLEMS" coursepersonnel="1"/> |
<student multichoice='1' variable="STUDENTS" nextstate="SELECT_PROBLEMS" coursepersonnel="1"/> |
</state> |
</state> |
$resource_selector |
$resource_selector |
Line 2293 CHOOSE_STUDENTS
|
Line 2296 CHOOSE_STUDENTS
|
} |
} |
push(@{$helper->{DATA}{ALL_CODE_CHOICES}},[$code,$choice]); |
push(@{$helper->{DATA}{ALL_CODE_CHOICES}},[$code,$choice]); |
} |
} |
$code_selection .= |
if (%codes_to_print) { |
' |
$code_selection .=' |
<exec> |
<exec> |
push(@{$state->{CHOICES}},@{$helper->{DATA}{ALL_CODE_CHOICES}}); |
push(@{$state->{CHOICES}},@{$helper->{DATA}{ALL_CODE_CHOICES}}); |
</exec> |
</exec> |
'.$/; |
'.$/; |
|
} |
|
|
|
|
open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); |
open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); |
Line 2418 RESOURCE_SELECTOR
|
Line 2422 RESOURCE_SELECTOR
|
<choice computer='0'>Sort by section then student</choice> |
<choice computer='0'>Sort by section then student</choice> |
<choice computer='1'>Sort by students across sections.</choice> |
<choice computer='1'>Sort by students across sections.</choice> |
</choices> |
</choices> |
|
<message><br /><hr /><br /></message> |
<student multichoice='1' variable="STUDENTS" nextstate="SELECT_RESOURCES" coursepersonnel="1" /> |
<student multichoice='1' variable="STUDENTS" nextstate="SELECT_RESOURCES" coursepersonnel="1" /> |
|
|
</state> |
</state> |
Line 2879 sub render {
|
Line 2884 sub render {
|
$result .= '<br /><font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br />'; |
$result .= '<br /><font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br />'; |
} |
} |
|
|
|
my $width = 18; |
|
my $format = $helper->{VARS}->{$self->{'formatvar'}}; |
|
if (substr($format, 2, 1) ne '1') { |
|
$width = 9; |
|
} |
|
|
$result .= <<ELEMENTHTML; |
$result .= <<ELEMENTHTML; |
|
|
<p>How should the column be formatted?</p> |
<p>How should the column be formatted?</p> |
Line 2886 sub render {
|
Line 2897 sub render {
|
<table cellpadding='3'> |
<table cellpadding='3'> |
<tr> |
<tr> |
<td align='right'><b>Width</b>:</td> |
<td align='right'><b>Width</b>:</td> |
<td align='left'><input type='text' name='$var.width' value='18' size='4'></td> |
<td align='left'><input type='text' name='$var.width' value='$width' size='4'></td> |
<td align='left'> |
<td align='left'> |
<select name='$var.widthunit'> |
<select name='$var.widthunit'> |
<option>cm</option><option>in</option> |
<option>cm</option><option>in</option> |
Line 2927 sub preprocess {
|
Line 2938 sub preprocess {
|
my $helper = Apache::lonhelper::getHelper(); |
my $helper = Apache::lonhelper::getHelper(); |
|
|
my $format = $helper->{VARS}->{$self->{'formatvar'}}; |
my $format = $helper->{VARS}->{$self->{'formatvar'}}; |
if (substr($format, 2, 1) ne '1') { |
# if (substr($format, 2, 1) ne '1') { |
$helper->changeState($self->{NEXTSTATE}); |
# $helper->changeState($self->{NEXTSTATE}); |
} |
# } |
|
|
return 1; |
return 1; |
} |
} |