version 1.557.2.2, 2009/07/14 11:08:00
|
version 1.557.2.4, 2009/07/23 10:42:41
|
Line 104 sub fetch_raw_resource {
|
Line 104 sub fetch_raw_resource {
|
sub annotate { |
sub annotate { |
my ($symb) = @_; |
my ($symb) = @_; |
|
|
my $annotation_text = &Apache::admannotations::get_annotation($symb, 1); |
my $annotation_text = &Apache::loncommon::get_annotation($symb, 1); |
|
|
|
|
my $result = ""; |
my $result = ""; |
Line 230 sub include_pdf {
|
Line 230 sub include_pdf {
|
sub ssi_with_retries { |
sub ssi_with_retries { |
my ($resource, $retries, %form) = @_; |
my ($resource, $retries, %form) = @_; |
|
|
|
my $target = $form{'grade_target'}; |
|
my $aom = $form{'answer_output_mode'}; |
|
|
|
|
|
|
my ($content, $response) = &Apache::loncommon::ssi_with_retries($resource, $retries, %form); |
my ($content, $response) = &Apache::loncommon::ssi_with_retries($resource, $retries, %form); |
if (!$response->is_success) { |
if (!$response->is_success) { |
Line 1344 sub print_page_in_course {
|
Line 1348 sub print_page_in_course {
|
$currentURL=~s|^(/adm/wrapper/)?ext/|http://|; |
$currentURL=~s|^(/adm/wrapper/)?ext/|http://|; |
my $title=&Apache::lonnet::gettitle($symb); |
my $title=&Apache::lonnet::gettitle($symb); |
$title = &Apache::lonxml::latex_special_symbols($title); |
$title = &Apache::lonxml::latex_special_symbols($title); |
$result.=' \strut \\\\ '.$title.' \strut \\\\ '.$currentURL.' '; |
|
} else { |
} else { |
$result.=$currentURL; |
$result.=$currentURL; |
} |
} |
|
$result .= '\\\\'; |
|
|
if ($helper->{'VARS'}->{'style_file'}=~/\w/) { |
if ($helper->{'VARS'}->{'style_file'}=~/\w/) { |
&Apache::lonnet::appenv({'construct.style' => |
&Apache::lonnet::appenv({'construct.style' => |
$helper->{'VARS'}->{'style_file'}}); |
$helper->{'VARS'}->{'style_file'}}); |
Line 1355 sub print_page_in_course {
|
Line 1360 sub print_page_in_course {
|
&Apache::lonnet::delenv('construct.style'); |
&Apache::lonnet::delenv('construct.style'); |
} |
} |
|
|
# First is theo verall page description. This is then followed by the |
# First is the overall page description. This is then followed by the |
# components of the page. Each of which must be printed independently. |
# components of the page. Each of which must be printed independently. |
|
|
my $the_page = shift(@page_resources); |
my $the_page = shift(@page_resources); |
$result .= "URL: $currentURL " .'\\\\'; |
|
|
|
foreach my $resource (@page_resources) { |
foreach my $resource (@page_resources) { |
my $resource_src = $resource->src(); # Essentially the URL of the resource. |
my $resource_src = $resource->src(); # Essentially the URL of the resource. |
|
$result .= $resource->title() . '\\\\'; |
|
|
# Recurse if a .page: |
# Recurse if a .page: |
|
|
if ($resource_src =~ /.page$/i) { |
if ($resource_src =~ /.page$/i) { |
Line 1408 sub print_page_in_course {
|
Line 1413 sub print_page_in_course {
|
|
|
my $texversion = &ssi_with_retries($urlp, $ssi_retry_count, %form); |
my $texversion = &ssi_with_retries($urlp, $ssi_retry_count, %form); |
|
|
|
# There seems to be an extraneous \vskip 1mm \\\\ : |
|
|
|
$texversion =~ s/^\\vskip 1mm \\\\\\\\//; |
|
|
# current document with answers.. no need to encap in minipage |
# current document with answers.. no need to encap in minipage |
# since there's only one answer. |
# since there's only one answer. |
|
|
if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') || |
if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') || |
($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) { |
($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) { |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
my %answerform = %form; |
$form{'grade_target'}='answer'; |
|
$form{'answer_output_mode'}='tex'; |
|
$form{'rndseed'}=$rndseed; |
$answerform{'problem_split'}=$parmhash{'problem_stream_switch'}; |
|
$answerform{'grade_target'}='answer'; |
|
$answerform{'answer_output_mode'}='tex'; |
|
$answerform{'rndseed'}=$rndseed; |
if ($helper->{'VARS'}->{'probstatus'} eq 'exam') { |
if ($helper->{'VARS'}->{'probstatus'} eq 'exam') { |
$form{'problemtype'}='exam'; |
$answerform{'problemtype'}='exam'; |
} |
} |
$resources_printed .= $currentURL.':'; |
$resources_printed .= $urlp.':'; |
my $answer=&ssi_with_retries($currentURL,$ssi_retry_count, %form); |
my $answer=&ssi_with_retries($urlp,$ssi_retry_count, %answerform); |
|
|
|
|
if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { |
if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { |
$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; |
$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; |
Line 1891 ENDPART
|
Line 1902 ENDPART
|
&& $currentURL=~/\.(sequence|page)$/ && $helper->{'VARS'}->{'construction'} eq '1') { |
&& $currentURL=~/\.(sequence|page)$/ && $helper->{'VARS'}->{'construction'} eq '1') { |
#printing content of sequence from the construction space |
#printing content of sequence from the construction space |
|
|
&Apache::lonnet::logthis("Printing sequence/page but construction space??"); |
|
|
|
$currentURL=~s|\/~([^\/]+)\/|\/home\/$1\/public_html\/|; |
$currentURL=~s|\/~([^\/]+)\/|\/home\/$1\/public_html\/|; |
# $result .= &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); |
# $result .= &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); |
Line 1929 ENDPART
|
Line 1939 ENDPART
|
$result .= &include_pdf($cleanURL); |
$result .= &include_pdf($cleanURL); |
$result .= '\end{document}'; |
$result .= '\end{document}'; |
} elsif ($cleanURL =~ /\.page$/i) { # Print page in non construction space contexts. |
} elsif ($cleanURL =~ /\.page$/i) { # Print page in non construction space contexts. |
&Apache::lonnet::logthis("Printing .page $cleanURL at " . __LINE__); |
|
|
|
# Determine the set of resources in the map of the page: |
# Determine the set of resources in the map of the page: |
|
|
Line 2007 ENDPART
|
Line 2016 ENDPART
|
my $texversion=''; |
my $texversion=''; |
if ($urlp!~m|^/adm/| |
if ($urlp!~m|^/adm/| |
&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
&Apache::lonnet::logthis("At line 1834 printing $urlp"); |
|
$resources_printed .= $urlp.':'; |
$resources_printed .= $urlp.':'; |
&Apache::lonxml::remember_problem_counter(); |
&Apache::lonxml::remember_problem_counter(); |
$texversion.=&ssi_with_retries($urlp, $ssi_retry_count, %form); |
$texversion.=&ssi_with_retries($urlp, $ssi_retry_count, %form); |
if ($urlp=~/\.page$/) { |
if ($urlp=~/\.page$/) { |
&Apache::lonnet::logthis("Handling a .page at ". __LINE__); |
|
|
|
($texversion,my $number_of_columns_page) = &page_cleanup($texversion); |
($texversion,my $number_of_columns_page) = &page_cleanup($texversion); |
if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} |
if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} |
Line 2602 sub print_resources {
|
Line 2609 sub print_resources {
|
if ($res_url!~m|^ext/| |
if ($res_url!~m|^ext/| |
&& $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
&& $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
$printed .= $curresline.':'; |
$printed .= $curresline.':'; |
&Apache::lonnet::logthis("At line 2427 printing $curresline"); |
|
&Apache::lonxml::remember_problem_counter(); |
&Apache::lonxml::remember_problem_counter(); |
|
|
my $rendered = &get_student_view_with_retries($curresline,$ssi_retry_count,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv); |
my $rendered = &get_student_view_with_retries($curresline,$ssi_retry_count,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv); |