[LON-CAPA-cvs] cvs: loncom /interface lonevaluate.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 Nov 2004 22:20:12 -0000


albertel		Thu Nov 11 17:20:12 2004 EDT

  Modified files:              
    /loncom/interface	lonevaluate.pm 
  Log:
  - fixed to handle encrypturl
  
  
Index: loncom/interface/lonevaluate.pm
diff -u loncom/interface/lonevaluate.pm:1.12 loncom/interface/lonevaluate.pm:1.13
--- loncom/interface/lonevaluate.pm:1.12	Sat Jul  5 06:07:11 2003
+++ loncom/interface/lonevaluate.pm	Thu Nov 11 17:20:12 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Evaluate
 #
-# $Id: lonevaluate.pm,v 1.12 2003/07/05 10:07:11 www Exp $
+# $Id: lonevaluate.pm,v 1.13 2004/11/11 22:20:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,13 +49,15 @@
     return OK if $r->header_only;
 
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']);
-  my $feedurl=$ENV{'form.postdata'};
-  $feedurl=~s/^http\:\/\///;
-  $feedurl=~s/^$ENV{'SERVER_NAME'}//;
-  $feedurl=~s/^$ENV{'HTTP_HOST'}//;
+    my $feedurl=$ENV{'form.postdata'};
+    $feedurl=~s/^http\:\/\///;
+    $feedurl=~s/^$ENV{'SERVER_NAME'}//;
+    $feedurl=~s/^$ENV{'HTTP_HOST'}//;
 
-  $feedurl=&Apache::lonnet::declutter($feedurl);
-  my $symb=&Apache::lonnet::symbread($feedurl);
+    $feedurl=&Apache::lonnet::declutter($feedurl);
+
+    my $title=&Apache::lonnet::gettitle($feedurl);
+    my $showurl=&Apache::lonenc::check_encrypt($feedurl);
 
     my ($rdomain,$rauth)=($feedurl=~/^(\w+)\/(\w+)\//);
 
@@ -89,14 +91,15 @@
             }
         }
         if ($complete) {
+	    my $showurl=&Apache::lonenc::check_encrypt(&Apache::lonnet::clutter($feedurl));
            $r->print(<<ENDHEADER);
 <html>
 <head>
 <title>Evaluation submitted</title>
 <script>
-    function go() {
+    function goback() {
 	if ((window.name=='loncapaclient')) {
-            window.location='/res/$feedurl';
+            window.location='$showurl';
         } else {
             self.close();
         }
@@ -113,7 +116,7 @@
 	       $r->print('<br>Logging first evaluation');
            }
            $r->print(
-            '<script>setTimeout("go()",2000);</script></body></html>');
+            '<script>setTimeout("goback()",2000);</script></body></html>');
            return OK;
         } else {
 	    $warning='Please fill out all fields below';
@@ -137,7 +140,6 @@
            $oldcomments=$currenteval{$prefix.$item};
        }       
     }
-
 # ------------------------------------------------------- Print out eval screen
     my $standardoptions=(<<ENDOPTIONS);
 <option value=0>-</option>
@@ -154,12 +156,12 @@
 <title>The LearningOnline Network with CAPA</title>
 </head>
 $bodytag
-<tt>$feedurl</tt><p>
+<tt>$title</tt><p>
 <h3><font color="red">$warning</font></h3>
 Please rank the following criteria:
 <form method=post name=evaluation>
 <input type=hidden name=submiteval value=true>
-<input type=hidden name=postdata value="$feedurl">
+<input type=hidden name=postdata value="$showurl">
 The material appears to be correct
 <br><select name=correct>
 $standardoptions