[LON-CAPA-cvs] cvs: doc /loncapafiles loncapafiles.lpml loncom/html/adm/help/tex Course_Disable_Anonymous_Discussion.tex loncom/interface courseprefs.pm lonfeedback.pm loncom/lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Tue Mar 22 22:19:37 EDT 2016


raeburn		Wed Mar 23 02:19:37 2016 EDT

  Added files:                 
    /loncom/html/adm/help/tex	Course_Disable_Anonymous_Discussion.tex 

  Modified files:              
    /loncom/interface	courseprefs.pm lonfeedback.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /doc/loncapafiles	loncapafiles.lpml 
  Log:
  - Bug 5917. Course preference to disable anonymous posts to discussion.
    - uses 'pac' priv.         
  
  
-------------- next part --------------
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.76 loncom/interface/courseprefs.pm:1.77
--- loncom/interface/courseprefs.pm:1.76	Fri Mar  4 21:43:15 2016
+++ loncom/interface/courseprefs.pm	Wed Mar 23 02:19:09 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.76 2016/03/04 21:43:15 raeburn Exp $
+# $Id: courseprefs.pm,v 1.77 2016/03/23 02:19:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -419,6 +419,7 @@
                     { text => 'Discussion and Chat',
                       help => 'Course_Prefs_Discussions',
                       ordered => ['pch.roles.denied','pch.users.denied',
+                                  'pac.roles.denied','pac.users.denied',
                                   'plc.roles.denied','plc.users.denied',
                                   'allow_limited_html_in_feedback',
                                   'allow_discussion_post_editing',
@@ -428,9 +429,11 @@
                          'pch.users.denied'             => 'No Resource Discussion',
                          'plc.roles.denied'             => 'No Chat room use',
                          'plc.users.denied'             => 'No Chat room use',
+                         'pac.roles.denied'             => 'No Anonymous Resource Discussion',
+                         'pac.users.denied'             => 'No Anonymous Resource Discussion',  
                          allow_limited_html_in_feedback => 'Allow limited HTML in discussion',
                          allow_discussion_post_editing  => 'Users can edit/delete own discussion posts',
-                         discussion_post_fonts       => 'Discussion post fonts based on likes/unlikes',
+                         discussion_post_fonts          => 'Discussion post fonts based on likes/unlikes',
                                   },
                     },
         'classlists' =>
@@ -1021,7 +1024,8 @@
                                     }
                                 }
                             }
-                        } elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied')) {
+                        } elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied') ||
+                                 ($entry eq 'pac.roles.denied')) {
                             my @denied = &Apache::loncommon::get_env_multiple('form.'.$entry);
                             @denied = sort(@denied);
                             my $deniedstr = '';
@@ -1029,7 +1033,8 @@
                                 $deniedstr = join(',', at denied);  
                             }
                             $newvalues{$entry} = $deniedstr;
-                        } elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied')) {
+                        } elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied') ||
+                                 ($entry eq 'pac.users.denied')) {
                             my $total = $env{'form.'.$entry.'_total'};
                             my $userstr = '';
                             my @denied;  
@@ -3617,6 +3622,20 @@
                            &mt('(specific user(s))'),
                    input => 'checkbox',
                  },
+
+        'pac.roles.denied' => {
+                   text => '<span class="LC_nobreak"><b>'.&mt($itemtext->{'pac.roles.denied'}).'</b>'.
+                           &Apache::loncommon::help_open_topic("Course_Disable_Anonymous_Discussion").'</span><br />'.
+                           &mt('(role-based)'),
+                   input => 'checkbox',
+                 },
+
+        'pac.users.denied'   => {
+                   text => '<span class="LC_nobreak"><b>'.&mt($itemtext->{'pac.users.denied'}).'</b><br />'.
+                           &mt('(specific user(s))'),
+                   input => 'checkbox',
+                 },
+
         'allow_limited_html_in_feedback' => {
                    text => '<b>'.&mt($itemtext->{'allow_limited_html_in_feedback'}).'</b>',
                    input => 'radio',
@@ -3667,6 +3686,14 @@
             $datatable .= '</td><td align="right">'.
                           &user_table($cdom,$item,undef,
                                       $settings->{$item},\%lt);
+        } elsif ($item eq 'pac.roles.denied') {
+            $datatable .= '</td><td align="right">'.
+                          '<table>'.&role_checkboxes($cdom,$cnum,$item,$settings).
+                          '</table>';
+        } elsif ($item eq 'pac.users.denied') {
+            $datatable .=  '</td><td align="right">'.
+                           &user_table($cdom,$item,undef,
+                                      $settings->{$item},\%lt);
         } elsif ($item eq 'allow_limited_html_in_feedback') {
             $datatable .= &yesno_radio($item,$settings);
         } elsif ($item eq 'allow_discussion_post_editing') {
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.371 loncom/interface/lonfeedback.pm:1.372
--- loncom/interface/lonfeedback.pm:1.371	Wed Sep 30 21:04:04 2015
+++ loncom/interface/lonfeedback.pm	Wed Mar 23 02:19:09 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.371 2015/09/30 21:04:04 musolffc Exp $
+# $Id: lonfeedback.pm,v 1.372 2016/03/23 02:19:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -933,7 +933,7 @@
         $currnewattach,$currdelold,$group,$crstype) = @_;
     my $newattachmsg;
     my %lt = &Apache::lonlocal::texthash(
-              'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
+             'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
              'title' => 'Title',
              'podi' => 'Post Discussion',
              'poan' => 'Post Anonymous Discussion',
@@ -952,9 +952,14 @@
             }
         }
     }
+    my $postanon;
+    if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+       ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+        $postanon = '<input type="submit" name="anondiscuss" value="'.$lt{'poan'}.'" />';
+    }
     $postingform .= (<<ENDDISCUSS);
 <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />
-<input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" />
+$postanon<input type="hidden" name="symb" value="$ressymb" />
 <input type="hidden" name="sendit" value="true" />
 <input type="hidden" name="timestamp" value="$now" />
 <a name="newpost"></a>
@@ -2062,7 +2067,7 @@
         $r->print('<input type="hidden" name="ref" value="'.$env{'form.ref'}.'" />');
     }
     $r->print(<<END);
-<input type="hidden" name="sendit" value="1" />
+<input type="hidden" name="sendit" value="1" /><br /><br />
 <input type="button" value="$send" onclick='gosubmit();' />
 </form>
 END
@@ -2937,12 +2942,16 @@
 				      $env{'request.course.id'}.
 				      ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) || 
             (($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) {
-	    $discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '.
-		$contribdisc.
-	        '</label><br /><label><input type="radio" name="discuss" value="anon" /> '.
-		$anoncontrib.
-		' <i>('.$namevis.')</i></label> '.
-		'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>';
+            $discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '.
+                            $contribdisc.
+                            '</label>'; 
+            if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+               ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+	        $discussoptions .= '<br /><label><input type="radio" name="discuss" value="anon" /> '.
+		                   $anoncontrib.
+		                   ' <i>('.$namevis.')</i></label> '.
+		                   '<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>';
+            }
             my $blockblog = &Apache::loncommon::blocking_status('blogs');
             if (!$blockblog) {
                 $discussoptions.= &add_blog_checkbox($crstype);
@@ -4636,7 +4645,11 @@
 	     && $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
 	   || $env{'form.anondiscuss'} ne '') {
 	  my $subject = &clear_out_html($env{'form.subject'});
-	  my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
+          my $anonmode;
+          if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+             ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+	      $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
+          }
 	  $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
 				  $subject,$group);
 	  $numpost++;
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1303 loncom/lonnet/perl/lonnet.pm:1.1304
--- loncom/lonnet/perl/lonnet.pm:1.1303	Fri Mar  4 21:43:33 2016
+++ loncom/lonnet/perl/lonnet.pm	Wed Mar 23 02:19:17 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1303 2016/03/04 21:43:33 raeburn Exp $
+# $Id: lonnet.pm,v 1.1304 2016/03/23 02:19:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7263,7 +7263,7 @@
        my $unamedom=$env{'user.name'}.':'.$env{'user.domain'};
        if ($env{'course.'.$env{'request.course.id'}.'.'.$priv.'.roles.denied'}
 	   =~/\Q$rolecode\E/) {
-	   if (($priv ne 'pch') && ($priv ne 'plc')) { 
+	   if (($priv ne 'pch') && ($priv ne 'plc') && ($priv ne 'pac')) {
 	       &logthis($env{'user.domain'}.':'.$env{'user.name'}.':'.$env{'user.home'}.':'.
 			'Denied by role: '.$priv.' for '.$uri.' as '.$rolecode.' in '.
 			$env{'request.course.id'});
@@ -7273,7 +7273,7 @@
 
        if ($env{'course.'.$env{'request.course.id'}.'.'.$priv.'.users.denied'}
 	   =~/\Q$unamedom\E/) {
-	   if (($priv ne 'pch') && ($priv ne 'plc')) { 
+	   if (($priv ne 'pch') && ($priv ne 'plc') && ($priv ne 'pac')) {
 	       &logthis($env{'user.domain'}.':'.$env{'user.name'}.':'.$env{'user.home'}.
 			'Denied by user: '.$priv.' for '.$uri.' as '.$unamedom.' in '.
 			$env{'request.course.id'});
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.928 doc/loncapafiles/loncapafiles.lpml:1.929
--- doc/loncapafiles/loncapafiles.lpml:1.928	Fri Feb 19 21:09:39 2016
+++ doc/loncapafiles/loncapafiles.lpml	Wed Mar 23 02:19:36 2016
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.928 2016/02/19 21:09:39 raeburn Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.929 2016/03/23 02:19:36 raeburn Exp $ -->
 
 <!--
 
@@ -3394,6 +3394,7 @@
 Course_Critical_Message.tex;
 Course_Deleting.tex;
 Course_Disable_Discussion.tex;
+Course_Disable_Anonymous_Discussion.tex;
 Course_Discussion_Board.tex;
 Course_Drop_Student.tex;
 Course_Edit_Content.tex;

Index: loncom/html/adm/help/tex/Course_Disable_Anonymous_Discussion.tex
+++ loncom/html/adm/help/tex/Course_Disable_Anonymous_Discussion.tex
\label{Course_Disable_Anonymous_Discussion}
By default, all users of a course who can use the discussion features
LON-CAPA provides may choose to post anonymously, although if a user
does so, course personnel can still see the identity of the user
responsible for the post. If you want to ensure that a user's
peers will also be able to see the true identity of a poster
then, as Course Coordinator, you will need to disable anonymous 
discussion posts for the course (for specific user roles, e.g.,
student). A Course Coordinator can also disallow anonymous 
discussion posting by specific users.

To disable anonymous discussion posting, do the following: 

\begin{enumerate}
\item Select 
\includegraphics[width=0.03\paperwidth]{crsconf}
\textbf{Modify course configuration} on the Main Menu.
\item At the \textbf{Course Configuration} screen check
\textbf{Discussion and Chat} and click \fbox{Display}.
\item Select specific roles and/or users as desired in the 
\textbf{No Anonymous Resource Discussion} row.
\item Click \fbox{Save Changes}.
\end{enumerate}



More information about the LON-CAPA-cvs mailing list