--- loncom/homework/structuretags.pm 2023/06/02 01:20:27 1.575 +++ loncom/homework/structuretags.pm 2023/11/27 22:44:20 1.581 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.575 2023/06/02 01:20:27 raeburn Exp $ +# $Id: structuretags.pm,v 1.581 2023/11/27 22:44:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -297,7 +297,7 @@ sub homework_js { } return &Apache::loncommon::resize_textarea_js(). &Apache::loncommon::colorfuleditor_js(). - &setmode_javascript(). + &Apache::lonxml::setmode_javascript(). <<"JS"; -ENDSCRIPT -} - sub page_start { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name, $extra_head)=@_; @@ -445,7 +430,7 @@ sub page_start { if (&Apache::lonhtmlcommon::htmlareabrowser()) { my %textarea_args; if (($env{'request.state'} ne 'construct') || - ($env{'environment.nocodemirror'})) { + (&Apache::loncommon::nocodemirror())) { %textarea_args = ( dragmath => 'math', ); @@ -554,11 +539,20 @@ sub page_start { && $env{'request.state'} eq 'construct') { if ($target eq 'web' || $target eq 'edit') { unless ($env{'form.inhibitmenu'} eq 'yes') { + my $text = 'Authoring Space'; + my $href = &Apache::loncommon::authorspace($env{'request.uri'}); + if ($env{'request.course.id'}) { + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + if ($href eq "/priv/$cdom/$cnum/") { + $text = &mt('Course Authoring Space'); + } + } # Breadcrumbs for Authoring Space &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Authoring Space', - 'href' => &Apache::loncommon::authorspace($env{'request.uri'}), + 'text' => $text, + 'href' => $href, }); # breadcrumbs (and tools) will be created # in start_page->bodytag->innerregister @@ -722,7 +716,7 @@ sub setup_rndseed { $env{'form.rndseed'}=$rndseed; } } - if ((($env{'request.state'} eq "construct") || ($symb eq '')) && + if ((($env{'request.state'} eq "construct") || ($symb eq '')) && ($Apache::lonhomework::type eq 'randomizetry')) { if ($numtries) { if (($reqtries =~ /^\d+$/) && ($reqtries > 1)) { @@ -826,13 +820,18 @@ sub problem_edit_action_button { sub problem_edit_buttons { my ($mode)=@_; + my %editors = &Apache::loncommon::permitted_editors(); # Buttons that save my $result = '