--- rat/lonsequence.pm 2002/04/02 21:17:34 1.7 +++ rat/lonsequence.pm 2008/11/11 16:40:38 1.33 @@ -2,7 +2,7 @@ # # Sequence Handler # -# $Id: lonsequence.pm,v 1.7 2002/04/02 21:17:34 www Exp $ +# $Id: lonsequence.pm,v 1.33 2008/11/11 16:40:38 jms Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,15 +26,46 @@ # # http://www.lon-capa.org/ # -# (Handler to resolve ambiguous file locations -# -# (TeX Content Handler -# -# 05/29/00,05/30,10/11 Gerd Kortemeyer) -# -# 10/11,10/12 Gerd Kortemeyer) -# -# 10/16 Gerd Kortemeyer + +=head1 NAME + +Apache::lonsequence + +=head1 SYNOPSIS + +Handler for showing sequence objects of +educational resources. + +This is part of the LearningOnline Network with CAPA project +described at http://www.lon-capa.org. + +=head1 HANDLER SUBROUTINE + +handler() + +and + +viewmap() + +=head1 OTHER SUBROUTINES + +=over + +=item * + +attemptread() + +=item * + +mapread() + +=item * + +start_fresh_session() + +=back + +=cut package Apache::lonsequence; @@ -42,110 +73,290 @@ use strict; use Apache::lonnet; use Apache::Constants qw(:common :http REDIRECT); use GDBM_File; +use LONCAPA::map(); +use Apache::lonpageflip(); +use Apache::loncommon(); +use Apache::groupsort(); +use Apache::lonlocal; +use HTML::Entities(); + +my %selhash; +my $successtied; + +# ----------------------------------------- Attempt to read from resource space + +sub attemptread { + my ($fn,$unsorted)=@_; + &Apache::lonnet::repcopy($fn); + if (-e $fn) { + return &LONCAPA::map::attemptread($fn,$unsorted); + } else { + return (); + } +} +sub mapread { + my $fn=shift; + &Apache::lonnet::repcopy($fn); + if (-e $fn) { + return &LONCAPA::map::mapread($fn,''); + } else { + return (); + } +} -# ----------------------------------------------------------- Could not resolve +# ---------------------------------------------------------------- View Handler -sub getlost { - my ($r,$errmsg)=@_; - $r->content_type('text/html'); - $r->send_http_header; - $r->print( - '
'.$errmsg. - '