--- rat/lonsequence.pm 2000/10/17 17:06:15 1.4 +++ rat/lonsequence.pm 2020/09/03 12:49:17 1.48.2.2 @@ -2,15 +2,32 @@ # # Sequence Handler # -# (Handler to resolve ambiguous file locations +# $Id: lonsequence.pm,v 1.48.2.2 2020/09/03 12:49:17 raeburn 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/ +# + + package Apache::lonsequence; @@ -18,116 +35,460 @@ use strict; use Apache::lonnet; use Apache::Constants qw(:common :http REDIRECT); use GDBM_File; +use LONCAPA::map(); +use LONCAPA; +use Apache::lonpageflip(); +use Apache::loncommon(); +use Apache::groupsort(); +use Apache::lonlocal; +use Apache::lonnavmaps(); +use Apache::lonenc(); +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 (); + } +} +# ---------------------------------------------------------------- View Handler -# ----------------------------------------------------------- Could not resolve +sub viewmap { + my ($r,$url)=@_; -sub getlost { - my ($r,$errmsg)=@_; - $r->content_type('text/html'); - $r->send_http_header; - $r->print( - '
'.$errmsg. - '