Diff for /loncom/interface/lonparmset.pm between versions 1.532 and 1.536

version 1.532, 2013/05/21 18:54:15 version 1.536, 2013/07/10 22:07:37
Line 1110  sub print_td { Line 1110  sub print_td {
         if ($which > 3) {          if ($which > 3) {
             $nolink = 1;              $nolink = 1;
         }          }
       } elsif ($mprefix =~ /examcode\&$/) {
           unless ($which == 2) {
               $nolink = 1;
           }
     }      }
     if ($nolink) {      if ($nolink) {
         $r->print(&valout($$outpar[$which],$$typeoutpar[$which]));          $r->print(&valout($$outpar[$which],$$typeoutpar[$which]));
Line 1433  sub lookUpTableParameter { Line 1437  sub lookUpTableParameter {
         'lenient' => 'grading',          'lenient' => 'grading',
         'retrypartial' => 'tries',          'retrypartial' => 'tries',
         'discussvote'  => 'misc',          'discussvote'  => 'misc',
           'examcode' => 'high_level_randomization', 
     );          );    
 }  }
   
Line 1506  sub parmboxes { Line 1510  sub parmboxes {
         &whatIsMyCategory($tempparameter, \%categoryList);          &whatIsMyCategory($tempparameter, \%categoryList);
     }      }
     #part to print the parm-list      #part to print the parm-list
     $r->print('<div class="LC_columnSection">'."\n");      foreach my $key (sort { $category_order{$a} <=> $category_order{$b} } keys(%categoryList)) {
           next if (@{$categoryList{$key}} == 0);
     #Print parameters          next if ($key eq '');
     for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) {          $r->print('<div class="LC_Box LC_400Box">'
         if(@{$categoryList{$key}} == 0) {                   .'<h4 class="LC_hcell">'.&mt($categories{$key}).'</h4>'."\n");
             next;          foreach my $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) {
         } else {               $r->print('<span class="LC_nobreak">'
             $r->print('<div class="LC_Box LC_400Box">'                       .'<label><input type="checkbox" name="pscat" '
                      .'<h4 class="LC_hcell">'                       .'value="'.$tempkey.'" ');
                      .&mt($categories{$key})              if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
                      .'</h4>'."\n");                  $r->print( ' checked="checked"');
             foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) {  
                     $r->print('<span class="LC_nobreak">'  
                              .'<label><input type="checkbox" name="pscat" ');  
                 $r->print('value="'.$tempkey.'" ');  
                 if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {  
                     $r->print(' checked="checked"');  
                 }  
                 $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}  
                                                       : $tempkey)  
                         .'</label></span><br />'."\n");  
             }              }
             $r->print("</div>\n");              $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}
                                                         : $tempkey)
                        .'</label></span><br />'."\n");
         }          }
           $r->print('</div>');
     }      }
       $r->print("\n");
     $r->print("</div>\n");  
 }  }
 #  #
 # This function offers some links on the parameter section to get with one click a group a parameters  # This function offers some links on the parameter section to get with one click a group a parameters
Line 1697  function group_or_section(caller) { Line 1693  function group_or_section(caller) {
 # This function shows on table Mode the available Parameters for the selected Resources  # This function shows on table Mode the available Parameters for the selected Resources
 #  #
 sub displaymenu {  sub displaymenu {
     my ($r,$allparms,$pscat,$psprt,$keyorder)=@_;      my ($r,$allparms,$pscat,$psprt,$keyorder,$divid)=@_;
   
     $r->print(&Apache::lonhtmlcommon::start_pick_box());      $r->print(&Apache::lonhtmlcommon::start_pick_box());
     $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));      $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
   
     &parmmenu($r,$allparms,$pscat,$keyorder);      &parmmenu($r,$allparms,$pscat,$keyorder);
     $r->print(&Apache::loncommon::start_scrollbox());      $r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid));
     &parmboxes($r,$allparms,$pscat,$keyorder);      &parmboxes($r,$allparms,$pscat,$keyorder);
     $r->print(&Apache::loncommon::end_scrollbox());      $r->print(&Apache::loncommon::end_scrollbox());
   
Line 1777  sub mapmenu { Line 1773  sub mapmenu {
            .'</div>'             .'</div>'
         );          );
   
         $r->print(&Apache::loncommon::start_scrollbox(undef,undef,undef,'mapmenuscroll'));          $r->print(&Apache::loncommon::start_scrollbox('700px','680px','400px','mapmenuscroll'));
         $r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner'));          $r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner'));
   
         # Display row: "All Maps or Folders"          # Display row: "All Maps or Folders"
Line 2190  sub assessparms { Line 2186  sub assessparms {
                         }                          }
                     }                      }
                 }                  }
             } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote)\&\d+$/) {              } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode)\&\d+$/) {
                 $name = $1;                  $name = $1;
                   my $val = $values[$i];
                   if ($name eq 'examcode') {
                      if (&Apache::lonnet::validCODE($values[$i])) {
                          $val = 'valid';    
                      }
                   }
                 $needsrelease =                  $needsrelease =
                     $Apache::lonnet::needsrelease{"parameter:$name:$values[$i]"};                      $Apache::lonnet::needsrelease{"parameter:$name:$val"};
                 if ($needsrelease) {                  if ($needsrelease) {
                     unless ($got_chostname) {                      unless ($got_chostname) {
                         ($chostname,$cmajor,$cminor) = &parameter_release_vars();                          ($chostname,$cmajor,$cminor) = &parameter_release_vars();
                         $got_chostname = 1;                          $got_chostname = 1;
                     }                      }
                     $needsnewer = &parameter_releasecheck($name,$values[$i],                      $needsnewer = &parameter_releasecheck($name,$val,
                                                           $needsrelease,                                                            $needsrelease,
                                                           $chostname,                                                            $chostname,
                                                           $cmajor,$cminor);                                                            $cmajor,$cminor);
Line 2283  ENDPARMSELSCRIPT Line 2285  ENDPARMSELSCRIPT
   
         # Step 2          # Step 2
         $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));          $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));
         &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder);          &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder,'parmmenuscroll');
   
         # Step 3          # Step 3
         $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));          $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));
Line 2841  sub storedata { Line 2843  sub storedata {
                 $name = 'lenient';                  $name = 'lenient';
             } elsif ($typeof eq 'string_discussvote') {              } elsif ($typeof eq 'string_discussvote') {
                 $name = 'discussvote';                  $name = 'discussvote';
               } elsif ($typeof eq 'string_examcode') {
                   $name = 'examcode'; 
             } elsif ($typeof eq 'string_yesno') {              } elsif ($typeof eq 'string_yesno') {
                 if ($thiskey =~ /\.retrypartial$/) {                  if ($thiskey =~ /\.retrypartial$/) {
                     $name = 'retrypartial';                      $name = 'retrypartial';
Line 4693  sub oldversion_warning { Line 4697  sub oldversion_warning {
                         lenient      => 'string_lenient',                          lenient      => 'string_lenient',
                         retrypartial => 'string_yesno',                          retrypartial => 'string_yesno',
                         discussvote  => 'string_discussvote',                          discussvote  => 'string_discussvote',
                           examcode     => 'string_examcode',
                       );                        );
     if (exists($stringtypes{$name})) {      if (exists($stringtypes{$name})) {
         if (ref($strings{$stringtypes{$name}}) eq 'ARRAY') {          if ($name eq 'examcode') {
               $desc = $value;
           } elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') {
             foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) {              foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) {
                 next unless (ref($possibilities) eq 'ARRAY');                  next unless (ref($possibilities) eq 'ARRAY');
                 my ($parmval, $description) = @{ $possibilities };                  my ($parmval, $description) = @{ $possibilities };

Removed from v.1.532  
changed lines
  Added in v.1.536


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