[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm /lonnet/perl lonnet.pm /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 06 Aug 2003 17:00:31 -0000


albertel		Wed Aug  6 13:00:31 2003 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/interface	lonfeedback.pm 
    /loncom/xml	lonxml.pm 
  Log:
  - fixes BUG#1989, students can generate an answer mode display but only when
    generating a feedback email
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.397 loncom/lonnet/perl/lonnet.pm:1.398
--- loncom/lonnet/perl/lonnet.pm:1.397	Wed Aug  6 12:43:36 2003
+++ loncom/lonnet/perl/lonnet.pm	Wed Aug  6 13:00:30 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.397 2003/08/06 16:43:36 albertel Exp $
+# $Id: lonnet.pm,v 1.398 2003/08/06 17:00:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2221,6 +2221,7 @@
     my $orguri=$uri;
     $uri=&declutter($uri);
 
+    if (defined($ENV{'allowed.'.$priv})) { return $ENV{'allowed.'.$priv}; }
 # Free bre access to adm and meta resources
 
     if ((($uri=~/^adm\//) || ($uri=~/\.meta$/)) && ($priv eq 'bre')) {
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.49 loncom/interface/lonfeedback.pm:1.50
--- loncom/interface/lonfeedback.pm:1.49	Sat Jul  5 06:07:11 2003
+++ loncom/interface/lonfeedback.pm	Wed Aug  6 13:00:30 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.49 2003/07/05 10:07:11 www Exp $
+# $Id: lonfeedback.pm,v 1.50 2003/08/06 17:00:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -567,10 +567,12 @@
 # Get output from resource
       my $usersaw=&resource_output($feedurl);
 
-# Get resource answer
+# Get resource answer (need to allow student to view grades for this to work)
+      &Apache::lonnet::appenv(('allowed.vgr'=>'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'}) {
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.268 loncom/xml/lonxml.pm:1.269
--- loncom/xml/lonxml.pm:1.268	Wed Aug  6 10:30:01 2003
+++ loncom/xml/lonxml.pm	Wed Aug  6 13:00:30 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.268 2003/08/06 14:30:01 bowersj2 Exp $
+# $Id: lonxml.pm,v 1.269 2003/08/06 17:00:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1460,7 +1460,7 @@
   my ($symb,$courseid,$domain,$name,$publicuser);
   if (defined($ENV{'form.grade_symb'})) {
     my $tmp_courseid=$ENV{'form.grade_courseid'};
-    my $allowed=&Apache::lonnet::allowed('mgr',$tmp_courseid);
+    my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid);
     if ($allowed) {
       $symb=$ENV{'form.grade_symb'};
       $courseid=$ENV{'form.grade_courseid'};