--- loncom/homework/structuretags.pm 2008/01/28 21:42:28 1.417 +++ loncom/homework/structuretags.pm 2008/08/13 16:56:15 1.427 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.417 2008/01/28 21:42:28 www Exp $ +# $Id: structuretags.pm,v 1.427 2008/08/13 16:56:15 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -148,6 +148,10 @@ sub page_start { $extra_head .= &homework_js(); + unless ($env{'environment.wysiwygeditor'} eq 'on') { + $extra_head .= &Apache::lonhtmlcommon::dragmath_js(); + } + my %body_args; if (defined($found{'html'})) { $body_args{'skip_phases'}{'head'}=1; @@ -312,24 +316,28 @@ sub remember_problem_state { '; } -sub problem_edit_header { - return ''. - &Apache::structuretags::remember_problem_state().' -
-
-'.&mt('Problem Editing').&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').' -
+sub problem_edit_buttons { + return '
- + ' onclick="javscript:setmode(this.form,'."'discard'".')" />
-
+
'; +} + +sub problem_edit_header { + return ''. + &Apache::structuretags::remember_problem_state().' +
+
+'.&mt('Problem Editing').&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').' +
'. +&problem_edit_buttons().'
'.&Apache::lonxml::message_location().'
@@ -340,17 +348,8 @@ sub problem_edit_header { sub problem_edit_footer { return '
'. @@ -451,7 +450,6 @@ $show_all $show_all "; } - $result.=' '.&mt('Apply style file: ').' @@ -459,6 +457,9 @@ $show_all '.&mt('Select').' +
'. + &Apache::lonxml::renderingoptions().' +
@@ -477,8 +478,8 @@ $show_all $result .= ''. &mt('[_1] for [_2] versions.', ' - ' + ,''). &Apache::loncommon::help_open_topic("Analyze_Problem",'',undef,undef,300). ''; @@ -645,26 +646,27 @@ sub firstaccess_msg { my $foldertitle=&Apache::lonnet::gettitle($map); &Apache::lonxml::debug("map is $map title is $foldertitle"); - $result .= (<The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle". -ENDCHECKOUT + $result .= "

".&mt('The resources in "[_1]" are open for a limited time.' + .' Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".' + ,$foldertitle,$time)."

"; } elsif ($interval[1] eq 'course') { my $course = $env{'course.'.$env{'request.course.id'}.'.description'}; - $result .= (<The resources in "$course" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources in "$course". -ENDCHECKOUT + $result .= "

".&mt('The resources in "[_1]" are open for a limited time.' + .' Once you click the "Show Resource" button below you have [_2] to complete all resources "[_1]".' + ,$course,$time)."

"; } else { my $title=&Apache::lonnet::gettitle($symb); - $result .= (<This resource "$title" is open for a limited time. Once you click the 'Show Resource' button below you have $time to complete this resource "$title". -ENDCHECKOUT - + $result .= "

".&mt('This resource "[_1]" is open for a limited time.' + .' Once you click the "Show Resource" button below you have [_2] to complete this resource "[_1]".' + ,$title,$time)."

"; } my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); + my $buttontext = &mt('Show Resource'); + my $timertext = &mt('Start Timer?'); $result .= (< - + ENDCHECKOUT return $result; @@ -1380,7 +1382,11 @@ sub end_languageblock { my $result = &Apache::lonxml::endredirection(); my $which = &Apache::lonxml::get_param('which',$parstack, $safeeval); - $available_texts{$which} = $result; + foreach my $language (split(/\s*\,\s*/,$which)) { + unless ($language=~/\w/) { next; } + $available_texts{$language} = $result; + } + } return ''; } @@ -1872,14 +1878,18 @@ sub end_startouttext { my $text=''; 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')." ".&mt('Delete:'). &Apache::edit::deletelist($target,$token) - ." -". - &Apache::edit::insertlist($target,$token). - '' . + .""; + unless ($env{'environment.wysiwygeditor'} eq 'on') { + $result.='' + .&Apache::lonhtmlcommon::dragmath_button($areaid,1) + .''; + } + $result.='' . &Apache::loncommon::helpLatexCheatsheet(). &Apache::edit::end_row(). &Apache::edit::start_spanning_row()."\n".