Diff for /loncom/interface/lonparmset.pm between versions 1.616 and 1.621

version 1.616, 2022/07/07 03:37:01 version 1.621, 2023/12/22 13:38:02
Line 329  use Apache::lonnavmaps; Line 329  use Apache::lonnavmaps;
 use Apache::longroup;  use Apache::longroup;
 use Apache::lonrss;  use Apache::lonrss;
 use HTML::Entities;  use HTML::Entities;
   use Text::Wrap();
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
   
   
Line 1749  sub print_row { Line 1750  sub print_row {
     if ($automatic) {      if ($automatic) {
         $parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';          $parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';
     }      }
       my $advice;
       if ((ref($name) eq 'HASH') && ($name->{$which} eq 'mapalias') &&
           (ref($symbp) eq 'HASH') && ($parmlev eq 'full')) {
           if ($symbp->{$rid} =~ m{^uploaded/}) {
               if ($result == 14) {
                   $advice = &mt('Use Course Editor to modify this.');
               } else {
                   $advice = &mt('Use Course Editor to set this.');
               }
           } else {
               if ($result == 14) {
                   $advice = &mt('Use Resource Assembly Tool to modify this.');
               } else {
                   $advice = &mt('Use Resource Assembly Tool to set this.');
               }
           }
           $parm .= '<br /><span class="LC_fontsize_small LC_cusr_emph">'.$advice.'</span>';
       }
     $r->print('<td>'.$parm.'</td>');      $r->print('<td>'.$parm.'</td>');
   
     my $thismarker=$which;      my $thismarker=$which;
Line 1830  sub print_row { Line 1849  sub print_row {
                 $extra = 'ltid_'.$domltistr;                  $extra = 'ltid_'.$domltistr;
             }              }
         }          }
         my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom);          my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider');
         if (keys(%courselti)) {          if (keys(%courselti)) {
             foreach my $item (sort { $a <=> $b } keys(%courselti)) {              foreach my $item (sort { $a <=> $b } keys(%courselti)) {
                 if (($item =~ /^\d+$/) && (ref($courselti{$item}) eq 'HASH')) {                  if (($item =~ /^\d+$/) && (ref($courselti{$item}) eq 'HASH')) {
Line 2463  sub lookUpTableParameter { Line 2482  sub lookUpTableParameter {
         'lenient' => 'grading',          'lenient' => 'grading',
         'retrypartial' => 'tries',          'retrypartial' => 'tries',
         'discussvote'  => 'misc',          'discussvote'  => 'misc',
           'texdisplay' => 'misc',
         'examcode' => 'high_level_randomization',          'examcode' => 'high_level_randomization',
     );      );
 }  }
Line 2552  sub parmboxes { Line 2572  sub parmboxes {
         &whatIsMyCategory($tempparameter, \%categoryList);          &whatIsMyCategory($tempparameter, \%categoryList);
     }      }
     #part to print the parm-list      #part to print the parm-list
       $Text::Wrap::columns=60;
       $Text::Wrap::separator='<br />';
     foreach my $key (sort { $category_order{$a} <=> $category_order{$b} } keys(%categoryList)) {      foreach my $key (sort { $category_order{$a} <=> $category_order{$b} } keys(%categoryList)) {
         next if (@{$categoryList{$key}} == 0);          next if (@{$categoryList{$key}} == 0);
         next if ($key eq '');          next if ($key eq '');
Line 2565  sub parmboxes { Line 2587  sub parmboxes {
             if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {              if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
                 $r->print( ' checked="checked"');                  $r->print( ' checked="checked"');
             }              }
             $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}              $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? 
                                                       : $tempkey)                               Text::Wrap::wrap('','&nbsp;'x4,$$allparms{$tempkey})
                                : $tempkey)
                      .'</label></span><br />'."\n");                       .'</label></span><br />'."\n");
         }          }
         $r->print('</div>');          $r->print('</div>');
Line 3689  sub assessparms { Line 3712  sub assessparms {
             'date_interval','int','float','string','string_lenient',              'date_interval','int','float','string','string_lenient',
             'string_examcode','string_deeplink','string_discussvote',              'string_examcode','string_deeplink','string_discussvote',
             'string_useslots','string_problemstatus','string_ip',              'string_useslots','string_problemstatus','string_ip',
             'string_questiontype') {              'string_questiontype','string_tex') {
         $r->print('<input type="hidden" value="'.          $r->print('<input type="hidden" value="'.
             &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').              &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').
             '" name="recent_'.$item.'" />');              '" name="recent_'.$item.'" />');
Line 4450  sub storedata { Line 4473  sub storedata {
                         if ($thiskey =~ /\.retrypartial$/) {                          if ($thiskey =~ /\.retrypartial$/) {
                             $name = 'retrypartial';                              $name = 'retrypartial';
                         }                          }
                       } elsif ($typeof eq 'string_tex') {
                           $name = 'texdisplay';
                     }                      }
                 } elsif ($cmd eq 'datepointer') {                  } elsif ($cmd eq 'datepointer') {
                     $data=&Apache::lonhtmlcommon::get_date_from_form($env{$key});                      $data=&Apache::lonhtmlcommon::get_date_from_form($env{$key});
Line 5024  sub listdata { Line 5049  sub listdata {
     # Ready to print      # Ready to print
     #      #
             my $parmitem = &standard_parameter_names($name);              my $parmitem = &standard_parameter_names($name);
               my $advice;
               if (($name eq 'mapalias') && ($middle) && (!$is_map)) {
                   if ($middle =~ m{^uploaded/}) {
                       $advice = &mt('Use Course Editor to set this.');
                   } else {
                       $advice = &mt('Use Resource Assembly Tool to set this.');
                   }
                   $advice = '<br /><span class="LC_fontsize_small LC_cusr_emph">'.$advice.'</span>';
               }
             $r->print(&tablestart($readonly,$is_map).              $r->print(&tablestart($readonly,$is_map).
                 &Apache::loncommon::start_data_table_row().                  &Apache::loncommon::start_data_table_row().
                 '<td><b>'.&mt($parmitem).                  '<td><b>'.&mt($parmitem).
                 '</b></td>');                  '</b>'.$advice.'</td>');
             unless ($readonly) {              unless ($readonly) {
                 my $disabled;                  my $disabled;
                 if (($name eq 'availablestudent') &&                  if (($name eq 'availablestudent') &&
                     (($showval eq '') || ($userscope))) {                      (($showval eq '') || ($userscope))) {
                     $disabled = ' disabled="disabled"';                      $disabled = ' disabled="disabled"';
                   } elsif (($name eq 'mapalias') && ($showval eq '')) {
                       $disabled = ' disabled="disabled"';
                 }                  }
                 $r->print('<td><input type="checkbox" name="del_'.                  $r->print('<td><input type="checkbox" name="del_'.
                         $thiskey.'"'.$disabled.' /></td>');                          $thiskey.'"'.$disabled.' /></td>');
Line 5065  sub listdata { Line 5101  sub listdata {
             } elsif ($thistype =~ m/^string/) {              } elsif ($thistype =~ m/^string/) {
                 if ($name eq 'availablestudent') {                  if ($name eq 'availablestudent') {
                     $readonly = 1;                      $readonly = 1;
                   } elsif (($name eq 'mapalias') && ($showval eq '')) {
                       $readonly = 1;
                 }                  }
                 $r->print(&string_selector($thistype,$thiskey,                  $r->print(&string_selector($thistype,$thiskey,
                           $showval,$name,$readonly));                            $showval,$name,$readonly));
Line 5310  sub string_deeplink_selector { Line 5348  sub string_deeplink_selector {
     }      }
     my %courselti =      my %courselti =
         &Apache::lonnet::get_course_lti($env{'course.'.$env{'request.course.id'}.'.num'},          &Apache::lonnet::get_course_lti($env{'course.'.$env{'request.course.id'}.'.num'},
                                         $env{'course.'.$env{'request.course.id'}.'.domain'});                                          $env{'course.'.$env{'request.course.id'}.'.domain'},
                                           'provider');
     foreach my $item (keys(%courselti)) {      foreach my $item (keys(%courselti)) {
         if (ref($courselti{$item}) eq 'HASH') {          if (ref($courselti{$item}) eq 'HASH') {
             $crslti{$item} = $courselti{$item}{'name'};              $crslti{$item} = $courselti{$item}{'name'};
Line 5510  my %strings = Line 5549  my %strings =
                  ['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']],                    ['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], 
      'string_deeplink'       'string_deeplink'
              => [['on','Set choices for link protection, resource listing, access scope, shown menu items, embedding, and exit link']],               => [['on','Set choices for link protection, resource listing, access scope, shown menu items, embedding, and exit link']],
        'string_tex'
                => [['tth', 'tth (TeX to HTML)'],
                    ['mathjax', 'MathJax']],
     );      );
         
   
Line 5531  my %stringtypes = ( Line 5573  my %stringtypes = (
                     examcode     => 'string_examcode',                      examcode     => 'string_examcode',
                     acc          => 'string_ip',                      acc          => 'string_ip',
                     deeplink     => 'string_deeplink',                      deeplink     => 'string_deeplink',
                       texdisplay   => 'string_tex',
                   );                    );
   
 # Returns the possible values and titles for a given string type, or undef if there are none.  # Returns the possible values and titles for a given string type, or undef if there are none.
Line 5591  sub string_selector { Line 5634  sub string_selector {
             ($thistype eq 'string_discussvote') ||              ($thistype eq 'string_discussvote') ||
             ($thistype eq 'string_ip') ||              ($thistype eq 'string_ip') ||
             ($thistype eq 'string_deeplink') ||              ($thistype eq 'string_deeplink') ||
               ($thistype eq 'string_tex') ||
             ($name eq 'retrypartial')) {              ($name eq 'retrypartial')) {
         my ($got_chostname,$chostname,$cmajor,$cminor);           my ($got_chostname,$chostname,$cmajor,$cminor); 
         foreach my $possibilities (@{ $strings{$thistype} }) {          foreach my $possibilities (@{ $strings{$thistype} }) {

Removed from v.1.616  
changed lines
  Added in v.1.621


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