--- loncom/publisher/londiff.pm 2005/05/29 01:46:16 1.17 +++ loncom/publisher/londiff.pm 2006/05/17 13:41:45 1.19 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show differences between file versions # -# $Id: londiff.pm,v 1.17 2005/05/29 01:46:16 www Exp $ +# $Id: londiff.pm,v 1.19 2006/05/17 13:41:45 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,7 @@ package Apache::londiff; use strict; use Apache::File; use File::Copy; +use File::Compare; use Algorithm::Diff qw(diff); use Apache::Constants qw(:common :http :methods); use Apache::loncacc; @@ -44,7 +45,7 @@ sub get_split_file { my ($fn,$style)=@_; my $f1; my @f1; - if ($style='local') { + if ($style eq 'local') { if (-e $fn) { my $fh=Apache::File->new($fn); my $line; @@ -66,6 +67,11 @@ sub get_split_file { return @f1; } +sub are_different_files { + my ($fileone,$filetwo)=@_; + return &compare($fileone,$filetwo); +} + sub handler { my $r=shift; @@ -104,9 +110,7 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - $r->print('