--- loncom/homework/bridgetask.pm 2006/07/17 20:35:11 1.181 +++ loncom/homework/bridgetask.pm 2006/10/11 21:06:49 1.184 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.181 2006/07/17 20:35:11 albertel Exp $ +# $Id: bridgetask.pm,v 1.184 2006/10/11 21:06:49 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -392,8 +392,10 @@ sub submission_time_stamp { my $submissiontime; my $version=$Apache::lonhomework::history{'resource.0.version'}; for (my $v=$Apache::lonhomework::history{'version'};$v>0;$v--) { - if (defined($Apache::lonhomework::history{$v.':resource.'.$version.'.0.bridgetask.portfiles'})) { + if (defined($Apache::lonhomework::history{$v.':resource.'.$version.'.0.bridgetask.portfiles'}) + && defined($Apache::lonhomework::history{$v.':resource.'.$version.'.0.tries'})) { $submissiontime=$Apache::lonhomework::history{$v.':timestamp'}; + last; } } my $result; @@ -404,16 +406,18 @@ sub submission_time_stamp { my ($color,$when)=('#FF6666','after'); if ($diff > 0) { ($color,$when)=('#336600','before'); } my $info; + $diff = abs($diff); if ($diff%60) { $info=($diff%60).' seconds'; } $diff=int($diff/60); if ($diff%60) { $info=($diff%60).' minutes '.$info; } $diff=int($diff/60); if ($diff) { $info=$diff.' hours '.$info; } $result='

'. - &mt('Student submitted [_1] [_2] the deadline. - (Submission was at [_3], end of period was [_4].)', - $info,$when,scalar(localtime($submissiontime)), - scalar(localtime($slot{'endtime'}))). + &mt('Student submitted [_1] [_2] the deadline. '. + '(Submission was at [_3], end of period was [_4].)', + $info,$when, + &Apache::lonlocal::locallocaltime($submissiontime), + &Apache::lonlocal::locallocaltime($slot{'endtime'})). '

'; } return $result; @@ -1098,8 +1102,6 @@ DONEBUTTON if ($award eq 'SUBMITTED') { &add_to_queue('gradingqueue',\%queue_data); } - } elsif ($Apache::lonhomework::results{'INTERNAL_store'}) { - &Apache::structuretags::finalize_storage(); } if ($target eq 'grade' && $env{'form.webgrade'} eq 'yes' && exists($env{'form.cancel'})) { @@ -1210,6 +1212,10 @@ DONEBUTTON &minimize_storage(); &Apache::structuretags::finalize_storage(); } + if (exists($Apache::lonhomework::results{'INTERNAL_store'})) { + # instance generation occured and hasn't yet been stored + &Apache::structuretags::finalize_storage(); + } } elsif ($target eq 'webgrade') { $result.=""; #$result.='