--- loncom/homework/lonhomework.pm 2007/10/30 00:24:40 1.279 +++ loncom/homework/lonhomework.pm 2007/11/10 01:38:21 1.283 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.279 2007/10/30 00:24:40 albertel Exp $ +# $Id: lonhomework.pm,v 1.283 2007/11/10 01:38:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,11 +49,11 @@ use Apache::matchresponse(); use Apache::chemresponse(); use Apache::drawimage(); use Apache::Constants qw(:common); -use HTML::Entities(); use Apache::loncommon(); use Apache::lonlocal; use Time::HiRes qw( gettimeofday tv_interval ); -use Apache::lonnet(); +use HTML::Entities(); +use File::Copy(); # FIXME - improve commenting @@ -149,7 +149,7 @@ sub get_target { } elsif ( $env{'form.problemmode'} eq &mt('Edit') || $env{'form.problemmode'} eq 'Edit') { if ( $env{'form.submitted'} eq 'edit' ) { - if ( $env{'form.submit'} eq &mt('Submit Changes and View') ) { + if ( $env{'form.submit'} eq &mt('Save and View') ) { return ('modified','web','answer'); } else { return ('modified','no_output_web','edit'); @@ -543,7 +543,8 @@ sub due_date { &Apache::lonxml::debug("looking for first_access $first_access"); if (defined($first_access)) { $interval = $first_access+$interval; - $date = ($interval < $due_date)? $interval : $due_date; + $date = (!$due_date || $interval < $due_date) ? $interval + : $due_date; } else { $date = $due_date; } @@ -909,7 +910,7 @@ sub editxmlmode { if (!$error) { $problem=&Apache::lonnet::getfile($file); } } &Apache::lonhomework::showhashsubset(\%env,'^form'); - if ( $env{'form.submit'} eq &mt('Submit Changes and View') ) { + if ( $env{'form.submit'} eq &mt('Save and View') ) { &Apache::lonhomework::showhashsubset(\%env,'^form'); $env{'form.problemmode'}='View'; &renderpage($request,$file); @@ -939,21 +940,30 @@ sub editxmlmode { $result.=$start_page. &renderpage($request,$file,['no_output_web'],1). - &Apache::lonxml::message_location().' -
'. &Apache::structuretags::remember_problem_state().'
- - - - -
- - -
+ +
+ '.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').' + + '.&Apache::loncommon::helpLatexCheatsheet().' +
+
+ + + + +
+
+ + +
+
+ '.&Apache::lonxml::message_location().'
- ' . $xml_help . ' + ' . '