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

droeschl droeschl@source.lon-capa.org
Wed, 07 Apr 2010 21:08:35 -0000


droeschl		Wed Apr  7 21:08:35 2010 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Currently broken. Just saving work for Gerd.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.606 loncom/homework/grades.pm:1.607
--- loncom/homework/grades.pm:1.606	Wed Apr  7 15:32:32 2010
+++ loncom/homework/grades.pm	Wed Apr  7 21:08:35 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.606 2010/04/07 15:32:32 wenzelju Exp $
+# $Id: grades.pm,v 1.607 2010/04/07 21:08:35 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9239,6 +9239,13 @@
            &mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page.','<a href="/adm/roles?selectrole=1&newrole='.$env{'request.role'}.'">','</a>').
            '</div>';
 }
+sub startpage{
+    my ($r,$crumbs) = @_;
+
+    unshift(@$crumbs,  {href=>"/adm/grades",text=>"Grading"});
+    $r->print(&Apache::loncommon::start_page('Grading',undef,
+                                          {'bread_crumbs' => $crumbs}));
+}
 
 sub handler {
     my $request=$_[0];
@@ -9258,11 +9265,8 @@
     if ($#commands > 0) {
 	&Apache::lonnet::logthis("grades got multiple commands ".join(':',@commands));
     }
-
+                             
     $ssi_error = 0;
-    my $brcrum = [{href=>"/adm/grades",text=>"Grading"}];
-    $request->print(&Apache::loncommon::start_page('Grading',undef,
-                                          {'bread_crumbs' => $brcrum}));
     if ($symb eq '' && $command eq '') {
 #
 # Not called from a resource
@@ -9271,6 +9275,7 @@
     } else {
 	&init_perm();
 	if ($command eq 'submission' && $perm{'vgr'}) {
+        &startpage($request, [{href=>"", text=>"Student Submissions"}]);
 	    ($env{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
 	} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {
 	    &pickStudentPage($request);
@@ -9281,6 +9286,7 @@
 	} elsif ($command eq 'processGroup' && $perm{'vgr'}) {
 	    &processGroup($request);
 	} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) {
+        &startpage($request);
 	    $request->print(&grading_menu($request));
 	} elsif ($command eq 'individual' && $perm{'vgr'}) {
 	    $request->print(&submit_options($request));