--- loncom/interface/lonfeedback.pm 2003/06/04 22:05:22 1.44 +++ loncom/interface/lonfeedback.pm 2003/08/06 17:00:30 1.50 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.44 2003/06/04 22:05:22 www Exp $ +# $Id: lonfeedback.pm,v 1.50 2003/08/06 17:00:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,7 +54,9 @@ use Apache::lontexconvert(); sub mail_screen { my ($r,$feedurl,$options) = @_; - my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion'); + my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion', + '','onLoad="window.focus();"'); + my $latexHelp = Apache::loncommon::helpLatexCheatsheet(); $r->print(< @@ -110,6 +112,7 @@ enctype="multipart/form-data"> Please check at least one of the following feedback types: $options
My question/comment/feedback:

+$latexHelp

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

+
ENDREDIR @@ -172,7 +177,7 @@ ENDNOREDIR $r->print (< - + Sorry, no feedback possible on this resource ... @@ -182,22 +187,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'; } @@ -206,19 +212,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; @@ -240,9 +249,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'}) {