--- loncom/homework/structuretags.pm 2015/04/21 22:48:46 1.512.2.10 +++ loncom/homework/structuretags.pm 2017/06/13 16:20:41 1.512.2.13.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.512.2.10 2015/04/21 22:48:46 raeburn Exp $ +# $Id: structuretags.pm,v 1.512.2.13.2.1 2017/06/13 16:20:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -270,6 +270,7 @@ sub homework_js { $jstimeout = 1000 * $timeout; } return &Apache::loncommon::resize_textarea_js(). + &Apache::loncommon::colorfuleditor_js(). &setmode_javascript(). <<"JS"; @@ -416,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$/); @@ -751,53 +758,82 @@ sub problem_edit_action_button { sub problem_edit_buttons { my ($mode)=@_; +# Buttons that save + my $result = '
';
+
+ ' . &Apache::lonxml::message_location();
+ $return .= '
+ ';
+
+ $return .= '
+
+
+ '.&mt('Problem Editing').$mode.&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').'
+
'. "\n\n".&Apache::loncommon::end_page(); @@ -1489,7 +1525,8 @@ sub start_problem { $target eq 'tex') { if ($env{'form.markaccess'}) { my @interval=&Apache::lonnet::EXT("resource.0.interval"); - &Apache::lonnet::set_first_access($interval[1],$interval[0]); + my ($timelimit) = ($interval[0] =~ /^(\d+)/); + &Apache::lonnet::set_first_access($interval[1],$timelimit); } ($status,$accessmsg,$slot_name,$slot) = @@ -2898,13 +2935,18 @@ sub end_startouttext { if ($target eq 'edit') { my $areaid = 'homework_edit_'.$Apache::lonxml::curdepth; $text=&Apache::lonxml::get_all_text("endouttext",$parser,$style); - $result.=&Apache::edit::start_table($token)." | ||||
".&mt('Text Block')." | " + $result.=&Apache::edit::start_table($token)."||||
".&Apache::loncommon::insert_folding_button() + ." ".&mt('Text Block')." | " .''.&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) .' | '