--- loncom/interface/lontrackstudent.pm 2004/12/22 22:54:59 1.11 +++ loncom/interface/lontrackstudent.pm 2004/12/30 16:34:05 1.12 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lontrackstudent.pm,v 1.11 2004/12/22 22:54:59 albertel Exp $ +# $Id: lontrackstudent.pm,v 1.12 2004/12/30 16:34:05 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,7 +47,6 @@ use Apache::Constants qw(:common :http); use Apache::lonnet(); use Apache::lonlocal; use Time::HiRes; -use Time::Local; sub get_data { my ($r,$prog_state,$navmap,$mode) = @_; @@ -178,14 +177,7 @@ sub get_max_time_in_db { $timestr = &Apache::lonnet::unescape($line); } close(TIMEDATA); - my ($year,$month,$day,$hour,$min,$sec) = - ($timestr =~ /^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/); - $month -= 1; # Good old timelocal - my $max_time = undef; - if (eval("&timelocal($sec,$min,$hour,$day,$month,$year)")) { - $max_time = &timelocal($sec,$min,$hour,$day,$month,$year); - } - return $max_time; + return &Apache::lonmysql::unsqltime($timestr); } sub build_query { @@ -232,6 +224,11 @@ sub output_results { my ($r,$results_file,$navmap,$mode) = @_; ## ## + if (! -s $results_file) { + # results file is empty, just let them know there is no data + $r->print('

'.&mt('No data was returned for your request').'

'); + return; + } if (! open(ACTIVITYDATA,$results_file)) { $r->print('

'.&mt('Unable to read results file.').'

'. '

'.