Diff for /loncom/interface/courseprefs.pm between versions 1.49.2.24 and 1.49.2.29

version 1.49.2.24, 2018/09/02 00:14:24 version 1.49.2.29, 2022/01/16 18:27:09
Line 464  sub handler { Line 464  sub handler {
                      help => 'Course_Prefs_Display',                       help => 'Course_Prefs_Display',
                      ordered => ['default_xml_style','pageseparators',                       ordered => ['default_xml_style','pageseparators',
                                  'disable_receipt_display','texengine',                                   'disable_receipt_display','texengine',
                                  'tthoptions','uselcmath','usejsme'],                                   'tthoptions','uselcmath','usejsme','inline_chem'],
                       itemtext => {                        itemtext => {
                           default_xml_style       => 'Default XML style file',                            default_xml_style       => 'Default XML style file',
                           pageseparators          => 'Visibly Separate Items on Pages',                            pageseparators          => 'Visibly Separate Items on Pages',
Line 473  sub handler { Line 473  sub handler {
                           tthoptions              => 'Default set of options to pass to tth/m when converting TeX',                            tthoptions              => 'Default set of options to pass to tth/m when converting TeX',
                           uselcmath               => 'Student formula entry uses inline preview, not DragMath pop-up',                            uselcmath               => 'Student formula entry uses inline preview, not DragMath pop-up',
                           usejsme                 => 'Molecule editor uses JSME (HTML5) in place of JME (Java)',                            usejsme                 => 'Molecule editor uses JSME (HTML5) in place of JME (Java)',
                             inline_chem             => 'Chemical reaction response uses inline preview, not pop-up',
                                   },                                    },
                   },                    },
         'grading' =>          'grading' =>
Line 943  sub process_changes { Line 944  sub process_changes {
                                         $autocoowner = $domconf{'autoenroll'}{'co-owners'};                                          $autocoowner = $domconf{'autoenroll'}{'co-owners'};
                                     }                                      }
                                 }                                  }
                                 unless ($autocoowner) {                                  if ($autocoowner) {
                                       $newvalues{'co-owners'} = $values->{'internal.co-owners'}; 
                                   } else {
                                     my @keepcoowners = &Apache::loncommon::get_env_multiple('form.coowners');                                      my @keepcoowners = &Apache::loncommon::get_env_multiple('form.coowners');
                                     my @pendingcoowners = &Apache::loncommon::get_env_multiple('form.pendingcoowners');                                      my @pendingcoowners = &Apache::loncommon::get_env_multiple('form.pendingcoowners');
                                     my @invitecoowners =  &Apache::loncommon::get_env_multiple('form.invitecoowners');                                      my @invitecoowners =  &Apache::loncommon::get_env_multiple('form.invitecoowners');
Line 967  sub process_changes { Line 970  sub process_changes {
                                 my $udom = $env{'user.domain'};                                  my $udom = $env{'user.domain'};
                                 my $pendingcoowners = $values->{'internal.pendingco-owners'};                                  my $pendingcoowners = $values->{'internal.pendingco-owners'};
                                 my @pendingcoown = split(',',$pendingcoowners);                                  my @pendingcoown = split(',',$pendingcoowners);
                                 if ($env{'form.pending_coowoner'}) {                                  if ($env{'form.pending_coowner'}) {
                                     foreach my $item (@pendingcoown) {                                      foreach my $item (@pendingcoown) {
                                         unless ($item eq $uname.':'.$udom) {                                          unless ($item eq $uname.':'.$udom) {
                                             push(@newpending,$item);                                              push(@newpending,$item);
                                         }                                          }
                                     }                                      }
                                     @newcoown = @currcoown;                                      @newcoown = @currcoown;
                                     if ($env{'form.pending_coowoner'} eq 'accept') {                                      if ($env{'form.pending_coowner'} eq 'accept') {
                                         unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) {                                          unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) {
                                             push(@newcoown,$uname.':'.$udom);                                              push(@newcoown,$uname.':'.$udom);
                                         }                                          }
                                     }                                      }
                                 } elsif ($env{'form.remove_coowoner'}) {                                  } elsif ($env{'form.remove_coowner'}) {
                                     foreach my $item (@currcoown) {                                      foreach my $item (@currcoown) {
                                         unless ($item eq $uname.':'.$udom) {                                          unless ($item eq $uname.':'.$udom) {
                                             push(@newcoown,$item);                                              push(@newcoown,$item);
Line 988  sub process_changes { Line 991  sub process_changes {
                                     if ($pendingcoowners ne '') {                                      if ($pendingcoowners ne '') {
                                         @newpending = @pendingcoown;                                          @newpending = @pendingcoown;
                                     }                                      }
                                   } else {
                                       @newcoown = @currcoown;
                                 }                                  }
                                 $newvalues{'pendingco-owners'} = join(',',sort(@newpending));                                  $newvalues{'pendingco-owners'} = join(',',sort(@newpending));
                                 $newvalues{'co-owners'} = join(',',sort(@newcoown));                                  $newvalues{'co-owners'} = join(',',sort(@newcoown));
Line 1475  sub store_changes { Line 1480  sub store_changes {
                                         $displayval = &Apache::lonlocal::locallocaltime($displayval);                                          $displayval = &Apache::lonlocal::locallocaltime($displayval);
                                     } elsif ($key eq 'categories') {                                      } elsif ($key eq 'categories') {
                                         $displayval = $env{'form.categories_display'};                                          $displayval = $env{'form.categories_display'};
                                     } elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') || ($key eq 'uselcmath')) {                                      } elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') ||
                                                ($key eq 'uselcmath') || ($key eq 'inline_chem')) {
                                         if ($changes->{$item}{$key} eq '1') {                                          if ($changes->{$item}{$key} eq '1') {
                                             $displayval = &mt('Yes');                                              $displayval = &mt('Yes');
                                         } elsif ($changes->{$item}{$key} eq '0') {                                          } elsif ($changes->{$item}{$key} eq '0') {
Line 1507  sub store_changes { Line 1513  sub store_changes {
                                                 }                                                  }
                                             }                                              }
                                             unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) {                                              unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) {
                                                 if ($env{'form.pending_coowoner'} eq 'accept') {                                                  if ($env{'form.pending_coowner'} eq 'accept') {
                                                         $displayval = &mt('on');                                                          $displayval = &mt('on');
                                                 } elsif ($env{'form.pending_coowoner'} eq 'decline') {                                                  } elsif ($env{'form.pending_coowner'} eq 'decline') {
                                                         $displayval = '';                                                          $displayval = '';
                                                         $output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'</li>';                                                          $output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'</li>';
                                                 } elsif ($env{'form.remove_coowoner'}) {                                                  } elsif ($env{'form.remove_coowner'}) {
                                                     $displayval = &mt('off');                                                      $displayval = &mt('off');
                                                 }                                                  }
                                                 if ($displayval) {                                                  if ($displayval) {
Line 3171  sub coowner_invitations { Line 3177  sub coowner_invitations {
         @pendingcoown = split(',',$pendingcoowners);          @pendingcoown = split(',',$pendingcoowners);
     }      }
     if (ref($currcoownref) eq 'ARRAY') {      if (ref($currcoownref) eq 'ARRAY') {
         @currcoown == @{$currcoownref};          @currcoown = @{$currcoownref};
     }      }
     my $disabled;      my $disabled;
     if ($noedit) {      if ($noedit) {
Line 3235  sub manage_coownership  { Line 3241  sub manage_coownership  {
         @pendingcoown = split(',',$pendingcoowners);          @pendingcoown = split(',',$pendingcoowners);
     }      }
     if (ref($currcoownref) eq 'ARRAY') {      if (ref($currcoownref) eq 'ARRAY') {
         @currcoown == @{$currcoownref};          @currcoown = @{$currcoownref};
     }      }
     my $disabled;      my $disabled;
     if ($noedit) {      if ($noedit) {
Line 3270  sub manage_coownership  { Line 3276  sub manage_coownership  {
         }          }
         $output .= '<span class="LC_nobreak">';          $output .= '<span class="LC_nobreak">';
         if ($is_coowner) {          if ($is_coowner) {
             $output .= &mt('You are currently a co-owner:').'&nbsp;<label><input type="checkbox" name="remove_coowoner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>';              $output .= &mt('You are currently a co-owner:').'&nbsp;<label><input type="checkbox" name="remove_coowner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>';
         } else {          } else {
             $output .= &mt('The course owner has invited you to become a co-owner:').'&nbsp;<label><input type="radio" name="pending_coowoner" value="accept"'.$disabled.' />'.&mt('Accept?').'</label>'.('&nbsp;'x2).              $output .= &mt('The course owner has invited you to become a co-owner:').'&nbsp;<label><input type="radio" name="pending_coowner" value="accept"'.$disabled.' />'.&mt('Accept?').'</label>'.('&nbsp;'x2).
                        '<label><input type="radio" name=pending_coowoner" value="decline"'.$disabled.' />'.&mt('Decline?').'</label>';                         '<label><input type="radio" name=pending_coowner" value="decline"'.$disabled.' />'.&mt('Decline?').'</label>';
         }          }
         $output .= '</span>';          $output .= '</span>';
         if (@currcoown) {          if (@currcoown) {
Line 3531  sub select_recipient { Line 3537  sub select_recipient {
     my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty);      my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty);
     my $selectlink =      my $selectlink =
         &Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num,          &Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num,
                                                $item.'_udom_'.$num,1);                                                 $item.'_udom_'.$num,'only');
     my $output =       my $output = 
         '<table><tr><td align="center">'.&mt('Username').'<br />'.          '<table><tr><td align="center">'.&mt('Username').'<br />'.
         '<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'.          '<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'.
Line 4016  sub print_appearance { Line 4022  sub print_appearance {
                    text => '<b>'.&mt($itemtext->{'usejsme'}).'</b>',                     text => '<b>'.&mt($itemtext->{'usejsme'}).'</b>',
                    input => 'radio',                     input => 'radio',
                  },                   },
            'inline_chem' => {
                      text => '<b>'.&mt($itemtext->{'inline_chem'}).'</b>',
                      input => 'radio',
                    },
     );      );
     return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit);      return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit);
 }  }
Line 4228  sub print_other { Line 4238  sub print_other {
                             input => 'textbox',                              input => 'textbox',
                             size  => '30',                              size  => '30',
                            };                             };
     my $output = &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other',$noedit);      return &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other',$noedit);
 }  }
   
 sub get_other_items {  sub get_other_items {
Line 4398  sub make_item_rows { Line 4408  sub make_item_rows {
                                                        $settings->{$item},$disabled);                                                         $settings->{$item},$disabled);
             } elsif ($items->{$item}{input} eq 'radio') {              } elsif ($items->{$item}{input} eq 'radio') {
                 my ($unsetdefault,$valueyes,$valueno);                  my ($unsetdefault,$valueyes,$valueno);
                 if (($item eq 'usejsme') || ($item eq 'uselcmath')) {                  if (($item eq 'usejsme') || ($item eq 'uselcmath') || ($item eq 'inline_chem')) {
                      my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);                       my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
                      unless ($domdefs{$item} eq '0') {                       unless ($domdefs{$item} eq '0') {
                          $unsetdefault = 1;                           $unsetdefault = 1;

Removed from v.1.49.2.24  
changed lines
  Added in v.1.49.2.29


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