--- rat/lonratparms.pm 2002/03/11 19:54:31 1.9 +++ rat/lonratparms.pm 2003/02/25 15:58:51 1.13 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Set parameters inside of the RAT # -# $Id: lonratparms.pm,v 1.9 2002/03/11 19:54:31 matthew Exp $ +# $Id: lonratparms.pm,v 1.13 2003/02/25 15:58:51 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -53,18 +53,8 @@ sub handler { # Get query string for limited number of parameters - foreach (split(/&/,$ENV{'QUERY_STRING'})) { - my ($name, $value) = split(/=/,$_); - $value =~ tr/+/ /; - $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; - if (($name eq 'url') || ($name eq 'parms') || - ($name eq 'resid')) { - unless ($ENV{'form.'.$name}) { - $ENV{'form.'.$name}=$value; - } - } - } - + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['url','parms','resid']); # ------------------------------------------------------------------- Read file @@ -83,6 +73,22 @@ sub handler { } } +# -------------------------------------- Additional parms for certain resources + + if ($uri=~/\.(sequence|page)\.meta$/) { + $content{'parameter_randompick'}=''; + $type{'parameter_randompick'}='int_pos'; + $display{'parameter_randompick'}='Randomly pick number of resources'; + + $content{'parameter_randompickseed'}=''; + $type{'parameter_randompickseed'}='int_pos'; + $display{'parameter_randompickseed'}= + 'Random seed for randomly picking number of resources (optional, only set if you know what you are doing)'; + } else { + $content{'parameter_mapalias'}=''; + $type{'parameter_mapalias'}='string'; + $display{'parameter_mapalias'}='Resource alias name for conditions'; + } # ---------------------------------------------------------- Current Parameters foreach (split(/\:/,$ENV{'form.parms'})) {