[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm lonhomework.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 12 May 2006 01:18:50 -0000


albertel		Thu May 11 21:18:50 2006 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm bridgetask.pm 
  Log:
  - supporting the newly seperated queu only grading priv
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.243 loncom/homework/lonhomework.pm:1.244
--- loncom/homework/lonhomework.pm:1.243	Tue May  9 15:03:02 2006
+++ loncom/homework/lonhomework.pm	Thu May 11 21:18:50 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.243 2006/05/09 19:03:02 albertel Exp $
+# $Id: lonhomework.pm,v 1.244 2006/05/12 01:18:50 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -86,9 +86,13 @@
 	} elsif ( defined($env{'form.grade_target'}  ) 
 		  && ($Apache::lonhomework::viewgrades eq 'F' )) {
 	    return ($env{'form.grade_target'});
+	} elsif ( $env{'form.grade_target'} eq 'webgrade'
+		  && ($Apache::lonhomework::queuegrade eq 'F' )) {
+	    return ($env{'form.grade_target'});
 	}
 	if ($env{'form.webgrade'} &&
-	    $Apache::lonhomework::modifygrades eq 'F') {
+	    ($Apache::lonhomework::modifygrades eq 'F'
+	     || $Apache::lonhomework::queuegrade eq 'F' )) {
 	    return ('grade','webgrade');
 	}
 	if ( defined($env{'form.submitted'}) &&
@@ -546,13 +550,15 @@
 	$viewgrades = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}.
                                                '/'.$env{'request.course.sec'});
     }
-    $Apache::lonhomework::viewgrades = $viewgrades; # File global variable...dirt.
+    $Apache::lonhomework::viewgrades = $viewgrades;
+
     if ($Apache::lonhomework::browse eq 'F' && 
 	$env{'form.devalidatecourseresdata'} eq 'on') {
 	my (undef,$courseid) = &Apache::lonxml::whichuser();
 	&Apache::lonnet::devalidatecourseresdata($env{"course.$courseid.num"},
 					      $env{"course.$courseid.domain"});
     }
+
     my $modifygrades = &Apache::lonnet::allowed('mgr',$env{'request.course.id'});
     if (! $modifygrades && 
 	exists($env{'request.course.sec'}) && 
@@ -562,6 +568,16 @@
 				     '/'.$env{'request.course.sec'});
     }
     $Apache::lonhomework::modifygrades = $modifygrades;
+
+    my $queuegrade = &Apache::lonnet::allowed('mqg',$env{'request.course.id'});
+    if (! $queuegrade && 
+	exists($env{'request.course.sec'}) && 
+	$env{'request.course.sec'} !~ /^\s*$/) {
+	$queuegrade = 
+	    &Apache::lonnet::allowed('qgr',$env{'request.course.id'}.
+				     '/'.$env{'request.course.sec'});
+    }
+    $Apache::lonhomework::queuegrade = $queuegrade;
     return '';
 }
 
@@ -968,7 +984,7 @@
 	}
     }
     if (&setupheader($request)) { return OK; }
-    &Apache::lonxml::debug("Permissions:$Apache::lonhomework::browse:$Apache::lonhomework::viewgrades:");
+    &Apache::lonxml::debug("Permissions:$Apache::lonhomework::browse:$Apache::lonhomework::viewgrades:$Apache::lonhomework::modifygrades:$Apache::lonhomework::queuegrade");
     &Apache::lonxml::debug("Problem Mode ".$env{'form.problemmode'});
     my ($symb) = &Apache::lonxml::whichuser();
     &Apache::lonxml::debug('symb is '.$symb);
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.146 loncom/homework/bridgetask.pm:1.147
--- loncom/homework/bridgetask.pm:1.146	Tue May  9 15:01:19 2006
+++ loncom/homework/bridgetask.pm	Thu May 11 21:18:50 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.146 2006/05/09 19:01:19 albertel Exp $
+# $Id: bridgetask.pm,v 1.147 2006/05/12 01:18:50 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -395,7 +395,8 @@
     }
 
     if ($target eq 'web' && $env{'request.state'} ne 'construct') {
-	if ($Apache::lonhomework::modifygrades) {
+	if ($Apache::lonhomework::queuegrade
+	    || $Apache::lonhomework::modifygrades) {
 	    $result.='<form name="gradesubmission" method="post" action="';
 	    my $uri=$env{'request.uri'};
 	    if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); }