--- loncom/interface/lonprintout.pm 2008/03/03 10:50:26 1.516 +++ loncom/interface/lonprintout.pm 2008/03/12 02:45:07 1.520 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.516 2008/03/03 10:50:26 foxr Exp $ +# $Id: lonprintout.pm,v 1.520 2008/03/12 02:45:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -149,6 +149,8 @@ sub ssi_with_retries { $ssi_error = 1; $ssi_last_error_resource = $resource; $ssi_last_error = $response->code . " " . $response->message; + + &Apache::lonnet::logthis("Error in SSI resource: $resource Error: $ssi_last_error"); } return $content; @@ -1124,6 +1126,7 @@ sub print_latex_header { '\usepackage[dvips]{graphicx}\usepackage{epsfig}'."\n". '\usepackage{wrapfig}'. '\usepackage{picins}\usepackage{calc}'."\n". + '\usepackage[utf8]{inputenc}'."\n". '\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}'."\n". '\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}'."\n". '\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}'."\n". @@ -1470,8 +1473,8 @@ ENDPART } if ($helper->{'VARS'}->{'style_file'}=~/\w/) { - &Apache::lonnet::appenv('construct.style' => - $helper->{'VARS'}->{'style_file'}); + &Apache::lonnet::appenv({'construct.style' => + $helper->{'VARS'}->{'style_file'}}); } elsif ($env{'construct.style'}) { &Apache::lonnet::delenv('construct\\.style'); } @@ -1514,7 +1517,7 @@ ENDPART $rndseed=$helper->{'VARS'}->{'curseed'}; } $form{'rndseed'}=$rndseed; - &Apache::lonnet::appenv(%moreenv); + &Apache::lonnet::appenv(\%moreenv); &Apache::lonxml::clear_problem_counter(); @@ -2165,7 +2168,7 @@ ERROR_END # yet. my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - &Apache::lonnet::appenv('cgi.'.$identifier.'.file' => $filename, + &Apache::lonnet::appenv({'cgi.'.$identifier.'.file' => $filename, 'cgi.'.$identifier.'.layout' => $laystyle, 'cgi.'.$identifier.'.numcol' => $numberofcolumns, 'cgi.'.$identifier.'.paper' => $papersize, @@ -2175,12 +2178,12 @@ ERROR_END 'cgi.'.$identifier.'.role' => $perm{'pav'}, 'cgi.'.$identifier.'.numberoffiles' => $#print_array, 'cgi.'.$identifier.'.studentnames' => $student_names, - 'cgi.'.$identifier.'.backref' => $URLback,); - &Apache::lonnet::appenv("cgi.$identifier.user" => $env{'user.name'}, + 'cgi.'.$identifier.'.backref' => $URLback,}); + &Apache::lonnet::appenv({"cgi.$identifier.user" => $env{'user.name'}, "cgi.$identifier.domain" => $env{'user.domain'}, "cgi.$identifier.courseid" => $cnum, "cgi.$identifier.coursedom" => $cdom, - "cgi.$identifier.resources" => $resources_printed); + "cgi.$identifier.resources" => $resources_printed}); my $end_page = &Apache::loncommon::end_page(); $r->print(<declareVar("showallfoils"); $helper->declareVar("STUDENTS"); + + + + # The page breaks can get loaded initially from the course environment: # But we only do this in the initial state so that they are allowed to change. # @@ -3205,19 +3212,24 @@ RNDSEED addMessage("Problem Type:"); - $paramHash = &Apache::lonhelper::getParamHash(); - $paramHash->{'variable'} = 'probstatus'; # Already declared: # # Initial value from construction space: # if (!$helper->{VARS}->{'probstatus'} && $env{'form.problemtype'}) { $helper->{VARS}->{'probstatus'} = $env{'form.problemtype'}; # initial value } - $paramHash->{CHOICES} = [ - ['Homework problem', 'problem'], - ['Exam Problem', 'exam'], - ['Survey question', 'survey']]; - Apache::lonhelper::dropdown->new(); + $xmlfrag = << "PROBTYPE"; + + + return "$helper->{VARS}->{'probstatus'}"; + + Homework Problem + Exam Problem + Survey question + +PROBTYPE + &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag); + addMessage(""); }