Diff for /loncom/interface/lonparmset.pm between versions 1.150 and 1.168.2.3

version 1.150, 2004/02/02 20:21:25 version 1.168.2.3, 2004/10/15 22:31:14
Line 307  sub startpage { Line 307  sub startpage {
     'ad'    => "at Domain"      'ad'    => "at Domain"
        );         );
     my $overallhelp=      my $overallhelp=
  &Apache::loncommon::help_open_topic("Course_Setting_Parameters").   &Apache::loncommon::help_open_menu('','Setting Parameters','Course_Setting_Parameters','',10,'Instructor Interface');
  &Apache::loncommon::help_open_faq(10).  
  &Apache::loncommon::help_open_bug('Instructor Interface');  
     my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters");      my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters");
     $r->print(<<ENDHEAD);      $r->print(<<ENDHEAD);
 <html>  <html>
Line 587  sub extractResourceInformation { Line 585  sub extractResourceInformation {
     my $resid=$2;      my $resid=$2;
     my $id=$mapid.'.'.$resid;      my $id=$mapid.'.'.$resid;
     my $srcf=$$bighash{$_};      my $srcf=$$bighash{$_};
     if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) {      if (1) {
    $srcf=~/\.(\w+)$/;
  $$ids[$#$ids+1]=$id;   $$ids[$#$ids+1]=$id;
  $$typep{$id}=$1;   $$typep{$id}=$1;
  $$keyp{$id}='';   $$keyp{$id}='';
Line 596  sub extractResourceInformation { Line 595  sub extractResourceInformation {
                     my $key=$_;                      my $key=$_;
                     my $allkey=$1;                      my $allkey=$1;
                     $allkey=~s/\_/\./g;                      $allkey=~s/\_/\./g;
       if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 
    'parm') {
    next; #hide hidden things
       }
                     my $display= &Apache::lonnet::metadata($srcf,$key.'.display');                      my $display= &Apache::lonnet::metadata($srcf,$key.'.display');
                     my $name=&Apache::lonnet::metadata($srcf,$key.'.name');                      my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
                     my $part= &Apache::lonnet::metadata($srcf,$key.'.part');                      my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
Line 943  sub assessparms { Line 946  sub assessparms {
                                                   
     my $submitmessage = &mt('Update Section or Specific User');      my $submitmessage = &mt('Update Section or Specific User');
     if (!$pssymb) {      if (!$pssymb) {
         $r->print('<tr><td>'.&mt('Select Parameter Level').'</td><td colspan="2">');          $r->print('<tr><td>'.&mt('Select Parameter Level').
          &Apache::loncommon::help_open_topic('Course_Parameter_Levels').
     '</td><td colspan="2">');
         $r->print('<select name="parmlev">');          $r->print('<select name="parmlev">');
         foreach (reverse sort keys %alllevs) {          foreach (reverse sort keys %alllevs) {
             $r->print('<option value="'.$alllevs{$_}.'"');              $r->print('<option value="'.$alllevs{$_}.'"');
Line 987  sub assessparms { Line 992  sub assessparms {
   
         $r->print('<tr><td colspan="3" align="center">'.&mt('Select Parameters to View').'</td></tr>');          $r->print('<tr><td colspan="3" align="center">'.&mt('Select Parameters to View').'</td></tr>');
   
         $r->print('<tr><td colspan="2"><table>');          $r->print('<tr><td colspan="2"><table><tr>');
         $r->print('<tr><td><input type="checkbox" name="pscat" value="all"');  
         $r->print(' checked') unless (@pscat);  
         $r->print('>'.&mt('All Parameters').'</td>');  
   
         my $cnt=0;          my $cnt=0;
         foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} }          foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} }
                       keys %allparms ) {                        keys %allparms ) {
             ++$cnt;              ++$cnt;
             $r->print('</tr><tr>') unless ($cnt%2);              $r->print('</tr><tr>') if ($cnt%2);
             $r->print('<td><input type="checkbox" name="pscat" ');              $r->print('<td><input type="checkbox" name="pscat" ');
             $r->print('value="'.$tempkey.'"');              $r->print('value="'.$tempkey.'"');
             if ($pscat[0] eq "all" || grep $_ eq $tempkey, @pscat) {              if ($pscat[0] eq "all" || grep $_ eq $tempkey, @pscat) {
                 $r->print(' checked');                  $r->print(' checked');
             }              }
             $r->print('>'.$allparms{$tempkey}.'</td>');      $r->print('>'.$allparms{$tempkey}.'</td>');
    }
    $r->print('
   </tr><tr><td>
   <script type="text/javascript">
       function checkall(value, checkName) {
    for (i=0; i<document.forms.parmform.elements.length; i++) {
               ele = document.forms.parmform.elements[i];
               if (ele.name == checkName) {
                   document.forms.parmform.elements[i].checked=value;
               }
         }          }
       }
   </script>
   <input type="button" onclick="checkall(true, \'pscat\')" value="Select All" />
   </td><td>
   <input type="button" onclick="checkall(false, \'pscat\')" value="Unselect All" />
   </td>
   ');
         $r->print('</tr></table>');          $r->print('</tr></table>');
   
 #        $r->print('<tr><td>Select Parts</td><td>');  #        $r->print('<tr><td>Select Parts</td><td>');
Line 1151  ENDTABLEHEADFOUR Line 1169  ENDTABLEHEADFOUR
                 my $rid=$_;                  my $rid=$_;
                 my ($inmapid)=($rid=~/\.(\d+)$/);                  my ($inmapid)=($rid=~/\.(\d+)$/);
   
                 if (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}) ||                  if ((!$pssymb && 
                     ($pssymb eq $symbp{$rid})) {       (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})))
       ||
       ($pssymb && $pssymb eq $symbp{$rid})) {
 # ------------------------------------------------------ Entry for one resource  # ------------------------------------------------------ Entry for one resource
                     if ($defbgone eq '"E0E099"') {                      if ($defbgone eq '"E0E099"') {
                         $defbgone='"E0E0DD"';                          $defbgone='"E0E0DD"';
Line 1196  ENDTABLEHEADFOUR Line 1216  ENDTABLEHEADFOUR
                              '><tt><font size=-1>'.                               '><tt><font size=-1>'.
                              join(' / ',split(/\//,$uri)).                               join(' / ',split(/\//,$uri)).
                              '</font></tt><p><b>'.                               '</font></tt><p><b>'.
                              "<a href=\"javascript:openWindow('/res/".$uri.                               "<a href=\"javascript:openWindow('".
     &Apache::lonnet::clutter($uri).
                              "', 'metadatafile', '450', '500', 'no', 'yes')\";".                               "', 'metadatafile', '450', '500', 'no', 'yes')\";".
                              " TARGET=_self>$title");                               " TARGET=_self>$title");
   
Line 1331  ENDMAPONE Line 1352  ENDMAPONE
                 $r->print('<th>'.&mt('Parameter in Effect').'</th></tr>');                  $r->print('<th>'.&mt('Parameter in Effect').'</th></tr>');
   
         foreach (sort keys %name) {          foreach (sort keys %name) {
                       $r->print('<tr>');
                     &print_row($r,$_,\%part,\%name,$mapid,\%default,                      &print_row($r,$_,\%part,\%name,$mapid,\%default,
                            \%type,\%display,$defbgone,$defbgtwo,                             \%type,\%display,$defbgone,$defbgtwo,
                            $parmlev);                             $parmlev);
Line 1408  ENDMAPONE Line 1430  ENDMAPONE
             $r->print('<th>'.&mt('Parameter in Effect').'</th></tr>');              $r->print('<th>'.&mt('Parameter in Effect').'</th></tr>');
   
     foreach (sort keys %name) {      foreach (sort keys %name) {
                   $r->print('<tr>');
                 &print_row($r,$_,\%part,\%name,$mapid,\%default,                  &print_row($r,$_,\%part,\%name,$mapid,\%default,
                        \%type,\%display,$defbgone,$defbgtwo,$parmlev);                         \%type,\%display,$defbgone,$defbgtwo,$parmlev);
 #                    $r->print("<tr><td>resource.$part{$_}.$name{$_},$symbp{$mapid}</td></tr>\n");  #                    $r->print("<tr><td>resource.$part{$_}.$name{$_},$symbp{$mapid}</td></tr>\n");
Line 1496  sub crsenv { Line 1519  sub crsenv {
         }          }
         #          #
         # Let the user know we made the changes          # Let the user know we made the changes
         if ($name) {          if ($name && defined($value)) {
             my $put_result = &Apache::lonnet::put('environment',              my $put_result = &Apache::lonnet::put('environment',
                                                   {$name=>$value},$dom,$crs);                                                    {$name=>$value},$dom,$crs);
             if ($put_result eq 'ok') {              if ($put_result eq 'ok') {
Line 1526  sub crsenv { Line 1549  sub crsenv {
                                  &mt('Modification may make assessment data inaccessible').                                   &mt('Modification may make assessment data inaccessible').
                                  '</font>',                                   '</font>',
              'description'    => '<b>'.&mt('Course Description').'</b>',               'description'    => '<b>'.&mt('Course Description').'</b>',
              'courseid'       => '<b>'.&mt('Course ID').' '.&mt('or').' '.&mt('number').               'courseid'       => '<b>'.&mt('Course ID or number').
                                  '</b><br />'.                                   '</b><br />'.
                                  '('.&mt('internal').', '.&mt('optional').')',                                   '('.&mt('internal').', '.&mt('optional').')',
              'grading'        => '<b>'.&mt('Grading').'</b><br />'.               'grading'        => '<b>'.&mt('Grading').'</b><br />'.
Line 1543  sub crsenv { Line 1566  sub crsenv {
              'policy.email'   => '<b>'.&mt('Feedback Addresses for Course Policy').'</b>'.               'policy.email'   => '<b>'.&mt('Feedback Addresses for Course Policy').'</b>'.
                                  '<br />(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)',                                   '<br />(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)',
              'hideemptyrows'  => '<b>'.&mt('Hide Empty Rows in Spreadsheets').'</b><br />'.               'hideemptyrows'  => '<b>'.&mt('Hide Empty Rows in Spreadsheets').'</b><br />'.
                                  '("<tt>yes</tt>" for default hiding)',                                   '('.&mt('"[_1]" for default hiding','<tt>yes</tt>').')',
              'pageseparators'  => '<b>'.&mt('Visibly Separate Items on Pages').'</b><br />'.               'pageseparators'  => '<b>'.&mt('Visibly Separate Items on Pages').'</b><br />'.
                                  '("<tt>'.&mt('yes').'</tt>" '.&mt('for visible separation').', '.                                   '('.&mt('"[_1]" for visible separation','<tt>yes</tt>').', '.
                                  &mt('changes will not show until next login').')',                                   &mt('changes will not show until next login').')',
   
              'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles').               'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles').
                                   '</b><br />"<tt>st</tt>": '.                                    '</b><br />"<tt>st</tt>": '.
                                   'student, "<tt>ta</tt>": '.                                    &mt('student').', "<tt>ta</tt>": '.
                                   'TA, "<tt>in</tt>": '.                                    'TA, "<tt>in</tt>": '.
                                   'instructor;<br /><tt>role,role,...</tt>) '.                                    &mt('instructor').';<br /><tt>'.&mt('role,role,...').'</tt>) '.
        Apache::loncommon::help_open_topic("Course_Disable_Discussion"),         Apache::loncommon::help_open_topic("Course_Disable_Discussion"),
              'plc.users.denied' =>                'plc.users.denied' => 
                           '<b>'.&mt('Disallow live chatroom use for Users').'</b><br />'.                            '<b>'.&mt('Disallow live chatroom use for Users').'</b><br />'.
Line 1584  sub crsenv { Line 1607  sub crsenv {
                     ",'spreadsheet')\">$SelectSpreadsheetFile</a><br />",                      ",'spreadsheet')\">$SelectSpreadsheetFile</a><br />",
      'allow_limited_html_in_feedback'       'allow_limited_html_in_feedback'
          => '<b>'.&mt('Allow limited HTML in discussion posts').'</b><br />'.           => '<b>'.&mt('Allow limited HTML in discussion posts').'</b><br />'.
             '('.&mt('Set value to').' "<tt>'.&mt('yes').'</tt>" '.&mt('to allow').')',              '('.&mt('Set value to "[_1]" to allow',"<tt>yes</tt>").')',
      'rndseed'       'rndseed'
          => '<b>'.&mt('Randomization algorithm used').'</b> <br />'.           => '<b>'.&mt('Randomization algorithm used').'</b> <br />'.
                     '<font color="red">'.&mt('Modifying this will make problems').' '.                      '<font color="red">'.&mt('Modifying this will make problems').' '.
                     &mt('have different numbers and answers').'</font>',                      &mt('have different numbers and answers').'</font>',
        'receiptalg'
            => '<b>'.&mt('Receipt algorithm used').'</b> <br />'.
                       &mt('This controls how receipt numbers are generated.'),
                'suppress_tries'
                    => '<b>'.&mt('Suppress number of tries in printing').'</b>('.
                       &mt('yes if supress').')',
              'problem_stream_switch'               'problem_stream_switch'
                  => '<b>'.&mt('Allow problems to be split over pages').'</b><br />'.                   => '<b>'.&mt('Allow problems to be split over pages').'</b><br />'.
                     ' ("<tt>'.&mt('yes').'</tt>" '.&mt('if allowed, anything else if not').')',                      ' ('.&mt('"[_1]" if allowed, anything else if not','<tt>yes</tt>').')',
                'default_paper_size' 
                    => '<b>'.&mt('Default paper type').'</b><br />'.
                       ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. 
                       ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. 
                       ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',
              'anonymous_quiz'               'anonymous_quiz'
                  => '<b>'.&mt('Anonymous quiz/exam').'</b><br />'.                   => '<b>'.&mt('Anonymous quiz/exam').'</b><br />'.
                     ' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)',                      ' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)',
Line 1602  sub crsenv { Line 1636  sub crsenv {
              'languages' => '<b>'.&mt('Languages used').'</b>',               'languages' => '<b>'.&mt('Languages used').'</b>',
              'disable_receipt_display'               'disable_receipt_display'
                  => '<b>'.&mt('Disable display of problem receipts').'</b><br />'.                   => '<b>'.&mt('Disable display of problem receipts').'</b><br />'.
                     ' ("<tt>'.&mt('yes').'</tt>" '.&mt('to disable, anything else if not').')',                      ' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')',
        'disablesigfigs'
            => '<b>'.&mt('Disable checking of Significant Figures').'</b><br />'.
                       ' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')',
      'tthoptions'       'tthoptions'
          => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'           => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
              );                ); 
Line 1615  sub crsenv { Line 1652  sub crsenv {
                              'languages',                               'languages',
      'nothideprivileged',       'nothideprivileged',
                              'rndseed',                               'rndseed',
                                'receiptalg',
                              'problem_stream_switch',                               'problem_stream_switch',
        'suppress_tries',
                                'default_paper_size',
                              'disable_receipt_display',                               'disable_receipt_display',
                              'spreadsheet_default_classcalc',                               'spreadsheet_default_classcalc',
                              'spreadsheet_default_studentcalc',                               'spreadsheet_default_studentcalc',
Line 1623  sub crsenv { Line 1663  sub crsenv {
                              'hideemptyrows',                               'hideemptyrows',
                              'default_enrollment_start_date',                               'default_enrollment_start_date',
                              'default_enrollment_end_date',                               'default_enrollment_end_date',
      'tthoptions'       'tthoptions',
        'disablesigfigs'
                              );                               );
  foreach my $parameter (sort(keys(%values))) {   foreach my $parameter (sort(keys(%values))) {
             unless ($parameter =~ m/^internal\./) {              unless ($parameter =~ m/^internal\./) {
Line 1668  sub crsenv { Line 1709  sub crsenv {
                 $onchange.' /></td><td>'.                  $onchange.' /></td><td>'.
     '<input type="checkbox" name="newp_setparmval" /></td></tr>';      '<input type="checkbox" name="newp_setparmval" /></td></tr>';
     }      }
       my %lt=&Apache::lonlocal::texthash(
       'par'   => 'Parameter',
       'val'   => 'Value',
       'set'   => 'Set',
       'sce'   => 'Set Course Environment'
          );
   
     my $Parameter=&mt('Parameter');      my $Parameter=&mt('Parameter');
     my $Value=&mt('Value');      my $Value=&mt('Value');
     my $Set=&mt('Set');      my $Set=&mt('Set');
       my $browse_js=&Apache::loncommon::browser_and_searcher_javascript('parmset');
     $r->print(<<ENDENV);      $r->print(<<ENDENV);
 <html>  <html>
 <script type="text/javascript" language="Javascript" >  <script type="text/javascript" language="Javascript" >
     var editbrowser;  $browse_js
     function openbrowser(formname,elementname,only,omit) {  
         var url = '/res/?';  
         if (editbrowser == null) {  
             url += 'launch=1&';  
         }  
         url += 'catalogmode=interactive&';  
         url += 'mode=parmset&';  
         url += 'form=' + formname + '&';  
         if (only != null) {  
             url += 'only=' + only + '&';  
         }   
         if (omit != null) {  
             url += 'omit=' + omit + '&';  
         }  
         url += 'element=' + elementname + '';  
         var title = 'Browser';  
         var options = 'scrollbars=1,resizable=1,menubar=0';  
         options += ',width=700,height=600';  
         editbrowser = open(url,title,options,'1');  
         editbrowser.focus();  
     }  
 </script>  </script>
 <head>  <head>
 <title>LON-CAPA Course Environment</title>  <title>LON-CAPA Course Environment</title>
Line 1705  $bodytag Line 1733  $bodytag
 $setoutput  $setoutput
 <p>  <p>
 <table border=2>  <table border=2>
 <tr><th>$Parameter</th><th>$Value</th><th>$Set?</th></tr>  <tr><th>$lt{'par'}</th><th>$lt{'val'}</th><th>$lt{'set'}?</th></tr>
 $output  $output
 </table>  </table>
 <input type="submit" name="crsenv" value="Set Course Environment">  <input type="submit" name="crsenv" value="$lt{'sce'}">
 </form>  </form>
 </body>  </body>
 </html>      </html>    
Line 1769  ENDOVER Line 1797  ENDOVER
  push (@deldata,$thiskey);   push (@deldata,$thiskey);
     } elsif ($cmd eq 'datepointer') {      } elsif ($cmd eq 'datepointer') {
  my $data=&Apache::lonhtmlcommon::get_date_from_form($ENV{$_});   my $data=&Apache::lonhtmlcommon::get_date_from_form($ENV{$_});
  if ($olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; }   if (defined($data) and $olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; }
     }      }
  }   }
     }      }
Line 1813  ENDOVER Line 1841  ENDOVER
     $middle=~s/\.$//;      $middle=~s/\.$//;
     my $realm='<font color="red">'.&mt('All Resources').'</font>';      my $realm='<font color="red">'.&mt('All Resources').'</font>';
     if ($middle=~/^(.+)\_\_\_\(all\)$/) {      if ($middle=~/^(.+)\_\_\_\(all\)$/) {
  $realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'</font>';   $realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><font color="#aaaaaa" size="-2">('.$1.')</font></font>';
     } elsif ($middle) {      } elsif ($middle) {
  $realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).'</font>';   my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
    $realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><font color="#aaaaaa" size="-2">('.$url.' in '.$map.' id: '.$id.')</font></font>';
     }      }
     if ($section ne $oldsection) {      if ($section ne $oldsection) {
  $r->print(&tableend()."\n<hr /><h1>$section</h1>");   $r->print(&tableend()."\n<hr /><h1>$section</h1>");
Line 1902  sub handler { Line 1931  sub handler {
 # ----------------------------------------------------- Needs to be in a course  # ----------------------------------------------------- Needs to be in a course
   
     if (($ENV{'request.course.id'}) &&       if (($ENV{'request.course.id'}) && 
  (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) {   (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}) || 
    &Apache::lonnet::allowed('opa',$ENV{'request.course.id'}.'/'.
     $ENV{'request.course.sec'})
    )) {
   
         &Apache::loncommon::content_type($r,'text/html');          &Apache::loncommon::content_type($r,'text/html');
         $r->send_http_header;          $r->send_http_header;

Removed from v.1.150  
changed lines
  Added in v.1.168.2.3


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