--- loncom/interface/lonparmset.pm 2001/12/06 22:39:45 1.37 +++ loncom/interface/lonparmset.pm 2001/12/19 17:17:46 1.40 @@ -1,18 +1,47 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # +# $Id: lonparmset.pm,v 1.40 2001/12/19 17:17:46 albertel Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# 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. +# +# 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/ +# # (Handler to resolve ambiguous file locations # # (TeX Content Handler # +# YEAR=2000 # 05/29/00,05/30,10/11 Gerd Kortemeyer) # # 10/11,10/12,10/16 Gerd Kortemeyer) # # 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28, # 12/08,12/12, +# YEAR=2001 # 16/01/01,02/08,03/20,03/23,03/24,03/26,05/09, # 07/05,07/06,08/08,08/09,09/01,09/21 Gerd Kortemeyer +# 12/17 Scott Harrison +# +### package Apache::lonparmset; @@ -250,7 +279,7 @@ sub assessparms { undef %allkeys; undef %allmaps; undef %defp; - map { + foreach (keys %bighash) { if ($_=~/^src\_(\d+)\.(\d+)$/) { my $mapid=$1; my $resid=$2; @@ -260,7 +289,8 @@ sub assessparms { $ids[$#ids+1]=$id; $typep{$id}=$1; $keyp{$id}=''; - map { + foreach (split(/\,/, + &Apache::lonnet::metadata($srcf,'keys'))) { if ($_=~/^parameter\_(.*)/) { my $key=$_; my $allkey=$1; @@ -282,8 +312,7 @@ sub assessparms { $keyp{$id}=$key; } } - } split(/\,/, - &Apache::lonnet::metadata($srcf,'keys')); + } $mapp{$id}= &Apache::lonnet::declutter($bighash{'map_id_'.$mapid}); $allmaps{$mapid}=$mapp{$id}; @@ -292,7 +321,7 @@ sub assessparms { &Apache::lonnet::declutter($srcf); } } - } keys %bighash; + } # ---------------------------------------------------------- Anything to store? if ($ENV{'form.pres_marker'}) { my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'}); @@ -384,22 +413,22 @@ sub assessparms { $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.':resourcedata', $ENV{'course.'.$ENV{'request.course.id'}.'.home'}); if ($reply!~/^error\:/) { - map { + foreach (split(/\&/,$reply)) { my ($name,$value)=split(/\=/,$_); $courseopt{&Apache::lonnet::unescape($name)}= &Apache::lonnet::unescape($value); - } split(/\&/,$reply); + } } # --------------------------------------------------- Get userdata (if present) if ($uname) { my $reply= &Apache::lonnet::reply('dump:'.$udom.':'.$uname.':resourcedata',$uhome); if ($reply!~/^error\:/) { - map { + foreach (split(/\&/,$reply)) { my ($name,$value)=split(/\=/,$_); $useropt{&Apache::lonnet::unescape($name)}= &Apache::lonnet::unescape($value); - } split(/\&/,$reply); + } } } @@ -492,37 +521,37 @@ ENDHEAD $r->print(''); } - map { + foreach ('tolerance','date_default','date_start','date_end', + 'date_interval','int','float','string') { $r->print(''); - } ('tolerance','date_default','date_start','date_end','date_interval', - 'int','float','string'); + } $r->print('
Sort list by | '); $r->print(' |
Select Enclosing Map | |
Select Parameter |