Diff for /loncom/interface/lonparmset.pm between versions 1.131 and 1.134

version 1.131, 2003/10/09 16:21:20 version 1.134, 2003/11/10 16:33:57
Line 293  sub startpage { Line 293  sub startpage {
         &Apache::loncommon::selectstudent_link('parmform','uname','udom');          &Apache::loncommon::selectstudent_link('parmform','uname','udom');
     my $selscript=&Apache::loncommon::studentbrowser_javascript();      my $selscript=&Apache::loncommon::studentbrowser_javascript();
     my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();      my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
       my %lt=&Apache::lonlocal::texthash(
       'cep'   => "Course Environment Parameters",
       'scep'  => "Set Course Environment Parameters",
       'smcap' => "Set/Modify Course Assessment Parameter",
       'mcap'  => "Modify Course Assessment Parameters",
       'caphm' => "Course Assessment Parameter - Helper Mode",
       'capom' => "Course Assessment Parameters - Overview Mode",
                       'captm' => "Course Assessments Parameters - Table Mode",
       'sg'    => "Section/Group",
       'fu'    => "For User",
       'oi'    => "or ID",
       'ad'    => "at Domain"
          );
     $r->print(<<ENDHEAD);      $r->print(<<ENDHEAD);
 <html>  <html>
 <head>  <head>
Line 343  $selscript Line 356  $selscript
 $bodytag  $bodytag
   
 <form method="post" action="/adm/parmset" name="envform">  <form method="post" action="/adm/parmset" name="envform">
 <h4>Course Environment Parameters</h4>  <h4>$lt{'cep'}</h4>
 <input type="submit" name="crsenv" value="Set Course Environment Parameters" />  <input type="submit" name="crsenv" value="$lt{'scep'}" />
 </form>  </form>
 <hr />  <hr />
 <form method="post" action="/adm/helper/parameter.helper" name="helpform">  <form method="post" action="/adm/helper/parameter.helper" name="helpform">
 <h4>Course Assessment Parameter - Helper Mode</h4>  <h4>$lt{'caphm'}</h4>
 <input type="submit" value="Set/Modify Course Assessment Parameter" />  <input type="submit" value="$lt{'smcap'}" />
 </form>  </form>
 <hr />  <hr />
 <form method="post" action="/adm/parmset" name="overview">  <form method="post" action="/adm/parmset" name="overview">
 <h4>Course Assessment Parameters - Overview Mode</h4>  <h4>$lt{'capom'}</h4>
 <input type="submit" name="overview" value="Modify Course Assessment Parameters" />  <input type="submit" name="overview" value="$lt{'mcap'}" />
 </form>  </form>
 <hr />  <hr />
 <form method="post" action="/adm/parmset" name="parmform">  <form method="post" action="/adm/parmset" name="parmform">
 <h4>Course Assessments Parameters - Table Mode</h4>  <h4>$lt{'captm'}</h4>
 ENDHEAD  ENDHEAD
   
     if (!$have_assesments) {      if (!$have_assesments) {
  $r->print('<font color="red">There are no assesment parameters in this course to set.</font><br />');   $r->print('<font color="red">'.&mt('There are no assesment parameters in this course to set.').'</font><br />');
     } else {      } else {
  $r->print(<<ENDHEAD);   $r->print(<<ENDHEAD);
 <b>  <b>
 Section/Group:  $lt{'sg'}:
 <input type="text" value="$csec" size="6" name="csec">  <input type="text" value="$csec" size="6" name="csec">
 <br>  <br>
 For User   $lt{'fu'} 
 <input type="text" value="$uname" size="12" name="uname">  <input type="text" value="$uname" size="12" name="uname">
 or ID  $lt{'oi'}
 <input type="text" value="$id" size="12" name="id">   <input type="text" value="$id" size="12" name="id"> 
 at Domain   $lt{'ad'}
 $chooseopt  $chooseopt
 </b>  </b>
 <input type="hidden" value='' name="pres_value">  <input type="hidden" value='' name="pres_value">
Line 505  sub print_td { Line 518  sub print_td {
     $r->print('</td>'."\n");      $r->print('</td>'."\n");
 }  }
   
 sub get_env_multiple {  
     my ($name) = @_;  
     my @values;  
     if (defined($ENV{$name})) {  
         # exists is it an array  
         if (ref($ENV{$name})) {  
             @values=@{ $ENV{$name} };  
         } else {  
             $values[0]=$ENV{$name};  
         }  
     }  
     return(@values);  
 }  
   
 =pod  =pod
   
 =item B<extractResourceInformation>: Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes.  =item B<extractResourceInformation>: Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes.
Line 680  sub assessparms { Line 679  sub assessparms {
     $udom=$ENV{'form.udom'};      $udom=$ENV{'form.udom'};
     unless ($udom) { $udom=$r->dir_config('lonDefDomain'); }      unless ($udom) { $udom=$r->dir_config('lonDefDomain'); }
   
     my @pscat=&get_env_multiple('form.pscat');      my @pscat=&Apache::loncommon::get_env_multiple('form.pscat');
     my $pschp=$ENV{'form.pschp'};      my $pschp=$ENV{'form.pschp'};
     my @psprt=&get_env_multiple('form.psprt');      my @psprt=&Apache::loncommon::get_env_multiple('form.psprt');
     if (!@psprt) { $psprt[0]='0'; }      if (!@psprt) { $psprt[0]='0'; }
     my $showoptions=$ENV{'form.showoptions'};      my $showoptions=$ENV{'form.showoptions'};
   
Line 726  sub assessparms { Line 725  sub assessparms {
     $id='';      $id='';
  } else {   } else {
     $message=      $message=
  "<font color=red>Unknown ID '$id' at domain '$udom'</font>";   "<font color=red>".&mt("Unknown ID")." '$id' ".
    &mt('at domain')." '$udom'</font>";
  }   }
     } else {      } else {
  $uname=$ENV{'form.uname'};   $uname=$ENV{'form.uname'};
Line 737  sub assessparms { Line 737  sub assessparms {
  $uhome=&Apache::lonnet::homeserver($uname,$udom);   $uhome=&Apache::lonnet::homeserver($uname,$udom);
         if ($uhome eq 'no_host') {          if ($uhome eq 'no_host') {
     $message=      $message=
  "<font color=red>Unknown user '$uname' at domain '$udom'</font>";   "<font color=red>".&mt("Unknown user")." '$uname' ".
    &mt("at domain")." '$udom'</font>";
     $uname='';      $uname='';
         } else {          } else {
     $csec=&Apache::lonnet::getsection($udom,$uname,      $csec=&Apache::lonnet::getsection($udom,$uname,
       $ENV{'request.course.id'});        $ENV{'request.course.id'});
     if ($csec eq '-1') {      if ($csec eq '-1') {
  $message="<font color=red>".   $message="<font color=red>".
     "User '$uname' at domain '$udom' not ".      &mt("User")." '$uname' ".&mt("at domain")." '$udom' ".
                     "in this course</font>";      &mt("not in this course")."</font>";
  $uname='';   $uname='';
  $csec=$ENV{'form.csec'};   $csec=$ENV{'form.csec'};
     } else {      } else {
  my %name=&Apache::lonnet::userenvironment($udom,$uname,   my %name=&Apache::lonnet::userenvironment($udom,$uname,
       ('firstname','middlename','lastname','generation','id'));        ('firstname','middlename','lastname','generation','id'));
  $message="\n<p>\nFull Name: ".   $message="\n<p>\n".&mt("Full Name").": ".
     $name{'firstname'}.' '.$name{'middlename'}.' '      $name{'firstname'}.' '.$name{'middlename'}.' '
  .$name{'lastname'}.' '.$name{'generation'}.   .$name{'lastname'}.' '.$name{'generation'}.
     "<br>\nID: ".$name{'id'}.'<p>';      "<br>\n".&mt('ID').": ".$name{'id'}.'<p>';
     }      }
         }          }
     }      }
Line 1081  sub assessparms { Line 1082  sub assessparms {
                $r->print("<th colspan=3 rowspan=2>");                 $r->print("<th colspan=3 rowspan=2>");
                $r->print(&mt("User")." $uname ".&mt('at Domain')." $udom</th>");                 $r->print(&mt("User")." $uname ".&mt('at Domain')." $udom</th>");
            }             }
      my %lt=&Apache::lonlocal::texthash(
     'pie'    => "Parameter in Effect",
     'csv'    => "Current Session Value",
                                     'at'     => 'at',
                                     'rl'     => "Resource Level",
     'ic'     => 'in Course',
     'aut'    => "Assessment URL and Title",
     'type'   => 'Type',
     'emof'   => "Enclosing Map or Folder",
     'part'   => 'Part',
                                     'pn'     => 'Parameter Name',
     'def'    => 'default',
     'femof'  => 'from Enclosing Map or Folder',
     'gen'    => 'general',
     'foremf' => 'for Enclosing Map or Folder',
     'fr'     => 'for Resource'
         );
            $r->print(<<ENDTABLETWO);             $r->print(<<ENDTABLETWO);
 <th rowspan=3>Parameter in Effect</th>  <th rowspan=3>$lt{'pie'}</th>
 <th rowspan=3>Current Session Value<br>($csuname at $csudom)</th>  <th rowspan=3>$lt{'csv'}<br>($csuname $lt{'at'} $csudom)</th>
 </tr><tr><td colspan=5></td><th colspan=2>Resource Level</th>  </tr><tr><td colspan=5></td><th colspan=2>$lt{'rl'}</th>
 <th colspan=3>in Course</th>  <th colspan=3>$lt{'ic'}</th>
 ENDTABLETWO  ENDTABLETWO
            if ($csec) {             if ($csec) {
                 $r->print("<th colspan=3>in Section/Group $csec</th>");                  $r->print("<th colspan=3>".
     &mt("in Section/Group")." $csec</th>");
            }             }
            $r->print(<<ENDTABLEHEADFOUR);             $r->print(<<ENDTABLEHEADFOUR);
 </tr><tr><th>Assessment URL and Title</th><th>Type</th>  </tr><tr><th>$lt{'aut'}</th><th>$lt{'type'}</th>
 <th>Enclosing Map or Folder</th><th>Part</th><th>Parameter Name</th>  <th>$lt{'emof'}</th><th>$lt{'part'}</th><th>$lt{'pn'}</th>
 <th>default</th><th>from Enclosing Map or Folder</th>  <th>$lt{'def'}</th><th>$lt{'femof'}</th>
 <th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th>  <th>$lt{'gen'}</th><th>$lt{'foremf'}</th><th>$lt{'fr'}</th>
 ENDTABLEHEADFOUR  ENDTABLEHEADFOUR
   
            if ($csec) {             if ($csec) {
Line 1264  ENDTABLEHEADFOUR Line 1283  ENDTABLEHEADFOUR
                 } # end loop through ids                  } # end loop through ids
                                                                     
 #---------------------------------------------------- print header information  #---------------------------------------------------- print header information
                 my $foldermap=($maptitle=~/^uploaded/?'Folder':'Map');                  my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map');
                 my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');                  my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
                 $r->print(<<ENDMAPONE);                  $r->print(<<ENDMAPONE);
 <center><h4>  <center><h4>
Line 1348  ENDMAPONE Line 1367  ENDMAPONE
             } # end loop through ids              } # end loop through ids
                                                                     
 #---------------------------------------------------- print header information  #---------------------------------------------------- print header information
       my $setdef=&mt("Set Defaults for All Resources in Course");
             $r->print(<<ENDMAPONE);              $r->print(<<ENDMAPONE);
 <center><h4>  <center><h4>$setdef
 <font color="red">Set Defaults for All Resources in Course  <font color="red">
 <i>$coursename</i><br />  <i>$coursename</i><br />
 ENDMAPONE  ENDMAPONE
             if ($uname) {              if ($uname) {
Line 1822  sub handler { Line 1842  sub handler {
   
 # ----------------------------------------------------------- Clear out garbage  # ----------------------------------------------------------- Clear out garbage
   
 %courseopt=();      %courseopt=();
 %useropt=();      %useropt=();
 %parmhash=();      %parmhash=();
   
 @ids=();  
 %symbp=();  
 %mapp=();  
 %typep=();  
 %keyp=();  
   
 %maptitles=();      @ids=();
       %symbp=();
       %mapp=();
       %typep=();
       %keyp=();
   
       %maptitles=();
   
 # ----------------------------------------------------- Needs to be in a course  # ----------------------------------------------------- Needs to be in a course
   

Removed from v.1.131  
changed lines
  Added in v.1.134


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