--- loncom/homework/bridgetask.pm 2006/07/17 20:35:11 1.181 +++ loncom/homework/bridgetask.pm 2006/10/31 21:29:38 1.188 @@ -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.188 2006/10/31 21:29:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,7 +43,7 @@ use LONCAPA; BEGIN { - &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','ClosingParagraph')); + &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','GraderNote','ClosingParagraph')); } my %dimension; @@ -105,7 +105,7 @@ sub check_in { sub check_in_sequence { my ($user,$domain,$slot_name) = @_; my $navmap = Apache::lonnavmaps::navmap->new(); - my ($symb) = &Apache::lonxml::whichuser(); + my ($symb) = &Apache::lonnet::whichuser(); my ($map) = &Apache::lonnet::decode_symb($symb); my @resources = $navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0); @@ -225,7 +225,7 @@ sub add_previous_version_button { } sub add_grading_button { - my (undef,$cid)=&Apache::lonxml::whichuser(); + my (undef,$cid)=&Apache::lonnet::whichuser(); my $cnum=$env{'course.'.$cid.'.num'}; my $cdom=$env{'course.'.$cid.'.domain'}; my %sections = &Apache::loncommon::get_sections($cdom,$cnum); @@ -388,12 +388,14 @@ sub internal_location { } sub submission_time_stamp { - my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser(); + my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser(); 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; @@ -422,7 +426,7 @@ sub submission_time_stamp { sub file_list { my ($files,$uname,$udom) = @_; if (!defined($uname) || !defined($udom)) { - (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); + (undef,undef,$udom,$uname) = &Apache::lonnet::whichuser(); } my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/'; @@ -483,7 +487,7 @@ sub done_screen { my ($version) = @_; my $title=&Apache::lonnet::gettitle(); my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'}); - my (undef,undef,$domain,$user)= &Apache::lonxml::whichuser(); + my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser(); my $files = '