--- loncom/interface/lonfeedback.pm 2005/11/09 11:41:02 1.172 +++ loncom/interface/lonfeedback.pm 2005/11/10 11:31:04 1.173 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.172 2005/11/09 11:41:02 www Exp $ +# $Id: lonfeedback.pm,v 1.173 2005/11/10 11:31:04 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -237,7 +237,8 @@ sub list_discussion { my %notshown = (); my %newitem = (); my $maxdepth=0; - + my %anonhash=(); + my $anoncnt=0; my $target=''; unless ($env{'browser.interface'} eq 'textual' || $env{'environment.remote'} eq 'off' ) { @@ -248,7 +249,7 @@ sub list_discussion { $discinfo{$visitkey} = $visit; &Apache::lonnet::put('nohist_'.$cid.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'}); - &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,$statusfilter,$toggkey,$outputtarget); + &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,$statusfilter,$toggkey,$outputtarget,\%anonhash,$anoncnt); my $discussion=''; my $manifestfile; @@ -392,19 +393,20 @@ imscp_v1p1.xsd http://www.imsglobal.org/ $discussion.='
'; $discussion .='
'. ''; + my $escsymb=&Apache::lonnet::escape($ressymb); if ($visible>2) { $discussion.=''; if ($newpostsflag) { if (!$markondisp) { - $discussion .=''; } @@ -432,7 +436,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ if ($numhidden > 0) { my $colspan = $maxdepth+1; $discussion.="\n".'
'. - '  '. - '   -   '.&mt('Mark NEW posts no longer new').'  '; + $discussion .=''. + &mt('Preferences on what is marked as NEW'). + '
'.&mt('Mark NEW posts no longer new').''; } else { $discussion .= '
 
'. - ''. + &Apache::lonnet::escape($ressymb).':::" '.$target.'>'. ''. &mt('Post Discussion').'
'; } @@ -755,10 +759,11 @@ ENDDISCUSS } sub build_posting_display { - my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget) = @_; + my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt) = @_; my @original=(); my @index=(); my $symb=&Apache::lonenc::check_decrypt($ressymb); + my $escsymb=&Apache::lonnet::escape($ressymb); my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'}, $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); @@ -822,6 +827,13 @@ sub build_posting_display { my %allattachments = (); my ($screenname,$plainname); my $sender = &mt('Anonymous'); +# Anonymous users getting number within a discussion +# Since idx is in static order, this should give the same sequence every time. + my $key=$contrib{$idx.':sendername'}.'@'.$contrib{$idx.':senderdomain'}; + unless ($$anonhash{$key}) { + $anoncnt++; + $$anonhash{$key}=&mt('Anonymous').' '.$anoncnt; + } my ($message,$subject,$vgrlink,$ctlink); &get_post_contents(\%contrib,$idx,$seeid,$outputtarget,\%messages,\%subjects,\%allattachments,\%attachtxt,$imsfiles,\$screenname,\$plainname,$numoldver); @@ -860,7 +872,7 @@ sub build_posting_display { $contrib{$idx.':sendername'}.' at '. $contrib{$idx.':senderdomain'}.')'; if ($contrib{$idx.':anonymous'}) { - $sender.=' ['.&mt('anonymous').'] '. + $sender.=' ['.$$anonhash{$key}.'] '. $screenname; } @@ -896,13 +908,13 @@ sub build_posting_display { if ($env{'course.'.$env{'request.course.id'}.'.allow_discussion_post_editing'} =~ m/yes/i) { if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) { $sender.=' '.&mt('Edit').''; unless ($seeid) { - $sender.=" '; } } @@ -911,7 +923,7 @@ sub build_posting_display { if ($hidden) { unless ($studenthidden) { $sender.=' '; } $sender.=' '.&mt('Display all versions').''; + $$discussionitems[$idx] .= '  '.&mt('Display all versions').''; } $$discussionitems[$idx].='
'.&mt('Earlier version(s) were posted on: '); if ($contrib{$idx.':history'} =~ m/:/) { @@ -2294,7 +2308,8 @@ sub screen_header { &mt('Contribution to course discussion of resource'); $discussoptions.='
'; + ' ('.&mt('name only visible to course faculty').') '. + ''.&mt('Change Screenname').''; } } if ($msgoptions) { $msgoptions='

'.&mt('Sending Messages').'

'.$msgoptions; }