--- loncom/interface/courseprefs.pm 2018/09/02 00:14:24 1.49.2.24 +++ loncom/interface/courseprefs.pm 2021/12/24 21:09:09 1.49.2.28 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.49.2.24 2018/09/02 00:14:24 raeburn Exp $ +# $Id: courseprefs.pm,v 1.49.2.28 2021/12/24 21:09:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -464,7 +464,7 @@ sub handler { help => 'Course_Prefs_Display', ordered => ['default_xml_style','pageseparators', 'disable_receipt_display','texengine', - 'tthoptions','uselcmath','usejsme'], + 'tthoptions','uselcmath','usejsme','inline_chem'], itemtext => { default_xml_style => 'Default XML style file', pageseparators => 'Visibly Separate Items on Pages', @@ -473,6 +473,7 @@ sub handler { tthoptions => 'Default set of options to pass to tth/m when converting TeX', uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', + inline_chem => 'Chemical reaction response uses inline preview, not pop-up', }, }, 'grading' => @@ -967,19 +968,19 @@ sub process_changes { my $udom = $env{'user.domain'}; my $pendingcoowners = $values->{'internal.pendingco-owners'}; my @pendingcoown = split(',',$pendingcoowners); - if ($env{'form.pending_coowoner'}) { + if ($env{'form.pending_coowner'}) { foreach my $item (@pendingcoown) { unless ($item eq $uname.':'.$udom) { push(@newpending,$item); } } @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)) { push(@newcoown,$uname.':'.$udom); } } - } elsif ($env{'form.remove_coowoner'}) { + } elsif ($env{'form.remove_coowner'}) { foreach my $item (@currcoown) { unless ($item eq $uname.':'.$udom) { push(@newcoown,$item); @@ -1475,7 +1476,8 @@ sub store_changes { $displayval = &Apache::lonlocal::locallocaltime($displayval); } elsif ($key eq 'categories') { $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') { $displayval = &mt('Yes'); } elsif ($changes->{$item}{$key} eq '0') { @@ -1507,12 +1509,12 @@ sub store_changes { } } 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'); - } elsif ($env{'form.pending_coowoner'} eq 'decline') { + } elsif ($env{'form.pending_coowner'} eq 'decline') { $displayval = ''; $output .= '
  • '.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'
  • '; - } elsif ($env{'form.remove_coowoner'}) { + } elsif ($env{'form.remove_coowner'}) { $displayval = &mt('off'); } if ($displayval) { @@ -3270,10 +3272,10 @@ sub manage_coownership { } $output .= ''; if ($is_coowner) { - $output .= &mt('You are currently a co-owner:').' '; + $output .= &mt('You are currently a co-owner:').' '; } else { - $output .= &mt('The course owner has invited you to become a co-owner:').' '.(' 'x2). - ''; + $output .= &mt('The course owner has invited you to become a co-owner:').' '.(' 'x2). + ''; } $output .= ''; if (@currcoown) { @@ -3531,7 +3533,7 @@ sub select_recipient { my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty); my $selectlink = &Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num, - $item.'_udom_'.$num,1); + $item.'_udom_'.$num,'only'); my $output = ''. @@ -4016,6 +4018,10 @@ sub print_appearance { text => ''.&mt($itemtext->{'usejsme'}).'', input => 'radio', }, + 'inline_chem' => { + text => ''.&mt($itemtext->{'inline_chem'}).'', + input => 'radio', + }, ); return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); } @@ -4228,7 +4234,7 @@ sub print_other { input => 'textbox', 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 { @@ -4398,7 +4404,7 @@ sub make_item_rows { $settings->{$item},$disabled); } elsif ($items->{$item}{input} eq 'radio') { 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); unless ($domdefs{$item} eq '0') { $unsetdefault = 1;
    '.&mt('Username').'
    '. '