Diff for /loncom/interface/lonquickgrades.pm between versions 1.117 and 1.118

version 1.117, 2020/08/10 19:28:21 version 1.118, 2020/09/01 03:35:54
Line 222  ENDCLOSE Line 222  ENDCLOSE
             $r->print('<p><span class="LC_warning">'.&mt("Unknown Student/Employee ID: [_1]",$stdid).'</span></p>');              $r->print('<p><span class="LC_warning">'.&mt("Unknown Student/Employee ID: [_1]",$stdid).'</span></p>');
             $stdid='';              $stdid='';
         }          }
           if (($uname eq '') && ($udom eq '')) {
               $uname = $env{'user.name'};
               $udom = $env{'user.domain'};
           }
         $r->print('<form method="post" name="quickform" action="/adm/quickgrades">');          $r->print('<form method="post" name="quickform" action="/adm/quickgrades">');
         my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.          my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.
            &Apache::loncommon::selectstudent_link('quickform','uname','udom');             &Apache::loncommon::selectstudent_link('quickform','uname','udom');
Line 237  ENDCLOSE Line 241  ENDCLOSE
     }      }
     $r->rflush();      $r->rflush();
   
     my $notshowSPRSlink =  
         (($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external')  
       || ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'));  
     my $notshowTotals=      my $notshowTotals=
         $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals';          $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals';
     my $showCategories=      my $showCategories=
Line 248  ENDCLOSE Line 249  ENDCLOSE
     my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=      my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=
        &getData($showPoints,$uname,$udom);         &getData($showPoints,$uname,$udom);
   
     if ($showCategories) {      if (ref($navmap)) {
        &outputCategories($r,$showPoints,$notshowTotals,          if ($showCategories) {
                  $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);              &outputCategories($r,$showPoints,$notshowTotals,
                   $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);
           } else {
               &outputTable($r,$showPoints,$notshowTotals,
                   $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);
           }
     } else {      } else {
        &outputTable($r,$showPoints,$notshowTotals,          if ($cangrade) { $r->print("\n</form>\n"); }
                  $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);          my $requrl = $r->uri;
           $env{'user.error.msg'} = "$requrl:bre:0:0:Navmap initialization failed.";
           return HTTP_NOT_ACCEPTABLE;
     }      }
     if ($cangrade) { $r->print("\n</form>\n"); }      if ($cangrade) { $r->print("\n</form>\n"); }
     &endGradeScreen($r);      &endGradeScreen($r);
Line 332  sub startGradeScreen { Line 340  sub startGradeScreen {
       || ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'));        || ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'));
     my $notshowTotals=      my $notshowTotals=
         $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals';          $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals';
       my $showSPRSlink =
           $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'spreadsheet';
     my $showCategories=      my $showCategories=
         $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories';          $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories';
     
Line 353  sub startGradeScreen { Line 363  sub startGradeScreen {
        push(@notes,&mt('Students do not see link to spreadsheet.')) if ($notshowSPRSlink);         push(@notes,&mt('Students do not see link to spreadsheet.')) if ($notshowSPRSlink);
        push(@notes,&mt('Students will see points based on problem weights.')) if ($showPoints);         push(@notes,&mt('Students will see points based on problem weights.')) if ($showPoints);
        push(@notes,&mt('Students will see points based on categories.')) if ($showCategories);         push(@notes,&mt('Students will see points based on categories.')) if ($showCategories);
          push(@notes,&mt('Students will see link to spreadsheet.')) if ($showSPRSlink);
        push(@notes, &Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading'));         push(@notes, &Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading'));
        $r->print(&Apache::loncommon::head_subbox(join('&nbsp;&nbsp;',@notes)));         $r->print(&Apache::loncommon::head_subbox(join('&nbsp;&nbsp;',@notes)));
     }      }
Line 393  sub startGradeScreen { Line 404  sub startGradeScreen {
 sub endGradeScreen {  sub endGradeScreen {
    my ($r)=@_;     my ($r)=@_;
    $r->print('</div></div></div>'.&Apache::loncommon::end_page());     $r->print('</div></div></div>'.&Apache::loncommon::end_page());
      return;
 }  }
   
 # -----------  # -----------
Line 465  sub getData { Line 477  sub getData {
     # Create the nav map      # Create the nav map
     my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom);      my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom);
   
       if (!defined($navmap)) {
           return ();
       }
   
     my $res = $navmap->firstResource(); # temp resource to access constants      my $res = $navmap->firstResource(); # temp resource to access constants
   
     my $iterator = $navmap->getIterator(undef, undef, undef, 1);      my $iterator = $navmap->getIterator(undef, undef, undef, 1);
Line 693  sub outputTable { Line 709  sub outputTable {
     }      }
   
     $r->print(&Apache::loncommon::end_data_table());      $r->print(&Apache::loncommon::end_data_table());
       return;
 }  }
   
 #  #

Removed from v.1.117  
changed lines
  Added in v.1.118


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>