Diff for /loncom/interface/lonprintout.pm between versions 1.575.2.1 and 1.575.2.2

version 1.575.2.1, 2010/05/10 10:21:24 version 1.575.2.2, 2010/05/11 11:10:19
Line 74  my $ssi_retry_count = 5;    # Some arbit Line 74  my $ssi_retry_count = 5;    # Some arbit
   
 my $font_size = 'normalsize';    # Default is normalsize...  my $font_size = 'normalsize';    # Default is normalsize...
   
   #
   #  Useful filters that will be filled in by printHelper.
   #  These are put here to support modularizing helpers into 
   #  less of a helper soup than it was originally:
   #  These can't be filled in here as there's some conditionalization
   #  involved.
   #
   
   my $isProblem;
   my $isProblemOrMap;
   my $isNotMap;
   my $isMap;
   my $symbFilter;
   
 #----------------------------  Helper helpers. -------------------------  #----------------------------  Helper helpers. -------------------------
   
   
 #  Returns the text needd for a student chooser.  #  Returns the text needd for a student chooser.
 #  that text must still be parsed by the helper xml parser.  #  that text must still be parsed by the helper xml parser.
 # Parameters:  # Parameters:
Line 239  CHOOSE_ANON1 Line 254  CHOOSE_ANON1
     return $result;      return $result;
 }  }
   
   # Returns the XML for the states associated with choosing incomplete problems
   # for selected students:
   # Paramterss:
   #   helper     - reference to the helper.
   #   map        - Map within which to generate the selector.
   #   base_state - The first/base state of the helper subsegment.
   #
   #  
   #
   #  States we will use:
   #   $base_state            - Selects resources.
   #   $base_state.WHO        - Selects the people to display.
   #   $base_state.FORMAT     - Selects the final print format etc.
   #
   
   sub generate_incomplete_states {
       my ($helper, $map, $base_state) = @_;
       my $result = '';
   
       $result .= &generate_resource_chooser(
     $base_state,
     'Select Problem(s) to print.',
     "multichoice='1' addstatus='1'",
     'RESOURCES',
     $base_state.'WHO',
     '',
     '$res->is_incomplete()'
     );
       $result .= &generate_student_chooser(
    $base_state.'WHO',
    'student_sort',
    'STUDENTS',
    $base_state.'FORMAT');
       return $result;
   }
   
 #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
   
 # Fetch the contents of a resource, uninterpreted.  # Fetch the contents of a resource, uninterpreted.
Line 3642  sub printHelper { Line 3693  sub printHelper {
   
     }      }
   
     # Detect whether we're coming from construction space      # Detect whether we're coming from construction space.  If so,
       # $helper->{VARS}->{'construction'} will be defined and true.
       # Otherwise, if this is a post, load the helper 'postdata' var with
       # the posted form data.
       
     if (      if (
         $env{'form.postdata'} =~ /^(?:http:\/\/[^\/]+\/|\/|)\~([^\/]+)\/(.*)$/ )          $env{'form.postdata'} =~ /^(?:http:\/\/[^\/]+\/|\/|)\~([^\/]+)\/(.*)$/ )
     {      {
Line 3755  sub printHelper { Line 3810  sub printHelper {
     }      }
   
     # Useful filter strings      # Useful filter strings
     my $isProblem =      $isProblem =
       '($res->is_problem()||$res->contains_problem||$res->is_practice()) ';        '($res->is_problem()||$res->contains_problem||$res->is_practice()) ';
     $isProblem .= ' && !$res->randomout()' if !$userCanSeeHidden;      $isProblem .= ' && !$res->randomout()' if !$userCanSeeHidden;
     my $isProblemOrMap =      $isProblemOrMap =
 '$res->is_problem() || $res->contains_problem() || $res->is_sequence() || $res->is_practice()';  '$res->is_problem() || $res->contains_problem() || $res->is_sequence() || $res->is_practice()';
     my $isNotMap = '!$res->is_sequence()';      $isNotMap = '!$res->is_sequence()';
     $isNotMap .= ' && !$res->randomout()' if !$userCanSeeHidden;      $isNotMap .= ' && !$res->randomout()' if !$userCanSeeHidden;
     my $isMap      = '$res->is_map()';      $isMap      = '$res->is_map()';
     my $symbFilter = '$res->shown_symb()';      $symbFilter = '$res->shown_symb()';
   
     my $urlValue   = '$res->link()';      my $urlValue   = '$res->link()';
   
     $helper->declareVar('SEQUENCE');      $helper->declareVar('SEQUENCE');
Line 3949  sub printHelper { Line 4005  sub printHelper {
       <student multichoice='1' variable="STUDENTS" nextstate="PRINT_FORMATTING" coursepersonnel="1"/>        <student multichoice='1' variable="STUDENTS" nextstate="PRINT_FORMATTING" coursepersonnel="1"/>
   </state>    </state>
 ALL_PROBLEMS  ALL_PROBLEMS
          #
          #  Support printing incompleteproblems.:
          #
          push @{$printChoices},
               [
                  &mtn('Incomplete <b>Problems</b> from <b>entire course</b> for <b>selected people</b>'),
        'incomplete_problems_students',
        'INCOMPLETE_PROBLEMS_STUDENTS'
        ];
   
         &Apache::lonxml::xmlparse(          &Apache::lonxml::xmlparse(
             $r, 'helper',              $r, 'helper',
             &generate_resource_chooser(      &generate_incomplete_states($helper, $map, 
        'INCOMPLETE_PROBLEMS_STUDENTS')
     
               .&generate_resource_chooser(
                 'ALL_PROBLEMS',                  'ALL_PROBLEMS',
                 'SelectProblem(s) to print',                  'SelectProblem(s) to print',
 'multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1"',  'multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1"',

Removed from v.1.575.2.1  
changed lines
  Added in v.1.575.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>