--- rat/lonsequence.pm 2000/10/17 10:36:17 1.3 +++ rat/lonsequence.pm 2008/11/11 16:40:38 1.33 @@ -2,15 +2,70 @@ # # Sequence Handler # -# (Handler to resolve ambiguous file locations +# $Id: lonsequence.pm,v 1.33 2008/11/11 16:40:38 jms Exp $ # -# (TeX Content Handler +# Copyright Michigan State University Board of Trustees # -# 05/29/00,05/30,10/11 Gerd Kortemeyer) +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). # -# 10/11,10/12 Gerd Kortemeyer) +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # -# 10/16 Gerd Kortemeyer +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# + +=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; @@ -18,96 +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. - '