version 1.8, 2001/02/10 14:10:13
|
version 1.10, 2001/07/25 16:08:38
|
Line 12
|
Line 12
|
# 3/1,2/3,2/5,2/6,2/8 Gerd Kortemeyer |
# 3/1,2/3,2/5,2/6,2/8 Gerd Kortemeyer |
# 2/9 Guy Albertelli |
# 2/9 Guy Albertelli |
# 2/10 Gerd Kortemeyer |
# 2/10 Gerd Kortemeyer |
|
# 2/13 Guy Albertelli |
|
# 7/25 Gerd Kortemeyer |
|
|
package Apache::lonfeedback; |
package Apache::lonfeedback; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::lonmsg(); |
use Apache::lonmsg(); |
|
use Apache::loncommon(); |
|
|
sub mail_screen { |
sub mail_screen { |
my ($r,$feedurl,$options) = @_; |
my ($r,$feedurl,$options) = @_; |
Line 29 sub mail_screen {
|
Line 32 sub mail_screen {
|
<script> |
<script> |
function gosubmit() { |
function gosubmit() { |
var rec=0; |
var rec=0; |
if (document.mailform.elements.author!=undefined) { |
if (typeof(document.mailform.elements.author!=undefined)) { |
if (document.mailform.elements.author.checked) { |
if (document.mailform.elements.author.checked) { |
rec=1; |
rec=1; |
} |
} |
} |
} |
if (document.mailform.elements.question!=undefined) { |
if (typeof(document.mailform.elements.question!=undefined)) { |
if (document.mailform.elements.question.checked) { |
if (document.mailform.elements.question.checked) { |
rec=1; |
rec=1; |
} |
} |
} |
} |
if (document.mailform.elements.course!=undefined) { |
if (typeof(document.mailform.elements.course!=undefined)) { |
if (document.mailform.elements.course.checked) { |
if (document.mailform.elements.course.checked) { |
rec=1; |
rec=1; |
} |
} |
} |
} |
if (document.mailform.elements.policy!=undefined) { |
if (typeof(document.mailform.elements.policy!=undefined)) { |
if (document.mailform.elements.policy.checked) { |
if (document.mailform.elements.policy.checked) { |
rec=1; |
rec=1; |
} |
} |
} |
} |
|
if (typeof(document.mailform.elements.discuss!=undefined)) { |
|
if (document.mailform.elements.discuss.checked) { |
|
rec=1; |
|
} |
|
} |
|
|
if (rec) { |
if (rec) { |
document.mailform.submit(); |
document.mailform.submit(); |
Line 155 sub screen_header {
|
Line 163 sub screen_header {
|
'<br><input type=checkbox name=policy> '. |
'<br><input type=checkbox name=policy> '. |
'Question/Comment/Feedback about course policy'; |
'Question/Comment/Feedback about course policy'; |
} |
} |
return $options; |
if ($ENV{'request.course.id'}) { |
} |
$options.='<br><input type=checkbox name=discuss> '. |
|
'<b>Contribution to course discussion of resource</b>'; |
sub get_previous_attempt { |
|
my ($symb)=@_; |
|
my $prevattempts=''; |
|
if ($symb) { |
|
my $answer=&Apache::lonnet::reply( |
|
"restore:".$ENV{'user.domain'}.':'.$ENV{'user.name'}.':'. |
|
$ENV{'request.course.id'}.':'. |
|
&Apache::lonnet::escape($symb), |
|
$ENV{'user.home'}); |
|
my %returnhash=(); |
|
map { |
|
my ($name,$value)=split(/\=/,$_); |
|
$returnhash{&Apache::lonnet::unescape($name)}= |
|
&Apache::lonnet::unescape($value); |
|
} split(/\&/,$answer); |
|
if ($returnhash{'version'}) { |
|
my %lasthash=(); |
|
my $version; |
|
for ($version=1;$version<=$returnhash{'version'};$version++) { |
|
map { |
|
$lasthash{$_}=$returnhash{$version.':'.$_}; |
|
} split(/\:/,$returnhash{$version.':keys'}); |
|
} |
|
$prevattempts='<table border=2></tr><th>History</th>'; |
|
map { |
|
$prevattempts.='<th>'.$_.'</th>'; |
|
} keys %lasthash; |
|
for ($version=1;$version<=$returnhash{'version'};$version++) { |
|
$prevattempts.='</tr><tr><th>Attempt '.$version.'</th>'; |
|
map { |
|
$prevattempts.='<td>'.$returnhash{$version.':'.$_}.'</td>'; |
|
} keys %lasthash; |
|
} |
|
$prevattempts.='</tr><tr><th>Current</th>'; |
|
map { |
|
$prevattempts.='<td>'.$lasthash{$_}.'</td>'; |
|
} keys %lasthash; |
|
$prevattempts.='</tr></table>'; |
|
} else { |
|
$prevattempts='Nothing submitted - no attempts.'; |
|
} |
|
} else { |
|
$prevattempts='No data.'; |
|
} |
} |
|
return $options; |
} |
} |
|
|
sub resource_output { |
sub resource_output { |
Line 334 sub handler {
|
Line 300 sub handler {
|
} else { |
} else { |
|
|
# Get previous user input |
# Get previous user input |
my $prevattempts=&get_previous_attempt($symb); |
my $prevattempts=&Apache::loncommon::get_previous_attempt( |
|
$symb,$ENV{'user.name'},$ENV{'user.domain'},$ENV{'user.home'}, |
|
$ENV{'request.course.id'}); |
|
|
# Get output from resource |
# Get output from resource |
my $usersaw=&resource_output($feedurl); |
my $usersaw=&resource_output($feedurl); |