--- loncom/homework/structuretags.pm 2010/08/16 18:09:28 1.465.2.3 +++ loncom/homework/structuretags.pm 2010/11/09 17:52:13 1.465.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.465.2.3 2010/08/16 18:09:28 raeburn Exp $ +# $Id: structuretags.pm,v 1.465.2.6 2010/11/09 17:52:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -161,6 +161,45 @@ function setmode(form,probmode) { ENDSCRIPT } +sub file_delchk_js { + my $delfilewarn = &mt('You have indicated you wish to delete some files previously included for submission.').'\\n'. + &mt('Deleted files will not be graded.').' '. + &mt('Submit Answer?'); + return <<"ENDSCRIPT"; + +ENDSCRIPT +} + sub page_start { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name, $extra_head)=@_; @@ -177,12 +216,17 @@ sub page_start { $parstack,$parser,$safeeval); } - $extra_head .= &homework_js(); - - if ($env{'environment.wysiwygeditor'} eq 'on') { - $extra_head .= &Apache::lonhtmlcommon::dragmath_js("FCKEditMathPopup"); - } else { - $extra_head .= &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); + $extra_head .= &homework_js(). + &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); + if (&Apache::lonhtmlcommon::htmlareabrowser()) { + my %textarea_args = ( + dragmath => 'math', + ); + $extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); + } + my $is_task = ($env{'request.uri'} =~ /\.task$/); + if ($is_task) { + $extra_head .= &file_delchk_js(); } my %body_args; @@ -280,6 +324,9 @@ sub page_start { if ($target eq 'edit') { $form_tag_start.=&Apache::edit::form_change_detection(); } + if ($is_task) { + $form_tag_start .= ' onsubmit="return file_deletion_check(this);"'; + } $form_tag_start.='>'."\n"; my $symb=&Apache::lonnet::symbread(); @@ -405,8 +452,6 @@ sub problem_edit_footer {