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

www www@source.lon-capa.org
Wed, 14 Apr 2010 00:38:19 -0000


This is a MIME encoded message

--www1271205499
Content-Type: text/plain

www		Wed Apr 14 00:38:19 2010 EDT

  Modified files:              
    /loncom/homework	grades.pm 
    /loncom/interface	lonwhatsnew.pm 
  Log:
  Direct jump from What's New into grading
  Trying to reduce the historically grown number of states that the
  grading interface can be in. This should be determined by privileges. 
  
  
--www1271205499
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20100414003819.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.617 loncom/homework/grades.pm:1.618
--- loncom/homework/grades.pm:1.617	Tue Apr 13 16:12:54 2010
+++ loncom/homework/grades.pm	Wed Apr 14 00:38:09 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.617 2010/04/13 16:12:54 www Exp $
+# $Id: grades.pm,v 1.618 2010/04/14 00:38:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -817,10 +817,9 @@
     unless ($submitonly) {
        $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
     }
-    my $viewgrade = $env{'form.showgrading'} eq 'yes' ? 'View/Grade/Regrade' : 'View';
 
     my $result='<h3><span class="LC_info">&nbsp;'
-	.&mt("$viewgrade Submissions for a Student or a Group of Students")
+	.&mt("View/Grade/Regrade Submissions for a Student or a Group of Students")
 	.'</span></h3>';
 
     my ($partlist,$handgrade,$responseType) = &response_type($symb
@@ -920,11 +919,10 @@
         &build_section_inputs().
 	'<input type="hidden" name="submitonly"  value="'.$submitonly.'" />'."\n".
 	'<input type="hidden" name="handgrade"   value="'.$env{'form.handgrade'}.'" /><br />'."\n".
-	'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" /><br />'."\n".
 	'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
 	'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n";
 
-    if (exists($env{'form.gradingMenu'}) && exists($env{'form.Status'})) {
+    if (exists($env{'form.Status'})) {
 	$gradeTable .= '<input type="hidden" name="Status" value="'.$stu_status.'" />'."\n";
     } else {
         $gradeTable .= &Apache::lonhtmlcommon::row_title(&mt('Student Status'))
@@ -939,7 +937,7 @@
                   .&Apache::lonhtmlcommon::end_pick_box();
 
     $gradeTable .= '<p>'
-                  .&mt('To '.lc($viewgrade)." a submission or a group of submissions, click on the check box(es) next to the student's name(s). Then click on the Next button.")."\n"
+                  .&mt("To view/grade/regrade a submission or a group of submissions, click on the check box(es) next to the student's name(s). Then click on the Next button.")."\n"
                   .'<input type="hidden" name="command" value="processGroup" />'
                   .'</p>';
 
@@ -956,9 +954,7 @@
     while ($loop < 2) {
 	$gradeTable.='<th>'.&mt('No.').'</th><th>'.&mt('Select').'</th>'.
 	    '<th>'.&nameUserString('header').'&nbsp;'.&mt('Section/Group').'</th>';
-	if ($env{'form.showgrading'} eq 'yes' 
-	    && $submitonly ne 'queued'
-	    && $submitonly ne 'all') {
+	if (($submitonly ne 'queued') && ($submitonly ne 'all')) {
 	    foreach my $part (sort(@$partlist)) {
 		my $display_part=
 		    &get_display_part((split(/_/,$part))[0],$symb);
@@ -994,9 +990,7 @@
 	    $status{'gradingqueue'} = $queue_status{'gradingqueue'};
 	}
 
-	if ($env{'form.showgrading'} eq 'yes' 
-	    && $submitonly ne 'queued'
-	    && $submitonly ne 'all') {
+	if (($submitonly ne 'queued') && ($submitonly ne 'all')) {
 	    (%status) =&student_gradeStatus($symb,$udom,$uname,$partlist);
 	    my $submitted = 0;
 	    my $graded = 0;
@@ -1037,7 +1031,7 @@
 	       &nameUserString(undef,$$fullname{$student},$uname,$udom).
 	       '&nbsp;'.$section.($group ne '' ?'/'.$group:'').'</td>'."\n";
 
-	    if ($env{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
+	    if ($submitonly ne 'all') {
 		foreach (sort(keys(%status))) {
 		    next if ($_ =~ /^resource.*?submitted_by$/);
 		    $gradeTable.='<td align="center">&nbsp;'.&mt($status{$_}).'&nbsp;</td>'."\n";
@@ -1051,9 +1045,7 @@
     }
     if ($ctr%2 ==1) {
 	$gradeTable.='<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>';
-	    if ($env{'form.showgrading'} eq 'yes' 
-		&& $submitonly ne 'queued'
-		&& $submitonly ne 'all') {
+	    if (($submitonly ne 'queued') && ($submitonly ne 'all')) {
 		foreach (@$partlist) {
 		    $gradeTable.='<td>&nbsp;</td>';
 		}
@@ -1285,7 +1277,6 @@
 	    
 	}
 	if (val == "Grade Student") {
-	    formname.showgrading.value = "yes";
 	    if (formname.Status.value == "") {
 		formname.Status.value = "Active";
 	    }
@@ -1960,7 +1951,6 @@
 			'<input type="hidden" name="studentNo"  value="" />'."\n".
 			'<input type="hidden" name="gradeOpt"   value="" />'."\n".
 			'<input type="hidden" name="symb"       value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-			'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" />'."\n".
 			'<input type="hidden" name="vProb"      value="'.$env{'form.vProb'}.'" />'."\n".
 			'<input type="hidden" name="vAns"       value="'.$env{'form.vAns'}.'" />'."\n".
 			'<input type="hidden" name="lastSub"    value="'.$env{'form.lastSub'}.'" />'."\n".
@@ -1994,7 +1984,7 @@
 	}
 	$request->print($prnmsg);
 
-	if ($env{'form.handgrade'} eq 'yes' && $env{'form.showgrading'} eq 'yes') {
+	if ($env{'form.handgrade'} eq 'yes') {
 #
 # Print out the keyword options line
 #
@@ -2206,9 +2196,7 @@
 	}
 	$request->print($lastsubonly);
    } elsif ($env{'form.lastSub'} eq 'datesub') {
-#	my (undef,$responseType,undef,$parts) = &showResourceInfo($symb);
-    my ($parts,$handgrade,$responseType) = &response_type($symb);
-
+        my ($parts,$handgrade,$responseType) = &response_type($symb);
 	$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom));
     } elsif ($env{'form.lastSub'} =~ /^(last|all)$/) {
 	$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
@@ -2220,7 +2208,7 @@
     $request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':'
 	.$udom.'" />'."\n");
     # return if view submission with no grading option
-    if ($env{'form.showgrading'} eq '' || (!&canmodify($usec))) {
+    if (!&canmodify($usec)) {
 	my $toGrade.='<input type="button" value="Grade Student" '.
 	    'onclick="javascript:checksubmit(this.form,\'Grade Student\',\''
 	    .$counter.'\');" target="_self" /> &nbsp;'."\n" if (&canmodify($usec));
@@ -8384,9 +8372,7 @@
     if (!$symb) {return '';}
 
     my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb),
-                  'command'=>'individual',
-                  'gradingMenu'=>1,
-                  'showgrading'=>"yes");
+                  'command'=>'individual');
     
     my $url1a = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
 
@@ -8473,9 +8459,7 @@
     my $Str;
     $Str .= '<form method="post" action="" name="gradingMenu">';
     $Str .= '<input type="hidden" name="command" value="" />'.
-    	'<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-	'<input type="hidden" name="gradingMenu" value="1" />'."\n".
-	'<input type="hidden" name="showgrading" value="yes" />'."\n";
+    	'<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n";
 
     $Str .= &Apache::lonhtmlcommon::generate_menu(@menu);
     return $Str;    
@@ -8494,10 +8478,7 @@
     my $result;
 
     $result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n".
-        '<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-        '<input type="hidden" name="gradingMenu" value="1" />'."\n".
-        '<input type="hidden" name="showgrading" value="yes" />'."\n";
-
+        '<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n";
     $result.='
 <h2>
   '.&mt('Grade page/folder for one student').'
@@ -8519,9 +8500,7 @@
     my $result;
 
     $result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n".
-        '<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-        '<input type="hidden" name="gradingMenu" value="1" />'."\n".
-        '<input type="hidden" name="showgrading" value="yes" />'."\n";
+        '<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n";
 
     $result.='
 <h2>
@@ -8548,10 +8527,7 @@
     my $result;
 
     $result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n".
-	'<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-	'<input type="hidden" name="gradingMenu" value="1" />'."\n".
-	'<input type="hidden" name="showgrading" value="yes" />'."\n";
-
+	'<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n";
     $result.='
 <h2>
   '.&mt('Select individual students to grade').'
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.101 loncom/interface/lonwhatsnew.pm:1.102
--- loncom/interface/lonwhatsnew.pm:1.101	Sun Feb 28 22:38:11 2010
+++ loncom/interface/lonwhatsnew.pm	Wed Apr 14 00:38:19 2010
@@ -1,5 +1,5 @@
 #
-# $Id: lonwhatsnew.pm,v 1.101 2010/02/28 22:38:11 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.102 2010/04/14 00:38:19 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1473,13 +1473,13 @@
         foreach my $res (@{$tograde}) {
             $rowNum ++;
             my $css_class = $rowNum%2?' class="LC_odd_row"':'';
-            my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
-            my $linkurl=&Apache::lonnet::clutter($url);
-            $linkurl .= '?symb='.&escape($res);
+            my $linkurl='/adm/grades';
             if ($$ungraded{$res}{'enclink'}) {
-                $linkurl = 
-                    $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};
-            } 
+                $linkurl.='?symb='.$$ungraded{$res}{'encsymb'};
+            } else {
+                $linkurl.='?symb='.&escape($res);
+            }
+            $linkurl.='&command=ungraded';
             $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');
         }
     } elsif ($itemserror) {

--www1271205499--