--- loncom/interface/lonfeedback.pm 2003/06/06 02:24:49 1.45 +++ loncom/interface/lonfeedback.pm 2003/09/03 18:09:50 1.51 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.45 2003/06/06 02:24:49 www Exp $ +# $Id: lonfeedback.pm,v 1.51 2003/09/03 18:09:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -56,6 +56,9 @@ sub mail_screen { my ($r,$feedurl,$options) = @_; my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion', '','onLoad="window.focus();"'); + my $title=&Apache::lonnet::gettitle($feedurl); + if (!$title) { $title = $feedurl; } + my $latexHelp = Apache::loncommon::helpLatexCheatsheet(); $r->print(< @@ -104,13 +107,14 @@ sub mail_screen { $bodytag -

$feedurl

+

$title

Please check at least one of the following feedback types: $options
My question/comment/feedback:

+$latexHelp

Attachment (128 KB max size): @@ -149,11 +153,13 @@ sub redirect_back { - + $typestyle Sent $sendsomething message(s), and $sendposts post(s). $status + +

ENDREDIR @@ -173,7 +179,7 @@ ENDNOREDIR $r->print (< - + Sorry, no feedback possible on this resource ... @@ -183,22 +189,23 @@ ENDNOREDIRTWO sub screen_header { my ($feedurl) = @_; - my $options=''; + my $msgoptions=''; + my $discussoptions=''; if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) { - $options= + $msgoptions= '

Feedback to resource author'; } if (&feedback_available(1)) { - $options.= + $msgoptions.= '
Question about resource content'; } if (&feedback_available(0,1)) { - $options.= + $msgoptions.= '
'. 'Question/Comment/Feedback about course content'; } if (&feedback_available(0,0,1)) { - $options.= + $msgoptions.= '
'. 'Question/Comment/Feedback about course policy'; } @@ -207,19 +214,22 @@ sub screen_header { if (&Apache::lonnet::allowed('pch', $ENV{'request.course.id'}. ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { - $options.='
'. - 'Contribution to course discussion of resource'; - $options.='
'. - 'Anonymous contribution to course discussion of resource'. - ' (name only visible to course faculty)'; + $discussoptions=' '. + 'Contribution to course discussion of resource'; + $discussoptions.='
'. + 'Anonymous contribution to course discussion of resource'. + ' (name only visible to course faculty)'; } } - return $options; + if ($msgoptions) { $msgoptions='

Sending Messages

'.$msgoptions; } + if ($discussoptions) { + $discussoptions='

Discussion Contributions

'.$discussoptions; } + return $msgoptions.$discussoptions; } sub resource_output { my ($feedurl) = @_; - my $usersaw=&Apache::lonnet::ssi($feedurl); + my $usersaw=&Apache::lonnet::ssi_body($feedurl); $usersaw=~s/\]*\>//gi; $usersaw=~s/\<\/body\>//gi; $usersaw=~s/\//gi; @@ -241,9 +251,9 @@ sub clear_out_html { BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1); $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ - {($html{uc($2)}&(length($1)<1000))?"\<$1":"\<$1"}/ge; + {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge; $message =~ s/(\]*)\>/ - {($html{uc($2)}&(length($1)<1000))?"$1\>":"$1\>"}/ge; + {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge; } else { $message=~s/\<\/*m\s*\>//g; $message=~s/\'F')); my $useranswer=&Apache::loncommon::get_student_answers( $symb,$ENV{'user.name'},$ENV{'user.domain'}, $ENV{'request.course.id'}); + &Apache::lonnet::delenv('allowed.vgr'); # Get attachments, if any, and not too large my $attachmenturl=''; if ($ENV{'form.attachment.filename'}) {