Annotation of loncom/interface/lonevaluate.pm, revision 1.3

1.1       www         1: # The LearningOnline Network
                      2: # Evaluate
                      3: #
1.2       www         4: # $Id: gplheader.pl,v 1.1 2001/11/29 18:19:27 www Exp $
                      5: #
                      6: # Copyright Michigan State University Board of Trustees
                      7: #
                      8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                      9: #
                     10: # LON-CAPA is free software; you can redistribute it and/or modify
                     11: # it under the terms of the GNU General Public License as published by
                     12: # the Free Software Foundation; either version 2 of the License, or
                     13: # (at your option) any later version.
                     14: #
                     15: # LON-CAPA is distributed in the hope that it will be useful,
                     16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     18: # GNU General Public License for more details.
                     19: #
                     20: # You should have received a copy of the GNU General Public License
                     21: # along with LON-CAPA; if not, write to the Free Software
                     22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     23: #
                     24: # /home/httpd/html/adm/gpl.txt
                     25: #
                     26: # http://www.lon-capa.org/
                     27: #
1.1       www        28: # (Internal Server Error Handler
                     29: #
                     30: # (Login Screen
                     31: # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
                     32: # 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
                     33: #
                     34: # 3/1/1 Gerd Kortemeyer)
                     35: #
1.3     ! www        36: # 3/1,12/6,12/12 Gerd Kortemeyer
1.1       www        37: #
                     38: package Apache::lonevaluate;
                     39: 
                     40: use strict;
1.3     ! www        41: use Apache::lonnet;
1.1       www        42: use Apache::Constants qw(:common);
                     43: 
                     44: sub handler {
                     45:     my $r = shift;
                     46:     $r->content_type('text/html');
                     47:     $r->send_http_header;
                     48:     return OK if $r->header_only;
                     49: 
1.3     ! www        50:   my $feedurl=$ENV{'form.postdata'};
        !            51:   $feedurl=~s/^http\:\/\///;
        !            52:   $feedurl=~s/^$ENV{'SERVER_NAME'}//;
        !            53:   $feedurl=~s/^$ENV{'HTTP_HOST'}//;
        !            54: 
        !            55:   $feedurl=&Apache::lonnet::declutter($feedurl);
        !            56:   my $symb=&Apache::lonnet::symbread($feedurl);
        !            57: 
        !            58:     my ($rdomain,$rauth)=($feedurl=~/^(\w+)\/(\w+)\//);
        !            59: 
        !            60:     my $prefix=$ENV{'user.name.'}.'@'.$ENV{'user.domain'}.'___'.
        !            61: 	$feedurl.'___';
        !            62: 
        !            63:     my @items=('correct','helpful','depth','clear','technical','comments');
        !            64: 
        !            65:     my @retrieve=map{ $prefix.$_ } @items;
        !            66: 
        !            67:     if ($ENV{'form.submiteval'} eq 'true') {
        !            68: # ------------------------------------------------ User is submitting something
        !            69:     }
        !            70: # ------------------------------------------------------- Print out eval screen
1.2       www        71:     my $standardoptions=(<<ENDOPTIONS);
                     72: <option value=0>-</option>
                     73: <option value=1>Strongly Disagree</option>
                     74: <option value=2>Disagree</option>
                     75: <option value=3>Neutral</option>
                     76: <option value=4>Agree</option>
                     77: <option value=5>Strongly Agree</option>
                     78: ENDOPTIONS
                     79: 
                     80:     my $dialold='';
                     81:     my $oldcomments='';
                     82: 
1.1       www        83:     $r->print(<<ENDDOCUMENT);
                     84: <html>
                     85: <head>
                     86: <title>The LearningOnline Network with CAPA</title>
                     87: </head>
                     88: <body bgcolor="#FFFFFF">
1.2       www        89: <h1>Evaluate Resource</h1>
1.3     ! www        90: <tt>$feedurl</tt><p>
1.2       www        91: Please rank the following criteria:
                     92: <form method=post>
                     93: <input type=hidden name=submiteval value=true>
1.3     ! www        94: <input type=hidden name=postdata value="$feedurl">
1.2       www        95: The material appears to be correct
                     96: <br><select name=correct>
                     97: $standardoptions
                     98: </select>
                     99: <hr>
                    100: The material is helpful
                    101: <br><select name=helpful>
                    102: $standardoptions
                    103: </select>
                    104: <hr>
                    105: The material is covered with sufficient depth
                    106: <br><select name=depth>
                    107: $standardoptions
                    108: </select>
                    109: <hr>
                    110: The material is presented in a clear way
                    111: <br><select name=clear>
                    112: $standardoptions
                    113: </select>
                    114: <hr>
                    115: The resource is technically correct 
                    116: (loads fast enough, does not produce errors, links work, etc) 
1.3     ! www       117: <br><select name=technical>
1.2       www       118: $standardoptions
                    119: </select>
                    120: <hr>
                    121: Any comments?
                    122: <br><textarea name=comments cols=40 rows=5>$oldcomments</textarea>
                    123: $dialold
                    124: </form>
1.1       www       125: </body>
                    126: </html>
                    127: ENDDOCUMENT
                    128:     return OK;
                    129: } 
                    130: 
                    131: 1;
                    132: __END__

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