Diff for /loncom/interface/courseprefs.pm between versions 1.28.2.10 and 1.40

version 1.28.2.10, 2011/07/28 04:32:28 version 1.40, 2011/01/13 22:49:47
Line 215  use Apache::lonnet; Line 215  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
 use Apache::lonconfigsettings;  use Apache::lonconfigsettings;
   use Apache::lonparmset;
 use Apache::lonlocal;  use Apache::lonlocal;
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
   
Line 267  sub handler { Line 268  sub handler {
     my %lt;      my %lt;
     if ($crstype eq 'Community') {      if ($crstype eq 'Community') {
         %lt = (          %lt = (
                 conf => 'Community Configuration',                  conf => 'Community Settings',
                 edit => 'Edit Community Configuration',                  edit => 'Edit Community Settings',
                 gens => 'General community settings',                  gens => 'General community settings',
                 idnu => 'Community ID or number',                  idnu => 'Community ID or number',
                 desc => 'Community Description',                  desc => 'Community Description',
Line 294  sub handler { Line 295  sub handler {
               );                );
     } else {      } else {
         %lt = (          %lt = (
                 conf => 'Course Configuration',                  conf => 'Course Settings',
                 edit => 'Edit Course Configuration',                  edit => 'Edit Course Settings',
                 gens => 'General course settings',                  gens => 'General course settings',
                 idnu => 'Course ID or number',                  idnu => 'Course ID or number',
                 desc => 'Course Description',                  desc => 'Course Description',
Line 338  sub handler { Line 339  sub handler {
   
     if ($phase eq 'releaseinfo') {      if ($phase eq 'releaseinfo') {
         my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'};          my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'};
         if ($loncaparev) {          if ($loncaparev) { 
             &display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype);              &display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype);
             return OK;              return OK;
         }          }
Line 353  sub handler { Line 354  sub handler {
         'courseinfo' =>          'courseinfo' =>
                    { text => $lt{'gens'},                     { text => $lt{'gens'},
                      help => 'Course_Environment',                       help => 'Course_Environment',
                      header => [{col1 => 'Setting',  
                                  col2 => 'Value'}],  
                      ordered => ['owner','co-owners','loncaparev','description',                       ordered => ['owner','co-owners','loncaparev','description',
                                  'courseid','categories','hidefromcat',                                   'courseid','categories','hidefromcat',
                                  'externalsyllabus','cloners','url','rolenames'],                                   'externalsyllabus','cloners','url','rolenames'],
Line 375  sub handler { Line 374  sub handler {
         'localization' =>          'localization' =>
                     { text => 'Language and Time Localization',                      { text => 'Language and Time Localization',
                       help => 'Course_Environment',                        help => 'Course_Environment',
                       header => [{col1 => 'Setting',  
                                   col2 => 'Value',}],  
                       ordered => ['languages','timezone','datelocale'],                        ordered => ['languages','timezone','datelocale'],
                       itemtext => {                        itemtext => {
                                     languages  => 'Languages used',                                      languages  => 'Languages used',
Line 388  sub handler { Line 385  sub handler {
                     { text => 'Feedback messages',                      { text => 'Feedback messages',
                       help => 'Course_Environment',                        help => 'Course_Environment',
                       header => [{col1 => 'Questions about:',                        header => [{col1 => 'Questions about:',
                                   col2 => 'Recipients'},                                    col2 => 'Recipients'}],
                                  {col1 => 'Questions about:',  
                                   col2 => 'Custom Text'}],  
                       ordered => ['question.email','comment.email','policy.email'],                        ordered => ['question.email','comment.email','policy.email'],
                       itemtext => {                        itemtext => {
                                      'question.email' => 'Resource Content',                                       'question.email' => 'Resource Content',
Line 439  sub handler { Line 434  sub handler {
         'appearance' =>          'appearance' =>
                    { text => 'Display of resources ',                     { text => 'Display of resources ',
                      help => 'Course_Environment',                       help => 'Course_Environment',
                      header => [{col1 => 'Setting',  
                                  col2 => 'Value',}],  
                      ordered => ['default_xml_style','pageseparators',                       ordered => ['default_xml_style','pageseparators',
                                  'disable_receipt_display','texengine',                                   'disable_receipt_display','texengine',
                                  'tthoptions'],                                   'tthoptions'],
Line 455  sub handler { Line 448  sub handler {
         'grading' =>          'grading' =>
                   { text => 'Grading',                    { text => 'Grading',
                     help => 'Course_Environment',                      help => 'Course_Environment',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value',}],  
                     ordered => ['grading','rndseed',                      ordered => ['grading','rndseed',
                                 'receiptalg','disablesigfigs'],                                  'receiptalg','disablesigfigs'],
                     itemtext => {                      itemtext => {
Line 470  sub handler { Line 461  sub handler {
         'printouts' =>          'printouts' =>
                   { text => 'Printout generation',                    { text => 'Printout generation',
                     help => 'Course_Environment',                      help => 'Course_Environment',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value',}],  
                     ordered => ['problem_stream_switch','suppress_tries',                      ordered => ['problem_stream_switch','suppress_tries',
                                 'default_paper_size','print_header_format',                                  'default_paper_size','print_header_format',
                                 'disableexampointprint'],                                  'disableexampointprint','canuse_pdfforms'],
                     itemtext => {                      itemtext => {
                         problem_stream_switch => 'Allow problems to be split over pages',                          problem_stream_switch => 'Allow problems to be split over pages',
                         suppress_tries        => 'Suppress number of tries in printing',                          suppress_tries        => 'Suppress number of tries in printing',
Line 487  sub handler { Line 476  sub handler {
         'spreadsheet' =>          'spreadsheet' =>
                   { text => 'Spreadsheets',                    { text => 'Spreadsheets',
                     help => 'Course_Environment',                      help => 'Course_Environment',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value'}],  
                     ordered => ['spreadsheet_default_classcalc',                      ordered => ['spreadsheet_default_classcalc',
                                 'spreadsheet_default_studentcalc',                                  'spreadsheet_default_studentcalc',
                                 'spreadsheet_default_assesscalc','hideemptyrows'],                                  'spreadsheet_default_assesscalc','hideemptyrows'],
Line 502  sub handler { Line 489  sub handler {
         'bridgetasks' =>          'bridgetasks' =>
                   { text => 'Bridge tasks',                    { text => 'Bridge tasks',
                     help => 'Course_Environment',                      help => 'Course_Environment',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value'}],  
                     ordered => ['task_messages','task_grading',                      ordered => ['task_messages','task_grading',
                                 'suppress_embed_prompt'],                                  'suppress_embed_prompt'],
                     itemtext => {                      itemtext => {
Line 559  sub print_config_box { Line 544  sub print_config_box {
     my $itemtext = $item->{'itemtext'};      my $itemtext = $item->{'itemtext'};
     my $rowtotal = 0;      my $rowtotal = 0;
     my $output =      my $output =
          '<table class="LC_nested_outer">          '<h3><a href="#">'.&mt($item->{text}).'</a></h3>
           <tr>          <div>&nbsp;<span style="float:right">'.
            <th align="left" valign="middle"><span class="LC_nobreak" style="font-size: larger;" >'.           &Apache::loncommon::help_open_topic($item->{'help'}).'</span>';
            &mt($item->{text}).'&nbsp;'.  
            &Apache::loncommon::help_open_topic($item->{'help'}).'</span></th>'."\n".  
           '</tr>';  
     if (($action eq 'feedback') || ($action eq 'classlists')) {      if (($action eq 'feedback') || ($action eq 'classlists')) {
         $output .= '          $output .= '
           <tr>              <table class="LC_nested">';   
            <td>  
             <table class="LC_nested">';  
         if (exists $item->{'header'}->[0]->{'col1'} ||           if (exists $item->{'header'}->[0]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {              exists $item->{'header'}->[0]->{'col2'}) {
  $output .= '             $output .= '          
Line 586  sub print_config_box { Line 566  sub print_config_box {
         }          }
         $output .= '          $output .= '
            </table>             </table>
           </td>  
          </tr>  
          <tr>  
            <td>  
             <table class="LC_nested">              <table class="LC_nested">
              <tr class="LC_info_row">               <tr class="LC_info_row">
               <td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>';                <td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>';
Line 600  sub print_config_box { Line 576  sub print_config_box {
             $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype).              $output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype).
                        '                         '
             </table>              </table>
            </td>  
           </tr>  
           <tr>  
            <td>  
             <table class="LC_nested">';              <table class="LC_nested">';
             if (exists $item->{'header'}->[0]->{'col1'} ||               if (exists $item->{'header'}->[0]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {              exists $item->{'header'}->[0]->{'col2'}) {
Line 612  sub print_config_box { Line 584  sub print_config_box {
   <td class="LC_left_item">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>    <td class="LC_left_item">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>
   <td class="LC_right_item">'.&mt($item->{'header'}->[0]->{'col2'}).'</td>    <td class="LC_right_item">'.&mt($item->{'header'}->[0]->{'col2'}).'</td>
  </tr>';   </tr>';
             }          }
         }          }
     } else {      } else {
         $output .= '          $output .= '
           <tr>  
            <td>  
             <table class="LC_nested">';              <table class="LC_nested">';
         if (exists $item->{'header'}->[0]->{'col1'} ||           if (exists $item->{'header'}->[0]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {              exists $item->{'header'}->[0]->{'col2'}) {
Line 654  sub print_config_box { Line 624  sub print_config_box {
     }      }
     $output .= '      $output .= '
    </table>     </table>
   </td>  </div>';
  </tr>  
 </table><br />';  
     return ($output,$rowtotal);      return ($output,$rowtotal);
 }  }
   
Line 1378  sub store_changes { Line 1346  sub store_changes {
                     $output .= '</ul>';                      $output .= '</ul>';
                 } else {                  } else {
                     if ($crstype eq 'Community') {                      if ($crstype eq 'Community') {
                         $output .= &mt('No changes made to community settings.');                          $output = &mt('No changes made to community settings.');
                     } else {                      } else {
                         $output .= &mt('No changes made to course settings.');                          $output = &mt('No changes made to course settings.');
                     }                      }
                 }                  }
             }              }
Line 1717  sub print_courseinfo { Line 1685  sub print_courseinfo {
                            '</span>',                             '</span>',
                    input => 'textbox',                     input => 'textbox',
                    size  => '40',                     size  => '40',
                      advanced => 1
                  },                   },
         'description'  => {           'description'  => { 
                    text => '<b>'.&mt($itemtext->{'description'}).'</b>',                     text => '<b>'.&mt($itemtext->{'description'}).'</b>',
Line 1740  sub print_courseinfo { Line 1709  sub print_courseinfo {
                            &mt('Owner and Coordinators included automatically'),                             &mt('Owner and Coordinators included automatically'),
                    input => 'textbox',                     input => 'textbox',
                    size  => '40',                     size  => '40',
                      advanced => 1
                          },                           },
         'rolenames'  => {           'rolenames'  => { 
                    text  => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'.                     text  => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'.
                             '('.$replace.')',                              '('.$replace.')',
                    input => 'textbox',                     input => 'textbox',
                    size  => '20',                     size  => '20',
                      advanced => 1
                         },                          },
         'externalsyllabus' => {          'externalsyllabus' => {
                    text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />('.                     text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />('.
Line 1777  sub print_courseinfo { Line 1748  sub print_courseinfo {
             next if (!$can_categorize);              next if (!$can_categorize);
         }          }
         $count ++;          $count ++;
         $datatable .= &item_table_row_start($items{$item}{text},$count);          if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) {
           $datatable .= &item_table_row_start($items{$item}{text},$count,"advanced");
           } else {
           $datatable .= &item_table_row_start($items{$item}{text},$count);
           }
         if ($items{$item}{input} eq 'radio') {          if ($items{$item}{input} eq 'radio') {
             $datatable .= &yesno_radio($item,$settings);              $datatable .= &yesno_radio($item,$settings);
         } elsif ($item eq 'cloners') {          } elsif ($item eq 'cloners') {
Line 2126  sub display_loncaparev_constraints { Line 2101  sub display_loncaparev_constraints {
                              if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) {                               if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) {
                                  $middle = $1;                                   $middle = $1;
                                  $which = $2;                                   $which = $2;
                                  $scope = 'user';                                   $scope = 'user'; 
                              } elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) {                               } elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) {
                                  $middle = $1;                                   $middle = $1;
                                  $which = $2;                                   $which = $2;
Line 2321  sub display_loncaparev_constraints { Line 2296  sub display_loncaparev_constraints {
     my $mapres_header = '<h4>'.      my $mapres_header = '<h4>'.
                         &mt('Requirements for specific folders or resources').                          &mt('Requirements for specific folders or resources').
                         '</h4>';                          '</h4>';
     if ((keys(%toshow) > 0) || (keys(%byresource) > 0) ||      if ((keys(%toshow) > 0) || (keys(%byresource) > 0) || 
         (keys(%bysubmission) > 0) || (keys(%byresponsetype))) {          (keys(%bysubmission) > 0) || (keys(%byresponsetype))) {
         $output .= $mapres_header;          $output .= $mapres_header;
     }      }
Line 2336  sub display_loncaparev_constraints { Line 2311  sub display_loncaparev_constraints {
             &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,              &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,
                                 \%byresponsetype,\@scopeorder,\%lt);                                  \%byresponsetype,\@scopeorder,\%lt);
         }          }
         $r->print('<br /><br />');          $r->print('<br /><br />'); 
     } else {      } else {
         $r->print('<p class="LC_info">'.          $r->print('<p class="LC_info">'.
                   &mt('No version requirements from resource content or settings.').                    &mt('No version requirements from resource content or settings.').
                   '</p>');                    '</p>'); 
     }      }
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return;      return;
Line 2349  sub display_loncaparev_constraints { Line 2324  sub display_loncaparev_constraints {
 sub show_contents_view {  sub show_contents_view {
     my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,      my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,
         $scopeorder,$lt) = @_;          $scopeorder,$lt) = @_;
     if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) ||      if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) || 
         (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {          (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {
         my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");          my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
         my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';          my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';
Line 2793  sub print_feedback { Line 2768  sub print_feedback {
   
     foreach my $item (@{$ordered}) {      foreach my $item (@{$ordered}) {
         $count ++;          $count ++;
         $datatable .= &item_table_row_start($items{$item}{text},$count);          if ($position eq 'top') {
           $datatable .= &item_table_row_start($items{$item}{text},$count);
           } else {
           $datatable .= &item_table_row_start($items{$item}{text}."<br/>(Custom text)",$count, "advanced");
           }
         if ($position eq 'top') {          if ($position eq 'top') {
             my $includeempty = 0;              my $includeempty = 0;
             $datatable .= &user_table($cdom,$item,\@sections,              $datatable .= &user_table($cdom,$item,\@sections,
                                       $settings->{$item},\%lt);                                        $settings->{$item},\%lt);
         } else {          } else {
             $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text',              $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text',
                               $settings->{$item.'.text'},$items{$item}{size});                                $settings->{$item.'.text'},$items{$item}{size});  
         }          }
         $datatable .= &item_table_row_end();          $datatable .= &item_table_row_end();
     }      }
Line 3250  sub print_grading { Line 3229  sub print_grading {
                    input => 'selectbox',                     input => 'selectbox',
                    options => {                     options => {
                                 standard => &mt('Standard: shows points'),                                  standard => &mt('Standard: shows points'),
                                   categories => &mt('Categories: shows points according to categories'),
                                 external => &mt('External: shows number of completed parts and totals'),                                  external => &mt('External: shows number of completed parts and totals'),
                                 externalnototals => &mt('External: shows only number of completed parts'),                                  externalnototals => &mt('External: shows only number of completed parts'),
                                 spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'),                                   spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), 
                               },                                },
                    order => ['standard','external','externalnototals','spreadsheet'],                     order => ['standard','categories','external','externalnototals','spreadsheet'],
                  },                   },
         'rndseed' => {          'rndseed' => {
                    text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'.                     text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'.

Removed from v.1.28.2.10  
changed lines
  Added in v.1.40


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