version 1.403, 2005/12/06 16:23:26
|
version 1.406, 2005/12/15 18:36:23
|
Line 844 sub print_latex_header {
|
Line 844 sub print_latex_header {
|
|
|
sub path_to_problem { |
sub path_to_problem { |
my ($urlp,$colwidth)=@_; |
my ($urlp,$colwidth)=@_; |
|
$urlp=&Apache::lonnet::clutter($urlp); |
|
|
my $newurlp = ''; |
my $newurlp = ''; |
$colwidth=~s/\s*mm\s*$//; |
$colwidth=~s/\s*mm\s*$//; |
#characters average about 2 mm in width |
#characters average about 2 mm in width |
if (length($urlp)*2 > $colwidth) { |
if (length($urlp)*2 > $colwidth) { |
my @elements = split '/',$urlp; |
my @elements = split('/',$urlp); |
my $curlength=0; |
my $curlength=0; |
foreach my $element (@elements) { |
foreach my $element (@elements) { |
|
if ($element eq '') { next; } |
if ($curlength+(length($element)*2) > $colwidth) { |
if ($curlength+(length($element)*2) > $colwidth) { |
$newurlp .= '|\vskip -1 mm \noindent \verb|'; |
$newurlp .= '|\vskip -1 mm \verb|'; |
$curlength=0; |
$curlength=length($element)*2; |
} else { |
} else { |
$curlength+=length($element)*2; |
$curlength+=length($element)*2; |
} |
} |
Line 1183 ENDPART
|
Line 1186 ENDPART
|
} else { |
} else { |
$texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); |
$texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); |
$texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm '; |
$texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm '; |
$texversion.=&path_to_problem ($currentURL,$LaTeXwidth); |
$texversion.=&path_to_problem($urlp,$LaTeXwidth); |
$texversion.='\vskip 1 mm '.$answer.'\end{document}'; |
$texversion.='\vskip 1 mm '.$answer.'\end{document}'; |
} |
} |
} |
} |
Line 1750 sub print_resources {
|
Line 1753 sub print_resources {
|
} else { |
} else { |
$rendered=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); |
$rendered=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); |
$rendered.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($curresline).'}\vskip 0 mm '; |
$rendered.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($curresline).'}\vskip 0 mm '; |
$rendered.=&path_to_problem ($curresline,$LaTeXwidth); |
$rendered.=&path_to_problem($res_url,$LaTeXwidth); |
$rendered.='\vskip 1 mm '.$ansrendered; |
$rendered.='\vskip 1 mm '.$ansrendered; |
} |
} |
} |
} |
Line 2169 CHOOSE_STUDENTS
|
Line 2172 CHOOSE_STUDENTS
|
my %all_codes = &Apache::lonnet::get('CODEs', |
my %all_codes = &Apache::lonnet::get('CODEs', |
\@names, $cdom,$cnum); |
\@names, $cdom,$cnum); |
my %code_values; |
my %code_values; |
my @all_code_array; |
my %codes_to_print; |
foreach my $key (keys %all_codes) { |
foreach my $key (keys(%all_codes)) { |
%code_values = &Apache::grades::get_codes($key, $cdom, $cnum); |
%code_values = &Apache::grades::get_codes($key, $cdom, $cnum); |
foreach my $key (keys %code_values) { |
foreach my $key (keys(%code_values)) { |
push (@all_code_array, "$key"); |
$codes_to_print{$key} = 1; |
} |
} |
} |
} |
|
|
my $code_selection = "<choice></choice>\n"; |
my $code_selection = "<choice></choice>\n"; |
foreach my $code (sort {uc($a) cmp uc($b)} @all_code_array) { |
foreach my $code (sort {uc($a) cmp uc($b)} (keys(%codes_to_print))) { |
my $choice = $code; |
my $choice = $code; |
if ($code =~ /^[A-Z]+$/) { # Alpha code |
if ($code =~ /^[A-Z]+$/) { # Alpha code |
$choice = &letters_to_num($code); |
$choice = &letters_to_num($code); |
Line 2394 CHOOSE_FROM_SUBDIR
|
Line 2397 CHOOSE_FROM_SUBDIR
|
<valuefunc>return $urlValue;</valuefunc> |
<valuefunc>return $urlValue;</valuefunc> |
<choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0); |
<choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0); |
</choicefunc> |
</choicefunc> |
<option text='Newpage' variable='FINISHPAGE' /> |
|
</resource> |
</resource> |
</state> |
</state> |
<state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print"> |
<state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print"> |