[LON-CAPA-cvs] cvs: loncom /publisher packages.tab rat lonuserstate.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 26 Oct 2004 15:10:42 -0000


albertel		Tue Oct 26 11:10:42 2004 EDT

  Modified files:              
    /rat	lonuserstate.pm 
    /loncom/publisher	packages.tab 
  Log:
  - PARMing of hidden,encrypturl works now
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.78 rat/lonuserstate.pm:1.79
--- rat/lonuserstate.pm:1.78	Tue May 11 02:28:23 2004
+++ rat/lonuserstate.pm	Tue Oct 26 11:10:42 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.78 2004/05/11 06:28:23 albertel Exp $
+# $Id: lonuserstate.pm,v 1.79 2004/10/26 15:10:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -335,21 +335,16 @@
     $sofar=simplify($sofar);
     unless ($beenhere=~/\&$rid\&/) {
        $beenhere.=$rid.'&';  
-       if ($hdnflag) {
-	   $hiddenurl{$rid}=1;
-       }
-       if ($encflag) {
-	   $encurl{$rid}=1;
-       }
+       my ($mapid,$resid)=split(/\./,$rid);
+       my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$hash{'src_'.$rid});
+       my $encrypt=&Apache::lonnet::EXT('resource.0.hiddenresource',$symb);
+       if ($hdnflag || lc($encrypt) eq 'yes') { $hiddenurl{$rid}=1; }
+       my $encrypt=&Apache::lonnet::EXT('resource.0.encrypturl',$symb);
+       if ($encflag || lc($encrypt) eq 'yes') { $encurl{$rid}=1; }
        if (($retfurl eq '') && ($hash{'src_'.$rid})
-        && ($hash{'src_'.$rid}!~/\.sequence$/)) {
-           my ($mapid,$resid)=split(/\./,$rid);
-           $retfurl=$hash{'src_'.$rid}.
-           (($hash{'src_'.$rid}=~/\?/)?'&':'?').'symb='.
-           &Apache::lonnet::symbclean(
-                           &Apache::lonnet::declutter($hash{'map_id_'.$mapid}).
-                           '___'.$resid.'___'.
-                           &Apache::lonnet::declutter($hash{'src_'.$rid}));
+	   && ($hash{'src_'.$rid}!~/\.sequence$/)) {
+           $retfurl=$hash{'src_'.$rid}.(($hash{'src_'.$rid}=~/\?/)?'&':'?').
+	       'symb='.$symb;
        }
        if (defined($hash{'conditions_'.$rid})) {
 	   $hash{'conditions_'.$rid}=simplify(
@@ -468,10 +463,7 @@
     my $courseuri=$uri;
     $courseuri=~s/^\/res\///;
     &Apache::lonnet::delenv('(acc\.|httpref\.)');
-    &Apache::lonnet::appenv(%acchash,
-                            "request.course.id"  => $short,
-                            "request.course.fn"  => $fn,
-                            "request.course.uri" => $courseuri); 
+    &Apache::lonnet::appenv(%acchash);
 }
 
 # ---------------- Selectively delete from randompick maps and hidden url parms
@@ -572,6 +564,9 @@
     $hash{'is_map_0.0'}=1;
     loadmap($uri);
     if (defined($hash{'map_start_'.$uri})) {
+	&Apache::lonnet::appenv("request.course.id"  => $short,
+				"request.course.fn"  => $fn,
+				"request.course.uri" => $uri);
         &traceroute('0',$hash{'map_start_'.$uri},'&');
         &accinit($uri,$short,$fn);
         &hiddenurls();
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.38 loncom/publisher/packages.tab:1.39
--- loncom/publisher/packages.tab:1.38	Tue Aug 17 16:27:04 2004
+++ loncom/publisher/packages.tab	Tue Oct 26 11:10:42 2004
@@ -28,10 +28,10 @@
 part_0&hiddenparts&type:string_any
 part_0&hiddenresource&display:Resource hidden from students
 part_0&hiddenresource&type:string_yesno
-part_0&hiddenresource&hidden:parm
+#part_0&hiddenresource&hidden:parm
 part_0&encrypturl&type:string_yesno
 part_0&encrypturl&display:Do not show plain URL
-part_0&encrypturl&hidden:parm
+#part_0&encrypturl&hidden:parm
 part_0&mapalias&type:string
 part_0&mapalias&display:Resource alias name for conditions
 part_0&interval&display:Time-Limit
@@ -96,7 +96,7 @@
 extension_page&discusshide&default:yes
 extension_page&encrypturl&type:string_yesno
 extension_page&encrypturl&display:Do not show plain URL
-extension_page&encrypturl&hidden:parm
+#extension_page&encrypturl&hidden:parm
 
 #default parameters for anything that doesn't have any more specific
 #pacakge defintions
@@ -109,7 +109,7 @@
 default&mapalias&display:Resource alias name for conditions
 default&encrypturl&type:string_yesno
 default&encrypturl&display:Do not show plain URL
-default&encrypturl&hidden:parm
+#default&encrypturl&hidden:parm
 default&discussend&display:Discussion End Time
 default&discussend&type:date_end
 default&discusshide&display:Hide Closed Discussion
@@ -117,4 +117,4 @@
 default&discusshide&default:yes
 default&hiddenresource&display:Resource Hidden from Students
 default&hiddenresource&type:string_yesno
-default&hiddenresource&hidden:parm
+#default&hiddenresource&hidden:parm