--- loncom/interface/groupsort.pm 2001/12/11 03:37:11 1.5 +++ loncom/interface/groupsort.pm 2002/01/17 12:17:50 1.6 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.5 2001/12/11 03:37:11 harris41 Exp $ +# $Id: groupsort.pm,v 1.6 2002/01/17 12:17:50 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -28,6 +28,8 @@ # # YEAR=2001 # 8/7,8/8,10/14,10/15,12/10 Scott Harrison +# YEAR=2002 +# 1/17 Scott Harrison # ### @@ -134,6 +136,29 @@ END $diropendb = "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; } + else { # choose last accessed + my $dsearch; my $dindex; + my $dsearcht; my $dindext; + $dsearch = + "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_searchcat.db"; + if (-e $dsearch) { + $dsearcht=(stat($dsearch))[9]; + } + $dindex = + "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; + if (-e $dindex) { + $dindext=(stat($dindex))[9]; + } + if (!$dsearcht and !$dindext) { + $diropendb=''; + } + elsif ($dsearcht>$dindext) { + $diropendb=$dsearch; + } + else { + $diropendb=$dindex; + } + } if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { my $acts = $ENV{'form.acts'}; my @Acts = split(/b/,$acts);