--- loncom/interface/lonprintout.pm 2005/03/28 12:14:13 1.371 +++ loncom/interface/lonprintout.pm 2005/03/29 10:21:21 1.372 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.371 2005/03/28 12:14:13 foxr Exp $ +# $Id: lonprintout.pm,v 1.372 2005/03/29 10:21:21 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -841,6 +841,7 @@ Please stand by while processing your pr ENDPART + # fetch the pagebreaks and store them in the course environment # The page breaks will be pulled into the hash %page_breaks which is # indexed by symb and contains 1's for each break. @@ -877,7 +878,18 @@ ENDPART my %form; $form{'grade_target'} = 'tex'; $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); - + + # If form.showallfoils is set, then request all foils be shown: + # privilege will be enforced both by not allowing the + # check box selecting this option to be presnt unless it's ok, + # and by lonresponse's priv. check. + # The if is here because lonresponse.pm only cares that + # showallfoils is defined, not what the value is. + + if ($helper->{'VARS'}->{'showallfoils'} eq "1") { + $form{'showallfoils'} = $helper->{'VARS'}->{'showallfoils'}; + } + if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') { #-- single document - problem, page, html, xml, ... my ($currentURL,$cleanURL); @@ -1649,6 +1661,7 @@ sub printHelper { $helper->declareVar('student_sort'); $helper->declareVar('FINISHPAGE'); $helper->declareVar('PRINT_TYPE'); + $helper->declareVar("showallfoils"); # The page breaks can get loaded initially from the course environment: @@ -2126,6 +2139,20 @@ CHOOSE_FROM_ANY_SEQUENCE ['Yes', 'yes'] ]; Apache::lonhelper::dropdown->new(); addMessage(""); + + # If advanced roles, then allow to show all foils. + + if ($ENV{'request.role.adv'}) { + addMessage(" "); + $paramHash = Apache::lonhelper::getParamHash(); + $paramHash->{'multichoice'} = "true"; + $paramHash->{'allowempty'} = "true"; + $paramHash->{'variable'} = "showallfoils"; + $paramHash->{'CHOICES'} = [ ["Show all foils", "1"] ]; + Apache::lonhelper::choices->new(); + addMessage(""); + } + } if ($helper->{'VARS'}->{'construction'}) { @@ -2147,7 +2174,8 @@ RNDSEED &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag); $helper->{'VARS'}->{'style_file'}=$ENV{'form.style_file_value'}; - } + } + }