[LON-CAPA-cvs] cvs: rat / lonpageflip.pm loncom/auth lonroles.pm loncom/interface lonblockingmenu.pm loncommon.pm lonmainmenu.pm lonnavdisplay.pm lonquickgrades.pm loncom/misc releaseslist.xml

raeburn raeburn at source.lon-capa.org
Sun Jun 25 21:57:12 EDT 2017


raeburn		Mon Jun 26 01:57:12 2017 EDT

  Modified files:              
    /loncom/interface	lonblockingmenu.pm loncommon.pm lonmainmenu.pm 
                     	lonnavdisplay.pm lonquickgrades.pm 
    /loncom/auth	lonroles.pm 
    /loncom/misc	releaseslist.xml 
    /rat	lonpageflip.pm 
  Log:
  - Blocking communication/resource access (e.g., for exams) can include
    suppression of interruptions to a student's workflow due to:
    (a) Critical messages not moved to INBOX
    (b) Detection of changes to course structure, as a result of actions by
        a Course Coordinator. 
  
  
-------------- next part --------------
Index: loncom/interface/lonblockingmenu.pm
diff -u loncom/interface/lonblockingmenu.pm:1.24 loncom/interface/lonblockingmenu.pm:1.25
--- loncom/interface/lonblockingmenu.pm:1.24	Sun Oct 23 17:02:56 2016
+++ loncom/interface/lonblockingmenu.pm	Mon Jun 26 01:56:58 2017
@@ -2,7 +2,7 @@
 # Routines for configuring blocking of access to collaborative functions, 
 # and specific resources during an exam
 #
-# $Id: lonblockingmenu.pm,v 1.24 2016/10/23 17:02:56 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.25 2017/06/26 01:56:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -578,6 +578,7 @@
     my %lt=&Apache::lonlocal::texthash (
             'cbds' => 'Blocking communication and/or content access during exams',
             'prev' => "For the duration of an exam, or a timed quiz, students in this course can be prevented from:",
+            'flow' => "For the duration of an exam, or a timed quiz, event-driven interruptions to a student's workflow can be suppressed:",
             'blca' => "Blocks can potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA $lctype.",
             'pobl' => "Portfolio blocking can impact a student's ability to complete assignments in courses besides your own. Please use this feature wisely.",
             'actt' => "Action to take:",
@@ -622,6 +623,11 @@
             '<li>'.&mt("accessing $lctype content in specified folders or resources").'</li>'.
             '<li>'.&mt("changing user's own password").'</li>'.
             '</ul>'.
+            $lt{'flow'}.
+            '<ul>'."\n".
+            '<li>'.&mt("re-initialization of cached course structure, when a change has been made to $lctype content by a Coordinator").'</li>'.
+            '<li>'.&mt('display of Critical Messages when navigation arrows used to move to the adjacent resource').'</li>'.
+            '</ul>'.
             '<p class="LC_warning">'.$lt{'blca'}.'<br />'.$lt{'pobl'}.'</p>'
         );
     }
@@ -877,6 +883,24 @@
                                            &escape($env{'form.title_'.$key})).'<br />';
                         }
                     }
+                    if ($blocktypes->{'alert'} eq 'on') {
+                        ($status,$needsrelease) = &check_release_required('alert',$chomemajor,$chomeminor);
+                        if ($status eq 'fail') {
+                            $blocktypes->{'alert'} = 'off';
+                            $output .= '<p class="LC_warning">'.
+                                       &mt('Message Alert blocking not allowed for [_1]',
+                                           &escape($env{'form.title_'.$key})).'<br />';
+                        }
+                    }
+                    if ($blocktypes->{'reinit'} eq 'on') {
+                        ($status,$needsrelease) = &check_release_required('reinit',$chomemajor,$chomeminor);
+                        if ($status eq 'fail') {
+                            $blocktypes->{'reinit'} = 'off';
+                            $output .= '<p class="LC_warning">'.
+                                       &mt('Course Re-initialization blocking not allowed for [_1]',
+                                           &escape($env{'form.title_'.$key})).'<br />';
+                        }
+                    }
                 }
                 if ($blockdocs) {
                     ($status,$needsrelease) = &check_release_required('docs',$chomemajor,$chomeminor);
@@ -1632,8 +1656,10 @@
         'docs' => 'Content',
         'printout' => 'Printouts',
         'passwd' => 'Change Password',
+        'alert'  => 'Critical Alert',
+        'reinit' => 'Course Re-init',
     );
-    my $typeorder = ['com','chat','boards','port','groups','blogs','printout','docs','passwd'];
+    my $typeorder = ['com','chat','boards','port','groups','blogs','printout','docs','alert','reinit','passwd'];
     return ($typeorder,\%types);
 }
 
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1281 loncom/interface/loncommon.pm:1.1282
--- loncom/interface/loncommon.pm:1.1281	Mon Jun 26 01:34:32 2017
+++ loncom/interface/loncommon.pm	Mon Jun 26 01:56:58 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1281 2017/06/26 01:34:32 raeburn Exp $
+# $Id: loncommon.pm,v 1.1282 2017/06/26 01:56:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4992,7 +4992,8 @@
     # boards, chat or groups, check for blocking in current course only.
 
     if (($activity eq 'boards' || $activity eq 'chat' ||
-         $activity eq 'groups' || $activity eq 'printout') &&
+         $activity eq 'groups' || $activity eq 'printout' ||
+         $activity eq 'reinit' || $activity eq 'alert') &&
         ($env{'request.course.id'})) {
         foreach my $key (keys(%live_courses)) {
             if ($key ne $env{'request.course.id'}) {
@@ -5309,6 +5310,10 @@
         $text = &mt('Printing Blocked');
     } elsif ($activity eq 'passwd') {
         $text = &mt('Password Changing Blocked');
+    } elsif ($activity eq 'alert') {
+        $text = &mt('Checking Critical Messages Blocked');
+    } elsif ($activity eq 'reinit') {
+        $text = &mt('Checking Course Update Blocked');
     }
     $output .= <<"END_BLOCK";
 <div class='$class'>
@@ -16993,8 +16998,12 @@
         $interval = 600;
     }
     if (($now-$env{'request.course.timechecked'})>$interval) {
-        my $lastchange = &Apache::lonnet::get_coursechange($cdom,$cnum);
         &Apache::lonnet::appenv({'request.course.timechecked'=>$now});
+        my $blocked = &blocking_status('alert',$cnum,$cdom,undef,1);
+        if ($blocked) {
+            return ();
+        }
+        my $lastchange = &Apache::lonnet::get_coursechange($cdom,$cnum);
         if ($lastchange > $env{'request.course.tied'}) {
             my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired');
             if ($curr_reqd_hash{'internal.releaserequired'} ne '') {
@@ -17434,9 +17443,25 @@
 
 # Checks for critical messages and returns a redirect url if one exists.
 # $interval indicates how often to check for messages.
+# $context is the calling context -- roles, grades, contents, menu or flip. 
 sub critical_redirect {
-    my ($interval) = @_;
+    my ($interval,$context) = @_;
     if ((time-$env{'user.criticalcheck.time'})>$interval) {
+        if (($env{'request.course.id'}) && (($context eq 'flip') || ($context eq 'contents'))) {
+            my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+            my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+            my $blocked = &blocking_status('alert',$cnum,$cdom,undef,1);
+            if ($blocked) {
+                my $checkrole = "cm./$cdom/$cnum";
+                if ($env{'request.course.sec'} ne '') {
+                    $checkrole .= "/$env{'request.course.sec'}";
+                }
+                unless ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) &&
+                        ($env{'request.role'} !~ m{^st\./$cdom/$cnum})) {
+                    return;
+                }
+            }
+        }
         my @what=&Apache::lonnet::dump('critical', $env{'user.domain'}, 
                                         $env{'user.name'});
         &Apache::lonnet::appenv({'user.criticalcheck.time'=>time});
Index: loncom/interface/lonmainmenu.pm
diff -u loncom/interface/lonmainmenu.pm:1.11 loncom/interface/lonmainmenu.pm:1.12
--- loncom/interface/lonmainmenu.pm:1.11	Tue May 20 20:33:24 2014
+++ loncom/interface/lonmainmenu.pm	Mon Jun 26 01:56:58 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the main menu
 #
-# $Id: lonmainmenu.pm,v 1.11 2014/05/20 20:33:24 musolffc Exp $
+# $Id: lonmainmenu.pm,v 1.12 2017/06/26 01:56:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,7 +44,7 @@
     my $r = shift;
 
     # Check for critical messages and redirect if present.  
-    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300);
+    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'menu');
     if ($redirect) {
         &Apache::loncommon::content_type($r,'text/html');
         $r->header_out(Location => $url);
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.33 loncom/interface/lonnavdisplay.pm:1.34
--- loncom/interface/lonnavdisplay.pm:1.33	Sat Apr  2 04:30:21 2016
+++ loncom/interface/lonnavdisplay.pm	Mon Jun 26 01:56:58 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Display Handler
 #
-# $Id: lonnavdisplay.pm,v 1.33 2016/04/02 04:30:21 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.34 2017/06/26 01:56:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -55,7 +55,7 @@
     }
 
     # Check for critical messages and redirect if present.  
-    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300);
+    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'contents');
     if ($redirect) {
         &Apache::loncommon::content_type($r,'text/html');
         $r->header_out(Location => $url);
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.109 loncom/interface/lonquickgrades.pm:1.110
--- loncom/interface/lonquickgrades.pm:1.109	Sat Apr  2 04:30:21 2016
+++ loncom/interface/lonquickgrades.pm	Mon Jun 26 01:56:58 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.109 2016/04/02 04:30:21 raeburn Exp $
+# $Id: lonquickgrades.pm,v 1.110 2017/06/26 01:56:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -80,7 +80,7 @@
 
     unless ($cangrade) {
         # Check for critical messages and redirect if present.
-        my ($redirect,$url) = &Apache::loncommon::critical_redirect(300);
+        my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'grades');
         if ($redirect) {
             &Apache::loncommon::content_type($r,'text/html');
             $r->header_out(Location => $url);
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.331 loncom/auth/lonroles.pm:1.332
--- loncom/auth/lonroles.pm:1.331	Fri May 19 19:47:40 2017
+++ loncom/auth/lonroles.pm	Mon Jun 26 01:57:02 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.331 2017/05/19 19:47:40 raeburn Exp $
+# $Id: lonroles.pm,v 1.332 2017/06/26 01:57:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -204,7 +204,7 @@
     my $r = shift;
 
     # Check for critical messages and redirect if present.
-    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300);
+    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'roles');
     if ($redirect) {
         &Apache::loncommon::content_type($r,'text/html');
         $r->header_out(Location => $url);
Index: loncom/misc/releaseslist.xml
diff -u loncom/misc/releaseslist.xml:1.15 loncom/misc/releaseslist.xml:1.16
--- loncom/misc/releaseslist.xml:1.15	Sat Apr  2 04:30:56 2016
+++ loncom/misc/releaseslist.xml	Mon Jun 26 01:57:07 2017
@@ -4,6 +4,8 @@
 <course name="commblock" value="docs">2.11</course>
 <course name="commblock" value="printout">2.11</course>
 <course name="commblock" value="passwd">2.12</course>
+<course name="commblock" value="reinit">2.12</course>
+<course name="commblock" value="alert">2.12</course>
 <parameter name="type" value="anonsurvey">2.10</parameter>
 <parameter name="type" value="anonsurveycred">2.10</parameter>
 <parameter name="type" value="surveycred">2.10</parameter>
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.95 rat/lonpageflip.pm:1.96
--- rat/lonpageflip.pm:1.95	Wed Mar  8 02:51:18 2017
+++ rat/lonpageflip.pm	Mon Jun 26 01:57:11 2017
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.95 2017/03/08 02:51:18 raeburn Exp $
+# $Id: lonpageflip.pm,v 1.96 2017/06/26 01:57:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -530,7 +530,7 @@
                      &Apache::lonnet::linklog($redirecturl,$currenturl);
 		  }
 # ------------------------------------- Check for and display critical messages
-                  my ($redirect, $url) = &Apache::loncommon::critical_redirect(300);
+                  my ($redirect, $url) = &Apache::loncommon::critical_redirect(300,'flip');
                   unless ($redirect) {
                       my $usehttp = &check_http_req(\$redirecturl);
                       if (($usehttp) && ($hostname ne '')) {


More information about the LON-CAPA-cvs mailing list