version 1.192, 2003/06/19 20:15:30
|
version 1.193, 2003/06/23 19:22:00
|
Line 583 ENDPART
|
Line 583 ENDPART
|
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or |
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or |
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems')) { |
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems')) { |
#-- produce an output string |
#-- produce an output string |
|
my %form=(); |
|
$form{'grade_target'}='tex'; |
|
$form{'textwidth'}=$LaTeXwidth; |
|
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
my $flag_latex_header_remove = 'NO'; |
my $flag_latex_header_remove = 'NO'; |
my $flag_page_in_sequence = 'NO'; |
my $flag_page_in_sequence = 'NO'; |
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; |
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; |
|
my $prevassignment=''; |
for (my $i=0;$i<=$#master_seq;$i++) { |
for (my $i=0;$i<=$#master_seq;$i++) { |
$master_seq[$i]=~/___\d+___(.*)$/; |
$master_seq[$i]=~/___\d+___(.*)$/; |
my $urlp='/res/'.$1; |
my $urlp='/res/'.$1; |
Line 596 ENDPART
|
Line 601 ENDPART
|
} elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') { |
} elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') { |
$selectionmade = 4; |
$selectionmade = 4; |
} |
} |
my %form; |
|
$form{'grade_target'}='tex'; |
|
$form{'textwidth'}=$LaTeXwidth; |
|
$form{'symb'}=$master_seq[$i]; |
$form{'symb'}=$master_seq[$i]; |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$master_seq[$i]=~/\/([^\/]+)\.sequence_/; |
|
my $assignment=' '.$1.' '; |
#&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]"); |
#&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]"); |
my $texversion=&Apache::lonnet::ssi($urlp,%form); |
my $texversion=&Apache::lonnet::ssi($urlp,%form); |
if ($urlp=~/\.page$/) { |
if ($urlp=~/\.page$/) { |
Line 621 ENDPART
|
Line 624 ENDPART
|
my $answer=&Apache::lonnet::ssi($urlp,%form); |
my $answer=&Apache::lonnet::ssi($urlp,%form); |
$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; |
$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; |
} |
} |
$result .= $texversion; |
# $result .= $texversion; |
|
if (($selectionmade == 4) and ($assignment ne $prevassignment) and ($i>1)) { |
|
my $name = &get_name(); |
|
if ($name =~ /^\s*$/) { |
|
$name=&Apache::lonxml::latex_special_symbols($ENV{'user.name'},undef, |
|
undef,'header'); |
|
} |
|
my $courseidinfo = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($ENV{'course.'.$ENV{'request.course.id'}.'.description'}),'','','header'); |
|
$prevassignment=$assignment; |
|
$result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$name.'}} - '.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}} \vskip -5 mm '; |
|
} |
|
$result .= $texversion; |
$flag_latex_header_remove = 'YES'; |
$flag_latex_header_remove = 'YES'; |
} |
} |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
Line 658 ENDPART
|
Line 672 ENDPART
|
if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { |
if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { |
my %form; |
my %form; |
$form{'answer_output_mode'}='tex'; |
$form{'answer_output_mode'}='tex'; |
my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain, |
my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$ENV{'request.course.id'},%form); |
$ENV{'request.course.id'},%form); |
|
$rendered=~s/(\\keephidden{ENDOFPROBLEM})/$ansrendered$1/; |
$rendered=~s/(\\keephidden{ENDOFPROBLEM})/$ansrendered$1/; |
} |
} |
$current_output .= $rendered; |
$current_output .= $rendered; |
Line 1001 HELPERFRAGMENT
|
Line 1014 HELPERFRAGMENT
|
</resource> |
</resource> |
<message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message> |
<message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message> |
<choices variable="EMPTY_PAGES"> |
<choices variable="EMPTY_PAGES"> |
<choice computer='0'>Start each student's assignment on a new page (add a pagefeed after each assignment)</choice> |
<choice computer='0'>Start each student\'s assignment on a new page (add a pagefeed after each assignment)</choice> |
<choice computer='1'>Add one empty page after each student's assignment</choice> |
<choice computer='1'>Add one empty page after each student\'s assignment</choice> |
<choice computer='2'>Add two empty pages after each student's assignment</choice> |
<choice computer='2'>Add two empty pages after each student\'s assignment</choice> |
</choices> |
</choices> |
</state> |
</state> |
CHOOSE_STUDENTS |
CHOOSE_STUDENTS |