--- loncom/homework/lonhomework.pm 2023/09/07 16:35:29 1.344.2.10.4.3 +++ loncom/homework/lonhomework.pm 2025/01/17 15:51:31 1.344.2.10.4.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.344.2.10.4.3 2023/09/07 16:35:29 raeburn Exp $ +# $Id: lonhomework.pm,v 1.344.2.10.4.11 2025/01/17 15:51:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,6 +49,7 @@ use Apache::matchresponse(); use Apache::chemresponse(); use Apache::functionplotresponse(); use Apache::drawimage(); +use Apache::loncapamath(); use Apache::loncourseuser(); use Apache::grades(); use Apache::Constants qw(:common); @@ -162,9 +163,19 @@ sub get_target { return ('web','answer'); } elsif (($env{'form.problemmode'} eq 'saveedit') || ($env{'form.problemmode'} eq 'undo')) { - return ('modified','no_output_web','edit'); + my %editors = &Apache::loncommon::permitted_editors(); + if ($editors{'edit'}) { + return ('modified','no_output_web','edit'); + } else { + return ('web'); + } } elsif ($env{'form.problemmode'} eq 'edit') { - return ('no_output_web','edit'); + my %editors = &Apache::loncommon::permitted_editors(); + if ($editors{'edit'}) { + return ('no_output_web','edit'); + } else { + return ('web'); + } } else { return ('web'); } @@ -865,7 +876,7 @@ STATE sub analyze_header { my ($request) = @_; - my $js = &Apache::structuretags::setmode_javascript(); + my $js = &Apache::lonxml::setmode_javascript(); # Breadcrumbs my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri), @@ -881,18 +892,26 @@ sub analyze_header { {'bread_crumbs' => $brcrum,}) .&Apache::loncommon::head_subbox( &Apache::loncommon::CSTR_pageheader()); + my %lt = &Apache::lonlocal::texthash( + edit => 'Edit', + editxml => 'EditXML', + ); $result .= '