Diff for /loncom/interface/lonparmset.pm between versions 1.522.2.28.4.8 and 1.522.2.28.4.11

version 1.522.2.28.4.8, 2023/01/31 15:47:57 version 1.522.2.28.4.11, 2023/12/29 20:45:18
Line 1408  sub print_row { Line 1408  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 1640  sub extractResourceInformation { Line 1640  sub extractResourceInformation {
         my $srcf=$resource->src();          my $srcf=$resource->src();
         $srcf=~/\.(\w+)$/;          $srcf=~/\.(\w+)$/;
         $$typep{$id}=$1;          $$typep{$id}=$1;
           my $toolsymb;
           if ($srcf =~ /ext\.tool$/) {
               $toolsymb = $resource->symb();
           }
         $$keyp{$id}='';          $$keyp{$id}='';
         $$uris{$id}=$srcf;          $$uris{$id}=$srcf;
   
         foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {          foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys',$toolsymb))) {
             next if ($key!~/^parameter_/);              next if ($key!~/^parameter_/);
   
 # Hidden parameters  # Hidden parameters
             next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm');              next if (&Apache::lonnet::metadata($srcf,$key.'.hidden',$toolsymb) eq 'parm');
 #  #
 # allparms is a hash of parameter names  # allparms is a hash of parameter names
 #  #
             my $name=&Apache::lonnet::metadata($srcf,$key.'.name');              my $name=&Apache::lonnet::metadata($srcf,$key.'.name',$toolsymb);
             if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {              if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
                 my ($display,$parmdis);                  my ($display,$parmdis);
                 $display = &standard_parameter_names($name);                  $display = &standard_parameter_names($name);
                 if ($display eq '') {                  if ($display eq '') {
                     $display= &Apache::lonnet::metadata($srcf,$key.'.display');                      $display= &Apache::lonnet::metadata($srcf,$key.'.display',$toolsymb);
                     $parmdis = $display;                      $parmdis = $display;
                     $parmdis =~ s/\s*\[Part.*$//g;                      $parmdis =~ s/\s*\[Part.*$//g;
                 } else {                  } else {
Line 1665  sub extractResourceInformation { Line 1669  sub extractResourceInformation {
                 $$allparms{$name}=$parmdis;                  $$allparms{$name}=$parmdis;
                 if (ref($defkeytype)) {                  if (ref($defkeytype)) {
                     $$defkeytype{$name}=                      $$defkeytype{$name}=
                     &Apache::lonnet::metadata($srcf,$key.'.type');                      &Apache::lonnet::metadata($srcf,$key.'.type',$toolsymb);
                 }                  }
             }              }
   
 #  #
 # allparts is a hash of all parts  # allparts is a hash of all parts
 #  #
             my $part= &Apache::lonnet::metadata($srcf,$key.'.part');              my $part= &Apache::lonnet::metadata($srcf,$key.'.part',$toolsymb);
             $$allparts{$part} = &mt('Part: [_1]',$part);              $$allparts{$part} = &mt('Part: [_1]',$part);
 #  #
 # Remember all keys going with this resource  # Remember all keys going with this resource
Line 1876  sub lookUpTableParameter { Line 1880  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 2886  sub assessparms { Line 2891  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 3139  ENDTABLEHEADFOUR Line 3144  ENDTABLEHEADFOUR
                     my %type=   ();                      my %type=   ();
                     my %default=();                      my %default=();
                     my $uri=&Apache::lonnet::declutter($uris{$rid});                      my $uri=&Apache::lonnet::declutter($uris{$rid});
                       my $toolsymb;
                       if ($uri =~ /ext\.tool$/) {
                           $toolsymb = $symbp{$rid};
                       }
   
                     my $filter=$env{'form.filter'};                      my $filter=$env{'form.filter'};
                     foreach (&keysplit($keyp{$rid})) {                      foreach (&keysplit($keyp{$rid})) {
                         my $tempkeyp = $_;                          my $tempkeyp = $_;
                         if (grep $_ eq $tempkeyp, @catmarker) {                          if (grep $_ eq $tempkeyp, @catmarker) {
                           my $parmname=&Apache::lonnet::metadata($uri,$_.'.name');                            my $parmname=&Apache::lonnet::metadata($uri,$_.'.name',$toolsymb);
 # We may only want certain parameters listed  # We may only want certain parameters listed
                           if ($filter) {                            if ($filter) {
                              unless ($filter=~/\Q$parmname\E/) { next; }                               unless ($filter=~/\Q$parmname\E/) { next; }
                           }                            }
                           $name{$_}=$parmname;                            $name{$_}=$parmname;
                           $part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');                            $part{$_}=&Apache::lonnet::metadata($uri,$_.'.part',$toolsymb);
   
                           my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display');                            my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display',$toolsymb);
                           if ($allparms{$name{$_}} ne '') {                            if ($allparms{$name{$_}} ne '') {
                               my $identifier;                                my $identifier;
                               if ($parmdis =~ /(\s*\[Part.*)$/) {                                if ($parmdis =~ /(\s*\[Part.*)$/) {
Line 3164  ENDTABLEHEADFOUR Line 3173  ENDTABLEHEADFOUR
                           }                            }
                           unless ($display{$_}) { $display{$_}=''; }                            unless ($display{$_}) { $display{$_}=''; }
                           $display{$_}.=' ('.$name{$_}.')';                            $display{$_}.=' ('.$name{$_}.')';
                           $default{$_}=&Apache::lonnet::metadata($uri,$_);                            $default{$_}=&Apache::lonnet::metadata($uri,$_,$toolsymb);
                           $type{$_}=&Apache::lonnet::metadata($uri,$_.'.type');                            $type{$_}=&Apache::lonnet::metadata($uri,$_.'.type',$toolsymb);
                           $thistitle=&Apache::lonnet::metadata($uri,$_.'.title');                            $thistitle=&Apache::lonnet::metadata($uri,$_.'.title',$toolsymb);
                         }                          }
                     }                      }
                     my $totalparms=scalar keys %name;                      my $totalparms=scalar keys %name;
Line 3251  ENDTABLEHEADFOUR Line 3260  ENDTABLEHEADFOUR
   
                      if ($map eq $mapid) {                       if ($map eq $mapid) {
                         my $uri=&Apache::lonnet::declutter($uris{$rid});                          my $uri=&Apache::lonnet::declutter($uris{$rid});
                           my $toolsymb;
                           if ($uri =~ /ext\.tool$/) {
                               $toolsymb = $symbp{$rid};
                           }
 #                    $r->print("Keys: $keyp{$rid} <br />\n");  #                    $r->print("Keys: $keyp{$rid} <br />\n");
   
 #--------------------------------------------------------------------  #--------------------------------------------------------------------
Line 3267  ENDTABLEHEADFOUR Line 3280  ENDTABLEHEADFOUR
   
                               if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {                                if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
                                 $part{$tempkeyp}="0";                                  $part{$tempkeyp}="0";
                                 $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');                                  $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name',$toolsymb);
                                 my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');                                  my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display',$toolsymb);
                                 if ($allparms{$name{$tempkeyp}} ne '') {                                  if ($allparms{$name{$tempkeyp}} ne '') {
                                     my $identifier;                                      my $identifier;
                                     if ($parmdis =~ /(\s*\[Part.*)$/) {                                      if ($parmdis =~ /(\s*\[Part.*)$/) {
Line 3281  ENDTABLEHEADFOUR Line 3294  ENDTABLEHEADFOUR
                                 unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }                                  unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
                                 $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';                                  $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
                                 $display{$tempkeyp} =~ s/_\w+_/_0_/;                                  $display{$tempkeyp} =~ s/_\w+_/_0_/;
                                 $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);                                  $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp,$toolsymb);
                                 $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');                                  $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type',$toolsymb);
                               }                                }
                         } # end loop through keys                          } # end loop through keys
                       }                        }
Line 3356  ENDTABLEHEADFOUR Line 3369  ENDTABLEHEADFOUR
                 my $rid = $_;                  my $rid = $_;
   
                 my $uri=&Apache::lonnet::declutter($uris{$rid});                  my $uri=&Apache::lonnet::declutter($uris{$rid});
                   my $toolsymb;
                   if ($uri =~ /ext\.tool$/) {
                       $toolsymb = $symbp{$rid};
                   }
   
 #--------------------------------------------------------------------  #--------------------------------------------------------------------
 # @catmarker contains list of all possible parameters including part #s  # @catmarker contains list of all possible parameters including part #s
Line 3370  ENDTABLEHEADFOUR Line 3387  ENDTABLEHEADFOUR
                       $tempkeyp =~ s/_\w+_/_0_/;                        $tempkeyp =~ s/_\w+_/_0_/;
                       if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {                        if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
                         $part{$tempkeyp}="0";                          $part{$tempkeyp}="0";
                         $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');                          $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name',$toolsymb);
                         my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');                          my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display',$toolsymb);
                         if ($allparms{$name{$tempkeyp}} ne '') {                          if ($allparms{$name{$tempkeyp}} ne '') {
                             my $identifier;                              my $identifier;
                             if ($parmdis =~ /(\s*\[Part.*)$/) {                              if ($parmdis =~ /(\s*\[Part.*)$/) {
Line 3384  ENDTABLEHEADFOUR Line 3401  ENDTABLEHEADFOUR
                         unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }                          unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
                         $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';                          $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
                         $display{$tempkeyp} =~ s/_\w+_/_0_/;                          $display{$tempkeyp} =~ s/_\w+_/_0_/;
                         $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp);                          $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp,$toolsymb);
                         $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type');                          $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type',$toolsymb);
                       }                        }
                 } # end loop through keys                  } # end loop through keys
             } # end loop through ids              } # end loop through ids
Line 3556  sub storedata { Line 3573  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 3687  sub parse_listdata_key { Line 3706  sub parse_listdata_key {
 }  }
   
 sub listdata {  sub listdata {
     my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly)=@_;      my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly,$parmlev)=@_;
 # Start list output  # Start list output
   
     my $oldsection='';      my $oldsection='';
Line 4161  sub string_deeplink_selector { Line 4180  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 4359  my %strings = Line 4379  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']],
      );       );
   
 my %stringmatches = (  my %stringmatches = (
Line 4377  my %stringtypes = ( Line 4400  my %stringtypes = (
                     examcode     => 'string_examcode',                      examcode     => 'string_examcode',
                     acc          => 'string_ip',                      acc          => 'string_ip',
                     deeplink     => 'string_deeplink',                      deeplink     => 'string_deeplink',
                       texdisplay   => 'string_tex',
                   );                    );
   
 sub standard_string_options {  sub standard_string_options {
Line 4749  ENDOVER Line 4773  ENDOVER
   
 # List data  # List data
   
         &listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly);          &listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly,$parmlev);
     }      }
     $r->print(&tableend());      $r->print(&tableend());
     unless ($readonly) {      unless ($readonly) {
Line 5923  sub parm_change_log { Line 5947  sub parm_change_log {
                     $parmitem = &mt($parmitem);                      $parmitem = &mt($parmitem);
             $output .= &mt('Type: [_1]',$parmitem);              $output .= &mt('Type: [_1]',$parmitem);
         } else {          } else {
             my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what),              my $toolsymb;
               if ($middle =~ /ext\.tool$/) {
                   $toolsymb = $middle;
               }
               my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what,$toolsymb),
                               $uname,$udom,$issection,$issection,$courseopt);                                $uname,$udom,$issection,$issection,$courseopt);
                     my $showvalue = $value;                      my $showvalue = $value;
                     if ($istype{$parmname} eq '') {                      if ($istype{$parmname} eq '') {

Removed from v.1.522.2.28.4.8  
changed lines
  Added in v.1.522.2.28.4.11


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