version 1.12, 2003/07/05 10:07:11
|
version 1.16, 2005/02/17 08:50:20
|
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; |
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
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) { |
$r->print(<<ENDHEADER); |
my $showurl=&Apache::lonenc::check_encrypt(&Apache::lonnet::clutter($feedurl)); |
<html> |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print(<<ENDHEADER); |
|
$html |
<head> |
<head> |
<title>Evaluation submitted</title> |
<title>Evaluation submitted</title> |
<script> |
<script> |
function go() { |
function goback() { |
if ((window.name=='loncapaclient')) { |
if ((window.name=='loncapaclient')) { |
window.location='/res/$feedurl'; |
window.location='$showurl'; |
} else { |
} else { |
self.close(); |
self.close(); |
} |
} |
Line 113 ENDHEADER
|
Line 118 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 137 ENDHEADER
|
Line 142 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 147 ENDHEADER
|
Line 151 ENDHEADER
|
<option value=4>Agree</option> |
<option value=4>Agree</option> |
<option value=5>Strongly Agree</option> |
<option value=5>Strongly Agree</option> |
ENDOPTIONS |
ENDOPTIONS |
|
|
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
$html |
<head> |
<head> |
<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 |