--- loncom/homework/structuretags.pm 2016/04/04 17:34:01 1.549 +++ loncom/homework/structuretags.pm 2016/09/14 02:42:43 1.550 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.549 2016/04/04 17:34:01 raeburn Exp $ +# $Id: structuretags.pm,v 1.550 2016/09/14 02:42:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -419,9 +419,13 @@ sub page_start { $extra_head .= &homework_js(). &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); if (&Apache::lonhtmlcommon::htmlareabrowser()) { - my %textarea_args = ( + my %textarea_args; + if (($env{'request.state'} ne 'construct') || + ($env{'environment.nocodemirror'})) { + %textarea_args = ( dragmath => 'math', ); + } $extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); } my $is_task = ($env{'request.uri'} =~ /\.task$/); @@ -774,7 +778,9 @@ sub problem_edit_buttons { if ($mode eq 'editxml') { $result.=&problem_edit_action_button('subedit','edit','e','Edit',1); $result.=&problem_edit_action_button('subundo','undoxml','u','Undo',1); - $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1); + if ($env{'environment.nocodemirror'}) { + $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1); + } } else { $result.=&problem_edit_action_button('subeditxml','editxml','x','EditXML',1); $result.=&problem_edit_action_button('subundo','undo','u','Undo',1); @@ -3003,9 +3009,13 @@ sub end_startouttext { .''.&mt('Delete?').' ' .&Apache::edit::deletelist($target,$token) .'' - .'' - .&Apache::lonhtmlcommon::dragmath_button($areaid,1) - .'' + .''; + if ($env{'environment.nocodemirror'}) { + $result.=&Apache::lonhtmlcommon::dragmath_button($areaid,1); + } else { + $result.=' '; + } + $result.='' .'' .&Apache::edit::insertlist($target,$token) .''