--- loncom/interface/courseprefs.pm 2016/11/13 16:20:54 1.49.2.22 +++ 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.22 2016/11/13 16:20:54 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 # @@ -375,7 +375,7 @@ sub handler { help => 'Course_Prefs_General', ordered => ['owner','co-owners','loncaparev','description', 'clonedfrom','courseid','uniquecode','categories', - 'hidefromcat','externalsyllabus','cloners','url', + 'hidefromcat','syllabus','cloners','url', 'rolenames'], itemtext => { 'owner' => $lt{'ownr'}, @@ -386,7 +386,7 @@ sub handler { 'categories' => $lt{'catg'}, 'hidefromcat' => $lt{'excc'}, 'cloners' => $lt{'clon'}, - 'externalsyllabus' => 'Syllabus status', + 'syllabus' => 'Syllabus status', 'url' => 'Top Level Map', 'rolenames' => $lt{'rept'}, 'loncaparev' => $lt{'lcrv'}, @@ -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' => @@ -763,7 +764,8 @@ sub process_changes { (!$can_categorize)); next if (($entry eq 'loncaparev') || ($entry eq 'owner') || - ($entry eq 'clonedfrom')); + ($entry eq 'clonedfrom') || + ($entry eq 'syllabus')); push(@ordered,$entry); } } elsif ($action eq 'classlists') { @@ -966,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); @@ -1474,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') { @@ -1506,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) { @@ -2052,14 +2055,20 @@ sub print_courseinfo { } else { $replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank'); } + my ($editmap,$editsyllabus); + unless ($noedit) { + $editmap = (' 'x2). + '". + &mt('Select Map').'
    '. + &mt('Modification may make assessment data inaccessible!'). + ''; + $editsyllabus = &mt('[_1]Edit[_2]','', + ''); + } my %items = ( 'url' => { - text => ''.&mt($itemtext->{'url'}).''.(' 'x2). - '". - &mt('Select Map').'
    '. - &mt('Modification may make assessment data inaccessible!'). - '', + text => ''.&mt($itemtext->{'url'}).''.$editmap, input => 'textbox', size => '55', advanced => 1 @@ -2101,11 +2110,10 @@ sub print_courseinfo { size => '20', advanced => 1 }, - 'externalsyllabus' => { - text => ''.&mt($itemtext->{'externalsyllabus'}).'
    '. + 'syllabus' => { + text => ''.&mt($itemtext->{'syllabus'}).'
    '. &mt('(Syllabus type in use)').(' ' x2). - &mt('[_1]Edit[_2]','', - ''), + $editsyllabus, }, 'hidefromcat' => { text => ''.&mt($itemtext->{'hidefromcat'}).'
    '. @@ -2348,7 +2356,7 @@ sub print_courseinfo { $datatable .= &manage_coownership($cnum,$cdom,\@currcoown,$noedit); } } - } elsif ($item eq 'externalsyllabus') { + } elsif ($item eq 'syllabus') { my $external = $env{'course.'.$env{'request.course.id'}.'.externalsyllabus'}; my $uploaded = $env{'course.'.$env{'request.course.id'}.'.uploadedsyllabus'}; my $minimal = $env{'course.'.$env{'request.course.id'}.'.minimalsyllabus'}; @@ -3264,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) { @@ -3525,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 = ''. @@ -4010,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); } @@ -4222,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 { @@ -4392,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').'
    '. '