Diff for /loncom/interface/lonevaluate.pm between versions 1.10 and 1.14

version 1.10, 2002/08/26 12:47:28 version 1.14, 2004/11/11 22:47:55
Line 38 Line 38
 package Apache::lonevaluate;  package Apache::lonevaluate;
   
 use strict;  use strict;
 use Apache::lonnet;  use Apache::lonnet();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::loncommon;  use Apache::loncommon();
   use Apache::lonenc();
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 49  sub handler { Line 50  sub handler {
     return OK if $r->header_only;      return OK if $r->header_only;
   
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']);
   my $feedurl=$ENV{'form.postdata'};      my $feedurl=$ENV{'form.postdata'};
   $feedurl=~s/^http\:\/\///;      $feedurl=~s/^http\:\/\///;
   $feedurl=~s/^$ENV{'SERVER_NAME'}//;      $feedurl=~s/^$ENV{'SERVER_NAME'}//;
   $feedurl=~s/^$ENV{'HTTP_HOST'}//;      $feedurl=~s/^$ENV{'HTTP_HOST'}//;
   
   $feedurl=&Apache::lonnet::declutter($feedurl);      $feedurl=&Apache::lonnet::declutter($feedurl);
   my $symb=&Apache::lonnet::symbread($feedurl);  
       my $title=&Apache::lonnet::gettitle($feedurl);
       my $showurl=&Apache::lonenc::check_encrypt($feedurl);
   
     my ($rdomain,$rauth)=($feedurl=~/^(\w+)\/(\w+)\//);      my ($rdomain,$rauth)=($feedurl=~/^(\w+)\/(\w+)\//);
   
Line 89  sub handler { Line 92  sub handler {
             }              }
         }          }
         if ($complete) {          if ($complete) {
       my $showurl=&Apache::lonenc::check_encrypt(&Apache::lonnet::clutter($feedurl));
            $r->print(<<ENDHEADER);             $r->print(<<ENDHEADER);
 <html>  <html>
 <head>  <head>
 <title>Evaluation submitted</title>  <title>Evaluation submitted</title>
 <script>  <script>
     function go() {      function goback() {
  if (window.name!='LONcatInfo') {   if ((window.name=='loncapaclient')) {
             window.location='/res/$feedurl';              window.location='$showurl';
           } else {
               self.close();
         }          }
     }      }
 </script>  </script>
Line 111  ENDHEADER Line 117  ENDHEADER
        $r->print('<br>Logging first evaluation');         $r->print('<br>Logging first evaluation');
            }             }
            $r->print(             $r->print(
             '<script>setTimeout("go()",2000);</script></body></html>');              '<script>setTimeout("goback()",2000);</script></body></html>');
            return OK;             return OK;
         } else {          } else {
     $warning='Please fill out all fields below';      $warning='Please fill out all fields below';
Line 125  ENDHEADER Line 131  ENDHEADER
   
     foreach my $item (@items) {      foreach my $item (@items) {
        unless ($item eq 'comments') {         unless ($item eq 'comments') {
            unless ($item eq 'timestamp') {             unless (($item eq 'timestamp') || 
                      (!defined($currenteval{$prefix.$item}))) {
               $dialold.=                $dialold.=
                    'document.evaluation.'.$item.'.selectedIndex='.                     'document.evaluation.'.$item.'.selectedIndex='.
                    $currenteval{$prefix.$item}.";\n";                     $currenteval{$prefix.$item}.";\n";
Line 134  ENDHEADER Line 141  ENDHEADER
            $oldcomments=$currenteval{$prefix.$item};             $oldcomments=$currenteval{$prefix.$item};
        }                }       
     }      }
   
 # ------------------------------------------------------- Print out eval screen  # ------------------------------------------------------- Print out eval screen
     my $standardoptions=(<<ENDOPTIONS);      my $standardoptions=(<<ENDOPTIONS);
 <option value=0>-</option>  <option value=0>-</option>
Line 151  ENDOPTIONS Line 157  ENDOPTIONS
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
 </head>  </head>
 $bodytag  $bodytag
 <tt>$feedurl</tt><p>  <tt>$title</tt><p>
 <h3><font color="red">$warning</font></h3>  <h3><font color="red">$warning</font></h3>
 Please rank the following criteria:  Please rank the following criteria:
 <form method=post name=evaluation>  <form method=post name=evaluation>
 <input type=hidden name=submiteval value=true>  <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  The material appears to be correct
 <br><select name=correct>  <br><select name=correct>
 $standardoptions  $standardoptions

Removed from v.1.10  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>